diff --git a/kqapi/pom.xml b/kqapi/pom.xml
index 652d3ef..1d58531 100644
--- a/kqapi/pom.xml
+++ b/kqapi/pom.xml
@@ -145,6 +145,10 @@
com.ningdatech
nd-swagger2-starter
+
+ com.ningdatech
+ nd-file-starter
+
diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/user/controller/UserInfoController.java b/kqapi/src/main/java/com/ningdatech/kqapi/user/controller/UserInfoController.java
index ee2ce0c..c56b5c5 100644
--- a/kqapi/src/main/java/com/ningdatech/kqapi/user/controller/UserInfoController.java
+++ b/kqapi/src/main/java/com/ningdatech/kqapi/user/controller/UserInfoController.java
@@ -8,7 +8,7 @@ import com.ningdatech.kqapi.user.model.po.ChangeAccountStatusReq;
import com.ningdatech.kqapi.user.model.po.ModifyPasswordReq;
import com.ningdatech.kqapi.user.model.po.SaveUserReq;
import com.ningdatech.kqapi.user.model.po.UserListReq;
-import com.ningdatech.kqapi.user.model.vo.UserBasicInfoVO;
+import com.ningdatech.kqapi.user.model.vo.LoginUserDetailVO;
import com.ningdatech.kqapi.user.model.vo.UserDetailVO;
import com.ningdatech.kqapi.user.model.vo.UserListVO;
import com.ningdatech.log.annotation.WebLog;
@@ -73,8 +73,8 @@ public class UserInfoController {
@PostMapping(value = "/basic-info")
@ApiOperation("获取用户基本信息")
@WebLog(value = "获取用户基本信息")
- public UserBasicInfoVO getBasicInfo() {
- return userInfoManage.getBasicInfo();
+ public LoginUserDetailVO loginUserDetail() {
+ return userInfoManage.loginUserDetail();
}
@PostMapping("/kick-off/{userId}")
diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/user/manage/UserInfoManage.java b/kqapi/src/main/java/com/ningdatech/kqapi/user/manage/UserInfoManage.java
index 301c9db..1b2f101 100644
--- a/kqapi/src/main/java/com/ningdatech/kqapi/user/manage/UserInfoManage.java
+++ b/kqapi/src/main/java/com/ningdatech/kqapi/user/manage/UserInfoManage.java
@@ -21,7 +21,7 @@ import com.ningdatech.kqapi.user.model.po.ModifyPasswordReq;
import com.ningdatech.kqapi.user.model.po.SaveUserReq;
import com.ningdatech.kqapi.user.model.po.UserListReq;
import com.ningdatech.kqapi.user.model.vo.UserListVO;
-import com.ningdatech.kqapi.user.model.vo.UserBasicInfoVO;
+import com.ningdatech.kqapi.user.model.vo.LoginUserDetailVO;
import com.ningdatech.kqapi.user.model.vo.UserDetailVO;
import com.ningdatech.kqapi.user.service.IUserAuthService;
import com.ningdatech.kqapi.user.service.IUserInfoService;
@@ -36,7 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.*;
-import java.util.function.Function;
+import java.util.stream.Collectors;
/**
@@ -158,27 +158,24 @@ public class UserInfoManage {
.eq(StrUtil.isNotBlank(req.getMobile()), UserInfo::getMobile, req.getMobile())
.orderByDesc(UserInfo::getUpdateOn);
Page page = userInfoService.page(req.page(), query);
- PageVo pageVo = new PageVo<>();
- long total = page.getTotal();
- pageVo.setTotal(total);
- if (total > 0) {
- Function mapping = r -> {
- UserListVO res = new UserListVO();
- res.setUserId(r.getId());
- res.setRealName(r.getRealName());
- res.setCreateTime(r.getCreateOn());
- res.setPhoneNo(r.getMobile());
- res.setAccountStatus(r.getAccountStatus());
- return res;
- };
- pageVo.setRecords(CollUtils.convert(page.getRecords(), mapping));
+ if (page.getTotal() == 0) {
+ return PageVo.empty();
}
- return pageVo;
+ List data = page.getRecords().stream().map(r -> {
+ UserListVO res = new UserListVO();
+ res.setUserId(r.getId());
+ res.setRealName(r.getRealName());
+ res.setCreateTime(r.getCreateOn());
+ res.setPhoneNo(r.getMobile());
+ res.setAccountStatus(r.getAccountStatus());
+ return res;
+ }).collect(Collectors.toList());
+ return PageVo.of(data, page.getTotal());
}
- public UserBasicInfoVO getBasicInfo() {
+ public LoginUserDetailVO loginUserDetail() {
UserInfoDetails details = LoginUserUtil.loginUserDetail();
- UserBasicInfoVO result = new UserBasicInfoVO();
+ LoginUserDetailVO result = new LoginUserDetailVO();
result.setUserId(details.getUserId());
result.setRealName(details.getRealName());
return result;
@@ -189,8 +186,7 @@ public class UserInfoManage {
.eq(UserAuth::getIdentifier, identifier)
.ne(userId != null, UserAuth::getUserId, userId)
.last(BizConst.LIMIT_1);
- UserAuth userAuth = userAuthService.getOne(query);
- if (Objects.nonNull(userAuth)) {
+ if (userAuthService.count(query) > 0) {
throw new BizException("当前账号已经注册");
}
diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/UserBasicInfoVO.java b/kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/LoginUserDetailVO.java
similarity index 93%
rename from kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/UserBasicInfoVO.java
rename to kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/LoginUserDetailVO.java
index bad231c..f914631 100644
--- a/kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/UserBasicInfoVO.java
+++ b/kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/LoginUserDetailVO.java
@@ -14,7 +14,7 @@ import lombok.Data;
*/
@Data
@ApiModel("用户基本信息")
-public class UserBasicInfoVO {
+public class LoginUserDetailVO {
@ApiModelProperty("用户id")
private Long userId;
diff --git a/kqapi/src/main/resources/application-prod.yml b/kqapi/src/main/resources/application-prod.yml
index 786db38..56dfaa5 100644
--- a/kqapi/src/main/resources/application-prod.yml
+++ b/kqapi/src/main/resources/application-prod.yml
@@ -118,7 +118,7 @@ log:
total-size: 50MB
swagger:
- enabled: true
+ enabled: false
hostname: iZut201mqskxt0mwme4tjfZ
diff --git a/kqapi/target/classes/BOOT-INF/classes/application-prod.yml b/kqapi/target/classes/BOOT-INF/classes/application-prod.yml
index 786db38..56dfaa5 100644
--- a/kqapi/target/classes/BOOT-INF/classes/application-prod.yml
+++ b/kqapi/target/classes/BOOT-INF/classes/application-prod.yml
@@ -118,7 +118,7 @@ log:
total-size: 50MB
swagger:
- enabled: true
+ enabled: false
hostname: iZut201mqskxt0mwme4tjfZ
diff --git a/kqapi/target/classes/META-INF/spring-configuration-metadata.json b/kqapi/target/classes/META-INF/spring-configuration-metadata.json
index b67fca4..e7eb022 100644
--- a/kqapi/target/classes/META-INF/spring-configuration-metadata.json
+++ b/kqapi/target/classes/META-INF/spring-configuration-metadata.json
@@ -85,8 +85,7 @@
{
"name": "security.auth.post-only-by-login",
"type": "java.lang.Boolean",
- "sourceType": "com.ningdatech.kqapi.security.AuthProperties",
- "defaultValue": true
+ "sourceType": "com.ningdatech.kqapi.security.AuthProperties"
},
{
"name": "security.auth.role-map",
diff --git a/kqapi/target/classes/application-prod.yml b/kqapi/target/classes/application-prod.yml
index 786db38..56dfaa5 100644
--- a/kqapi/target/classes/application-prod.yml
+++ b/kqapi/target/classes/application-prod.yml
@@ -118,7 +118,7 @@ log:
total-size: 50MB
swagger:
- enabled: true
+ enabled: false
hostname: iZut201mqskxt0mwme4tjfZ