Browse Source

增加文件上传依赖

master
WendyYang 6 months ago
parent
commit
88bf00901b
8 changed files with 29 additions and 30 deletions
  1. +4
    -0
      kqapi/pom.xml
  2. +3
    -3
      kqapi/src/main/java/com/ningdatech/kqapi/user/controller/UserInfoController.java
  3. +17
    -21
      kqapi/src/main/java/com/ningdatech/kqapi/user/manage/UserInfoManage.java
  4. +1
    -1
      kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/LoginUserDetailVO.java
  5. +1
    -1
      kqapi/src/main/resources/application-prod.yml
  6. +1
    -1
      kqapi/target/classes/BOOT-INF/classes/application-prod.yml
  7. +1
    -2
      kqapi/target/classes/META-INF/spring-configuration-metadata.json
  8. +1
    -1
      kqapi/target/classes/application-prod.yml

+ 4
- 0
kqapi/pom.xml View File

@@ -145,6 +145,10 @@
<groupId>com.ningdatech</groupId>
<artifactId>nd-swagger2-starter</artifactId>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-file-starter</artifactId>
</dependency>
</dependencies>
<!-- 打包 -->
<!--配置环境的profile-->


+ 3
- 3
kqapi/src/main/java/com/ningdatech/kqapi/user/controller/UserInfoController.java View File

@@ -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}")


+ 17
- 21
kqapi/src/main/java/com/ningdatech/kqapi/user/manage/UserInfoManage.java View File

@@ -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<UserInfo> page = userInfoService.page(req.page(), query);
PageVo<UserListVO> pageVo = new PageVo<>();
long total = page.getTotal();
pageVo.setTotal(total);
if (total > 0) {
Function<UserInfo, UserListVO> 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<UserListVO> 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("当前账号已经注册");
}



kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/UserBasicInfoVO.java → kqapi/src/main/java/com/ningdatech/kqapi/user/model/vo/LoginUserDetailVO.java View File

@@ -14,7 +14,7 @@ import lombok.Data;
*/
@Data
@ApiModel("用户基本信息")
public class UserBasicInfoVO {
public class LoginUserDetailVO {

@ApiModelProperty("用户id")
private Long userId;

+ 1
- 1
kqapi/src/main/resources/application-prod.yml View File

@@ -118,7 +118,7 @@ log:
total-size: 50MB

swagger:
enabled: true
enabled: false

hostname: iZut201mqskxt0mwme4tjfZ



+ 1
- 1
kqapi/target/classes/BOOT-INF/classes/application-prod.yml View File

@@ -118,7 +118,7 @@ log:
total-size: 50MB

swagger:
enabled: true
enabled: false

hostname: iZut201mqskxt0mwme4tjfZ



+ 1
- 2
kqapi/target/classes/META-INF/spring-configuration-metadata.json View File

@@ -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",


+ 1
- 1
kqapi/target/classes/application-prod.yml View File

@@ -118,7 +118,7 @@ log:
total-size: 50MB

swagger:
enabled: true
enabled: false

hostname: iZut201mqskxt0mwme4tjfZ



Loading…
Cancel
Save