更新了写真预约特殊产品处理

This commit is contained in:
chen-xin-zhi 2025-03-07 13:41:28 +08:00
parent df3aa4c46f
commit 70c5284a71
4 changed files with 59 additions and 9 deletions

View File

@ -141,6 +141,34 @@ public class FileController {
}
@PostMapping("/upload/only")
@Operation(summary = "单独文件上传(只返回url)", description = "参数file文件对象multipartFile)权限所有人方法名uploadServerFile")
public String uploadOnlyServerFile(@RequestPart("file")MultipartFile multipartFile, HttpServletRequest request) {
//
// 校验文件
validFile(multipartFile, null);
// 文件目录根据业务用户来划分
String uuid = RandomStringUtils.randomAlphabetic(8);
String filename = uuid + "-" + multipartFile.getOriginalFilename();
String filepath = String.format("/%s/%s/%s", "single", "yt", filename);
// 判断目录是否存在
File file = new File(FileConstant.SERVER_UPLOAD_DIR, filepath);
if (!file.exists()) {
// 创建目录
boolean mkdirs = file.mkdirs();
if (!mkdirs) {
throw new BusinessException(ErrorCode.SYSTEM_ERROR, "创建目录失败");
}
}
//返回可访问地址
return iHweiYunOBSService.fileUpload(multipartFile, "feiyi" + filepath);
}
/**

View File

@ -105,18 +105,34 @@ public class UserController {
/**
* 退出登录
* Web端管理员退出登录
* @param request http
* @return 是否退出登录成功
*/
@PostMapping("/logout")
@Operation(summary = "Web端管理员退出登录", description = "参数权限所有人方法名userLogout")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<Boolean> userLogout(HttpServletRequest request) {
boolean result = userService.userLogout(request);
return ResultUtils.success(result);
}
/**
* 小程序用户退出登录
* @param request http
* @return 是否退出登录成功
*/
@PostMapping("/mini/logout")
@Operation(summary = "小程序用户退出登录", description = "参数权限所有人方法名userLogout")
public BaseResponse<Boolean> miniUserLogout(HttpServletRequest request) {
boolean result = userService.userLogout(request);
return ResultUtils.success(result);
}
/**
* 小程序端(Web端)用户获取登录信息
* @param request http
@ -148,7 +164,7 @@ public class UserController {
BeanUtils.copyProperties(userUpdateMyRequest, user);
user.setId(loginUser.getId());
boolean result = userService.updateById(user);
ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR);
ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "用户信息更新失败");
return ResultUtils.success(true);
}

View File

@ -25,12 +25,6 @@ public class UserUpdateMyRequest implements Serializable {
@Schema(description = "用户头像", example = "https://xxx/xxx.jpg")
private String userAvatar;
/**
* 手机号
*/
@Schema(description = "手机号", example = "18845892473")
private String phone;
@Serial
private static final long serialVersionUID = 1L;

View File

@ -19,7 +19,7 @@ spring:
# max-lifetime: 120000
# 生产环境
rabbitmq:
host: 123.249.108.160
port: 5672
@ -31,6 +31,18 @@ spring:
prefetch: 1
# 测试环境
# rabbitmq:
# host: 154.8.193.216
# port: 5672
# username: admin
# password: cksys6509
# virtual-host: vhost
# listener:
# simple:
# prefetch: 1
data: