文件上传https

This commit is contained in:
chen-xin-zhi 2025-03-18 16:36:50 +08:00
parent 104b68f324
commit 7e6efa4d50
2 changed files with 56 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import com.cultural.heritage.exception.ThrowUtils;
import com.cultural.heritage.model.dto.CommonRequest;
import com.cultural.heritage.model.dto.user.*;
import com.cultural.heritage.model.entity.User;
import com.cultural.heritage.model.vo.user.UserMainInfoVO;
import com.cultural.heritage.model.vo.user.UserVO;
import com.cultural.heritage.service.user.UserService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -200,13 +201,15 @@ public class UserController {
@PostMapping("/query/id")
@Operation(summary = "Web端管理员根据id查询用户信息", description = "参数用户id, 权限:管理员(boss, admin), 方法名getUserById")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<UserVO> getUserById(@RequestBody CommonRequest commonRequest) {
public BaseResponse<UserMainInfoVO> getUserById(@RequestBody CommonRequest commonRequest) {
if (commonRequest == null) {
throw new BusinessException(ErrorCode.PARAMS_ERROR);
}
Long id = commonRequest.getId();
User user = userService.getById(id);
return ResultUtils.success(userService.getUserVO(user));
UserMainInfoVO userMainInfoVO = new UserMainInfoVO();
BeanUtils.copyProperties(user, userMainInfoVO);
return ResultUtils.success(userMainInfoVO);
}

View File

@ -0,0 +1,51 @@
package com.cultural.heritage.model.vo.user;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class UserMainInfoVO implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 账号
*/
private String userAccount;
/**
* 密码
*/
private String userPassword;
/**
* 用户昵称
*/
private String userName;
/**
* 用户头像
*/
private String userAvatar;
/**
* 积分
*/
private Integer points;
/**
* 用户身份
*/
private String userRole;
@Serial
private static final long serialVersionUID = 1L;
}