|
|
@@ -19,7 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据用户Id查询用户信息业务层处理 |
|
|
|
* 根据用户名查询用户信息业务层处理 |
|
|
|
* |
|
|
|
* @author wanjing |
|
|
|
* @team tuoheng |
|
|
@@ -43,11 +43,11 @@ public class QueryUserInfoByIdService { |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public JsonResult getUserInfo(String id) { |
|
|
|
log.info("进入根据用户Id查询用户信息业务"); |
|
|
|
JsonResult result = this.check(id); |
|
|
|
public JsonResult getUserInfo(String username) { |
|
|
|
log.info("进入根据用户名查询用户信息业务"); |
|
|
|
JsonResult result = this.check(username); |
|
|
|
if (0 != result.getCode()) { |
|
|
|
log.info("根据用户Id查询用户信息业务:校验失败:{}", result.getMsg()); |
|
|
|
log.info("根据用户名查询用户信息业务:校验失败:{}", result.getMsg()); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
@@ -73,15 +73,15 @@ public class QueryUserInfoByIdService { |
|
|
|
/** |
|
|
|
* 检查参数 |
|
|
|
* |
|
|
|
* @param id |
|
|
|
* @param username |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private JsonResult check(String id) { |
|
|
|
if (StringUtils.isEmpty(id)) { |
|
|
|
return JsonResult.error(QueryUserInfoByIdCodeEnum.USER_ID_IS_NULL.getCode(), QueryUserInfoByIdCodeEnum.USER_ID_IS_NULL.getMsg()); |
|
|
|
private JsonResult check(String username) { |
|
|
|
if (StringUtils.isEmpty(username)) { |
|
|
|
return JsonResult.error(QueryUserInfoByIdCodeEnum.USERNAME_ID_IS_NULL.getCode(), QueryUserInfoByIdCodeEnum.USERNAME_ID_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() |
|
|
|
.eq(User::getId, id) |
|
|
|
.eq(User::getUsername, username) |
|
|
|
.eq(User::getMark, 1)); |
|
|
|
|
|
|
|
if (ObjectUtil.isNull(user)) { |