Description:
Field am in wow.service.AdminServiceImpl required a bean of type 'wow.mapper.AdminMapper' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'wow.mapper.AdminMapper' in your configuration.
Process finished with exit code 1
代码:
@Mapper
public interface AdminMapper {
@Select("select user_count from t_usercount")
Integer getUserCount();
}
@Service
@Transactional(propagation=Propagation.REQUIRED, isolation=Isolation.DEFAULT)
public class AdminServiceImpl implements AdminService {
@Autowired
private AdminMapper am;
@Override
@Transactional(readOnly=true)
public BackJSON getUserCount() {
BackJSON json = new BackJSON(200);
String count = "{\"count\":"+am.getUserCount()+"}";
json.setData(JSONObject.parse(count));
return json;
}
}