mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +08:00 
			
		
		
		
	build: continew-starter 2.10.0 => 2.11.0
1.SaToken 升级适配 2.DictField 注解 => DictModel 3.BaseIdResp => IdResp 4.CRUD 删除接口由 URL 传参重构为请求体传参 5.访问日志打印问题修复等
This commit is contained in:
		| @@ -116,11 +116,7 @@ public class AuthController { | ||||
|     private AuthRequest getAuthRequest(String source) { | ||||
|         try { | ||||
|             AuthConfig authConfig = authProperties.getType().get(source.toUpperCase()); | ||||
|             return AuthRequestBuilder | ||||
|                 .builder() | ||||
|                 .source(source) | ||||
|                 .authConfig(authConfig) | ||||
|                 .build(); | ||||
|             return AuthRequestBuilder.builder().source(source).authConfig(authConfig).build(); | ||||
|         } catch (Exception e) { | ||||
|             throw new BadRequestException("暂不支持 [%s] 平台账号登录".formatted(source)); | ||||
|         } | ||||
|   | ||||
| @@ -30,11 +30,10 @@ import top.continew.admin.system.model.resp.message.MessageUnreadResp; | ||||
| import top.continew.admin.system.service.MessageService; | ||||
| import top.continew.admin.system.service.MessageUserService; | ||||
| import top.continew.starter.extension.crud.model.query.PageQuery; | ||||
| import top.continew.starter.extension.crud.model.req.IdsReq; | ||||
| import top.continew.starter.extension.crud.model.resp.PageResp; | ||||
| import top.continew.starter.log.annotation.Log; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 消息管理 API | ||||
|  * | ||||
| @@ -58,24 +57,28 @@ public class MessageController { | ||||
|     } | ||||
|  | ||||
|     @Operation(summary = "删除数据", description = "删除数据") | ||||
|     @Parameter(name = "ids", description = "ID 列表", example = "1,2", in = ParameterIn.PATH) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public void delete(@PathVariable List<Long> ids) { | ||||
|         baseService.delete(ids); | ||||
|     @DeleteMapping | ||||
|     public void delete(@Validated @RequestBody IdsReq req) { | ||||
|         baseService.delete(req.getIds()); | ||||
|     } | ||||
|  | ||||
|     @Operation(summary = "标记已读", description = "将消息标记为已读状态") | ||||
|     @Parameter(name = "ids", description = "消息ID列表", example = "1,2", in = ParameterIn.QUERY) | ||||
|     @PatchMapping("/read") | ||||
|     public void readMessage(@RequestParam(required = false) List<Long> ids) { | ||||
|         messageUserService.readMessage(ids); | ||||
|     public void read(@Validated @RequestBody IdsReq req) { | ||||
|         messageUserService.readMessage(req.getIds()); | ||||
|     } | ||||
|  | ||||
|     @Operation(summary = "全部已读", description = "将所有消息标记为已读状态") | ||||
|     @PatchMapping("/readAll") | ||||
|     public void readAll() { | ||||
|         messageUserService.readMessage(null); | ||||
|     } | ||||
|  | ||||
|     @Log(ignore = true) | ||||
|     @Operation(summary = "查询未读消息数量", description = "查询当前用户的未读消息数量") | ||||
|     @Parameter(name = "isDetail", description = "是否查询详情", example = "true", in = ParameterIn.QUERY) | ||||
|     @GetMapping("/unread") | ||||
|     public MessageUnreadResp countUnreadMessage(@RequestParam(required = false) Boolean detail) { | ||||
|     public MessageUnreadResp countUnread(@RequestParam(required = false) Boolean detail) { | ||||
|         return messageUserService.countUnreadMessageByUserId(UserContextHolder.getUserId(), detail); | ||||
|     } | ||||
| } | ||||
| @@ -29,8 +29,8 @@ import org.springframework.http.MediaType; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | ||||
| import top.continew.admin.common.controller.BaseController; | ||||
| import top.continew.admin.common.constant.RegexConstants; | ||||
| import top.continew.admin.common.controller.BaseController; | ||||
| import top.continew.admin.common.util.SecureUtils; | ||||
| import top.continew.admin.system.model.query.UserQuery; | ||||
| import top.continew.admin.system.model.req.user.UserImportReq; | ||||
| @@ -46,7 +46,7 @@ import top.continew.starter.core.util.ExceptionUtils; | ||||
| import top.continew.starter.core.validation.ValidationUtils; | ||||
| import top.continew.starter.extension.crud.annotation.CrudRequestMapping; | ||||
| import top.continew.starter.extension.crud.enums.Api; | ||||
| import top.continew.starter.extension.crud.model.resp.BaseIdResp; | ||||
| import top.continew.starter.extension.crud.model.resp.IdResp; | ||||
| import top.continew.starter.extension.crud.validation.CrudValidationGroup; | ||||
|  | ||||
| import java.io.IOException; | ||||
| @@ -67,7 +67,7 @@ public class UserController extends BaseController<UserService, UserResp, UserDe | ||||
|  | ||||
|     @Override | ||||
|     @Operation(summary = "新增数据", description = "新增数据") | ||||
|     public BaseIdResp<Long> create(@Validated(CrudValidationGroup.Create.class) @RequestBody UserReq req) { | ||||
|     public IdResp<Long> create(@Validated(CrudValidationGroup.Create.class) @RequestBody UserReq req) { | ||||
|         String rawPassword = ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(req.getPassword())); | ||||
|         ValidationUtils.throwIfNull(rawPassword, "密码解密失败"); | ||||
|         ValidationUtils.throwIf(!ReUtil | ||||
|   | ||||
| @@ -5,5 +5,5 @@ | ||||
|   \____|\___/ |_| |_| \__||_||_| \_| \___|  \_/\_/       /_/   \_\\__,_||_| |_| |_||_||_| |_| | ||||
|  | ||||
|  :: ${project.name}   ::                                               v${project.version} | ||||
|  :: ContiNew Starter ::                                               v2.10.0 | ||||
|  :: ContiNew Starter ::                                               v2.11.0 | ||||
|  :: Spring Boot      ::                                               v${spring-boot.version} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user