2643616413 1 nedēļu atpakaļ
vecāks
revīzija
d07a8a03d9

+ 5 - 4
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/AitagAppController.java

@@ -2,6 +2,7 @@ package cn.com.yusys.yusp.controller;
 
 import cn.com.yusys.yusp.domain.dto.AitagAppListDto;
 import cn.com.yusys.yusp.domain.dto.AitagAppQueryDto;
+import cn.com.yusys.yusp.domain.dto.AitagAppResetSecretDto;
 import cn.com.yusys.yusp.model.Result;
 import cn.com.yusys.yusp.domain.dto.AitagAppCreateDto;
 import cn.com.yusys.yusp.domain.entity.AitagApp;
@@ -64,9 +65,9 @@ public class AitagAppController {
 
     @ApiOperationType("重置密钥")
     @PostMapping("/reset-secret")
-    public Result<String> resetSecret(@RequestParam String id) {
+    public Result<String> resetSecret(@Validated @RequestBody AitagAppResetSecretDto dto) {
         try {
-            String newSecret = aiTagAppService.resetSecret(id);
+            String newSecret = aiTagAppService.resetSecret(dto.getId());
             return Result.success(newSecret);
         } catch (Exception e) {
             return Result.error("500", "密钥重置失败:" + e.getMessage());
@@ -75,9 +76,9 @@ public class AitagAppController {
 
     @ApiOperationType("禁用应用")
     @PostMapping("/disable")
-    public Result<Void> disableApp(@RequestParam String id) {
+    public Result<Void> disableApp(@Validated @RequestBody AitagAppResetSecretDto dto) {
         try {
-            aiTagAppService.disableApp(id);
+            aiTagAppService.disableApp(dto.getId());
             return Result.success();
         } catch (Exception e) {
             return Result.error("500", "应用禁用失败:" + e.getMessage());

+ 9 - 8
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/AitagTagCategoryController.java

@@ -68,10 +68,10 @@ public class AitagTagCategoryController {
 
     @ApiOperationType("启用标签体系")
     @PostMapping("/enable")
-    public Result<Void> enableCategory(@RequestParam String id) {
+    public Result<Void> enableCategory(@Validated @RequestBody AitagTagCategoryOperationDto dto) {
         try {
-            aiTagCategoryService.enableCategory(id);
-            fastApiService.categorySync(id);
+            aiTagCategoryService.enableCategory(dto.getId());
+            fastApiService.categorySync(dto.getId());
             return Result.success();
         } catch (Exception e) {
             return Result.error("500", "启用标签体系失败:" + e.getMessage());
@@ -80,10 +80,10 @@ public class AitagTagCategoryController {
 
     @ApiOperationType("停用标签体系")
     @PostMapping("/disable")
-    public Result<Void> disableCategory(@RequestParam String id) {
+    public Result<Void> disableCategory(@Validated @RequestBody AitagTagCategoryOperationDto dto) {
         try {
-            aiTagCategoryService.disableCategory(id);
-            fastApiService.categorySync(id);
+            aiTagCategoryService.disableCategory(dto.getId());
+            fastApiService.categorySync(dto.getId());
             return Result.success();
         } catch (Exception e) {
             return Result.error("500", "停用标签体系失败:" + e.getMessage());
@@ -92,15 +92,16 @@ public class AitagTagCategoryController {
 
     @ApiOperationType("删除标签体系")
     @PostMapping("/delete")
-    public Result<Void> deleteCategory(@RequestParam String id) {
+    public Result<Void> deleteCategory(@Validated @RequestBody AitagTagCategoryOperationDto dto) {
         try {
-            aiTagCategoryService.deleteCategory(id);
+            aiTagCategoryService.deleteCategory(dto.getId());
             return Result.success();
         } catch (Exception e) {
             return Result.error("500", "删除标签体系失败:" + e.getMessage());
         }
     }
 
+
     @ApiOperationType("已启用标签体系列表一览")
     @PostMapping("/enablelist")
     public Result<List<AitagTagCategoryVo>> listEnabledCategories(@RequestBody AitagEnabledTagCategoryListDto dto) {

+ 16 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/dto/AitagAppResetSecretDto.java

@@ -0,0 +1,16 @@
+package cn.com.yusys.yusp.domain.dto;
+
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 应用重置密钥请求 DTO
+ */
+@Data
+public class AitagAppResetSecretDto {
+    
+    @NotBlank(message = "应用 ID 不能为空")
+    @ApiModelProperty(value = "应用 ID", required = true)
+    private String id;
+}

+ 16 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/dto/AitagTagCategoryOperationDto.java

@@ -0,0 +1,16 @@
+package cn.com.yusys.yusp.domain.dto;
+
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 标签体系操作请求 DTO(启用/禁用/删除)
+ */
+@Data
+public class AitagTagCategoryOperationDto {
+
+    @NotBlank(message = "体系 ID 不能为空")
+    @ApiModelProperty(value = "体系 ID", required = true)
+    private String id;
+}