qq_42545382
Zhang_Tmac
采纳率0%
2019-01-14 16:31

IDEA导入码云springboot项目后引用自动注入的service抱错。

@Autowired
private JfUserAddressService jfUserAddressService;

@PostMapping(value = "/jfUser/getAllAddress")
@ApiOperation(value = "获得全部地址" , notes = "获得全部地址")
@ApiImplicitParams({
        @ApiImplicitParam(name = "userId" ,value = "用户Id", paramType = "String")
})
@ApiResponses({
        @ApiResponse(code = 200, message = "查询成功"),
        @ApiResponse(code = 201, message = "请添加地址"),
        @ApiResponse(code = 402, message = "参数不能为空,或缺少参数"),
        @ApiResponse(code = 500, message = "系统错误"),

})
public PageVO<List<JfUserAddress>> getAllAddress(@RequestBody Map map){
    try {
        if (isNull(map,"userId" )){
            return new PageVO<>(402,"参数不能为空,或缺少参数",null);
        }
        String userId = (String) map.get("userId");
        List<JfUserAddress> addresses = this.jfUserAddressService.selectList(new EntityWrapper<JfUserAddress>().eq("user_id", userId));
        if(addresses.size()==0){
            return new PageVO<>(201,"请添加地址",null);
        }
        return new PageVO<>(200,"查询成功",addresses);
    } catch (Exception e) {
        e.printStackTrace();
        return new PageVO<>(500,"系统错误",null);
    }
}

this.jfUserAddressService抱错,错误为:Cannot access com.jiafacity.base.service.BaseService 求大神怎么解决?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • tavatimsa tavatimsa 2年前

    看看maven有没有报错,你点extends BaseService看点的开不。点不开就是没导入进去。

    点赞 评论 复制链接分享
  • sinat_36339134 HessianTes 2年前

    你这个BaseService 是不是没有导入进来

    点赞 评论 复制链接分享

相关推荐