Explorar el Código

update RepoAuthConfig

reghao hace 22 horas
padre
commit
6e3a11efef

+ 3 - 1
mgr/src/main/java/cn/reghao/devops/mgr/ops/build/model/constant/RepoType.java

@@ -1,11 +1,13 @@
 package cn.reghao.devops.mgr.ops.build.model.constant;
 
 /**
+ * 仓库类型
+ *
  * @author reghao
  * @date 2021-02-05 22:50:41
  */
 public enum RepoType {
-    git;
+    git, docker;
 
     public String getName() {
         return this.name();

+ 5 - 5
mgr/src/main/java/cn/reghao/devops/mgr/ops/build/model/po/RepoAuthConfig.java

@@ -29,14 +29,14 @@ import jakarta.validation.constraints.Pattern;
 @Entity
 @Table(name = "devops_repo_auth_config")
 public class RepoAuthConfig extends BaseEntity {
-    @ValidEnum(value = RepoType.class, message = "请选择正确的仓库类型")
-    private String type;
+    @ValidEnum(value = RepoAuthType.class, message = "请选择的认证类型")
+    private String authType;
     @Pattern(regexp = "^\\S*$", message = "认证名字不能包含空白符")
     @Length(max = 255, message = "认证名字的最大长度不能超过 255 个字符")
     @Column(nullable = false, unique = true)
     private String name;
-    @ValidEnum(value = RepoAuthType.class, message = "请选择的仓库认证类型")
-    private String authType;
+    @ValidEnum(value = RepoType.class, message = "请选择正确的仓库类型")
+    private String type;
 
     @NotBlank(groups = {HttpRepoAuth.class}, message = "认证用户名不能为空")
     @Length(max = 255, message = "认证用户名的最大长度不能超过 255 个字符")
@@ -59,6 +59,6 @@ public class RepoAuthConfig extends BaseEntity {
     }
 
     public RepoAuth getRepoAuth() {
-        return new RepoAuth(this.type, this.name, this.authType, this.username, this.password, this.rsaPrikey);
+        return new RepoAuth("this.type", this.name, this.authType, this.username, this.password, this.rsaPrikey);
     }
 }