校验用户是否存在
This commit is contained in:
parent
fb2a782f23
commit
513e0e45fc
@ -216,4 +216,15 @@ public class EbikeUserController {
|
||||
}
|
||||
return JsonResult.success(jsonResult.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户是否存在
|
||||
* @param userId 用户id
|
||||
* @return true 存在 false 不存在
|
||||
*/
|
||||
@GetMapping("checkUserExit")
|
||||
public JsonResult<?> checkUserExit(@RequestParam("userId") Long userId) {
|
||||
boolean result = ebikeUserService.checkUserExit(userId);
|
||||
return JsonResult.success(result);
|
||||
}
|
||||
}
|
||||
@ -51,4 +51,11 @@ public interface EbikeUserService extends IService<EbikeUser> {
|
||||
void updateUserInfo(String decryptedData, String openId);
|
||||
|
||||
EbikeUserVo getUserInfoByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 校验用户是否存在
|
||||
* @param userId 用户id
|
||||
* @return true 存在 false 不存在
|
||||
*/
|
||||
boolean checkUserExit(Long userId);
|
||||
}
|
||||
|
||||
@ -126,6 +126,11 @@ public class EbikeUserServiceImpl extends ServiceImpl<EbikeUserMapper, EbikeUser
|
||||
return getOneAs(query, EbikeUserVo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkUserExit(Long userId) {
|
||||
return getOne(buildBaseUserQuery().where(EBIKE_USER.USER_ID.eq(userId))) != null;
|
||||
}
|
||||
|
||||
|
||||
private String getSafeText(JsonNode node, String fieldName) {
|
||||
return node.has(fieldName) && !node.get(fieldName).isNull()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user