Kaynağa Gözat

AliyunController 添加一个 add 接口

reghao 3 gün önce
ebeveyn
işleme
0a5e71f2b2

+ 7 - 1
mgr/src/main/java/cn/reghao/devops/mgr/ops/aliyun/controller/AliyunController.java

@@ -1,12 +1,12 @@
 package cn.reghao.devops.mgr.ops.aliyun.controller;
 
+import cn.reghao.devops.mgr.ops.aliyun.model.dto.AliyunAccountDto;
 import cn.reghao.devops.mgr.ops.aliyun.model.dto.GetSignedUrl;
 import cn.reghao.devops.mgr.ops.aliyun.model.po.AliyunAccount;
 import cn.reghao.devops.mgr.ops.aliyun.model.vo.AliyunAccountVO;
 import cn.reghao.devops.mgr.ops.aliyun.model.vo.StsToken;
 import cn.reghao.devops.mgr.ops.aliyun.service.AliyunAccountService;
 import cn.reghao.devops.mgr.ops.aliyun.service.AliyunService;
-import cn.reghao.devops.mgr.util.SelectOption;
 import cn.reghao.jutil.web.WebResult;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.Operation;
@@ -34,6 +34,12 @@ public class AliyunController {
         this.aliyunService = aliyunService;
     }
 
+    @Operation(summary = "添加阿里云帐号", description = "N")
+    @PostMapping(value = "/key", produces = MediaType.APPLICATION_JSON_VALUE)
+    public String addAliyunAccount(@RequestBody @Validated AliyunAccountDto aliyunAccountDto) {
+        return WebResult.success();
+    }
+
     @Operation(summary = "阿里云 key 页面", description = "N")
     @GetMapping("/key")
     public String aliyunKeyPage() {

+ 24 - 0
mgr/src/main/java/cn/reghao/devops/mgr/ops/aliyun/model/dto/AliyunAccountDto.java

@@ -0,0 +1,24 @@
+package cn.reghao.devops.mgr.ops.aliyun.model.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author reghao
+ * @date 2026-03-25 11:26:33
+ */
+@NoArgsConstructor
+@Data
+public class AliyunAccountDto {
+    @NotBlank(message = "repoAuthName 不能为空字符")
+    @Size(max = 255, message = "repoAuthName 长度不能超过 255 个字符")
+    private String repoAuthName;
+    @NotBlank(message = "endpoint 不能为空字符")
+    @Size(max = 255, message = "endpoint 不能超过 255 个字符")
+    private String endpoint;
+    @NotBlank(message = "name 不能为空字符")
+    @Size(max = 255, message = "name 不能超过 255 个字符")
+    private String name;
+}