diff --git a/.idea/compiler.xml b/.idea/compiler.xml index ea777c86..6724a6a6 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -18,43 +18,29 @@ + - - - - - - - - - - - - - - - - - - - + - + - - + + + + - + + @@ -64,7 +50,21 @@ + + + + + + + + + + + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml index d5c91f5b..621a1934 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -56,12 +56,26 @@ diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 58b60839..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/GitHt/占位 b/GitHt/占位 deleted file mode 100644 index e69de29b..00000000 diff --git a/dependencies/.flattened-pom.xml b/dependencies/.flattened-pom.xml new file mode 100644 index 00000000..85629b05 --- /dev/null +++ b/dependencies/.flattened-pom.xml @@ -0,0 +1,590 @@ + + + 4.0.0 + cd.casic.boot + dependencies + 2.0.0-jdk17 + pom + dependencies + 管理整个项目的依赖版本 + + 2.9.2 + 8.0.0.RELEASE + 1.6.0 + 5.1.0 + 1.6.2 + 1.2.83 + 3.47.1.0 + 3.5.16 + 0.33.0 + 2.9.3 + 20250107 + 8.6.0 + 1.27.1 + 2.3.1 + 2.7.0 + 4.3.1 + 3.36.0 + 0.9.0 + 2.14.5 + 1.28 + 3.3.4 + 1.80 + 2.3.0 + 1.12 + 2.2.7 + 2.17.0 + 1.2.11 + 2.6.10 + 6.0.0-M16 + 2.3.0 + 1.18.1 + 3.5.8 + 4.5.0 + 1.18.34 + 9.0.0 + 5.2.0 + 1.2.11 + 1.4.0 + 2.4 + 0.10.2 + 3.0.6 + 2.0.8.3 + 3.12.1 + 1.2.13 + 1.4.13 + 5.8.32 + 2.0.0-jdk17 + 0.1.55 + 1.28 + 42.7.4 + 3.3.3 + 23.5.0.24.07 + 4.1.113.Final + 6.6.5 + 1.1.4 + 33.3.1-jre + 1.12.777 + 3.11.1 + 1.7.8 + 4.0.3 + 1.5.6 + 1.2.23 + 3.0.6 + 8.1.3.140 + + + + + io.netty + netty-bom + ${netty.version} + pom + import + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot.version} + pom + import + + + cd.casic.boot + commons + ${revision} + + + cd.casic.boot + spring-boot-starter-biz-data-permission + ${revision} + + + cd.casic.boot + spring-boot-starter-biz-ip + ${revision} + + + cd.casic.boot + spring-boot-starter-biz-tenant + ${revision} + + + cd.casic.boot + spring-boot-starter-excel + ${revision} + + + cd.casic.boot + spring-boot-starter-job + ${revision} + + + cd.casic.boot + spring-boot-starter-mongo + ${revision} + + + cd.casic.boot + spring-boot-starter-monitor + ${revision} + + + cd.casic.boot + spring-boot-starter-mq + ${revision} + + + org.apache.rocketmq + rocketmq-spring-boot-starter + ${rocketmq-spring.version} + + + cd.casic.boot + spring-boot-starter-mybatis + ${revision} + + + cd.casic.boot + spring-boot-starter-protection + ${revision} + + + cd.casic.boot + spring-boot-starter-redis + ${revision} + + + cd.casic.boot + spring-boot-starter-security + ${revision} + + + cd.casic.boot + spring-boot-starter-test + ${revision} + + + cd.casic.boot + spring-boot-starter-web + ${revision} + + + cd.casic.boot + spring-boot-starter-websocket + ${revision} + + + cd.casic.boot + module-infra-api + ${revision} + + + cd.casic.boot + module-infra-biz + ${revision} + + + cd.casic.boot + module-system-api + ${revision} + + + cd.casic.boot + module-system-biz + ${revision} + + + io.github.mouzt + bizlog-sdk + ${bizlog-sdk.version} + + + org.springframework.boot + spring-boot-starter + + + + + org.springframework.boot + spring-boot-configuration-processor + ${spring.boot.version} + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + ${knife4j.version} + + + org.springdoc + springdoc-openapi-starter-webmvc-api + ${springdoc.version} + + + com.alibaba + druid-spring-boot-3-starter + ${druid.version} + + + org.mybatis + mybatis + ${mybatis.version} + + + com.baomidou + mybatis-plus-spring-boot3-starter + ${mybatis-plus.version} + + + com.baomidou + mybatis-plus-generator + ${mybatis-plus.version} + + + com.baomidou + dynamic-datasource-spring-boot3-starter + ${dynamic-datasource.version} + + + com.github.yulichang + mybatis-plus-join-boot-starter + ${mybatis-plus-join.version} + + + com.fhs-opensource + easy-trans-spring-boot-starter + ${easy-trans.version} + + + org.springframework + spring-context + + + org.springframework.cloud + spring-cloud-commons + + + + + com.fhs-opensource + easy-trans-mybatis-plus-extend + ${easy-trans.version} + + + com.fhs-opensource + easy-trans-anno + ${easy-trans.version} + + + org.redisson + redisson-spring-boot-starter + ${redisson.version} + + + org.springframework.boot + spring-boot-starter-actuator + + + + + com.baomidou + lock4j-redisson-spring-boot-starter + ${lock4j.version} + + + org.redisson + redisson-spring-boot-starter + + + + + org.apache.skywalking + apm-toolkit-trace + ${skywalking.version} + + + org.apache.skywalking + apm-toolkit-logback-1.x + ${skywalking.version} + + + org.apache.skywalking + apm-toolkit-opentracing + ${skywalking.version} + + + io.opentracing + opentracing-api + ${opentracing.version} + + + io.opentracing + opentracing-util + ${opentracing.version} + + + io.opentracing + opentracing-noop + ${opentracing.version} + + + de.codecentric + spring-boot-admin-starter-server + ${spring-boot-admin.version} + + + de.codecentric + spring-boot-admin-server-cloud + + + + + de.codecentric + spring-boot-admin-starter-client + ${spring-boot-admin.version} + + + org.mockito + mockito-inline + ${mockito-inline.version} + + + org.springframework.boot + spring-boot-starter-test + ${spring.boot.version} + + + org.ow2.asm + asm + + + org.mockito + mockito-core + + + + + com.github.fppt + jedis-mock + ${jedis-mock.version} + + + uk.co.jemos.podam + podam + ${podam.version} + + + org.projectlombok + lombok + ${lombok.version} + + + org.mapstruct + mapstruct + ${mapstruct.version} + + + org.mapstruct + mapstruct-jdk8 + ${mapstruct.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + cn.hutool + hutool-all + ${hutool-5.version} + + + org.dromara.hutool + hutool-extra + ${hutool-6.version} + + + com.alibaba + easyexcel + ${easyexcel.verion} + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.commons + commons-compress + ${commons-compress.version} + + + org.apache.tika + tika-core + ${tika-core.version} + + + org.apache.velocity + velocity-engine-core + ${velocity.version} + + + com.alibaba + fastjson + ${fastjson.version} + + + com.networknt + json-schema-validator + ${json.schema.validator.veresion} + + + org.json + json + ${json.version} + + + com.google.guava + guava + ${guava.version} + + + com.alibaba + transmittable-thread-local + ${transmittable-thread-local.version} + + + commons-net + commons-net + ${commons-net.version} + + + com.jcraft + jsch + ${jsch.version} + + + com.amazonaws + aws-java-sdk-s3 + ${aws-java-sdk-s3.version} + + + org.lionsoul + ip2region + ${ip2region.version} + + + org.jsoup + jsoup + ${jsoup.version} + + + com.github.oshi + oshi-core + ${oshi-version} + + + org.pf4j + pf4j + ${pf4j.version} + + + org.slf4j + slf4j-log4j12 + + + + + org.pf4j + pf4j-spring + ${pf4j-spring.version} + + + com.dameng + DmJdbcDriver18 + ${dm8.jdbc.version} + + + com.oracle.database.jdbc + ojdbc8 + ${oracle.version} + + + org.postgresql + postgresql + ${postgresql.version} + + + org.opengauss + opengauss-jdbc + ${opengauss.jdbc.version} + + + cn.com.kingbase + kingbase8 + ${kingbase.jdbc.version} + + + org.xerial + sqlite-jdbc + ${sqlite.version} + + + com.gitee.anwena + mongo-plus-boot-starter + ${anwena.version} + + + org.bouncycastle + bcprov-jdk18on + ${bcprov-jdk18on.version} + + + org.jvnet.winp + winp + ${winp.version} + + + org.reflections + reflections + ${reflections.version} + + + org.apache.commons + commons-exec + ${commons-exec.version} + + + com.googlecode.plist + dd-plist + ${dd-plist.version} + + + net.dongliu + apk-parser + ${apk-parser.version} + + + ch.qos.logback + logback-core + ${logback-core.version} + + + ch.qos.logback + logback-classic + ${logback-classic.version} + + + com.github.ben-manes.caffeine + caffeine + ${caffeine.version} + + + io.github.resilience4j + resilience4j-circuitbreaker + ${resilience4j-circuitbreaker.version} + + + + diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 03a30c66..0685ab60 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -220,90 +220,6 @@ - - cd.casic.boot - module-ci-common-pipeline - ${revision} - - - - cd.casic.boot - module-ci-process-api - ${revision} - - - - cd.casic.boot - module-ci-environment - ${revision} - - - - cd.casic.boot - module-ci-event - ${revision} - - - - cd.casic.boot - module-ci-log - ${revision} - - - - cd.casic.boot - module-ci-market - ${revision} - - - - cd.casic.boot - module-ci-process-api - ${revision} - - - - cd.casic.boot - module-ci-project - ${revision} - - - - cd.casic.boot - module-ci-quality - ${revision} - - - - cd.casic.boot - module-ci-ticket - ${revision} - - - - cd.casic.boot - module-ci-repository - ${revision} - - - - cd.casic.boot - module-ci-worker - ${revision} - - - - cd.casic.boot - module-ci-dispatch-api - ${revision} - - - - cd.casic.boot - module-ci-store-api - ${revision} - - io.github.mouzt diff --git a/modules/module-ci-common-pipeline/pom.xml b/modules/module-ci-common-pipeline/pom.xml deleted file mode 100644 index c6cd71cc..00000000 --- a/modules/module-ci-common-pipeline/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-common-pipeline - - ${project.artifactId} - jar - - - - cd.casic.boot - commons - - - cd.casic.boot - spring-boot-starter-mybatis - - - com.networknt - json-schema-validator - - - org.json - json - - - cd.casic.boot - spring-boot-starter-test - - - - \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/CommonPipelineAutoConfiguration.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/CommonPipelineAutoConfiguration.java deleted file mode 100644 index 6f81731b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/CommonPipelineAutoConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import com.fasterxml.jackson.databind.ObjectMapper; -import jakarta.annotation.PostConstruct; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:CommonPipelineAutoConfiguration - * @Date:2025/03/25 17:30 - * @Filename:CommonPipelineAutoConfiguration - * @description:Todo - */ -@Configuration -@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE) -public class CommonPipelineAutoConfiguration { - - @Autowired(required = false) - private ObjectMapper objectMapper; - - @PostConstruct - public void registerSubtypesObjectMapper() { - ElementSubTypeRegisterLoader.registerElement(objectMapper); - DispatchSubTypeRegisterLoader.registerType(); - DispatchSubInfoRegisterLoader.registerInfo(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubInfoFetcher.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubInfoFetcher.java deleted file mode 100644 index 8636ea31..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubInfoFetcher.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.matrix.DispatchInfo; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:DispatchSubInfoFetcher - * @Date:2025/03/25 17:34 - * @Filename:DispatchSubInfoFetcher - * @description:Todo - */ -public interface DispatchSubInfoFetcher { - - /** - * 返回扩展的子类 - */ - Map> jsonSubInfo(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubInfoRegisterLoader.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubInfoRegisterLoader.java deleted file mode 100644 index ded2a32f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubInfoRegisterLoader.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.matrix.DispatchInfo; -import com.fasterxml.jackson.databind.jsontype.NamedType; -import com.fasterxml.jackson.databind.module.SimpleModule; -import lombok.extern.slf4j.Slf4j; - -import java.util.Map; -import java.util.ServiceLoader; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:DispatchSubInfoRegisterLoader - * @Date:2025/03/25 17:34 - * @Filename:DispatchSubInfoRegisterLoader - * @description:Todo - */ -@Slf4j -public class DispatchSubInfoRegisterLoader { - - public static void registerInfo() { - Class clazz = DispatchSubInfoFetcher.class; - ServiceLoader fetcheries = ServiceLoader.load(clazz); - - if (!fetcheries.iterator().hasNext()) { - fetcheries = ServiceLoader.load(clazz, ServiceLoader.class.getClassLoader()); - } - SimpleModule infoSubModule = new SimpleModule(); - for (DispatchSubInfoFetcher fetcher : fetcheries) { - log.info("[DISPATCH_FETCHER]| {}", fetcher.getClass()); - Map> jsonSubTypes = fetcher.jsonSubInfo(); - for (Map.Entry> entry : jsonSubTypes.entrySet()) { - infoSubModule.registerSubtypes(new NamedType(entry.getValue(), entry.getKey())); - log.info("[REGISTER_DISPATCH]|{} for {}", entry.getValue(), entry.getKey()); - } - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubTypeFetcher.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubTypeFetcher.java deleted file mode 100644 index 0c9e662d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubTypeFetcher.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.type.DispatchType; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:DispatchSubTypeFetcher - * @Date:2025/03/25 17:36 - * @Filename:DispatchSubTypeFetcher - * @description:Todo - */ -public interface DispatchSubTypeFetcher { - - /** - * 返回扩展的子类 - */ - Map> jsonSubTypes(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubTypeRegisterLoader.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubTypeRegisterLoader.java deleted file mode 100644 index a42ff0d7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/DispatchSubTypeRegisterLoader.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.type.DispatchType; -import com.fasterxml.jackson.databind.jsontype.NamedType; -import com.fasterxml.jackson.databind.module.SimpleModule; -import lombok.extern.slf4j.Slf4j; - -import java.util.Map; -import java.util.ServiceLoader; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:DispatchSubTypeRegisterLoader - * @Date:2025/03/25 17:37 - * @Filename:DispatchSubTypeRegisterLoader - * @description:Todo - */ -@Slf4j -public class DispatchSubTypeRegisterLoader { - - public static void registerType() { - Class clazz = DispatchSubTypeFetcher.class; - ServiceLoader fetcheries = ServiceLoader.load(clazz); - - if (!fetcheries.iterator().hasNext()) { - fetcheries = ServiceLoader.load(clazz, ServiceLoader.class.getClassLoader()); - } - SimpleModule typeSubModule = new SimpleModule(); - for (DispatchSubTypeFetcher fetcher : fetcheries) { - log.info("[DISPATCH_FETCHER]| {}", fetcher.getClass()); - Map> jsonSubTypes = fetcher.jsonSubTypes(); - for (Map.Entry> entry : jsonSubTypes.entrySet()) { - typeSubModule.registerSubtypes(new NamedType(entry.getValue(), entry.getKey())); - log.info("[REGISTER_DISPATCH]|{} for {}", entry.getValue(), entry.getKey()); - } - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ElementSubTypeFetcher.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ElementSubTypeFetcher.java deleted file mode 100644 index 42f413e7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ElementSubTypeFetcher.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.pojo.element.Element; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:ElementSubTypeFetcher - * @Date:2025/03/25 17:38 - * @Filename:ElementSubTypeFetcher - * @description:Todo - */ -public interface ElementSubTypeFetcher { - - /** - * 返回扩展的子类 - */ - Map> jsonSubTypes(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ElementSubTypeRegisterLoader.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ElementSubTypeRegisterLoader.java deleted file mode 100644 index ec920c6b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ElementSubTypeRegisterLoader.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.jsontype.NamedType; -import com.fasterxml.jackson.databind.module.SimpleModule; -import lombok.extern.slf4j.Slf4j; - -import java.util.Map; -import java.util.ServiceLoader; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:ElementSubTypeRegisterLoader - * @Date:2025/03/25 17:38 - * @Filename:ElementSubTypeRegisterLoader - * @description:Todo - */ -@Slf4j -public class ElementSubTypeRegisterLoader { - - public static void registerElementForJsonUtil() { - registerElement(null); - } - - public static void registerElement(ObjectMapper objectMapper) { - Class clazz = ElementSubTypeFetcher.class; - ServiceLoader fetcheries = ServiceLoader.load(clazz); - - if (!fetcheries.iterator().hasNext()) { - fetcheries = ServiceLoader.load(clazz, ServiceLoader.class.getClassLoader()); - } - SimpleModule elementSubModule = new SimpleModule(); - for (ElementSubTypeFetcher fetcher : fetcheries) { - log.info("[ELEMENT_FETCHER]| {}", fetcher.getClass()); - Map> jsonSubTypes = fetcher.jsonSubTypes(); - for (Map.Entry> entry : jsonSubTypes.entrySet()) { - elementSubModule.registerSubtypes(new NamedType(entry.getValue(), entry.getKey())); - log.info("[REGISTER_MODEL_ELEMENT]|{} for {}", entry.getValue(), entry.getKey()); - } - } - } -} - diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/EnvReplacementParser.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/EnvReplacementParser.java deleted file mode 100644 index e76490fe..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/EnvReplacementParser.java +++ /dev/null @@ -1,65 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.functions.ExpressionOutput; -import cd.casic.ci.common.pipeline.functions.IFunctionInfo; -import cd.casic.ci.common.pipeline.pojo.NamedValueInfo; -import cd.casic.ci.common.pipeline.dialect.IPipelineDialect; -import cd.casic.ci.common.pipeline.utils.ObjectReplaceEnvVarUtil; -import cn.hutool.core.lang.Pair; -import cn.hutool.json.JSONUtil; -import com.networknt.schema.ExecutionContext; -import lombok.extern.slf4j.Slf4j; - -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:EnvReplacementParser - * @Date:2025/03/25 17:38 - * @Filename:EnvReplacementParser - * @description:Todo - */ -@Slf4j -public class EnvReplacementParser { - private static final Pattern expressionPattern = Pattern.compile("\\$[{]{2}([^$^{}]+)[}]{2}"); - - public static String parse(Object value, Map contextMap, Boolean onlyExpression, - Pair> contextPair, Iterable functions, - ExpressionOutput output) { - ExprReplacementOptions options = new ExprReplacementOptions(contextMap, contextPair, functions, output); - return parse(value, onlyExpression, options); - } - - public static String parse(Object value, Map contextMap, IPipelineDialect dialect, - Pair> contextPair, Iterable functions, - ExpressionOutput output) { - ExprReplacementOptions options = new ExprReplacementOptions(contextMap, contextPair, functions, output); - return parse(value, dialect.supportUseExpression(), options); - } - - public static String parse(Object value, Boolean onlyExpression, ExprReplacementOptions options) { - if (value == null) return ""; - if (onlyExpression == null || !onlyExpression) { - return JSONUtil.toJsonStr(ObjectReplaceEnvVarUtil.replaceEnvVar(value, options.getContextMap())); - } else { - //return JsonUtil.toJson(ExprReplacementUtil.replaceEnvVar(value, options), false); - return null; - } - } - -// public static Pair> getCustomExecutionContextByMap(Map variables, -// List extendNamedValueMap) { -// return ExprReplacementUtil.getCustomExecutionContextByMap(variables, extendNamedValueMap); -// } - - public static boolean containsExpressions(String value) { - if (value == null) { - return false; - } - return expressionPattern.matcher(value).find(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ExprReplacementOptions.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ExprReplacementOptions.java deleted file mode 100644 index 21af73d2..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ExprReplacementOptions.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.functions.ExpressionOutput; -import cd.casic.ci.common.pipeline.functions.IFunctionInfo; -import cd.casic.ci.common.pipeline.pojo.NamedValueInfo; -import cn.hutool.core.lang.Pair; -import com.networknt.schema.ExecutionContext; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:ExprReplacementOptions - * @Date:2025/03/25 17:39 - * @Filename:ExprReplacementOptions - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "表达式替换参数") -public class ExprReplacementOptions { - - @Schema(title = "环境变量", required = true) - private Map contextMap; - - @Schema(title = "值是否能不存在", required = true) - private boolean contextNotNull; - - @Schema(title = "表达式上下文", required = true) - private Pair> contextPair; - - private Iterable functions; - - private ExpressionOutput output; - - public ExprReplacementOptions(Map contextMap, Pair> contextPair, Iterable functions, ExpressionOutput output) { - this.contextMap = contextMap; - this.contextPair = contextPair; - this.functions = functions; - this.output = output; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/IModelTemplate.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/IModelTemplate.java deleted file mode 100644 index 87d97ceb..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/IModelTemplate.java +++ /dev/null @@ -1,43 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:IModelTemplate - * @Date:2025/03/25 17:39 - * @Filename:IModelTemplate - * @description:Todo - */ -@Schema(title = "model中报错模板信息的扩展参数") -public interface IModelTemplate { - - @Schema(title = "模板", required = true) - String getTemplate(); - - @Schema(title = "引用", required = true) - String getRef(); - - @Schema(title = "变量", required = true) - Map getVariables(); - - void setTemplate(String template); - - void setRef(String ref); - - void setVariables(Map variables); - - /** - * 判读是否来自于模板 - * - * @return true 是来自于模板|false 不是来自于模板 - */ - default boolean fromTemplate() { - String template = getTemplate(); - return template != null && !template.isEmpty(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/Model.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/Model.java deleted file mode 100644 index caaa3ab2..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/Model.java +++ /dev/null @@ -1,121 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.container.TriggerContainer; -import cd.casic.ci.common.pipeline.enums.CallBackEvent; -import cd.casic.ci.common.pipeline.pojo.event.PipelineCallbackEvent; -import cd.casic.ci.common.pipeline.pojo.event.ProjectPipelineCallBack; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import cd.casic.ci.common.pipeline.pojo.transfer.Resources; -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:Model - * @Date:2025/03/25 17:39 - * @Filename:Model - * @description:Todo - */ -@Data -@Schema(title = "流水线模型-创建信息") -public class Model implements IModelTemplate { - @Schema(title = "名称", required = true) - private String name; - - @Schema(title = "描述", required = false) - private String desc; - - @Schema(title = "阶段集合", required = true) - private List stages; - - @Schema(title = "标签", required = false) - @Deprecated - //"以PipelineGroupService和流水线设置版本中为准" - private List labels; - - @Schema(title = "是否从模板中实例化出来的", required = false) - private Boolean instanceFromTemplate; - - @Schema(title = "创建人", required = false) - private String pipelineCreator; - - @Schema(title = "当前模板对应的被复制的模板或安装的研发商店的模板对应的ID", required = false) - private String srcTemplateId; - - @Schema(title = "当前模板的ID", required = false) - private String templateId; - - @Schema(title = "提示", required = false) - private String tips; - - @Schema(title = "流水线事件回调", required = false) - private Map events; - - @Schema(title = "静态流水线组", required = false) - private List staticViews; - - @Schema(title = "各项耗时", required = true) - private BuildRecordTimeCost timeCost; - - @Schema(title = "模板地址", required = true) - private String template; - - @Schema(title = "模板版本", required = true) - private String ref; - - @Schema(title = "模板入参", required = true) - private Map variables; - - @Schema(title = "模板资源", required = true) - private Resources resources; - - @Schema(title = "提交时流水线最新版本号", required = false) - private int latestVersion; - /** - * 获取流水线回调配置 - * @param projectId 项目ID - * @param callbackEvent 回调事件类型 - * @return 流水线回调配置列表 - */ - public List getPipelineCallBack( - String projectId, - CallBackEvent callbackEvent - ) { - List pipelineCallBack = new ArrayList<>(); - if (events != null) { - events.forEach((eventName, event) -> { - // TODO 可能要重写equals - if (callbackEvent==event.getCallbackEvent()) { - pipelineCallBack.add( - new ProjectPipelineCallBack( - null, - projectId, - event.getCallbackEvent().name(), - event.getCallbackUrl(), - event.getSecretToken(), - true, - null, - null, - null - ) - ); - } - }); - } - return pipelineCallBack; - } - public TriggerContainer getTriggerContainer(){ - Container container = stages.get(0).getContainers().get(0); - return JSON.parseObject(JSON.toJSONString(container),TriggerContainer.class); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ModelUpdate.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ModelUpdate.java deleted file mode 100644 index c7daec5f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/ModelUpdate.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:ModelUpdate - * @Date:2025/03/25 17:40 - * @Filename:ModelUpdate - * @description:Todo - */ -@Data -@Schema(title = "流水线更新信息") -public class ModelUpdate { - - @Schema(title = "项目id", required = true) - private String projectId; - - @Schema(title = "流水线id", required = true) - private String pipelineId; - - @Schema(title = "名称", required = true) - private String name; - - @Schema(title = "更新人", required = true) - private String updateUserId; - - @Schema(title = "更新结果信息", required = false) - private String updateResultMessage; - - @Schema(title = "更新结果", required = true) - private boolean updateResult; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/NameAndValue.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/NameAndValue.java deleted file mode 100644 index bdf90ae0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/NameAndValue.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:NameAndValue - * @Date:2025/03/25 17:40 - * @Filename:NameAndValue - * @description:Todo - */ -@Data -@Schema(title = "名称和值") -public class NameAndValue { - - @Schema(title = "名称", required = true) - private String key; - - @Schema(title = "值", required = false) - private String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/PipelineVersionWithModel.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/PipelineVersionWithModel.java deleted file mode 100644 index f700adf5..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/PipelineVersionWithModel.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.pojo.PipelineModelAndSetting; -import cd.casic.ci.common.pipeline.pojo.transfer.PreviewResponse; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:PipelineVersionWithModel - * @Date:2025/03/25 17:40 - * @Filename:PipelineVersionWithModel - * @description:Todo - */ -@Data -@Schema(title = "流水线版本与模型") -public class PipelineVersionWithModel { - - @Schema(title = "版本号(流水线唯一递增)", required = true) - private int version; - - @Schema(title = "版本名称", required = true) - private String versionName; - - @Schema(title = "该版本的源版本号", required = true) - private Integer baseVersion; - - @Schema(title = "该版本的版本号名", required = true) - private String baseVersionName; - - @Schema(title = "流水线模型", required = true) - private PipelineModelAndSetting modelAndSetting; - - @Schema(title = "流水线YAML编排(含高亮)", required = false) - private PreviewResponse yamlPreview; - - @Schema(title = "是否处在可以调试状态", required = false) - private Boolean canDebug; - - @Schema(title = "版本变更说明", required = false) - private String description; - - @Schema(title = "是否支持YAML解析", required = true) - private boolean yamlSupported; - - @Schema(title = "YAML解析异常信息") - private String yamlInvalidMsg; - - @Schema(title = "更新操作人", required = true) - private String updater; - - @Schema(title = "版本修改时间", required = true) - private Long updateTime; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/PipelineVersionWithModelRequest.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/PipelineVersionWithModelRequest.java deleted file mode 100644 index 07b79e2a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/PipelineVersionWithModelRequest.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import cd.casic.ci.common.pipeline.enums.PipelineStorageType; -import cd.casic.ci.common.pipeline.pojo.PipelineModelAndSetting; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline - * @Project:ops-pro - * @name:PipelineVersionWithModelRequest - * @Date:2025/03/25 17:41 - * @Filename:PipelineVersionWithModelRequest - * @description:Todo - */ -@Data -@Schema(title = "流水线版本与模型请求") -public class PipelineVersionWithModelRequest { - - @Schema(title = "流水线ID(为空时导入并创建流水线)", required = false) - private String pipelineId; - - @Schema(title = "草稿的来源版本(前端保存时传递)", required = true) - private int baseVersion; - - @Schema(title = "流水线模型", required = true) - private PipelineModelAndSetting modelAndSetting; - - @Schema(title = "流水线YAML编排(不为空时以YAML为准)", required = false) - private String yaml; - - @Schema(title = "存储格式", required = false) - private PipelineStorageType storageType = PipelineStorageType.MODEL; - - @Schema(title = "版本变更说明", required = false) - private String description; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/UUIDUtil.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/UUIDUtil.java deleted file mode 100644 index acfd1d81..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/UUIDUtil.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.common.pipeline; - -import java.util.UUID; - -public class UUIDUtil { - private UUIDUtil() { - // 私有构造方法防止实例化 - } - - /** - * 生成32位字符随机UUID - * @return UUID字符串 - */ - public static String generate() { - UUID uuid = UUID.randomUUID(); - String str = uuid.toString(); - // 通过substring拼接去掉UUID中的连字符 - return str.substring(0, 8) + str.substring(9, 13) + str.substring(14, 18) + str.substring(19, 23) + str.substring(24); - } - - // 可选方案:使用replace方法更简洁 - // public static String generate() { - // return UUID.randomUUID().toString().replace("-", ""); - // } -} - diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/BaseConstant.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/BaseConstant.java deleted file mode 100644 index 6a70f426..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/BaseConstant.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @Classname BaseConstant - * @Description 标志位 - * @Date 2025/3/18 10:00 - * @author mianbin - */ -public class BaseConstant { - /** - * 已删 - */ - public static final Integer DELETED = 1; - - /** - * 未删 - */ - public static final Integer NOT_DELETED = 0; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/CommonConstants.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/CommonConstants.java deleted file mode 100644 index c1b967dc..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/CommonConstants.java +++ /dev/null @@ -1,160 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.constant - * @Project:ops-pro - * @name:CommonConstants - * @Date:2025/03/26 18:02 - * @Filename:CommonConstants - * @description:Todo - */ -public class CommonConstants { - public static final String BCI_CODE_PREFIX = "BCI_CODE_"; - public static final String DEVOPS = "DevOps"; - public static final int NUM_ONE = 1; - public static final int NUM_TWO = 2; - public static final int NUM_THREE = 3; - public static final int NUM_FOUR = 4; - public static final int NUM_FIVE = 5; - public static final int NUM_SIX = 6; - public static final int NUM_SEVEN = 7; - public static final int NUM_EIGHT = 8; - public static final int NUM_NINE = 9; - public static final String INIT_VERSION = "1.0.0"; // 初始化版本 - public static final String BEGIN = "begin"; // 开始 - public static final String EDIT = "edit"; // 提交信息 - public static final String COMMIT = "commit"; // 提交 - public static final String BUILD = "build"; // 构建 - public static final String CHECK = "check"; // 验证 - public static final String TEST = "test"; // 测试 - public static final String CODECC = "codecc"; // 代码检查 - public static final String APPROVE = "approve"; // 审核 - public static final String END = "end"; // 结束 - public static final String SUCCESS = "success"; // 成功 - public static final String UNDO = "undo"; // 未执行 - public static final String DOING = "doing"; // 执行中 - public static final String FAIL = "fail"; // 失败 - public static final String ONLINE = "online"; // 上线 - public static final String TEST_ENV_PREPARE = "testEnvPrepare"; // 准备测试环境 - public static final String ING = "ing"; // 中 - public static final String LATEST = "latest"; // 最新 - public static final String DEVELOP = "develop"; // 开发 - public static final String DEPLOY = "deploy"; // 部署 - public static final String SECURITY = "security"; // 安全 - public static final String NORMAL = "normal"; // 正常 - public static final String EXCEPTION = "exception"; // 异常 - public static final String REQUIRED = "required"; // 必选 - public static final String MIN_LENGTH = "minLength"; // 最小长度 - public static final String MAX_LENGTH = "maxLength"; // 最大长度 - public static final String DEFAULT = "default"; // 默认 - public static final String JAVA = "java"; // java - public static final String PYTHON = "python"; // python - public static final String NODEJS = "nodejs"; // nodejs - public static final String GOLANG = "golang"; // golang - public static final String JS = "js"; // js - public static final String PATTERN_STYLE = "patternStyle"; // 正则表达式规则 - public static final String MESSAGE = "message"; // 提示信息 - public static final String STATIC = "static"; // 静态资源 - public static final String NAME = "name"; // 名称 - public static final String FAIL_NUM = "failNum"; // 失败数量 - public static final String VERSION = "version"; // 版本号 - public static final String TYPE = "type"; // 类型 - public static final String OUTPUT_DESC = "description"; // 插件输出字段描述 - public static final String COMPONENT = "component"; // 组件 - public static final String PIPELINE_URL = "pipelineUrl"; // 流水线链接 - public static final String ARTIFACT = "artifact"; // 构件 - public static final String REPORT = "report"; // 报告 - public static final String VALUE = "value"; // 值 - public static final String MULTIPLE_SELECTOR = "multiple"; // 多选 - public static final String SINGLE_SELECTOR = "single"; // 单选 - public static final String OPTIONS = "options"; // 可选项 - public static final String LABEL = "label"; // 标签 - public static final String NO_LABEL = "noLabel"; // 无标题 - public static final String URL = "url"; // url链接 - public static final String PATH = "path"; // 路径 - public static final String ARTIFACTORY_TYPE = "artifactoryType"; // 归档仓库类型 - public static final String REPORT_TYPE = "reportType"; // 报告类型 - public static final String DATA = "data"; // 数据 - public static final String STRING = "string"; // 字符串 - public static final String LATEST_MODIFIER = "latestModifier"; // 最近修改人 - public static final String IMPORTER = "importer"; // 导入人 - public static final String USAGE = "usage"; // 用途 - public static final String ALIAS = "alias"; // 别名 - public static final String LATEST_UPDATE_TIME = "latestUpdateTime"; // 最近修改时间 - public static final String LATEST_EXECUTOR = "latestExecutor"; // 最近执行人 - public static final String LATEST_EXECUTE_TIME = "latestExecuteTime"; // 最近执行时间 - public static final String LATEST_EXECUTE_PIPELINE = "latestExecutePipeline"; // 最近执行流水线 - public static final String DANG = "dang"; // 当 - public static final String AND = "and"; // 和 - public static final String OR = "or"; // 或 - public static final String TIMETOSELECT = "timetoSelect"; // 时必选 - public static final String MASTER = "master"; // 主干 - public static final String SYSTEM = "system"; // 系统 - public static final String IN_READY_TEST = "IN_READY_TEST"; // 正在测试中 - public static final String BUILD_RUNNING = "buildRunning"; // 运行中 - public static final String BUILD_QUEUE = "buildQueue"; // 构建排队中 - public static final String BUILD_REVIEWING = "buildReviewing"; // 构建待审核 - public static final String BUILD_STAGE_SUCCESS = "buildStageSuccess"; // 构建阶段性完成 - public static final String BUILD_COMPLETED = "buildCompleted"; // 构建完成 - public static final String BUILD_CANCELED = "buildCanceled"; // 构建已取消 - public static final String BUILD_FAILED = "buildFailed"; // 构建失败 - public static final String ID = "id"; // id - public static final String STATUS = "status"; // 状态 - public static final String EXECUTE_COUNT = "executeCount"; - public static final String LOCALE_LANGUAGE = "BK_CI_LOCALE_LANGUAGE"; // locale国际化语言信息 - public static final String DEFAULT_LOCALE_LANGUAGE = "zh_CN"; // 默认语言信息 - public static final String REQUEST_CHANNEL = "BK_CI_REQUEST_CHANNEL"; // 请求渠道 - public static final String API_PERMISSION = "BK_CI_API_PERMISSION"; // 请求API权限 - public static final String REQUEST_IP = "X-Forwarded-For"; // 请求IP - public static final String BK_CREATE = "bkCreate"; // 创建 - public static final String BK_REVISE = "bkRevise"; // 修改 - public static final String FAIL_MSG = "failMsg"; // 失败信息 - - public static final String KEY_START_TIME = "startTime"; - public static final String KEY_END_TIME = "endTime"; - public static final String KEY_CHANNEL = "channel"; - public static final String HIDDEN_SYMBOL = "******"; - public static final String KEY_DEFAULT = "default"; - public static final String KEY_INPUT = "vuex-input"; - public static final String KEY_TEXTAREA = "vuex-textarea"; - public static final String KEY_CODE_EDITOR = "atom-ace-editor"; - public static final String KEY_OS = "os"; - public static final String KEY_SUMMARY = "summary"; - public static final String KEY_DOCSLINK = "docsLink"; - public static final String KEY_DESCRIPTION = "description"; - public static final String KEY_WEIGHT = "weight"; - public static final String KEY_ALL = "all"; - public static final String API_ACCESS_TOKEN_PROPERTY = "access_token"; - public static final String TEMPLATE_ACROSS_INFO_ID = "devops_template_across_info_id"; - public static final String KEY_OS_NAME = "osName"; - public static final String KEY_OS_ARCH = "osArch"; - public static final String KEY_INVALID_OS_INFO = "invalidOsInfo"; - public static final String KEY_VALID_OS_NAME_FLAG = "validOsNameFlag"; - public static final String KEY_VALID_OS_ARCH_FLAG = "validOsArchFlag"; - public static final String KEY_SCRIPT = "script"; - public static final String KEY_COMMIT_ID = "commitId"; - public static final String KEY_BRANCH = "branch"; - public static final String KEY_REPOSITORY_HASH_ID = "repositoryHashId"; - public static final String KEY_REPOSITORY_PATH = "repositoryPath"; - public static final String KEY_VERSION = "version"; - public static final String KEY_VERSION_NAME = "versionName"; - public static final String KEY_UPDATED_TIME = "updatedTime"; - public static final String KEY_INSTANCE_ERROR_INFO = "instanceErrorInfo"; - public static final String KEY_DEFAULT_LOCALE_LANGUAGE = "defaultLocaleLanguage"; - public static final String KEY_PROJECT_ID = "projectId"; - public static final String KEY_PIPELINE_ID = "pipelineId"; - public static final String KEY_PIPELINE_NUM = "pipelineNum"; - public static final String KEY_ARCHIVE = "archive"; - public static final String KEY_BRANCH_TEST_FLAG = "branchTestFlag"; - public static final String KEY_TASK_ATOM = "taskAtom"; - public static final String KEY_ELEMENT_ENABLE = "elementEnable"; - public static final String KEY_SHA_CONTENT = "shaContent"; - public static final String KEY_FILE_SHA_CONTENT = "fileShaContent"; - - public static final String BK_BUILD_ENV_START_FAILED = "bkBuildEnvStartFailed"; // 构建环境启动失败 - public static final String BK_START_PULL_IMAGE = "bkStartPullImage"; // 开始拉取镜像,镜像名称: - public static final String BK_PULLING_IMAGE = "bkPullingImage"; // 正在拉取镜像,第{0}层,进度:{1} - public static final String BK_PUSH_IMAGE = "bkPushImage"; // 正在推送镜像,第{0}层,进度:{1} - public static final String BK_HUMAN_SERVICE = "bkHumanService"; // 人工服务 -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/CommonMessageCode.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/CommonMessageCode.java deleted file mode 100644 index 8a10398f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/CommonMessageCode.java +++ /dev/null @@ -1,225 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.constant - * @Project:ops-pro - * @name:CommonMessageCode - * @Date:2025/03/26 18:02 - * @Filename:CommonMessageCode - * @description:Todo - */ -public class CommonMessageCode { - public static final String MSG_CODE_ROLE_PREFIX = "MSG_CODE_ROLE_PREFIX_"; // 角色国际化前缀 - public static final String MSG_CODE_PERMISSION_PREFIX = "MSG_CODE_PERMISSION_PREFIX_"; // 操作权限国际化前缀 - public static final String SUCCESS = "0"; // 成功 - public static final int OAUTH_DENERD = 418; // 自定义状态码, 未进行oauth认证 - public static final String SYSTEM_ERROR = "2100001"; // 系统内部繁忙,请稍后再试 - public static final String PARAMETER_IS_NULL = "2100002"; // 参数{0}不能为空 - public static final String PARAMETER_IS_EXIST = "2100003"; // 参数值{0}已经存在系统,请换一个再试 - public static final String PARAMETER_IS_INVALID = "2100004"; // 参数值{0}为非法数据 - public static final String OAUTH_TOKEN_IS_INVALID = "2100005"; // 无效的token,请先oauth认证 - public static final String PERMISSION_DENIED = "2100006"; // 无权限{0} - public static final String ERROR_SERVICE_NO_FOUND = "2100007"; // "找不到任何有效的{0}服务提供者" - public static final String ERROR_SERVICE_INVOKE_FAILURE = "2100008"; // "服务调用失败:{0},uniqueId={1}" - public static final String ERROR_INVALID_CONFIG = "2100009"; // "配置不可用:{0},uniqueId={1}" - public static final String ERROR_REST_EXCEPTION_COMMON_TIP = "2100010"; // 接口访问出现异常,请联系助手或稍后再重试 - public static final String ERROR_CLIENT_REST_ERROR = "2100011"; // 用户请求不合法,参数或方法错误,请咨询助手 - public static final String ERROR_PROJECT_FEATURE_NOT_ACTIVED = "2100012"; // 项目[{0}]未开通该功能 - public static final String ERROR_INVALID_PARAM_ = "2100013"; // 无效参数: {0} - public static final String ERROR_NEED_PARAM_ = "2100014"; // 缺少参数: {0} - public static final String PARAMETER_VALIDATE_ERROR = "2100015"; // {0}参数校验错误: {1} - public static final String ERROR_SERVICE_NO_AUTH = "2100016"; // 无访问服务的权限 - public static final String ERROR_QUERY_NUM_TOO_BIG = "2100017"; // 查询的数量超过系统规定的值:{0},请调整查询条件或咨询助手 - public static final String ERROR_QUERY_TIME_RANGE_TOO_LARGE = "2100018"; // 查询的时间范围跨度最大,最长时间范围跨度不能超过{0}天 - public static final String ERROR_HTTP_RESPONSE_BODY_TOO_LARGE = "2100019"; // http请求返回体太大 - public static final String PERMISSION_DENIED_FOR_APP = "2100020"; // APP的无权限{0} - public static final String ERROR_SENSITIVE_API_NO_AUTH = "2100021"; // 无敏感API访问权限 - public static final String PARAMETER_LENGTH_TOO_LONG = "2100022"; // 参数长度不能超过{0}个字符 - public static final String PARAMETER_LENGTH_TOO_SHORT = "2100023"; // 参数长度不能小于{0}个字符 - public static final String PARAMETER_ILLEGAL_ERROR = "2100024"; // {0}参数非法错误: {1} - public static final String PARAMETER_EXPIRED_ERROR = "2100025"; // {0}token过期错误: {1} - public static final String PARAMETER_SECRET_ERROR = "2100026"; // {0}密钥配置错误: {1} - public static final String PARAMETER_IS_EMPTY = "2100027"; // 参数不能为空 - public static final String ERROR_QUERY_TIME_RANGE_ERROR = "2100028"; // 查询的时间范围跨度错误 - public static final String SERVICE_NOT_EXIST = "2100029"; // 父服务不存在异常 - - public static final String ILLEGAL_GITCI_SERVICE_IMAGE_FORMAT = "2100030"; // GITCI Service镜像格式非法 - public static final String THIRD_PARTY_SERVICE_DEVCLOUD_EXCEPTION = "2100031"; // 第三方服务-DEVCLOUD 异常,请联系8006排查,异常信息 - - public static final String CREATE_CONTAINER_INTERFACE_EXCEPTION = "2100032"; // 创建容器接口异常 - public static final String CREATE_CONTAINER_RETURNS_FAILED = "2100033"; // 创建容器接口返回失败 - public static final String CREATE_CONTAINER_TIMED_OUT = "2100034"; // 创建容器接口超时 - public static final String OPERATION_CONTAINER_INTERFACE_EXCEPTION = "2100035"; // 操作容器接口异常 - public static final String OPERATION_CONTAINER_RETURNED_FAILURE = "2100036"; // 操作容器接口返回失败 - public static final String OPERATION_CONTAINER_TIMED_OUT = "2100037"; // 操作容器接口超时 - public static final String GET_STATUS_INTERFACE_EXCEPTION = "2100038"; // 获取容器状态接口异常 - public static final String GET_STATUS_TIMED_OUT = "2100039"; // 获取容器状态接口超时 - public static final String CREATE_MIRROR_INTERFACE_EXCEPTION = "2100040"; // 创建镜像接口异常 - public static final String CREATE_MIRROR_INTERFACE_RETURNED_FAILURE = "2100041"; // 创建镜像接口返回失败 - public static final String CREATE_MIRROR_INTERFACE_EXCEPTION_NEW = "2100042"; // 创建镜像新版本接口异常 - public static final String NEW_MIRROR_INTERFACE_RETURNED_FAILURE = "2100043"; // 创建镜像新版本接口返回失败 - public static final String TASK_STATUS_INTERFACE_EXCEPTION = "2100044"; // 获取TASK状态接口异常 - public static final String TASK_STATUS_TIMED_OUT = "2100045"; // 获取TASK状态接口超时 - public static final String GET_WEBSOCKET_INTERFACE_EXCEPTION = "2100046"; // 获取websocket接口异常 - public static final String PARAMETER_CANNOT_EMPTY_ALL = "2100047"; // 参数不能全部为空 - public static final String USERS_EXCEEDS_THE_LIMIT = "2100048"; // 授权用户数越界:{0} - public static final String FAILED_TO_QUERY_GSE_AGENT_STATUS = "2100049"; // 查询 Gse Agent 状态失败 - public static final String FAILED_TO_GET_AGENT_STATUS = "2100050"; // 获取agent状态失败 - public static final String STAGES_AND_STEPS_CANNOT_EXIST_BY_SIDE = "2100053"; // stages和steps不能并列存在! - - public static final String USER_NOT_PERMISSIONS_OPERATE_PIPELINE = "2100054"; // 用户({0})无权限在工程({1})下{2}流水线{3} - public static final String USER_NOT_HAVE_PROJECT_PERMISSIONS = "2100055"; // 用户 {0}无项目{1}权限 - public static final String UNABLE_GET_PIPELINE_JOB_STATUS = "2100056"; // 无法获取流水线JOB状态,构建停止 - public static final String JOB_BUILD_STOPS = "2100057"; // 流水线JOB已经不再运行,构建停止 - public static final String PIPELINE_NAME_OCCUPIED = "2100058"; // 流水线名称已被他人使用 - public static final String INTERNAL_DEPENDENCY_SERVICE_EXCEPTION = "2100059"; // 内部依赖服务异常 - public static final String PUBLIC_BUILD_RESOURCE_POOL_NOT_EXIST = "2100060"; // 公共构建资源池不存在,请检查yml配置. - public static final String ERROR_LANGUAGE_IS_NOT_SUPPORT = "2100061"; // 该语言蓝盾目前不支持,蓝盾目前支持的语言标识为:{0} - public static final String INIT_SERVICE_LIST_ERROR = "2100062"; // 初始化服务列表异常问题 - public static final String FILE_NOT_EXIST = "2100063"; // 文件{0}不存在 - public static final String USER_ACCESS_CHECK_FAIL = "2100064"; // Gitlab access token 不正确 - - public static final String GITLAB_TOKEN_EMPTY = "2100065"; // GitLab Token为空 - public static final String GITLAB_HOOK_URL_EMPTY = "2100066"; // GitLab hook url为空 - public static final String GITLAB_TOKEN_FAIL = "2100067"; // GitLab Token不正确 - public static final String GIT_TOKEN_FAIL = "2100068"; // Git Token不正确 - public static final String SERCRT_EMPTY = "2100069"; // GIT 私钥为空 - public static final String GIT_SERCRT_WRONG = "2100070"; // Git 私钥不对 - public static final String PWD_EMPTY = "2100071"; // 用户密码为空 - public static final String USER_NAME_EMPTY = "2100072"; // 用户名为空 - public static final String GITLAB_INVALID = "2100073"; // 无效的GITLAB仓库 - public static final String GIT_TOKEN_WRONG = "2100074"; // Git Token 不正确 - public static final String GIT_LOGIN_FAIL = "2100075"; // Git 用户名或者密码不对 - public static final String GIT_TOKEN_EMPTY = "2100076"; // Git Token为空 - public static final String GIT_HOOK_URL_EMPTY = "2100077"; // Git hook url为空 - public static final String TGIT_LOGIN_FAIL = "2100078"; // TGit 用户名或者密码不对 - public static final String TGIT_TOKEN_FAIL = "2100079"; // TGit Token 不正确 - public static final String TGIT_SECRET_WRONG = "2100080"; // TGit 私钥不对 - public static final String SVN_SECRET_OR_PATH_ERROR = "2100081"; // SVN 私钥不正确 或者 SVN 路径没有权限 - public static final String SVN_CREATE_HOOK_FAIL = "2100082"; // 添加SVN WEB hook 失败 - public static final String LOCK_FAIL = "2100083"; // lock失败 - public static final String UNLOCK_FAIL = "2100084"; // unlock失败 - public static final String GIT_REPO_PEM_FAIL = "2100085"; // 代码仓库访问未授权 - public static final String CALL_REPO_ERROR = "2100086"; // 代码仓库访问异常 - public static final String P4_USERNAME_PASSWORD_FAIL = "2100087"; // p4用户名密码错误 - public static final String PARAM_ERROR = "2100088"; // 参数错误 - public static final String AUTH_FAIL = "2100089"; // {0}认证失败 - public static final String ACCOUNT_NO_OPERATION_PERMISSIONS = "2100090"; // 账户没有{0}的权限 - public static final String REPO_NOT_EXIST_OR_NO_OPERATION_PERMISSION = "2100091"; // {0}仓库不存在或者是账户没有该项目{1}的权限 - public static final String GIT_INTERFACE_NOT_EXIST = "2100092"; // {0}平台没有{1}的接口 - public static final String GIT_CANNOT_OPERATION = "2100093"; // {0}平台{1}操作不能进行 - public static final String WEBHOOK_LOCK_UNLOCK_FAIL = "2100094"; // unlock webhooklock失败,请确认token是否已经配置 - public static final String COMMIT_CHECK_ADD_FAIL = "2100095"; // Commit Check添加失败,请确保该代码库的凭据关联的用户对代码库有Developer权限 - public static final String ADD_MR_COMMENTS_FAIL = "2100096"; // 添加MR的评论失败,请确保该代码库的凭据关联的用户对代码库有Developer权限 - public static final String WEBHOOK_ADD_FAIL = "2100097"; // Webhook添加失败,请确保该代码库的凭据关联的用户对代码库有{0}权限 - public static final String WEBHOOK_UPDATE_FAIL = "2100098"; // Webhook更新失败,请确保该代码库的凭据关联的用户对代码库有Developer权限 - public static final String ENGINEERING_REPO_UNAUTHORIZED = "2100099"; // 工程仓库访问未授权 - public static final String ENGINEERING_REPO_NOT_EXIST = "2100100"; // 工程仓库不存在 - public static final String ENGINEERING_REPO_CALL_ERROR = "2100101"; // 工程仓库访问异常 - public static final String NOT_MEMBER_AND_NOT_OPEN_SOURCE = "2100102"; // 非项目成员且项目为非开源项目 - public static final String USER_NO_PIPELINE_PERMISSION = "2100108"; // 流水线: 用户无{0}权限 - public static final String SERVICE_COULD_NOT_BE_ANALYZED = "2100109"; // 无法根据接口"{0}"分析所属的服务 - public static final String RETURNED_RESULT_COULD_NOT_BE_PARSED = "2100110"; // 内部服务返回结果无法解析 status:{0} body:{1} - public static final String SERVICE_PROVIDER_NOT_FOUND = "2100111"; // 找不到任何有效的{0}【{1}】服务提供者 - public static final String ILLEGAL_JOB_TYPE = "2100112"; // 非法的job类型! - public static final String ERROR_YAML_FORMAT_EXCEPTION = "2100113"; // {0} 中 {1} 格式有误,应为 {2}, error message:{3} - public static final String ERROR_YAML_FORMAT_EXCEPTION_CHECK_STAGE_LABEL = "2100114"; // 请核对Stage标签是否正确 - public static final String ERROR_YAML_FORMAT_EXCEPTION_LENGTH_LIMIT_EXCEEDED = "2100115"; // "{0} job.id 超过长度限制64 {1}}" - public static final String ERROR_YAML_FORMAT_EXCEPTION_NEED_PARAM = "2100116"; // {0} 中的step必须包含uses或run或checkout! - public static final String ERROR_YAML_FORMAT_EXCEPTION_SERVICE_IMAGE_FORMAT_ILLEGAL = "2100117"; // STREAM Service镜像格式非法 - public static final String ERROR_YAML_FORMAT_EXCEPTION_STEP_ID_UNIQUENESS = "2100118"; // 请确保step.id唯一性!({0}) - public static final String BUILD_RESOURCE_NOT_EXIST = "2100119"; // {0}构建资源不存在,请检查yml配置. - public static final String ERROR_YAML_FORMAT_EXCEPTION_ENV_QUANTITY_LIMIT_EXCEEDED = "2100120"; // {0}配置Env数量超过100限制! - public static final String ERROR_YAML_FORMAT_EXCEPTION_ENV_VARIABLE_LENGTH_LIMIT_EXCEEDED = "2100121"; // {0}Env单变量{1}长度超过{2}字符!({3}) - public static final String ERROR_PROJECT_API_ACCESS_NO_PERMISSION = "2100122"; // 项目[{0}]没有接口[{1}]的访问权限 - public static final String ERROR_INTERFACE_RETRY_NUM_EXCEEDED = "2100123"; // 接口连续重试次数超过{0}次,请稍后再试 - public static final String ERROR_PIPELINE_API_ACCESS_NO_PERMISSION = "2100124"; // 流水线[{0}]没有接口[{1}]的访问权限 - public static final String TEMPLATE_PLUGIN_NOT_ALLOWED_USE = "2100125"; // 模板中插件【{0}】的【{1}】版本的状态是【{2}】,不允许使用 - public static final String ADD_MR_FAIL = "2100126"; // 添加MR失败 - - public static final String ELEMENT_UPDATE_WRONG_PATH = "2100127"; // 更新插件的标注位置有误 - public static final String ELEMENT_NOT_SUPPORT_TRANSFER = "2100128"; // 如下插件在 Code 方式下已不支持,请修改后再切换: \n[{0}] - public static final String DISPATCH_NOT_SUPPORT_TRANSFER = "2100129"; // 如下构建环境在 Code 方式下不支持转换,请修改后再切换: \n[{0}] - public static final String YAML_NOT_VALID = "2100130"; // yaml不合法 {0} - public static final String GIT_INVALID_PRIVATE_KEY = "2100131"; // 不支持的SSH私钥格式,仅支持rsa格式私钥 - public static final String THIRD_PARTY_SERVICE_OPERATION_FAILED = "2100132"; // 第三方服务[{0}]操作失败,失败详情:{1} - public static final String MR_ACCEPT_EVENT_NOT_SUPPORT_TRANSFER = "2100133"; // mr accept事件类型不支持code转换 - - public static final String SVN_TOKEN_FAIL = "2100135"; // SVN Token 不正确 - public static final String SVN_TOKEN_EMPTY = "2100136"; // SVN Token 为空, 请检查代码库的凭证类型 - public static final String ERROR_VARIABLE_NOT_FOUND = "2100137"; // SVN Token 为空, 请检查代码库的凭证类型 - public static final String BK_CONTAINER_TIMED_OUT = "bkContainerTimedOut"; // 创建容器超时 - public static final String BK_CREATION_FAILED_EXCEPTION_INFORMATION = "bkCreationFailedExceptionInformation"; // 创建失败,异常信息 - - public static final String BK_FILE_NAME = "bkFileName"; // 文件名 - public static final String BK_BELONG_TO_THE_PROJECT = "bkBelongToTheProject"; // 所属项目 - public static final String BK_OPERATING = "bkOperating"; // 操作 - public static final String BK_PUSH_FROM_BLUE_SHIELD_DEVOPS_PLATFORM = "bkPushFromBlueShieldDevopsPlatform"; // 来自蓝盾DevOps平台的推送 - public static final String BK_TABLE_CONTENTS = "bkTableContents"; // 表格内容 - public static final String BK_PLEASE_FEEL_TO_CONTACT_BLUE_SHIELD_ASSISTANT = "bkPleaseFeelToContactBlueShieldAssistant"; // 如有任何问题,可随时联系蓝盾助手 - public static final String BK_ETH1_NETWORK_CARD_IP_EMPTY = "bkEth1NetworkCardIpEmpty"; // eth1 网卡Ip为空,因此,获取eth0的网卡ip - public static final String BK_LOOPBACK_ADDRESS_OR_NIC_EMPTY = "bkLoopbackAddressOrNicEmpty"; // loopback地址或网卡名称为空 - public static final String BK_FAILED_GET_NETWORK_CARD = "bkFailedGetNetworkCard"; // 获取网卡失败 - public static final String BK_MANUAL_TRIGGER = "bkManualTrigger"; // 手动触发 - public static final String BK_BUILD_TRIGGER = "bkBuildTrigger"; // 构建触发 - public static final String BK_VIEW_DETAILS = "bkSeeDetails"; // 查看详情 - public static final String BK_PROJECT_ID = "bkProjectId"; // # 项目ID: - public static final String BK_PIPELINE_NAME = "bkPipelineName"; // # 流水线名称: - public static final String BK_CREATE_SERVICE = "bkCreateService"; // 创建{0}服务 - public static final String BK_SESSION_ID = "bkSessionId"; // 会话ID - public static final String BK_GROUP_ID = "bkGroupId"; // 群ID - public static final String BK_THIS_GROUP_ID = "bkThisGroupId"; // 本群ID={0}。PS:群ID可用于蓝盾平台上任意企业微信群通知。 - public static final String BK_MISSING_RESOURCE_DEPENDENCY = "bkMissingResourceDependency"; // 依赖的资源不存在 - - public static final String BK_REQUEST_TIMED_OUT = "bkRequestTimedOut"; // 请求超时 - public static final String BK_QUERY_PARAM_REQUEST_ERROR = "bkQueryParamRequestError"; // 查询参数请求错误 - public static final String BK_JSON_BAD_PARAMETERS = "bkJsonBadParameters"; // JSON参数错误/Bad Parameters in json - public static final String BK_REQUEST_BODY_CONTENT_PARAMETER_INCORRECT = "bkRequestBodyContentParameterIncorrect"; // 请求体内容参数错误。温馨提示:请确认{0}是否符合要求 - public static final String BK_REQUESTED_RESOURCE_DOES_NOT_EXIST = "bkRequestedResourceDoesNotExist"; // 请求的资源不存在 - public static final String BK_NOT_OAUTH_CERTIFICATION = "bkNotOauthCertification"; // 你没有Oauth认证 - public static final String BK_QUERY_PARAM_REQUEST_EMPTY = "bkQueryParamRequestEmpty"; // 请求的参数内容为空 - public static final String BK_QUERY_PARAM_TYPE_ERROR = "bkQueryParamTypeError"; // 查询参数类型错误 - public static final String BK_NOT_HAVE_PERMISSION_PERFORM_THIS_OPERATION = "bkNotHavePermissionPerformThisOperation"; // 你没有权限进行该操作 - public static final String BK_FAILED_ACCESS_BACKGROUND_DATA = "bkFailedAccessBackgroundData"; // 访问后台数据失败,已通知产品、开发,请稍后重试 - public static final String BK_RESOURCES_THAT_NOT_AUTHORIZED_ACCESS = "bkResourcesThatNotAuthorizedAccess"; // 未授权访问的资源 - public static final String BK_CODE_BASE_TRIGGERING = "bkCodeBaseTriggering"; // 代码库触发 - public static final String BK_FAILED_START_BUILD_MACHINE = "bkFailedStartBuildMachine"; // 启动构建机失败 - - public static final String CREATE_BRANCH = "bkCreateBranch"; // 创建分支 - public static final String DELETE_BRANCH = "bkDeleteBranch"; // 删除分支 - - public static final String GET_PROJECT_INFO = "bkGetProjectInfo"; // 获取项目详情 - public static final String GET_COMMIT_REVIEW_INFO = "bkGetCommitReviewInfo"; // 获取Commit Review详情 - public static final String GET_SESSION_INFO = "bkGetSessionInfo"; // 获取会话详情 - - public static final String OPERATION_BRANCH = "bkOperationBranch"; // 拉分支 - public static final String OPERATION_TAG = "bkOperationTag"; // 拉标签 - public static final String OPERATION_ADD_WEBHOOK = "bkOperationAddWebhook"; // 添加WEBHOOK - public static final String OPERATION_UPDATE_WEBHOOK = "bkOperationUpdateWebhook"; // 修改WEBHOOK - public static final String OPERATION_LIST_WEBHOOK = "bkOperationListWebhook"; // 查询WEBHOOK - public static final String OPERATION_ADD_COMMIT_CHECK = "bkOperationAddCommitCheck"; // 添加COMMIT CHECK - public static final String OPERATION_ADD_MR_COMMENT = "bkOperationAddMrComment"; // 添加MR COMMENT - public static final String OPERATION_LIST_MR = "bkOperationListMr"; // 添加MR - public static final String OPERATION_ADD_MR = "bkOperationAddMr"; // 添加MR - public static final String OPERATION_COMMIT = "bkOperationCommit"; // 拉提交记录 - public static final String OPERATION_COMMIT_DIFF = "bkOperationCommitDiff"; // 查询commit变化 - public static final String OPERATION_UNLOCK_HOOK_LOCK = "bkOperationUnlockHookLock"; // 解锁hook锁 - public static final String OPERATION_MR_CHANGE = "bkOperationMrChange"; // 查询合并请求的代码变更 - public static final String OPERATION_MR_INFO = "bkOperationMrInfo"; // 查询项目合并请求 - public static final String OPERATION_GET_CHANGE_FILE_LIST = "bkOperationGetChangeFileList"; // 查询变更文件列表 - public static final String OPERATION_GET_MR_COMMIT_LIST = "bkOperationGetMrCommitList"; // 获取合并请求中的提交 - public static final String OPERATION_PROJECT_USER_INFO = "bkOperationProjectUserInfo"; // 获取项目中成员信息 - public static final String OPERATION_TAPD_WORKITEMS = "bkOperationTapdWorkItems"; // 查看绑定的TAPD单 - public static final String BK_USER_GROUP_CRATE_TIME = "bkUserGroupCrateTime"; // {0} 用户组:{1},由{2} 创建于 - public static final String BK_USER_RATING_ADMIN_CRATE_TIME = "bkUserRatingAdminCrateTime"; // {0} 分级管理员,由{1} 创建于 - public static final String BK_SECOND_LEVEL_ADMIN_CREATE = "bkSecondLevelAdminCreate"; // {0} 二级管理员, 由{1} 创建于 - public static final String BK_SECOND_LEVEL_ADMIN_REVISE = "bkSecondLevelAdminRevise"; // {0} 二级管理员, 由{1} 修改于 - public static final String BK_USER_REQUESTS_THE_PROJECT = "bkUserRequestsTheProject"; // 用户 {0} 申请{1}蓝盾项目 {2} ,请审批! - public static final String BK_ENV_NOT_YET_SUPPORTED = "bkEnvNotYetSupported"; // 尚未支持 {0} {1},请联系 管理员 添加对应版本 - - public static final String BK_BUILD_ENV_TYPE = "BUILD_ENV_TYPE_"; // 构建环境- - public static final String BK_BUILD_ENV_TYPE_BUILDLESS = "BUILD_ENV_TYPE_BUILDLESS"; // 无编译环境 - public static final String BK_BUILD_ENV_TYPE_BUILD_TRIGGERS = "BUILD_ENV_TYPE_BUILD_TRIGGER"; // 构建触发 - public static final String TRANSFER_ERROR_CHECK_AGENT_ID_FAILED = "transferErrorCheckAgentIdFailed"; // 当前私有构建机数据有误或不存在 - public static final String TRANSFER_ERROR_CHECK_ENV_ID_FAILED = "transferErrorCheckEnvIdFailed"; // 当前私有构建机集群数据有误或不存在 -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/HttpStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/HttpStatus.java deleted file mode 100644 index 14307acf..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/HttpStatus.java +++ /dev/null @@ -1,119 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.constant - * @Project:ops-pro - * @name:HttpStatus - * @Date:2025/03/26 18:26 - * @Filename:HttpStatus - * @description:Todo - */ -public enum HttpStatus { - CONTINUE(100, "Continue"), - SWITCHING_PROTOCOLS(101, "Switching Protocols"), - PROCESSING(102, "Processing"), - CHECKPOINT(103, "Checkpoint"), - OK(200, "OK"), - CREATED(201, "Created"), - ACCEPTED(202, "Accepted"), - NON_AUTHORITATIVE_INFORMATION(203, "Non-Authoritative Information"), - NO_CONTENT(204, "No Content"), - RESET_CONTENT(205, "Reset Content"), - PARTIAL_CONTENT(206, "Partial Content"), - MULTI_STATUS(207, "Multi-Status"), - ALREADY_REPORTED(208, "Already Reported"), - IM_USED(226, "IM Used"), - MULTIPLE_CHOICES(300, "Multiple Choices"), - MOVED_PERMANENTLY(301, "Moved Permanently"), - FOUND(302, "Found"), - MOVED_TEMPORARILY(302, "Moved Temporarily"), - SEE_OTHER(303, "See Other"), - NOT_MODIFIED(304, "Not Modified"), - USE_PROXY(305, "Use Proxy"), - TEMPORARY_REDIRECT(307, "Temporary Redirect"), - PERMANENT_REDIRECT(308, "Permanent Redirect"), - BAD_REQUEST(400, "Bad Request"), - UNAUTHORIZED(401, "Unauthorized"), - PAYMENT_REQUIRED(402, "Payment Required"), - FORBIDDEN(403, "Forbidden"), - NOT_FOUND(404, "Not Found"), - METHOD_NOT_ALLOWED(405, "Method Not Allowed"), - NOT_ACCEPTABLE(406, "Not Acceptable"), - PROXY_AUTHENTICATION_REQUIRED(407, "Proxy Authentication Required"), - REQUEST_TIMEOUT(408, "Request Timeout"), - CONFLICT(409, "Conflict"), - GONE(410, "Gone"), - LENGTH_REQUIRED(411, "Length Required"), - PRECONDITION_FAILED(412, "Precondition Failed"), - PAYLOAD_TOO_LARGE(413, "Payload Too Large"), - REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"), - URI_TOO_LONG(414, "URI Too Long"), - REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"), - UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"), - REQUESTED_RANGE_NOT_SATISFIABLE(416, "Requested range not satisfiable"), - EXPECTATION_FAILED(417, "Expectation Failed"), - I_AM_A_TEAPOT(418, "I'm a teapot"), - INSUFFICIENT_SPACE_ON_RESOURCE(419, "Insufficient Space On Resource"), - METHOD_FAILURE(420, "Method Failure"), - DESTINATION_LOCKED(421, "Destination Locked"), - UNPROCESSABLE_ENTITY(422, "Unprocessable Entity"), - LOCKED(423, "Locked"), - FAILED_DEPENDENCY(424, "Failed Dependency"), - TOO_EARLY(425, "Too Early"), - UPGRADE_REQUIRED(426, "Upgrade Required"), - PRECONDITION_REQUIRED(428, "Precondition Required"), - TOO_MANY_REQUESTS(429, "Too Many Requests"), - REQUEST_HEADER_FIELDS_TOO_LARGE(431, "Request Header Fields Too Large"), - UNAVAILABLE_FOR_LEGAL_REASONS(451, "Unavailable For Legal Reasons"), - INTERNAL_SERVER_ERROR(500, "Internal Server Error"), - NOT_IMPLEMENTED(501, "Not Implemented"), - BAD_GATEWAY(502, "Bad Gateway"), - SERVICE_UNAVAILABLE(503, "Service Unavailable"), - GATEWAY_TIMEOUT(504, "Gateway Timeout"), - HTTP_VERSION_NOT_SUPPORTED(505, "HTTP Version not supported"), - VARIANT_ALSO_NEGOTIATES(506, "Variant Also Negotiates"), - INSUFFICIENT_STORAGE(507, "Insufficient Storage"), - LOOP_DETECTED(508, "Loop Detected"), - BANDWIDTH_LIMIT_EXCEEDED(509, "Bandwidth Limit Exceeded"), - NOT_EXTENDED(510, "Not Extended"), - NETWORK_AUTHENTICATION_REQUIRED(511, "Network Authentication Required"); - - private final int value; - private final String reasonPhrase; - - HttpStatus(int value, String reasonPhrase) { - this.value = value; - this.reasonPhrase = reasonPhrase; - } - - public int getValue() { - return value; - } - - public String getReasonPhrase() { - return reasonPhrase; - } - - public boolean isServerError() { - return value >= INTERNAL_SERVER_ERROR.getValue(); - } - - public static HttpStatus valueOf(int statusCode) throws IllegalArgumentException { - for (HttpStatus status : values()) { - if (status.getValue() == statusCode) { - return status; - } - } - throw new IllegalArgumentException("No matching constant for [" + statusCode + "]"); - } - - public static HttpStatus resolve(int statusCode) { - for (HttpStatus status : values()) { - if (status.getValue() == statusCode) { - return status; - } - } - return null; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/LeafAllocConstant.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/LeafAllocConstant.java deleted file mode 100644 index 8de5e7e0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/LeafAllocConstant.java +++ /dev/null @@ -1,64 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @Classname LeafAllocConstant - * @Description 流水线的枚举 - * @Date 2025/3/18 10:16 - * @author mianbin - */ -public class LeafAllocConstant { - /** =========================================流水线====================================================== */ - public static final String AUDIT_RESOURCE = "AUDIT_RESOURCE"; - - public static final String PIPELINE_RESOURCE = "PIPELINE_RESOURCE"; - - public static final String PIPELINE_VERSION_SIMPLE_RESOURCE = "PIPELINE_VERSION_SIMPLE_RESOURCE"; - - public static final String PIPELINE_SETTING_RESOURCE = "PIPELINE_SETTING_RESOURCE"; - - public static final String PIPELINE_VERSION_SETTING_RESOURCE = "PIPELINE_VERSION_SETTING_RESOURCE"; - - public static final String PIPELINE_LABEL_PIPELINE_RESOURCE = "PIPELINE_LABEL_PIPELINE_RESOURCE"; - - public static final String TEMPLATE_PIPELINE_RESOURCE = "TEMPLATE_PIPELINE_RESOURCE"; - - public static final String PIPELINE_BUILD_SUMMARY = "PIPELINE_BUILD_SUMMARY"; - - public static final String PIPELINE_BUILD_HISTORY = "PIPELINE_BUILD_HISTORY"; - - public static final String PIPELINE_BUILD_TASK = "PIPELINE_BUILD_TASK"; - - public static final String PIPELINE_BUILD_CONTAINER = "PIPELINE_BUILD_CONTAINER"; - - public static final String PIPELINE_BUILD_STAGE = "PIPELINE_BUILD_STAGE"; - - public static final String PIPELINE_BUILD_RECORD_CONTAINER = "PIPELINE_BUILD_RECORD_CONTAINER"; - - public static final String PIPELINE_BUILD_RECORD_MODEL = "PIPELINE_BUILD_RECORD_MODEL"; - - public static final String PIPELINE_BUILD_RECORD_STAGE = "PIPELINE_BUILD_RECORD_STAGE"; - - public static final String PIPELINE_BUILD_RECORD_TASK = "PIPELINE_BUILD_RECORD_TASK"; - - public static final String PIPELINE_BUILD_DETAIL = "PIPELINE_BUILD_DETAIL"; - - public static final String PIPELINE_LABEL_PIPELINE = "PIPELINE_LABEL_PIPELINE"; - - public static final String STAGE_TAG = "STAGE_TAG"; - - public static final String PIPELINE_JOB_MUTEX_GROUP_RESOURCE = "PIPELINE_JOB_MUTEX_GROUP_RESOURCE"; - - public static final String MODEL_TASK = "PIPELINE_MODEL_TASK"; - - public static final String PIPELINE_TRIGGER_REVIEW = "PIPELINE_TRIGGER_REVIEW"; - - public static final String PIPELINE_BUILD_VAR = "PIPELINE_BUILD_VAR"; - - /** =========================================项目====================================================== */ - public static final String PROJECT_RESOURCE = "PROJECT_RESOURCE"; - - /** ========================================日志===================================================== */ - public static final String LOG_STATUS = "LOG_STATUS"; - public static final String LOG_SUBTAGS = "LOG_SUBTAGS"; - public static final String LOG_INDICES_V2 = "LOG_INDICES_V2"; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/OpsHeader.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/OpsHeader.java deleted file mode 100644 index 95af0267..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/OpsHeader.java +++ /dev/null @@ -1,88 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - - -/** - * @author by mianbin - * @Classname OpsHeader - * @Description 重要,莫动 - * @Date 2025/3/19 14:49 - */ - -public final class OpsHeader { - - public static final String AUTH_HEADER_USER_ID = "X-DEVOPS-UID"; - public static final String AUTH_HEADER_USER_ID_DEFAULT_VALUE = "admin"; - public static final String AUTH_HEADER_BUILD_ID = "X-DEVOPS-BUILD-ID"; - public static final String AUTH_HEADER_VM_SEQ_ID = "X-DEVOPS-VM-SID"; - public static final String AUTH_HEADER_VM_NAME = "X-DEVOPS-VM-NAME"; - public static final String AUTH_HEADER_PROJECT_ID = "X-DEVOPS-PROJECT-ID"; - public static final String AUTH_HEADER_AGENT_SECRET_KEY = "X-DEVOPS-AGENT-SECRET-KEY"; - public static final String AUTH_HEADER_AGENT_ID = "X-DEVOPS-AGENT-ID"; - public static final String AUTH_HEADER_PIPELINE_ID = "X-DEVOPS-PIPELINE-ID"; - public static final String AUTH_HEADER_REGION = "X-DEVOPS-REGION"; - public static final String AUTH_HEADER_DEVOPS_APP_CODE = "X-DEVOPS-APP-CODE"; - public static final String AUTH_HEADER_DEVOPS_APP_SECRET = "X-DEVOPS-APP-SECRET"; - public static final String AUTH_HEADER_DEVOPS_BUILD_TYPE = "X-DEVOPS-BUILD-TYPE"; - public static final String AUTH_HEADER_DEVOPS_USER_ID = AUTH_HEADER_USER_ID; - public static final String AUTH_HEADER_DEVOPS_USER_ID_DEFAULT_StringUE = "admin"; - public static final String AUTH_HEADER_DEVOPS_APP_CODE_DEFAULT_StringUE = "opsci"; - public static final String AUTH_HEADER_DEVOPS_BG_ID = "X-DEVOPS-BG-ID"; - public static final String AUTH_HEADER_DEVOPS_DEPT_ID = "X-DEVOPS-DEPT-ID"; - public static final String AUTH_HEADER_DEVOPS_CENTER_ID = "X-DEVOPS-CENTER-ID"; - public static final String AUTH_HEADER_DEVOPS_ORGANIZATION_TYPE = "X-DEVOPS-ORGANIZATION-TYPE"; - public static final String AUTH_HEADER_DEVOPS_ORGANIZATION_TYPE_BG = "BG"; - public static final String AUTH_HEADER_DEVOPS_ORGANIZATION_TYPE_DEPARTMENT = "DEPARTMENT"; - public static final String AUTH_HEADER_DEVOPS_ORGANIZATION_TYPE_CENTER = "CENTER"; - public static final String AUTH_HEADER_DEVOPS_ORGANIZATION_ID = "X-DEVOPS-ORGANIZATION-ID"; - public static final String AUTH_HEADER_DEVOPS_ORGANIZATION_NAME = "X-DEVOPS-ORGANIZATION-NAME"; - public static final String AUTH_HEADER_DEVOPS_PROJECT_ID = "X-DEVOPS-PROJECT-ID"; - public static final String AUTH_HEADER_DEVOPS_PIPELINE_ID = "X-DEVOPS-PIPELINE-ID"; - public static final String AUTH_HEADER_DEVOPS_BUILD_ID = "X-DEVOPS-BUILD-ID"; - public static final String AUTH_HEADER_DEVOPS_VM_SEQ_ID = "X-DEVOPS-VM-SID"; - public static final String AUTH_HEADER_DEVOPS_VM_NAME = "X-DEVOPS-VM-NAME"; - public static final String AUTH_HEADER_DEVOPS_REAL_IP = "X-DEVOPS-REAL-IP"; - public static final String AUTH_HEADER_DEVOPS_AGENT_ID = "X-DEVOPS-AGENT-ID"; - public static final String AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY = "X-DEVOPS-AGENT-SECRET-KEY"; - public static final String AUTH_HEADER_DEVOPS_OPS_TOKEN = "X-DEVOPS-OPS-TOKEN"; - public static final String AUTH_HEADER_DEVOPS_ACCESS_TOKEN = "X-DEVOPS-ACCESS-TOKEN"; - public static final String AUTH_HEADER_DEVOPS_OPS_TICKET = "X-DEVOPS-OPS-TOKEN"; - public static final String AUTH_HEADER_DEVOPS_USER_CHINESE_NAME = "X-DEVOPS-CHINESE-NAME"; - public static final String AUTH_HEADER_DEVOPS_USER_PAAS_ID = "X-DEVOPS-PAAS-USER-ID"; - public static final String AUTH_HEADER_DEVOPS_ORIGINAL_HOST = "X-DEVOPS-ORIGINAL-HOST"; - public static final String AUTH_HEADER_DEVOPS_JWT_TOKEN = "X-DEVOPS-JWT-TOKEN"; - public static final String AUTH_HEADER_IAM_TOKEN = "Authorization"; - public static final String AUTH_HEADER_DEVOPS_SIGN_INFO = "X-DEVOPS-SIGN-INFO"; - public static final String AUTH_HEADER_PLATFORM = "X-DEVOPS-PLATFORM"; - public static final String AUTH_HEADER_APP_VERSION = "X-DEVOPS-APP-VERSION"; - public static final String AUTH_HEADER_GATEWAY_TAG = "X-GATEWAY-TAG"; - public static final String AUTH_HEADER_DEVOPS_CI_TASK_ID = "X-DEVOPS-CI-TASK-ID"; - public static final String SIGN_HEADER_TIMESTAMP = "X-DEVOPS-TIMESTAMP"; - public static final String SIGN_HEADER_NONCE = "X-DEVOPS-NONCE"; - public static final String SING_HEADER_SIGNATURE = "X-DEVOPS-SIGNATURE"; - public static final String AUTH_HEADER_GITHUB_TOKEN = "X-GITHUB-TOKEN"; - public static final String AUTH_HEADER_GIT_TYPE = "X-DEVOPS-STREAM-GIT-TYPE"; - public static final String AUTH_HEADER_OPS_CI_LOGIN_TOKEN = "X-DEVOPS-CI-LOGIN-TOKEN"; - public static final String AUTH_HEADER_DEVOPS_SERVICE_NAME = "X-DEVOPS-SERVICE-NAME"; - - public static final String AUTH_HEADER_DEVOPS_BK_TOKEN = "X-DEVOPS-BK-TOKEN"; - - public static final String AUTH_HEADER_CODECC_OPENAPI_TOKEN = "X-CODECC-OPENAPI-TOKEN"; - - public static final String AUTH_HEADER_OAUTH2_CLIENT_ID = "X-DEVOPS-OAUTH2-CLIENT-ID"; - public static final String AUTH_HEADER_OAUTH2_CLIENT_SECRET = "X-DEVOPS-OAUTH2-CLIENT-SECRET"; - public static final String AUTH_HEADER_OAUTH2_AUTHORIZATION = "X-DEVOPS-OAUTH2-AUTHORIZATION"; - public static final String REFERER = "referer"; // 来源 - - public static final String DEVX_HEADER_GW_TOKEN = "X-DEVOPS-DEVX-GW-TOKEN"; - public static final String DEVX_HEADER_NGGW_CLIENT_ADDRESS = "X-OPS-NGGW-CLIENT-ADDRESS"; - public static final String DEVX_HEADER_CDS_TOKEN = "X-OPS-CDS-TOKEN"; - - public static final String AUTH_HEADER_DEVOPS_SHA_CONTENT = "X-DEVOPS-SHA-CONTENT"; - public static final String AUTH_HEADER_DEVOPS_OS_NAME = "X-DEVOPS-OS-NAME"; - public static final String AUTH_HEADER_DEVOPS_OS_ARCH = "X-DEVOPS-OS-ARCH"; - public static final String AUTH_HEADER_DEVOPS_STORE_CODE = "X-DEVOPS-STORE-CODE"; - public static final String AUTH_HEADER_DEVOPS_STORE_TYPE = "X-DEVOPS-STORE-TYPE"; - public static final String AUTH_HEADER_DEVOPS_STORE_VERSION = "X-DEVOPS-STORE-VERSION"; - public static final String AUTH_HEADER_DEVOPS_SIGN_FILE_NAME = "X-DEVOPS-SIGN-FILE-NAME"; - public static final String AUTH_HEADER_DEVOPS_ENV = "X-DEVOPS-ENV"; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/PipelineConstants.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/PipelineConstants.java deleted file mode 100644 index a709c9a7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/PipelineConstants.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.constant - * @Project:ops-pro - * @name:PipelineConstants - * @Date:2025/03/26 15:59 - * @Filename:PipelineConstants - * @description:Todo - */ -public class PipelineConstants { - public static final String PIPELINE_SUBPIPELINE_CALL_ELEMENT_ID = "pipeline.subpipeline.call.element.id"; - public static final String PIPELINE_SUBPIPELINE_CALL_ELEMENT_NAME = "pipeline.subpipeline.call.element.name"; - public static final String PIPELINE_GIT_REF = "GIT_CI_REF"; - public static final String PIPELINE_GIT_HEAD_REF = "GIT_CI_HEAD_REF"; - public static final String PIPELINE_GIT_BASE_REF = "GIT_CI_BASE_REF"; - public static final String PIPELINE_GIT_REPO = "GIT_CI_REPO"; - public static final String PIPELINE_GIT_REPO_ID = "GIT_CI_REPO_ID"; - public static final String PIPELINE_GIT_REPO_NAME = "GIT_CI_REPO_NAME"; - public static final String PIPELINE_GIT_REPO_GROUP = "GIT_CI_REPO_GROUP"; - public static final String PIPELINE_GIT_REPO_CREATE_TIME = "GIT_CI_REPO_CREATE_TIME"; - public static final String PIPELINE_GIT_REPO_CREATOR = "GIT_CI_REPO_CREATOR"; - public static final String PIPELINE_GIT_EVENT = "GIT_CI_EVENT"; - public static final String PIPELINE_GIT_EVENT_CONTENT = "GIT_CI_EVENT_CONTENT"; - public static final String PIPELINE_GIT_SHA = "GIT_CI_SHA"; - public static final String PIPELINE_GIT_SHA_SHORT = "GIT_CI_SHA_SHORT"; - public static final String PIPELINE_GIT_BEFORE_SHA = "GIT_CI_BEFORE_SHA"; - public static final String PIPELINE_GIT_BEFORE_SHA_SHORT = "GIT_CI_BEFORE_SHA_SHORT"; - public static final String PIPELINE_GIT_COMMIT_MESSAGE = "GIT_CI_COMMIT_MESSAGE"; - public static final String PIPELINE_GIT_EVENT_URL = "GIT_CI_EVENT_URL"; - public static final String PIPELINE_GIT_ACTION = "GIT_CI_ACTION"; - public static final String PIPELINE_GIT_YAML_PATH = "GIT_CI_YAML_PATH"; - public static final String PIPELINE_GIT_REPO_URL = "GIT_CI_REPO_URL"; - public static final String PIPELINE_GIT_BASE_REPO_URL = "GIT_CI_BASE_REPO_URL"; - public static final String PIPELINE_GIT_HEAD_REPO_URL = "GIT_CI_HEAD_REPO_URL"; - public static final String PIPELINE_GIT_COMMIT_AUTHOR = "GIT_CI_COMMIT_AUTHOR"; - public static final String PIPELINE_GIT_UPDATE_USER = "GIT_CI_PIPELINE_UPDATE_USER"; - public static final String PIPELINE_GIT_AUTHORIZER = "GIT_CI_AUTHORIZER"; - public static final String PIPELINE_GIT_TAG_MESSAGE = "GIT_CI_TAG_MESSAGE"; - public static final String PIPELINE_GIT_TAG_FROM = "GIT_CI_TAG_FROM"; - public static final String PIPELINE_GIT_MR_ID = "GIT_CI_MR_ID"; - public static final String PIPELINE_GIT_MR_IID = "GIT_CI_MR_IID"; - public static final String PIPELINE_GIT_MR_URL = "GIT_CI_MR_URL"; - public static final String PIPELINE_GIT_MR_TITLE = "GIT_CI_MR_TITLE"; - public static final String PIPELINE_GIT_MR_DESC = "GIT_CI_MR_DESC"; - public static final String PIPELINE_GIT_MR_PROPOSER = "GIT_CI_MR_PROPOSER"; - public static final String PIPELINE_GIT_MR_ACTION = "GIT_CI_MR_ACTION"; - public static final String PIPELINE_PAC_REPO_HASH_ID = "BK_CI_PAC_REPO_HASH_ID"; - public static final String PIPELINE_GIT_TIME_TRIGGER_KIND = "schedule"; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/StringConstant.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/StringConstant.java deleted file mode 100644 index cfdc2596..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/StringConstant.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.constant - * @Project:ops-pro - * @name:StringConstant - * @Date:2025/03/26 18:26 - * @Filename:StringConstant - * @description:Todo - */ -public class StringConstant { - public static String coerceAtMaxLength(String str, int maxLength) { - if (str.length() > maxLength) { - return str.substring(0, maxLength); - } - return str; - } - - public static String appendIfNotEmpty(String str, String suffix, String separator) { - if (suffix != null && !suffix.isEmpty()) { - return str + separator + suffix; - } - return str; - } - - public static String appendIfNotEmpty(String str, String suffix) { - return appendIfNotEmpty(str, suffix, "."); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/WebhookConstant.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/WebhookConstant.java deleted file mode 100644 index 9ab99dab..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/constant/WebhookConstant.java +++ /dev/null @@ -1,178 +0,0 @@ -package cd.casic.ci.common.pipeline.constant; - -/** - * @author by mianbin - * @Classname WebhookConstant - * @Description TODO - * @Date 2025/4/1 16:55 - */ -public class WebhookConstant { - public static final String CI_RUN = "CI_RUN"; - public static final String CI_REF = "CI_REF"; - public static final String CI_REPO_OWNER = "CI_REPO_OWNER"; - public static final String CI_REPOSITORY = "CI_REPOSITORY"; - public static final String CI_BRANCH = "ci.branch"; - public static final String DELETE_EVENT = "delete"; - - public static final String REPO_WEBHOOK_REPO_TYPE = "CI_REPO_WEBHOOK_REPO_TYPE"; - public static final String REPO_WEBHOOK_REPO_URL = "CI_REPO_WEBHOOK_REPO_URL"; - public static final String REPO_WEBHOOK_REPO_NAME = "CI_REPO_WEBHOOK_NAME"; - public static final String REPO_WEBHOOK_REPO_ALIAS_NAME = "CI_REPO_WEBHOOK_ALIAS_NAME"; - public static final String REPO_WEBHOOK_HASH_ID = "CI_REPO_WEB_HOOK_HASHID"; - public static final String REPO_WEBHOOK_REPO_AUTH_USER = "CI_REPO_WEBHOOK_AUTH_USER"; - - public static final String REPO_GIT_WEBHOOK_COMMIT_MESSAGE = "CI_REPO_GIT_WEBHOOK_COMMIT_MESSAGE"; - public static final String REPO_GIT_WEBHOOK_COMMIT_ID = "CI_REPO_GIT_WEBHOOK_COMMITID"; - public static final String REPO_GIT_WEBHOOK_COMMIT_ID_SHORT = "CI_REPO_GIT_WEBHOOK_COMMITID_SHORT"; - public static final String REPO_GIT_WEBHOOK_EVENT_TYPE = "CI_REPO_GIT_WEBHOOK_EVENT_TYPE"; - public static final String REPO_GIT_WEBHOOK_INCLUDE_BRANCHS = "CI_REPO_GIT_WEBHOOK_INCLUDE_BRANCH"; - public static final String REPO_GIT_WEBHOOK_EXCLUDE_BRANCHS = "CI_REPO_GIT_WEBHOOK_EXCLUDE_BRANCH"; - public static final String REPO_GIT_WEBHOOK_INCLUDE_PATHS = "CI_REPO_GIT_WEBHOOK_INCLUDE_PATHS"; - public static final String REPO_GIT_WEBHOOK_EXCLUDE_PATHS = "CI_REPO_GIT_WEBHOOK_EXCLUDE_PATHS"; - public static final String REPO_GIT_WEBHOOK_EXCLUDE_USERS = "CI_REPO_GIT_WEBHOOK_EXCLUDE_USERS"; - public static final String REPO_GIT_WEBHOOK_INCLUDE_USERS = "CI_REPO_GIT_WEBHOOK_INCLUDE_USERS"; - public static final String REPO_GIT_WEBHOOK_BRANCH = "CI_REPO_GIT_WEBHOOK_BRANCH"; - public static final String REPO_GIT_MANUAL_UNLOCK = "CI_REPO_GIT_MANUAL_UNLOCK"; - public static final String REPO_GIT_WEBHOOK_ENABLE_CHECK = "REPO_GIT_WEBHOOK_ENABLE_CHECK"; - - public static final String REPO_GIT_WEBHOOK_PUSH_USERNAME = "CI_REPO_GIT_WEBHOOK_PUSH_USERNAME"; - public static final String REPO_GIT_WEBHOOK_PUSH_BEFORE_COMMIT = "REPO_GIT_WEBHOOK_PUSH_BEFORE_COMMIT"; - public static final String REPO_GIT_WEBHOOK_PUSH_AFTER_COMMIT = "REPO_GIT_WEBHOOK_PUSH_AFTER_COMMIT"; - public static final String REPO_GIT_WEBHOOK_PUSH_TOTAL_COMMIT = "REPO_GIT_WEBHOOK_PUSH_TOTAL_COMMIT"; - public static final String REPO_GIT_WEBHOOK_PUSH_COMMIT_PREFIX = "REPO_GIT_WEBHOOK_PUSH_COMMIT_"; - public static final String REPO_GIT_WEBHOOK_PUSH_COMMIT_MSG_PREFIX = "REPO_GIT_WEBHOOK_PUSH_COMMIT_MSG_"; - public static final String REPO_GIT_WEBHOOK_PUSH_COMMIT_TIMESTAMP_PREFIX = "REPO_GIT_WEBHOOK_PUSH_COMMIT_TIMESTAMP_"; - public static final String REPO_GIT_WEBHOOK_PUSH_COMMIT_AUTHOR_PREFIX = "REPO_GIT_WEBHOOK_PUSH_COMMIT_AUTHOR_"; - public static final String REPO_GIT_WEBHOOK_PUSH_ADD_FILE_PREFIX = "REPO_GIT_WEBHOOK_PUSH_ADD_FILE_"; - public static final String REPO_GIT_WEBHOOK_PUSH_MODIFY_FILE_PREFIX = "REPO_GIT_WEBHOOK_PUSH_MODIFY_FILE_"; - public static final String REPO_GIT_WEBHOOK_PUSH_DELETE_FILE_PREFIX = "REPO_GIT_WEBHOOK_PUSH_DELETE_FILE_"; - public static final String REPO_GIT_WEBHOOK_PUSH_ADD_FILE_COUNT = "REPO_GIT_WEBHOOK_PUSH_ADD_FILE_COUNT"; - public static final String REPO_GIT_WEBHOOK_PUSH_MODIFY_FILE_COUNT = "REPO_GIT_WEBHOOK_PUSH_MODIFY_FILE_COUNT"; - public static final String REPO_GIT_WEBHOOK_PUSH_DELETE_FILE_COUNT = "REPO_GIT_WEBHOOK_PUSH_DELETE_FILE_COUNT"; - public static final String REPO_GIT_WEBHOOK_PUSH_OPERATION_KIND = "REPO_GIT_WEBHOOK_PUSH_OPERATION_KIND"; - public static final String REPO_GIT_WEBHOOK_PUSH_ACTION_KIND = "REPO_GIT_WEBHOOK_PUSH_ACTION_KIND"; - public static final String REPO_GIT_WEBHOOK_PUSH_PROJECT_ID = "REPO_GIT_WEBHOOK_PUSH_PROJECT_ID"; - - public static final String REPO_GIT_WEBHOOK_FINAL_INCLUDE_BRANCH = "CI_GIT_WEBHOOK_FINAL_INCLUDE_BRANCH"; - public static final String REPO_GIT_WEBHOOK_FINAL_INCLUDE_PATH = "CI_GIT_WEBHOOK_FINAL_INCLUDE_PATH"; - - public static final String REPO_GIT_WEBHOOK_MR_AUTHOR = "CI_REPO_GIT_WEBHOOK_MR_AUTHOR"; - public static final String REPO_GIT_WEBHOOK_MR_ACTION = "CI_REPO_GIT_WEBHOOK_MR_ACTION"; - public static final String REPO_GIT_WEBHOOK_MR_TARGET_URL = "CI_REPO_GIT_WEBHOOK_TARGET_URL"; - public static final String REPO_GIT_WEBHOOK_MR_SOURCE_URL = "CI_REPO_GIT_WEBHOOK_SOURCE_URL"; - public static final String REPO_GIT_WEBHOOK_MR_TARGET_BRANCH = "CI_REPO_GIT_WEBHOOK_TARGET_BRANCH"; - public static final String REPO_GIT_WEBHOOK_MR_SOURCE_BRANCH = "CI_REPO_GIT_WEBHOOK_SOURCE_BRANCH"; - public static final String REPO_GIT_WEBHOOK_MR_CREATE_TIME = "CI_REPO_GIT_WEBHOOK_MR_CREATE_TIME"; - public static final String REPO_GIT_WEBHOOK_MR_UPDATE_TIME = "CI_REPO_GIT_WEBHOOK_MR_UPDATE_TIME"; - public static final String REPO_GIT_WEBHOOK_MR_CREATE_TIMESTAMP = "CI_REPO_GIT_WEBHOOK_MR_CREATE_TIMESTAMP"; - public static final String REPO_GIT_WEBHOOK_MR_UPDATE_TIMESTAMP = "CI_REPO_GIT_WEBHOOK_MR_UPDATE_TIMESTAMP"; - public static final String REPO_GIT_WEBHOOK_MR_ID = "CI_REPO_GIT_WEBHOOK_MR_ID"; - public static final String REPO_GIT_WEBHOOK_MR_NUMBER = "CI_REPO_GIT_WEBHOOK_MR_NUMBER"; - public static final String REPO_GIT_WEBHOOK_MR_DESCRIPTION = "CI_REPO_GIT_WEBHOOK_MR_DESC"; - public static final String REPO_GIT_WEBHOOK_MR_TITLE = "CI_REPO_GIT_WEBHOOK_MR_TITLE"; - public static final String REPO_GIT_WEBHOOK_MR_ASSIGNEE = "CI_REPO_GIT_WEBHOOK_MR_ASSIGNEE"; - public static final String REPO_GIT_WEBHOOK_MR_URL = "CI_REPO_GIT_WEBHOOK_MR_URL"; - public static final String REPO_GIT_WEBHOOK_MR_REVIEWERS = "CI_REPO_GIT_WEBHOOK_MR_REVIEWERS"; - public static final String REPO_GIT_WEBHOOK_MR_MILESTONE = "CI_REPO_GIT_WEBHOOK_MR_MILESTONE"; - public static final String REPO_GIT_WEBHOOK_MR_MILESTONE_ID = "CI_REPO_GIT_WEBHOOK_MR_MILESTONE_ID"; - public static final String REPO_GIT_WEBHOOK_MR_MILESTONE_DUE_DATE = "CI_REPO_GIT_WEBHOOK_MR_MILESTONE_DUE_DATE"; - public static final String REPO_GIT_WEBHOOK_MR_LABELS = "CI_REPO_GIT_WEBHOOK_MR_LABELS"; - public static final String REPO_GIT_WEBHOOK_MR_LAST_COMMIT = "REPO_GIT_WEBHOOK_MR_LAST_COMMIT"; - public static final String REPO_GIT_WEBHOOK_MR_LAST_COMMIT_MSG = "REPO_GIT_WEBHOOK_MR_LAST_COMMIT_MSG"; - public static final String REPO_GIT_WEBHOOK_MR_MERGE_TYPE = "REPO_GIT_WEBHOOK_MR_MERGE_TYPE"; - public static final String REPO_GIT_WEBHOOK_MR_MERGE_COMMIT_SHA = "REPO_GIT_WEBHOOK_MR_MERGE_COMMIT_SHA"; - public static final String REPO_GIT_WEBHOOK_MR_BASE_COMMIT = "REPO_GIT_WEBHOOK_MR_BASE_COMMIT"; - public static final String REPO_GIT_WEBHOOK_MR_TARGET_COMMIT = "REPO_GIT_WEBHOOK_MR_TARGET_COMMIT"; - public static final String REPO_GIT_WEBHOOK_MR_SOURCE_COMMIT = "REPO_GIT_WEBHOOK_MR_SOURCE_COMMIT"; - - public static final String REPO_GIT_WEBHOOK_REVIEW_REVIEWABLE_ID = "CI_REPO_GIT_WEBHOOK_REVIEW_REVIEWABLE_ID"; - public static final String REPO_GIT_WEBHOOK_REVIEW_REVIEWABLE_TYPE = "CI_REPO_GIT_WEBHOOK_REVIEW_REVIEWABLE_TYPE"; - public static final String REPO_GIT_WEBHOOK_REVIEW_RESTRICT_TYPE = "CI_REPO_GIT_WEBHOOK_REVIEW_RESTRICT_TYPE"; - public static final String REPO_GIT_WEBHOOK_REVIEW_APPROVING_REVIEWERS = "CI_REPO_GIT_WEBHOOK_REVIEW_APPROVING_REVIEWERS"; - public static final String REPO_GIT_WEBHOOK_REVIEW_APPROVED_REVIEWERS = "CI_REPO_GIT_WEBHOOK_REVIEW_APPROVED_REVIEWERS"; - public static final String REPO_GIT_WEBHOOK_REVIEW_REVIEWERS = "CI_REPO_GIT_WEBHOOK_REVIEW_REVIEWERS"; - public static final String REPO_GIT_WEBHOOK_REVIEW_STATE = "CI_REPO_GIT_WEBHOOK_REVIEW_STATE"; - public static final String REPO_GIT_WEBHOOK_REVIEW_OWNER = "CI_REPO_GIT_WEBHOOK_REVIEW_OWNER"; - public static final String REPO_GIT_WEBHOOK_REVIEW_ID = "CI_REPO_GIT_WEBHOOK_REVIEW_ID"; - public static final String REPO_GIT_WEBHOOK_REVIEW_IID = "CI_REPO_GIT_WEBHOOK_REVIEW_IID"; - public static final String REPO_GIT_WEBHOOK_REVIEW_SOURCE_BRANCH = "CI_REPO_GIT_WEBHOOK_REVIEW_SOURCE_BRANCH"; - public static final String REPO_GIT_WEBHOOK_REVIEW_SOURCE_PROJECT_ID = "CI_REPO_GIT_WEBHOOK_REVIEW_SOURCE_PROJECT_ID"; - public static final String REPO_GIT_WEBHOOK_REVIEW_SOURCE_COMMIT = "CI_REPO_GIT_WEBHOOK_REVIEW_SOURCE_COMMIT"; - public static final String REPO_GIT_WEBHOOK_REVIEW_TARGET_COMMIT = "CI_REPO_GIT_WEBHOOK_REVIEW_TARGET_COMMIT"; - public static final String REPO_GIT_WEBHOOK_REVIEW_TARGET_BRANCH = "CI_REPO_GIT_WEBHOOK_REVIEW_TARGET_BRANCH"; - public static final String REPO_GIT_WEBHOOK_REVIEW_TARGET_PROJECT_ID = "CI_REPO_GIT_WEBHOOK_REVIEW_TARGET_PROJECT_ID"; - - public static final String REPO_GIT_WEBHOOK_TAG_NAME = "CI_REPO_GIT_WEBHOOK_TAG_NAME"; - public static final String REPO_GIT_WEBHOOK_TAG_OPERATION = "CI_REPO_GIT_WEBHOOK_TAG_OPERATION"; - public static final String REPO_GIT_WEBHOOK_TAG_USERNAME = "CI_REPO_GIT_WEBHOOK_TAG_USERNAME"; - public static final String REPO_GIT_WEBHOOK_TAG_CREATE_FROM = "CI_REPO_GIT_WEBHOOK_TAG_CREATE_FROM"; - - public static final String REPO_GITHUB_WEBHOOK_CREATE_REF_NAME = "CI_REPO_GITHUB_WEBHOOK_CREATE_REF_NAME"; - public static final String REPO_GITHUB_WEBHOOK_CREATE_REF_TYPE = "CI_REPO_GITHUB_WEBHOOK_CREATE_REF_TYPE"; - public static final String REPO_GITHUB_WEBHOOK_CREATE_USERNAME = "CI_REPO_GITHUB_WEBHOOK_CREATE_USERNAME"; - - public static final String REPO_SVN_WEBHOOK_REVERSION = "CI_REPO_SVN_WEBHOOK_REVERSION"; - public static final String REPO_SVN_WEBHOOK_USERNAME = "CI_REPO_SVN_WEBHOOK_USERNAME"; - public static final String REPO_SVN_WEBHOOK_COMMIT_TIME = "CI_REPO_SVN_WEBHOOK_COMMIT_TIME"; - public static final String REPO_SVN_WEBHOOK_RELATIVE_PATH = "CI_REPO_SVN_WEBHOOK_INCLUDE_PATHS"; - public static final String REPO_SVN_WEBHOOK_EXCLUDE_PATHS = "CI_REPO_SVN_WEBHOOK_EXCLUDE_PATHS"; - public static final String REPO_SVN_WEBHOOK_INCLUDE_USERS = "CI_REPO_SVN_WEBHOOK_INCLUDE_USERS"; - public static final String REPO_SVN_WEBHOOK_EXCLUDE_USERS = "CI_REPO_SVN_WEBHOOK_EXCLUDE_USERS"; - public static final String REPO_SVN_WEBHOOK_FINAL_INCLUDE_PATH = "CI_REPO_SVN_WEBHOOK_FINAL_INCLUDE_PATH"; - - public static final String PIPELINE_WEBHOOK_MR_ID = "CI_HOOK_MR_ID"; // hookMergeRequestId - public static final String PIPELINE_WEBHOOK_MR_COMMITTER = "CI_HOOK_MR_COMMITTER"; // "hookMergeRequest_committer" - public static final String PIPELINE_WEBHOOK_SOURCE_BRANCH = "CI_HOOK_SOURCE_BRANCH"; // hookSourceBranch - public static final String PIPELINE_WEBHOOK_TARGET_BRANCH = "CI_HOOK_TARGET_BRANCH"; // hookTargetBranch - public static final String PIPELINE_WEBHOOK_SOURCE_PROJECT_ID = "CI_HOOK_SOURCE_PROJECT_ID"; - public static final String PIPELINE_WEBHOOK_TARGET_PROJECT_ID = "CI_HOOK_TARGET_PROJECT_ID"; - public static final String PIPELINE_WEBHOOK_SOURCE_REPO_NAME = "CI_HOOK_SOURCE_REPO_NAME"; - public static final String PIPELINE_WEBHOOK_TARGET_REPO_NAME = "CI_HOOK_TARGET_REPO_NAME"; - public static final String MATCH_BRANCH = "matchBranch"; - public static final String MATCH_PATHS = "matchPaths"; - public static final String GIT_MR_NUMBER = "CI_GIT_MR_NUMBER"; // git_mr_number - public static final String GITHUB_PR_NUMBER = "CI_GITHUB_PR_NUMBER"; // github_pr_number - - public static final String REPO_P4_WEBHOOK_P4PORT = "CI_REPO_P4_WEBHOOK_P4PORT"; - public static final String REPO_P4_WEBHOOK_EVENT_TYPE = "CI_REPO_P4_WEBHOOK_EVENT_TYPE"; - public static final String REPO_P4_WEBHOOK_INCLUDE_PATHS = "CI_REPO_P4_WEBHOOK_INCLUDE_PATHS"; - public static final String REPO_P4_WEBHOOK_EXCLUDE_PATHS = "CI_REPO_P4_WEBHOOK_EXCLUDE_PATHS"; - public static final String REPO_P4_WEBHOOK_CHANGE = "CI_REPO_P4_WEBHOOK_CHANGE"; - - public static final String PIPELINE_WEBHOOK_REVISION = "CI_HOOK_REVISION"; // hookRevision - public static final String PIPELINE_WEBHOOK_BRANCH = "CI_HOOK_BRANCH"; // hookBranch - public static final String PIPELINE_WEBHOOK_SOURCE_URL = "CI_HOOK_SOURCE_URL"; // hookSourceUrl - public static final String PIPELINE_WEBHOOK_TARGET_URL = "CI_HOOK_TARGET_URL"; // hookTargetUrl - public static final String PIPELINE_WEBHOOK_REPO = "CI_HOOK_REPO"; // hookRepo - public static final String PIPELINE_WEBHOOK_REPO_TYPE = "CI_HOOK_REPO_TYPE"; // hookRepoType - public static final String PIPELINE_WEBHOOK_BLOCK = "CI_HOOK_BLOCK"; // hookBlock - public static final String PIPELINE_WEBHOOK_TYPE = "CI_HOOK_TYPE"; // hookType - public static final String PIPELINE_WEBHOOK_EVENT_TYPE = "CI_HOOK_EVENT_TYPE"; // hookEventType - public static final String PIPELINE_REPO_NAME = "CI_REPO_NAME"; // "repoName" - public static final String PIPELINE_WEBHOOK_COMMIT_MESSAGE = "CI_HOOK_MESSAGE"; // hook message - public static final String PIPELINE_START_WEBHOOK_USER_ID = "CI_START_WEBHOOK_USER_ID"; // "pipeline.start.webhook.user.id" - public static final String PIPELINE_WEBHOOK_QUEUE = "CI_HOOK_QUEUE"; - - // issue事件 - public static final String REPO_GIT_WEBHOOK_ISSUE_TITLE = "CI_REPO_GIT_WEBHOOK_ISSUE_TITLE"; - public static final String REPO_GIT_WEBHOOK_ISSUE_ID = "CI_REPO_GIT_WEBHOOK_ISSUE_ID"; - public static final String REPO_GIT_WEBHOOK_ISSUE_IID = "CI_REPO_GIT_WEBHOOK_ISSUE_IID"; - public static final String REPO_GIT_WEBHOOK_ISSUE_DESCRIPTION = "CI_REPO_GIT_WEBHOOK_ISSUE_DESCRIPTION"; - public static final String REPO_GIT_WEBHOOK_ISSUE_STATE = "CI_REPO_GIT_WEBHOOK_ISSUE_STATE"; - public static final String REPO_GIT_WEBHOOK_ISSUE_OWNER = "CI_REPO_GIT_WEBHOOK_ISSUE_OWNER"; // issue 的负责人 - public static final String REPO_GIT_WEBHOOK_ISSUE_URL = "CI_REPO_GIT_WEBHOOK_ISSUE_URL"; - public static final String REPO_GIT_WEBHOOK_ISSUE_MILESTONE_ID = "CI_REPO_GIT_WEBHOOK_ISSUE_MILESTONE_ID"; - public static final String REPO_GIT_WEBHOOK_ISSUE_ACTION = "CI_REPO_GIT_WEBHOOK_ISSUE_ACTION"; - - // note事件 - public static final String PIPELINE_WEBHOOK_NOTE_COMMENT = "PIPELINE_WEBHOOK_NOTE_COMMENT"; - public static final String PIPELINE_WEBHOOK_NOTE_ID = "PIPELINE_WEBHOOK_NOTE_ID"; - public static final String REPO_GIT_WEBHOOK_NOTE_COMMENT = "CI_REPO_GIT_WEBHOOK_NOTE_COMMENT"; - public static final String REPO_GIT_WEBHOOK_NOTE_ID = "CI_REPO_GIT_WEBHOOK_NOTE_ID"; - public static final String REPO_GIT_WEBHOOK_NOTE_PROJECT_ID = "CI_REPO_GIT_WEBHOOK_NOTE_PROJECT_ID"; - public static final String REPO_GIT_WEBHOOK_NOTE_NOTEABLE_TYPE = "CI_REPO_GIT_WEBHOOK_NOTE_NOTEABLE_TYPE"; - public static final String REPO_GIT_WEBHOOK_NOTE_AUTHOR_ID = "CI_REPO_GIT_WEBHOOK_NOTE_AUTHOR_ID"; - public static final String REPO_GIT_WEBHOOK_NOTE_CREATED_AT = "CI_REPO_GIT_WEBHOOK_NOTE_CREATED_AT"; - public static final String REPO_GIT_WEBHOOK_NOTE_UPDATED_AT = "CI_REPO_GIT_WEBHOOK_NOTE_UPDATED_AT"; - public static final String REPO_GIT_WEBHOOK_NOTE_URL = "CI_REPO_GIT_WEBHOOK_NOTE_URL"; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/AgentReuseMutex.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/AgentReuseMutex.java deleted file mode 100644 index 6620e18d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/AgentReuseMutex.java +++ /dev/null @@ -1,108 +0,0 @@ -package cd.casic.ci.common.pipeline.container; - -import cd.casic.ci.common.pipeline.pojo.agent.AgentType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.container - * @Project:ops-pro - * @name:AgentReuseMutex - * @Date:2025/03/25 16:51 - * @Filename:AgentReuseMutex - * @description: * AgentReuseMutex 构建机复用互斥 - * * 在同一次构建中总共有五种情况 - * * 1、单个Agent节点且明确指定了使用某个Agent(AgentId或者AgentName),这种情况在item中可以直接拿到,直接进行项目级的互斥逻辑 - * * 2、单个Agent节点但使用变量指代Agent - * * 2-1、被指代的Agent节点与复用他的Job处在同一Stage下,并行执行,这时被指代的Agent与复用他的Job进行同样的变量替换, - * * 并行竞争,没有先后顺序 - * * 2-2、被指代的Agent节点与复用他的Job处在同一Stage下,串行执行(即流水线的Job依赖),这时被指代的Agent应先于复用他的Job执行, - * * 且在Var表中写入可以拿到Agent的只读变量,复用Job读取变量执行 - * * 3、Agent集群且明确指定了某个集群(集群ID或者名称),在分发到Dispatch前需要进行集群级别的互斥锁逻辑, - * * 这样可以保证同样进行互斥逻辑的集群在引擎处进行等待。 - * * 与单个Agent节点的Job关系相同,并行执行时并行竞争,串行时天然的有先后顺序,读取Var表中节点进行项目级的互斥逻辑 - * * 4、Agent集群但使用变量指代,与未进行变量指代的逻辑一致,无需特殊声明 - * * 注:如果是共享集群不受影响,依旧使用执行项目来进行锁定 - * * @param reUseJobId 如果为空说明当前job为被依赖job - * * @param agentOrEnvId agentId/agentName 或者 envId/envName 或者变量,根据 type 区分不同值 - * * @param type 复用互斥的各种类型 - * * @param endJob 是否是最后一波的Job - */ -@Data -@NoArgsConstructor -@Schema(title = "构建机复用互斥模型") -public class AgentReuseMutex { - private String jobId; - private String reUseJobId; - private String agentOrEnvId; - private AgentReuseMutexType type; - private Boolean endJob; - @Schema(title = "是否排队", required = false) - private Boolean queueEnable = true; - @Schema(title = "排队等待时间(分钟)0表示不等待直接失败", required = false) - private Integer timeout = 900; - @Schema(title = "支持变量解析的timeout,变量值非数字则会改取timeout值", required = false) - private String timeoutVar; - @Schema(title = "排队队列大小", required = false) - private Integer queue = 10; - @Schema(title = "运行时的agentOrEnvId,如果有值说明已经初始化了", required = false) - private String runtimeAgentOrEnvId; - @Schema(title = "占用锁定的信息用于日志提示", required = false) - private String linkTip; - - public static class Companion { - public static final long AGENT_LOCK_TIMEOUT = 60 * 60 * 24 * 7L; - public static final String CONTEXT_KEY_SUFFIX = ".container.agent_id"; - - public static String genAgentContextKey(String jobId) { - return "jobs." + jobId + CONTEXT_KEY_SUFFIX; - } - - public static String genAgentReuseMutexLockKey(String projectId, String agentId) { - return "lock:agent:reuse:project:" + projectId + ":agent:" + agentId + ":lock"; - } - - public static String genAgentReuseMutexQueueKey(String projectId, String agentId) { - return "lock:agent:reuse:project:" + projectId + ":agent:" + agentId + ":queue"; - } - - public static String genAgentReuseMutexLinkTipKey(String buildId) { - return "agent:reuse:linkTip:" + buildId; - } - } - - public enum AgentReuseMutexType { - AGENT_ID, - AGENT_NAME, - AGENT_ENV_ID, - AGENT_ENV_NAME, - AGENT_DEP_VAR; - - public boolean isEnvType() { - return this == AGENT_ENV_ID || this == AGENT_ENV_NAME; - } - - public boolean isAgentType() { - return this == AGENT_ID || this == AGENT_NAME; - } - - public boolean needEngineLock() { - return isAgentType(); - } - - public AgentType toAgentType() { - switch (this) { - case AGENT_ID: - case AGENT_ENV_ID: - return AgentType.ID; - case AGENT_NAME: - case AGENT_ENV_NAME: - return AgentType.NAME; - default: - return null; - } - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/Container.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/Container.java deleted file mode 100644 index 6b629211..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/Container.java +++ /dev/null @@ -1,99 +0,0 @@ -package cd.casic.ci.common.pipeline.container; - -import cd.casic.ci.common.pipeline.IModelTemplate; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import cn.hutool.json.JSONUtil; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.experimental.SuperBuilder; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.container - * @Project:ops-pro - * @name:Container - * @Date:2025/03/25 16:53 - * @Filename:Container - * @description:Todo - */ -@Data -@SuperBuilder -@Schema(title = "流水线模型-多态基类") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = TriggerContainer.class, name = TriggerContainer.classType), - @JsonSubTypes.Type(value = NormalContainer.class, name = NormalContainer.classType), - @JsonSubTypes.Type(value = VMBuildContainer.class, name = VMBuildContainer.classType) -}) -@Getter -@NoArgsConstructor -@AllArgsConstructor -public abstract class Container implements IModelTemplate { - protected String id; // seq id - protected String name; - protected List elements; - protected String status; - @Deprecated(since = "即将被timeCost代替") - protected Long startEpoch; - @Deprecated(since = "即将被timeCost代替") - protected Long systemElapsed; // 系统耗时(开机时间) - @Deprecated(since = "即将被timeCost代替") - protected Long elementElapsed; // 插件执行耗时 - protected Boolean canRetry; // 当前job是否能重试 - protected String containerId; // container 流水线唯一ID,同seq id - protected String containerHashId; // container 全局唯一ID - protected String startVMStatus; - protected Integer executeCount; - protected String jobId; // 用户自定义id - protected Boolean containPostTaskFlag; // 是否包含post任务 - protected Boolean matrixGroupFlag; // 是否为构建矩阵组 - protected BuildRecordTimeCost timeCost; // 耗时结果 - protected Integer startVMTaskSeq; // 开机任务序号 - - public void resetBuildOption(int executeCount) { - this.status = null; - this.timeCost = null; - this.startEpoch = null; - this.elementElapsed = null; - this.systemElapsed = null; - this.startVMStatus = null; - this.executeCount = executeCount; - } - - public void transformCompatibility() { - if (elements != null) { - elements.forEach(Element::transformCompatibility); - } - } - - public Map genTaskParams() { - Map configParams = JSONUtil.parseObj(this).toBean(Map.class); - if (elements != null && !elements.isEmpty()) { - configParams.put("elements", List.of()); - } - return configParams; - } - - public abstract String getClassType(); - - public abstract Container getContainerById(String vmSeqId); - - public abstract void retryFreshMatrixOption(); - - public abstract List fetchGroupContainers(); - - public abstract Map fetchMatrixContext(); - - public abstract boolean containerEnabled(); - - public abstract void setContainerEnable(boolean enable); -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/MutexGroup.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/MutexGroup.java deleted file mode 100644 index 888e92c3..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/MutexGroup.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.common.pipeline.container; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.container - * @Project:ops-pro - * @name:MutexGroup - * @Date:2025/03/25 16:54 - * @Filename:MutexGroup - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "互斥组模型") -public class MutexGroup { - @Schema(title = "是否启用", required = false) - private Boolean enable; - @Schema(title = "互斥组名称", required = false) - private String mutexGroupName; - @Schema(title = "是否排队", required = false) - private Boolean queueEnable; - @Schema(title = "排队等待时间(分钟)0表示不等待直接失败", required = false) - private Integer timeout; - @Schema(title = "支持变量解析的timeout,变量值非数字则会改取timeout值", required = false) - private String timeoutVar; - @Schema(title = "排队队列大小", required = false) - private Integer queue; - @Schema(title = "运行时实际互斥锁名称(有值则已初始化)", required = false) - private String runtimeMutexGroup; - @Schema(title = "占用锁定的信息用于日志提示", required = false) - private String linkTip; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/NormalContainer.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/NormalContainer.java deleted file mode 100644 index 03409f0b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/NormalContainer.java +++ /dev/null @@ -1,125 +0,0 @@ -package cd.casic.ci.common.pipeline.container; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.option.JobControlOption; -import cd.casic.ci.common.pipeline.option.MatrixControlOption; -import io.swagger.v3.oas.annotations.media.Schema; -import kotlin.ReplaceWith; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.List; -import java.util.Map; - -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(title = "流水线模型-普通任务容器") -public class NormalContainer extends Container { - public static final String classType = "normal"; - - private Boolean enableSkip = false; - - private List conditions; - - private Integer maxQueueMinutes = 60; - - private Integer maxRunningMinutes = 1440; - - private JobControlOption jobControlOption; // 为了兼容旧数据,所以定义为可空以及var - private MutexGroup mutexGroup; // 为了兼容旧数据,所以定义为可空以及var - private MatrixControlOption matrixControlOption; - private String matrixGroupId; - private Map matrixContext; - private List groupContainers; - - @Override - public String getClassType() { - return classType; - } - - @Override - public Container getContainerById(String vmSeqId) { - if (vmSeqId.equals(id) || vmSeqId.equals(containerId)) { - return this; - } - List containers = fetchGroupContainers(); - if (containers != null) { - for (Container container : containers) { - if (vmSeqId.equals(container.getId()) || vmSeqId.equals(container.getContainerId())) { - return container; - } - } - } - return null; - } - - @Override - public void retryFreshMatrixOption() { - groupContainers = null; - if (matrixControlOption != null) { - matrixControlOption.setFinishCount(null); - matrixControlOption.setTotalCount(null); - } - } - - @Override - public List fetchGroupContainers() { - return groupContainers != null ? List.copyOf(groupContainers) : null; - } - - @Override - public Map fetchMatrixContext() { - return matrixContext; - } - - @Override - public boolean containerEnabled() { - return jobControlOption == null || jobControlOption.getEnable(); - } - - @Override - public void setContainerEnable(boolean enable) { - jobControlOption = jobControlOption != null ? jobControlOption.setEnable(enable) : new JobControlOption().setEnable(enable); - } - - @Override - public void transformCompatibility() { - if (jobControlOption != null && (jobControlOption.getTimeoutVar() == null || jobControlOption.getTimeoutVar().isEmpty())) { - jobControlOption.setTimeoutVar(String.valueOf(jobControlOption.getTimeout())); - } - if (mutexGroup != null && (mutexGroup.getTimeoutVar() == null || mutexGroup.getTimeoutVar().isEmpty())) { - mutexGroup.setTimeoutVar(String.valueOf(mutexGroup.getTimeout())); - } - super.transformCompatibility(); - } - - @Override - public String getTemplate() { - return null; - } - - @Override - public String getRef() { - return null; - } - - @Override - public Map getVariables() { - return null; - } - - @Override - public void setTemplate(String template) { - - } - - @Override - public void setRef(String ref) { - - } - - @Override - public void setVariables(Map variables) { - - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/Stage.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/Stage.java deleted file mode 100644 index aa32481f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/Stage.java +++ /dev/null @@ -1,141 +0,0 @@ -package cd.casic.ci.common.pipeline.container; - -import cd.casic.ci.common.pipeline.IModelTemplate; -import cd.casic.ci.common.pipeline.option.StageControlOption; -import cd.casic.ci.common.pipeline.pojo.StagePauseCheck; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.container - * @Project:ops-pro - * @name:Stage - * @Date:2025/03/25 16:55 - * @Filename:Stage - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线模型-阶段") -public class Stage implements IModelTemplate { - @Schema(title = "容器集合", required = true) - private List containers; - @Schema(title = "阶段ID (系统标识,用户不可编辑)", required = false) - private String id; - @Schema(title = "阶段名称", required = true) - private String name; - @Schema(title = "阶段ID (用户可编辑)", required = false) - private String stageIdForUser; - @Schema(title = "阶段标签", required = false, readOnly = true) - private List tag; - @Schema(title = "阶段状态", required = false, readOnly = true) - private String status; - @Schema(title = "阶段启动时间", required = false, readOnly = true) - @Deprecated - private Long startEpoch; - @Schema(title = "容器运行时间", required = false, readOnly = true) - @Deprecated - private Long elapsed; - @Schema(title = "用户自定义环境变量", required = false) - private Map customBuildEnv; - @Schema(title = "是否启用容器失败快速终止阶段", required = false) - private Boolean fastKill; - @Schema(title = "标识是否为FinallyStage,每个Model只能包含一个FinallyStage,并且处于最后位置", required = false) - private Boolean finallyStage; - @Schema(title = "当前Stage是否能重试", required = false) - private Boolean canRetry; - @Schema(title = "流程控制选项", required = true) - private StageControlOption stageControlOption; - @Schema(title = "stage准入配置", required = false) - private StagePauseCheck checkIn; - @Schema(title = "stage准出配置", required = false) - private StagePauseCheck checkOut; - @Schema(title = "步骤运行次数", required = false, readOnly = true) - private Integer executeCount; - @Schema(title = "各项耗时", required = true) - private BuildRecordTimeCost timeCost; - - public void resetBuildOption(Boolean init) { - if (init != null && init) { - status = null; - startEpoch = null; - elapsed = null; - } - if (checkIn != null) { - checkIn.fixReviewGroups(init != null && init); - } - if (checkOut != null) { - checkOut.fixReviewGroups(init != null && init); - } - if (stageControlOption != null && stageControlOption.getManualTrigger() && checkIn == null) { - checkIn = StagePauseCheck.convertControlOption(stageControlOption); - } - if (finallyStage !=null && finallyStage){ - canRetry = false; - } - } - - public Container getContainer(String vmSeqId) { - if (containers != null) { - for (Container container : containers) { - Container foundContainer = container.getContainerById(vmSeqId); - if (foundContainer != null) { - return foundContainer; - } - } - } - return null; - } - - public void transformCompatibility() { - if (containers != null) { - for (Container container : containers) { - container.transformCompatibility(); - } - } - } - - public Boolean stageEnabled() { - return stageControlOption != null ? stageControlOption.getEnable() : true; - } - - public boolean isFinally() { - return finallyStage != null && finallyStage; - } - - @Override - public String getTemplate() { - return null; - } - - @Override - public String getRef() { - return null; - } - - @Override - public Map getVariables() { - return null; - } - - @Override - public void setTemplate(String template) { - - } - - @Override - public void setRef(String ref) { - - } - - @Override - public void setVariables(Map variables) { - - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/TriggerContainer.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/TriggerContainer.java deleted file mode 100644 index ae84204d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/TriggerContainer.java +++ /dev/null @@ -1,142 +0,0 @@ -package cd.casic.ci.common.pipeline.container; - -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.container - * @Project:ops-pro - * @name:TriggerContainer - * @Date:2025/03/25 16:56 - * @Filename:TriggerContainer - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线模型-构建触发容器") -public class TriggerContainer extends Container { - public static final String classType = "trigger"; - - @Schema(title = "构建容器序号id", required = false, readOnly = true) - private String id; - @Schema(title = "容器名称", required = true) - private String name; - @Schema(title = "任务集合", required = true) - private List elements; - @Schema(title = "状态", required = true, readOnly = true) - private String status; - @Schema(title = "系统运行时间", required = false) - @Deprecated - private Long startEpoch; - @Schema(title = "系统耗时(开机时间)", required = false, readOnly = true) - @Deprecated - private Long systemElapsed; - @Schema(title = "插件执行耗时", required = false, readOnly = true) - @Deprecated - private Long elementElapsed; - @Schema(title = "参数化构建", required = false) - private List params; - @Schema(title = "模板参数构建", required = false) - private List templateParams; - @Schema(title = "构建版本号", required = false) - private BuildNo buildNo; - @Schema(title = "是否可重试-仅限于构建详情展示重试,目前未作为编排的选项,暂设置为null不存储", required = false, readOnly = true) - private Boolean canRetry; - @Schema(title = "构建容器顺序ID(同id值)", required = false, readOnly = true) - private String containerId; - @Schema(title = "容器唯一ID", required = false, readOnly = true) - private String containerHashId; - @Schema(title = "构建环境启动状态", required = false, readOnly = true) - private String startVMStatus; - @Schema(title = "容器运行次数", required = false, readOnly = true) - private Integer executeCount; - @Schema(title = "用户自定义ID", required = false, hidden = false) - private String jobId; - @Schema(title = "是否包含post任务标识", required = false, readOnly = true) - private Boolean containPostTaskFlag; - @Schema(title = "是否为构建矩阵", required = false, readOnly = true) - private Boolean matrixGroupFlag; - @Schema(title = "各项耗时", required = true) - private BuildRecordTimeCost timeCost; - @Schema(title = "开机任务序号", required = false, readOnly = true) - private Integer startVMTaskSeq; - - @Override - public String getClassType() { - return classType; - } - - @Override - public Container getContainerById(String vmSeqId) { - return id.equals(vmSeqId) ? this : null; - } - - @Override - public void retryFreshMatrixOption() { - // No operation needed - } - - @Override - public List fetchGroupContainers() { - return null; - } - - @Override - public Map fetchMatrixContext() { - return null; - } - - @Override - public boolean containerEnabled() { - return true; - } - - @Override - public void setContainerEnable(boolean enable) { - - } - - @Override - public void transformCompatibility() { - // No compatibility transformation needed - } - - @Override - public String getTemplate() { - return null; - } - - @Override - public String getRef() { - return null; - } - - @Override - public Map getVariables() { - return null; - } - - @Override - public void setTemplate(String template) { - - } - - @Override - public void setRef(String ref) { - - } - - @Override - public void setVariables(Map variables) { - - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/VMBuildContainer.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/VMBuildContainer.java deleted file mode 100644 index b4ebc7fa..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/container/VMBuildContainer.java +++ /dev/null @@ -1,206 +0,0 @@ -package cd.casic.ci.common.pipeline.container; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.enums.VMBaseOS; -import cd.casic.ci.common.pipeline.option.JobControlOption; -import cd.casic.ci.common.pipeline.option.MatrixControlOption; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import cd.casic.ci.common.pipeline.type.DispatchType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.container - * @Project:ops-pro - * @name:VMBuildContainer - * @Date:2025/03/25 16:56 - * @Filename:VMBuildContainer - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线模型-虚拟机构建容器") -public class VMBuildContainer extends Container { - public static final String classType = "vmBuild"; - - @Schema(title = "构建容器序号id", required = false, readOnly = true) - private String id; - @Schema(title = "容器名称", required = true) - private String name = "构建环境"; - @Schema(title = "任务集合", required = true) - private List elements; - @Schema(title = "容器状态", required = false, readOnly = true) - private String status; - @Schema(title = "系统运行时间", required = false, readOnly = true) - @Deprecated - private Long startEpoch; - @Schema(title = "系统耗时(开机时间)", required = false, readOnly = true) - @Deprecated - private Long systemElapsed; - @Schema(title = "插件执行耗时", required = false, readOnly = true) - @Deprecated - private Long elementElapsed; - @Schema(title = "VM基础操作系统", required = true) - private VMBaseOS baseOS; - @Schema(title = "预指定VM名称列表", required = true) - private Set vmNames; - @Schema(title = "排队最长时间(分钟)", required = true) - @Deprecated - private Integer maxQueueMinutes = 60; - @Schema(title = "运行最长时间(分钟)", required = true) - @Deprecated - private Integer maxRunningMinutes = 480; - @Schema(title = "构建机环境变量(容器启动时写入环境)", required = false) - private Map buildEnv; - @Schema(title = "用户自定义环境变量(Agent启动时写入环境)", required = false) - @Deprecated - private Map customBuildEnv; - @Schema(title = "用户自定义环境变量(Agent启动时写入环境)", required = false) - private List customEnv; - @Schema(title = "第三方构建Hash ID", required = false) - private String thirdPartyAgentId; - @Schema(title = "第三方构建环境ID", required = false) - private String thirdPartyAgentEnvId; - @Schema(title = "第三方构建环境工作空间", required = false) - private String thirdPartyWorkspace; - @Schema(title = "Docker构建机", required = false) - private String dockerBuildVersion; - @Schema(title = "TStack Hash Id", required = false) - @Deprecated - private String tstackAgentId; - @Schema(title = "新的选择构建机环境", required = false) - private DispatchType dispatchType; - @Schema(title = "是否显示构建资源信息", required = false) - private Boolean showBuildResource; - @Schema(title = "是否访问外网", required = false, readOnly = true) - private Boolean enableExternal; - @Schema(title = "构建容器顺序ID(同id值)", required = false, readOnly = true) - private String containerId; - @Schema(title = "容器唯一ID", required = false, readOnly = true) - private String containerHashId; - @Schema(title = "流程控制选项", required = true) - private JobControlOption jobControlOption; - @Schema(title = "互斥组", required = false) - private MutexGroup mutexGroup; - @Schema(title = "构建环境启动状态", required = false, readOnly = true) - private String startVMStatus; - @Schema(title = "容器运行次数", required = false, readOnly = true) - private Integer executeCount; - @Schema(title = "用户自定义ID", required = false, hidden = false) - private String jobId; - @Schema(title = "是否包含post任务标识", required = false, readOnly = true) - private Boolean containPostTaskFlag; - @Schema(title = "是否为构建矩阵", required = false, readOnly = true) - private Boolean matrixGroupFlag; - @Schema(title = "各项耗时", required = true) - private BuildRecordTimeCost timeCost; - @Schema(title = "开机任务序号", required = false, readOnly = true) - private Integer startVMTaskSeq; - @Schema(title = "构建矩阵配置项", required = false) - private MatrixControlOption matrixControlOption; - @Schema(title = "所在构建矩阵组的containerHashId(分裂后的子容器特有字段)", required = false) - private String matrixGroupId; - @Schema(title = "当前矩阵子容器的上下文组合(分裂后的子容器特有字段)", required = false) - private Map matrixContext; - @Schema(title = "分裂后的容器集合(分裂后的父容器特有字段)", required = false) - private List groupContainers; - @Schema(title = "nfs挂载开关", required = false, readOnly = true) - private Boolean nfsSwitch; - - public Boolean getNfsSwitch() { - return nfsSwitch != null ? nfsSwitch : true; - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public Container getContainerById(String vmSeqId) { - if (id.equals(vmSeqId) || containerId.equals(vmSeqId)) return this; - if (groupContainers != null) { - for (Container container : groupContainers) { - if (container.getId().equals(vmSeqId) || container.getContainerId().equals(vmSeqId)) return container; - } - } - return null; - } - - @Override - public void retryFreshMatrixOption() { - groupContainers = new ArrayList<>(); - if (matrixControlOption != null) { - matrixControlOption.setFinishCount(null); - matrixControlOption.setTotalCount(null); - } - } - - @Override - public List fetchGroupContainers() { - return groupContainers != null ? new ArrayList<>(groupContainers) : null; - } - - @Override - public Map fetchMatrixContext() { - return matrixContext; - } - - @Override - public boolean containerEnabled() { - return jobControlOption != null ? jobControlOption.getEnable() : true; - } - - @Override - public void setContainerEnable(boolean enable) { - - } - - @Override - public void transformCompatibility() { - if (jobControlOption != null && jobControlOption.getTimeoutVar() == null || jobControlOption.getTimeoutVar().isBlank()) { - jobControlOption.setTimeoutVar(String.valueOf(jobControlOption.getTimeout())); - } - if (mutexGroup != null && (mutexGroup.getTimeoutVar() == null || mutexGroup.getTimeoutVar().isBlank())) { - mutexGroup.setTimeoutVar(String.valueOf(mutexGroup.getTimeout())); - } - } - - @Override - public String getTemplate() { - return null; - } - - @Override - public String getRef() { - return null; - } - - @Override - public Map getVariables() { - return null; - } - - @Override - public void setTemplate(String template) { - - } - - @Override - public void setRef(String ref) { - - } - - @Override - public void setVariables(Map variables) { - - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/ClassicPipelineDialect.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/ClassicPipelineDialect.java deleted file mode 100644 index e6dd2aae..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/ClassicPipelineDialect.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.dialect; - -import lombok.Getter; -import lombok.Setter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.dialect - * @Project:ops-pro - * @name:ClassicPipelineDialect - * @Date:2025/03/27 10:36 - * @Filename:ClassicPipelineDialect - * @description:Todo - */ -@Getter -@Setter -public class ClassicPipelineDialect implements IPipelineDialect { - @Override - public String getPipelineDialectType() { - return PipelineDialectType.CLASSIC.name(); - } - - @Override - public boolean supportUseExpression() { - return false; - } - - @Override - public boolean supportChineseVarName() { - return true; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/ConstrainedPipelineDialect.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/ConstrainedPipelineDialect.java deleted file mode 100644 index 2e609ddd..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/ConstrainedPipelineDialect.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.dialect; - -import lombok.Getter; -import lombok.Setter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.dialect - * @Project:ops-pro - * @name:ConstrainedPipelineDialect - * @Date:2025/03/27 10:36 - * @Filename:ConstrainedPipelineDialect - * @description:Todo - */ -@Getter -@Setter -public class ConstrainedPipelineDialect implements IPipelineDialect { - @Override - public String getPipelineDialectType() { - return PipelineDialectType.CONSTRAINED.name(); - } - - @Override - public boolean supportUseExpression() { - return true; - } - - @Override - public boolean supportChineseVarName() { - return false; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/IPipelineDialect.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/IPipelineDialect.java deleted file mode 100644 index ba48c9ce..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/IPipelineDialect.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.dialect; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.dialect - * @Project:ops-pro - * @name:IPipelineDialect - * @Date:2025/03/27 10:35 - * @Filename:IPipelineDialect - * @description:Todo - */ -public interface IPipelineDialect { - String getPipelineDialectType(); - - /** - * 1. 仅支持双花括号,避免出现 bash 脚本变量在执行前被系统赋值的问题 - * 2. 流程控制选项、插件入参、Job设置等流水线配置中均可使用函数 - */ - boolean supportUseExpression(); - /** - * 是否支持中文变量名 - */ - boolean supportChineseVarName(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/PipelineDialectType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/PipelineDialectType.java deleted file mode 100644 index 40dbd626..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/PipelineDialectType.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.dialect; - -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.dialect - * @Project:ops-pro - * @name:PipelineDialectType - * @Date:2025/03/27 10:36 - * @Filename:PipelineDialectType - * @description:Todo - */ -@Getter -public enum PipelineDialectType { - CLASSIC(new ClassicPipelineDialect()), - CONSTRAINED(new ConstrainedPipelineDialect()); - - private final IPipelineDialect dialect; - - PipelineDialectType(IPipelineDialect dialect) { - this.dialect = dialect; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/PipelineDialectUtil.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/PipelineDialectUtil.java deleted file mode 100644 index c9725e0e..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/dialect/PipelineDialectUtil.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.common.pipeline.dialect; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.dialect - * @Project:ops-pro - * @name:PipelineDialectUtil - * @Date:2025/03/27 10:36 - * @Filename:PipelineDialectUtil - * @description:Todo - */ -@NoArgsConstructor -public class PipelineDialectUtil { - public static IPipelineDialect getPipelineDialect(String pipelineDialectType) { - return pipelineDialectType != null ? PipelineDialectType.valueOf(pipelineDialectType).getDialect() : PipelineDialectType.CLASSIC.getDialect(); - } - - public static IPipelineDialect getPipelineDialect(Boolean inheritedDialect, String projectDialect, String pipelineDialect) { - return getPipelineDialectType(inheritedDialect, projectDialect, pipelineDialect).getDialect(); - } - - public static PipelineDialectType getPipelineDialectType(Boolean inheritedDialect, String projectDialect, String pipelineDialect) { - if (inheritedDialect == null || inheritedDialect) { - if (projectDialect != null) { - return PipelineDialectType.valueOf(projectDialect); - } - } else if (pipelineDialect != null) { - return PipelineDialectType.valueOf(pipelineDialect); - } - return PipelineDialectType.CLASSIC; - } - -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AgentAction.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AgentAction.java deleted file mode 100644 index c3518a10..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AgentAction.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:AgentAction - * @Date:2025/03/26 10:13 - * @Filename:AgentAction - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum AgentAction { - OFFLINE, - ONLINE; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AgentStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AgentStatus.java deleted file mode 100644 index 617c3ba6..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AgentStatus.java +++ /dev/null @@ -1,64 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:AgentStatus - * @Date:2025/03/26 10:13 - * @Filename:AgentStatus - * @description:Todo - */ -@Getter -@Slf4j -@AllArgsConstructor -public enum AgentStatus { - UN_IMPORT(0), // 未导入,用户刚刚在界面上面生成链接 - UN_IMPORT_OK(1), // 未导入但是agent状态正常(这个时候还是不能用来当构建机) - IMPORT_OK(2), // 用户已经在界面导入并且agent工作正常(构建机只有在这个状态才能正常工作) - IMPORT_EXCEPTION(3), // agent异常 - DELETE(4); // 删除 - - private final int status; - - @Override - public String toString() { - return String.valueOf(status); - } - - public static AgentStatus fromStatus(int status) { - for (AgentStatus agentStatus : values()) { - if (agentStatus.getStatus() == status) { - return agentStatus; - } - } - log.error("Unknown agent status(" + status + ")"); - return AgentStatus.UN_IMPORT; - } - - public static boolean isDelete(AgentStatus status) { - return status == DELETE; - } - - public static boolean isUnImport(AgentStatus status) { - return status == UN_IMPORT; - } - - public static boolean isImportException(AgentStatus status) { - return status == IMPORT_EXCEPTION; - } - - public static AgentStatus fromString(String status) { - for (AgentStatus agentStatus : values()) { - if (agentStatus.name().equals(status)) { - return agentStatus; - } - } - log.error("Unknown agent status(" + status + ")"); - return AgentStatus.UN_IMPORT; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AuthSystemType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AuthSystemType.java deleted file mode 100644 index 801c481d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/AuthSystemType.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -public enum AuthSystemType { - // v0权限中心 - V0_AUTH_TYPE("v0"), - - // v3权限中心 - V3_AUTH_TYPE("v3"), - - // rbac权限中心 - RBAC_AUTH_TYPE("rbac"); - private String value; - - AuthSystemType(String value) { - this.value = value; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BkStyleEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BkStyleEnum.java deleted file mode 100644 index db540e40..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BkStyleEnum.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @Classname StyleEnum - * @Description ops类型枚举 - * @Date 2025/3/18 10:26 - * @author mianbin - */ -public enum BkStyleEnum { - COMMON_STYLE("^(.|\\r|\\n)*$"), - NUMBER_STYLE("[0-9]*$"), - CODE_STYLE("^[a-zA-Z_][\\w-()]{0,31}$"), - ID_STYLE("^[\\w-]{1,64}$"), - NAME_STYLE("^[\\w-\\u4E00-\\u9FBB\\u3400-\\u4DBF\\uF900-\\uFAD9\\u3000-\\u303F\\u2000-\\u206F\\uFF00-\\uFFEF.()\\s]{1,40}$"), - STORE_MEMBER_TYPE_STYLE("^ADMIN|DEVELOPER$"), - EMAIL_STYLE("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"), - AUTH_STYLE("^HTTP|HTTPS|OAUTH|SSH$"), - NOTE_STYLE("^[A-Za-z0-9\\u4E00-\\u9FBB\\u3400-\\u4DBF\\uF900-\\uFAD9\\u3000-\\u303F" + - "\\u2000-\\u206F\\uFF00-\\uFFEF.。??!!,(),、;;::'‘’“”\"…\\s]{1,256}$"), - VISIBILITY_LEVEL_STYLE("^PRIVATE|LOGIN_PUBLIC$"), - LANGUAGE_STYLE("^java|python|nodejs|kotilin|golang|c|c++|php|c#$"), - BOOLEAN_STYLE("^true|false$"), - SCOPE_STYLE("^TEST|PRD|ALL$"), - SERVICE_CODE_STYLE("^[a-z][([-a-z-0-9]*[a-z-0-9])?]{0,31}$"), - BUILD_NUM_RULE_STYLE("^[\\w-{}() +?.:$\"]{1,256}$"), - STORE_FIELD_TYPE_STYLE("^BACKEND|FRONTEND|ALL$"), - PAGE_SIZE_STYLE("^100$|^([1-9]|[1-9]\\d)$"); - - private final String style; - - BkStyleEnum(String style) { - this.style = style; - } - - public String getStyle() { - return style; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BranchVersionAction.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BranchVersionAction.java deleted file mode 100644 index 891e3a4c..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BranchVersionAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:BranchVersionAction - * @Date:2025/03/25 17:25 - * @Filename:BranchVersionAction - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum BranchVersionAction { - ACTIVE("活跃分支(可以被代码推送直接更新)"), - INACTIVE("不活跃分支(已被发布或已被删除)"), - CONFLICT("有冲突分支(落后于主干无法直接合入)"); - - private final String statusName; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildFormPropertyType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildFormPropertyType.java deleted file mode 100644 index 73f40751..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildFormPropertyType.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:BuildFormPropertyType - * @Date:2025/03/25 17:01 - * @Filename:BuildFormPropertyType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum BuildFormPropertyType { - STRING("string"), - TEXTAREA("textarea"), - ENUM("enum"), - DATE("date"), - LONG("long"), - BOOLEAN("boolean"), - SVN_TAG("svn_tag"), - GIT_REF("git_ref"), - REPO_REF("repo_ref"), - MULTIPLE("multiple"), - CODE_LIB("code_lib"), - CONTAINER_TYPE("container_type"), - ARTIFACTORY("artifactory"), - SUB_PIPELINE("sub_pipeline"), - CUSTOM_FILE("custom_file"), - PASSWORD("password"), - TEMPORARY("do not storage in database"); - - private final String value; - - @Override - public String toString() { - return value; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildPropertyType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildPropertyType.java deleted file mode 100644 index 2d4b4008..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildPropertyType.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:BuildPropertyType - * @Date:2025/03/25 17:01 - * @Filename:BuildPropertyType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum BuildPropertyType { - BUILD; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildRecordTimeStamp.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildRecordTimeStamp.java deleted file mode 100644 index d8717eba..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildRecordTimeStamp.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeLine; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:BuildRecordTimeStamp - * @Date:2025/03/25 17:02 - * @Filename:BuildRecordTimeStamp - * @description:Todo - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class BuildRecordTimeStamp { - private Long startTime; - private Long endTime; - - public long between() { - return (endTime != null ? endTime : startTime != null ? startTime : 0) - (startTime != null ? startTime : 0); - } - - public void insert2TimeLine(List timeline) { - if (startTime != null && endTime != null) { - timeline.add(new BuildRecordTimeLine.Moment(startTime, endTime)); - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildReviewType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildReviewType.java deleted file mode 100644 index 7027cced..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildReviewType.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:BuildReviewType - * @Date:2025/03/26 10:15 - * @Filename:BuildReviewType - * @description:Todo - */ - -@Getter -@AllArgsConstructor -public enum BuildReviewType { - TASK_REVIEW, - STAGE_REVIEW, - QUALITY_TASK_REVIEW_PASS, - QUALITY_TASK_REVIEW_ABORT, - QUALITY_CHECK_IN, - QUALITY_CHECK_OUT, - TRIGGER_REVIEW; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildScriptType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildScriptType.java deleted file mode 100644 index 4e3aad41..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildScriptType.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:BuildScriptType - * @Date:2025/03/25 17:02 - * @Filename:BuildScriptType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum BuildScriptType { - PYTHON2, - PYTHON3, - SHELL, - BAT, - POWER_SHELL; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildStatus.java deleted file mode 100644 index 22a39dd5..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildStatus.java +++ /dev/null @@ -1,110 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:BuildStatus - * @Date:2025/03/25 17:02 - * @Filename:BuildStatus - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum BuildStatus { - SUCCEED("succeed", true), - FAILED("failed", true), - CANCELED("canceled", true), - RUNNING("running", true), - TERMINATE("terminate", true), - REVIEWING("reviewing", true), - REVIEW_ABORT("reviewAbort", true), - REVIEW_PROCESSED("reviewProcessed", true), - HEARTBEAT_TIMEOUT("heartbeatTimeout", true), - PREPARE_ENV("prepareEnv", true), - UNEXEC("unexec", false), - SKIP("skip", true), - QUALITY_CHECK_FAIL("qualityCheckFail", true), - QUEUE("queue", true), - LOOP_WAITING("loopWaiting", true), - CALL_WAITING("callWaiting", true), - TRY_FINALLY("tryFinally", false), - QUEUE_TIMEOUT("queueTimeout", true), - EXEC_TIMEOUT("execTimeout", true), - QUEUE_CACHE("queueCache", true), - RETRY("retry", true), - PAUSE("pause", true), - STAGE_SUCCESS("stageSuccess", true), - QUOTA_FAILED("quotaFailed", true), - DEPENDENT_WAITING("dependentWaiting", true), - QUALITY_CHECK_PASS("qualityCheckPass", true), - QUALITY_CHECK_WAIT("qualityCheckWait", true), - TRIGGER_REVIEWING("triggerReviewing", true), - UNKNOWN("unknown", false); - - private final String statusName; - private final boolean visible; - - public boolean isNeverRun() { - return this == UNEXEC || this == TRIGGER_REVIEWING; - } - - public boolean isFinish() { - return isFailure() || isSuccess() || isCancel(); - } - - public boolean isFailure() { - return this == FAILED || isPassiveStop() || isTimeout(); - } - - public boolean isSuccess() { - return this == SUCCEED || this == SKIP || this == REVIEW_PROCESSED || this == QUALITY_CHECK_PASS; - } - - public boolean isCancel() { - return this == CANCELED; - } - - public boolean isSkip() { - return this == SKIP; - } - - public boolean isTerminate() { - return this == TERMINATE; - } - - public boolean isRunning() { - return this == RUNNING || this == LOOP_WAITING || this == REVIEWING || this == PREPARE_ENV || this == CALL_WAITING || this == PAUSE; - } - - public boolean isReview() { - return this == REVIEW_ABORT || this == REVIEW_PROCESSED; - } - - public boolean isReadyToRun() { - return this == QUEUE || this == QUEUE_CACHE || this == RETRY || this == DEPENDENT_WAITING; - } - - public boolean isPassiveStop() { - return this == TERMINATE || this == REVIEW_ABORT || this == QUALITY_CHECK_FAIL; - } - - public boolean isPause() { - return this == PAUSE; - } - - public boolean isTimeout() { - return this == QUEUE_TIMEOUT || this == EXEC_TIMEOUT || this == HEARTBEAT_TIMEOUT; - } - - public static BuildStatus parse(String statusName) { - try { - return statusName == null ? UNKNOWN : BuildStatus.valueOf(statusName); - } catch (Exception ignored) { - return UNKNOWN; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildTaskStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildTaskStatus.java deleted file mode 100644 index 1dd300f8..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BuildTaskStatus.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:BuildTaskStatus - * @Date:2025/03/25 17:03 - * @Filename:BuildTaskStatus - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum BuildTaskStatus { - WAIT, - END, - DO; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BusTypeEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BusTypeEnum.java deleted file mode 100644 index a98ed2c1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/BusTypeEnum.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:BusTypeEnum - * @Date:2025/03/26 10:16 - * @Filename:BusTypeEnum - * @description:Todo - */ - -@Getter -@AllArgsConstructor -public enum BusTypeEnum { - PIPELINE, - TEMPLATE; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CallBackEvent.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CallBackEvent.java deleted file mode 100644 index e54bbb4a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CallBackEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @author by mianbin - * @Classname CallBackEvent - * @Description TODO - * @Date 2025/4/2 9:48 - */ // 定义回调事件的枚举类 -public enum CallBackEvent { - DELETE_PIPELINE, /*流水线删除*/ - CREATE_PIPELINE, /*流水线创建*/ - UPDATE_PIPELINE, /*流水线更新,包括model和setting。*/ - STREAM_ENABLED, /*stream ci 开启/关闭*/ - RESTORE_PIPELINE, /*流水线恢复*/ - - BUILD_QUEUE, /*构建排队,包含并发超限时排队、并发组排队。*/ - BUILD_START, /*构建开始,不包含并发超限时排队、并发组排队。*/ - BUILD_END, /*构建结束*/ - BUILD_STAGE_START, /*stage开始*/ - BUILD_STAGE_END, /*stage结束*/ - BUILD_JOB_QUEUE, /*job排队,包含互斥组排队、构建机复用互斥排队、最大job并发排队。*/ - BUILD_JOB_START, /*job开始,不包含BUILD_JOB_QUEUE。如果job SKIP或没有可执行的插件,就不会有该事件。*/ - BUILD_JOB_END, /*job结束,job SKIP或没有可执行的插件时会有该事件。*/ - BUILD_AGENT_START, /*构建机启动,现在仅包含第三方构建机*/ - BUILD_TASK_START, /*插件开始*/ - BUILD_TASK_END, /*插件结束*/ - BUILD_TASK_PAUSE, /*插件前置暂停*/ - - PROJECT_CREATE, /*项目创建*/ - PROJECT_UPDATE, /*项目更新*/ - PROJECT_ENABLE, /*项目启用*/ - PROJECT_DISABLE /*项目禁用*/ -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CertType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CertType.java deleted file mode 100644 index 3d3a6e97..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CertType.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:CertType - * @Date:2025/03/25 17:03 - * @Filename:CertType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum CertType { - PERSONAL("PERSONAL"), - ENTERPRISE("ENTERPRISE"); - - private final String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ChannelCode.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ChannelCode.java deleted file mode 100644 index 0cd3b552..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ChannelCode.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:ChannelCode - * @Date:2025/03/25 17:03 - * @Filename:ChannelCode - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum ChannelCode { - BS, - AM, - CODECC, - GCLOUD, - GIT, - GONGFENGSCAN, - CODECC_EE; - - public static boolean isNeedAuth(ChannelCode channelCode) { - return channelCode == BS; - } - - public static boolean webChannel(ChannelCode channelCode) { - return channelCode == BS || channelCode == GIT; - } - - public static ChannelCode getChannel(String channel) { - for (ChannelCode code : values()) { - if (code.name().equals(channel)) { - return code; - } - } - return null; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CharsetType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CharsetType.java deleted file mode 100644 index 77fcdb19..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CharsetType.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:CharsetType - * @Date:2025/03/25 17:03 - * @Filename:CharsetType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum CharsetType { - DEFAULT, - GB2312, - UTF_8, - GBK; -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CheckoutRepositoryType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CheckoutRepositoryType.java deleted file mode 100644 index 18e32163..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CheckoutRepositoryType.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:CheckoutRepositoryType - * @Date:2025/03/26 10:16 - * @Filename:CheckoutRepositoryType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum CheckoutRepositoryType { - ID, - NAME, - URL, - SELF; - - public static CheckoutRepositoryType parseType(String type) { - if (type == null || type.isBlank()) return ID; - return valueOf(type); - } - - public static boolean skipTimerTriggerChange(String type) { - return "URL".equals(type) || "SELF".equals(type); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CodePullStrategy.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CodePullStrategy.java deleted file mode 100644 index b1be0eea..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CodePullStrategy.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:CodePullStrategy - * @Date:2025/03/25 17:03 - * @Filename:CodePullStrategy - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum CodePullStrategy { - FRESH_CHECKOUT("fresh_checkout"), - INCREMENT_UPDATE("increment_update"), - REVERT_UPDATE("revert_update"); - - private final String value; - - public static CodePullStrategy fromValue(String value) { - for (CodePullStrategy strategy : values()) { - if (strategy.value.equals(value)) { - return strategy; - } - } - throw new IllegalArgumentException("The strategy(" + value + ") is not exist"); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CodeTargetAction.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CodeTargetAction.java deleted file mode 100644 index 8c4a5a92..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CodeTargetAction.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:CodeTargetAction - * @Date:2025/03/25 17:04 - * @Filename:CodeTargetAction - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum CodeTargetAction { - COMMIT_TO_MASTER("提交到主干"), - CHECKOUT_BRANCH_AND_REQUEST_MERGE("新建分支创建MR"), - COMMIT_TO_SOURCE_BRANCH("提交到原始版本分支"), - COMMIT_TO_SOURCE_BRANCH_AND_REQUEST_MERGE("提交到原始版本分支创建MR"), - COMMIT_TO_BRANCH("提交到指定分支"); - - private final String desc; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CommonStatusEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CommonStatusEnum.java deleted file mode 100644 index 70418d27..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CommonStatusEnum.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import cd.casic.framework.commons.core.IntArrayValuable; -import lombok.AllArgsConstructor; -import lombok.Getter; - -import java.util.Arrays; - -/** - * @Classname CommonStatusEnum - * @Description - * @Date 2025/3/18 11:26 - * @author mianbin - */ -@Getter -@AllArgsConstructor -public enum CommonStatusEnum implements IntArrayValuable { - - ENABLE(0, "开启"), - DISABLE(1, "关闭"); - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray(); - - /** - * 状态值 - */ - private final Integer status; - /** - * 状态名 - */ - private final String name; - - @Override - public int[] array() { - return ARRAYS; - } - -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ContainerMutexStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ContainerMutexStatus.java deleted file mode 100644 index 8288151a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ContainerMutexStatus.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:ContainerMutexStatus - * @Date:2025/03/25 17:04 - * @Filename:ContainerMutexStatus - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum ContainerMutexStatus { - READY, - WAITING, - CANCELED, - FIRST_LOG; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CrudEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CrudEnum.java deleted file mode 100644 index 3c54092a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/CrudEnum.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:CrudEnum - * @Date:2025/03/26 10:16 - * @Filename:CrudEnum - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum CrudEnum { - CREATE, // 增加 - DELETE, // 删除 - UPDATE, // 更新 - READ; // 查询 -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DateIntervalEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DateIntervalEnum.java deleted file mode 100644 index a6405919..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DateIntervalEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import cd.casic.framework.commons.core.IntArrayValuable; -import cn.hutool.core.util.ArrayUtil; -import lombok.AllArgsConstructor; -import lombok.Getter; -import java.util.Arrays; - -/** - * @Classname DateIntervalEnum - * @Description 时间间隔的枚举 - * @Date 2025/3/18 11:26 - * @author mianbin - */ -@Getter -@AllArgsConstructor -public enum DateIntervalEnum implements IntArrayValuable { - - DAY(1, "天"), - WEEK(2, "周"), - MONTH(3, "月"), - QUARTER(4, "季度"), - YEAR(5, "年") - ; - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DateIntervalEnum::getInterval).toArray(); - - /** - * 类型 - */ - private final Integer interval; - /** - * 名称 - */ - private final String name; - - @Override - public int[] array() { - return ARRAYS; - } - - public static DateIntervalEnum valueOf(Integer interval) { - return ArrayUtil.firstMatch(item -> item.getInterval().equals(interval), DateIntervalEnum.values()); - } - -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DependOnType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DependOnType.java deleted file mode 100644 index d5edb8b7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DependOnType.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:DependOnType - * @Date:2025/03/25 17:04 - * @Filename:DependOnType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum DependOnType { - ID, - NAME; - - public static DependOnType parse(String type) { - if (type == null) return ID; - for (DependOnType t : values()) { - if (t.name().equals(type)) return t; - } - return ID; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DeployStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DeployStatus.java deleted file mode 100644 index feb036ba..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DeployStatus.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:DeployStatus - * @Date:2025/03/25 17:12 - * @Filename:DeployStatus - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum DeployStatus { - SUCCEED, - FAILED, - RUNNING, - TIMEOUT; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DockerVersion.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DockerVersion.java deleted file mode 100644 index 607f85cd..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/DockerVersion.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:DockerVersion - * @Date:2025/03/25 17:12 - * @Filename:DockerVersion - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum DockerVersion { - TLINUX1_2("tlinux1.2"), - TLINUX2_2("tlinux2.2"), - CUSTOMIZE("customize"); - - private final String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnumLoader.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnumLoader.java deleted file mode 100644 index 7098f80f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnumLoader.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.extern.slf4j.Slf4j; - -import java.util.ServiceLoader; -import java.util.concurrent.atomic.AtomicBoolean; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:EnumLoader - * @Date:2025/03/26 10:16 - * @Filename:EnumLoader - * @description:Todo - */ -@Slf4j -public class EnumLoader { - private static final AtomicBoolean MODIFY = new AtomicBoolean(false); - - public static void enumModified() { - if (!MODIFY.compareAndSet(false, true)) { - return; - } - Class clazz = EnumModifier.class; - ServiceLoader fetcheries = ServiceLoader.load(clazz); - if (!fetcheries.iterator().hasNext()) { - fetcheries = ServiceLoader.load(clazz, ServiceLoader.class.getClassLoader()); - } - fetcheries.forEach(modifier -> { - log.info("[ENUM MODIFIER]: " + modifier); - try { - modifier.modified(); - } catch (Exception e) { - log.error("[ENUM MODIFIER]| load fail| " + e.getMessage(), e); - } - }); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnumModifier.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnumModifier.java deleted file mode 100644 index 44c61c7c..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnumModifier.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:EnumModifier - * @Date:2025/03/26 10:17 - * @Filename:EnumModifier - * @description:Todo - */ -public interface EnumModifier { - void modified(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnvControlTaskType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnvControlTaskType.java deleted file mode 100644 index e3a71d9d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/EnvControlTaskType.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:EnvControlTaskType - * @Date:2025/03/25 17:12 - * @Filename:EnvControlTaskType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum EnvControlTaskType { - VM, - NORMAL; - - public static EnvControlTaskType parse(String type) { - try { - return EnvControlTaskType.valueOf(type); - } catch (Exception ignore) { - return null; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ErrorCode.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ErrorCode.java deleted file mode 100644 index 6a4a535c..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ErrorCode.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @author by mianbin - * @Classname ErrorCode - * @Description TODO - * @Date 2025/4/1 15:00 - */ -public class ErrorCode { - // 蓝盾系统错误 - public static final int SYSTEM_DAEMON_INTERRUPTED = 2189500; // 守护进程中断 - public static final int SYSTEM_SERVICE_ERROR = 2189501; // 系统内部服务调用出错 - public static final int SYSTEM_OUTTIME_ERROR = 2189502; // 执行请求超时 - public static final int SYSTEM_WORKER_LOADING_ERROR = 2189503; // worker插件加载出错 - public static final int SYSTEM_WORKER_INITIALIZATION_ERROR = 2189504; // 构建机拉起出错 - public static final int SYSTEM_INNER_TASK_ERROR = 2189505; // 系统任务执行出错 - // 第三方接入平台错误 - public static final int THIRD_PARTY_INTERFACE_ERROR = 2199501; // 第三方接口调用错误 - public static final int THIRD_PARTY_BUILD_ENV_ERROR = 2199502; // 第三方构建环境错误 - // 插件执行错误 - public static final int PLUGIN_DEFAULT_ERROR = 2199001; // 插件异常默认 - // 用户使用错误 - public static final int USER_INPUT_INVAILD = 2199002; // 用户输入数据有误 - public static final int USER_RESOURCE_NOT_FOUND = 2199003; // 找不到对应系统资源 - public static final int USER_TASK_OPERATE_FAIL = 2199004; // 插件执行过程出错 - public static final int USER_JOB_OUTTIME_LIMIT = 2199005; // 用户Job排队超时(自行限制) - public static final int USER_TASK_OUTTIME_LIMIT = 2199006; // 用户插件执行超时(自行限制) - public static final int USER_QUALITY_CHECK_FAIL = 2199007; // 质量红线检查失败 - public static final int USER_SCRIPT_COMMAND_INVAILD = 2199009; // 脚本命令无法正常执行 - public static final int USER_STAGE_FASTKILL_TERMINATE = 2199010; // 因用户配置了FastKill导致的终止执行 - public static final int USER_SCRIPT_TASK_FAIL = 2199011; // bash脚本发生用户错误 - - private ErrorCode() { - // 私有构造函数,防止实例化 - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/FrontendTypeEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/FrontendTypeEnum.java deleted file mode 100644 index 80d9286a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/FrontendTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:FrontendTypeEnum - * @Date:2025/03/26 10:26 - * @Filename:FrontendTypeEnum - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum FrontendTypeEnum { - HISTORY("1.0"), // 历史老插件UI - NORMAL("1.1"), // 官方提供典型的插件UI配置方式 - SPECIAL("1.2"); // 定制插件UI方式 - - private final String typeVersion; - - public static FrontendTypeEnum getFrontendTypeObj(String typeVersion) { - for (FrontendTypeEnum frontendTypeEnum : values()) { - if (frontendTypeEnum.getTypeVersion().equals(typeVersion)) { - return frontendTypeEnum; - } - } - return null; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/GitPullModeType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/GitPullModeType.java deleted file mode 100644 index 3232235f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/GitPullModeType.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:GitPullModeType - * @Date:2025/03/25 17:13 - * @Filename:GitPullModeType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum GitPullModeType { - BRANCH, - TAG, - COMMIT_ID; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/JobRunCondition.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/JobRunCondition.java deleted file mode 100644 index 947594e1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/JobRunCondition.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:JobRunCondition - * @Date:2025/03/25 17:13 - * @Filename:JobRunCondition - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum JobRunCondition { - STAGE_RUNNING, - CUSTOM_VARIABLE_MATCH, - CUSTOM_VARIABLE_MATCH_NOT_RUN, - CUSTOM_CONDITION_MATCH, - PREVIOUS_STAGE_SUCCESS, - PREVIOUS_STAGE_FAILED, - PREVIOUS_STAGE_CANCEL; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ManualReviewAction.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ManualReviewAction.java deleted file mode 100644 index d05507b6..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ManualReviewAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:ManualReviewAction - * @Date:2025/03/25 17:13 - * @Filename:ManualReviewAction - * @description:Todo - */ - -@Getter -@AllArgsConstructor -public enum ManualReviewAction { - PROCESS, - ABORT; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/OSType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/OSType.java deleted file mode 100644 index de43b64d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/OSType.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:OSType - * @Date:2025/03/26 10:27 - * @Filename:OSType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum OSType { - WINDOWS, - LINUX, - MAC_OS, - OTHER; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/PipelineInstanceTypeEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/PipelineInstanceTypeEnum.java deleted file mode 100644 index d22d9616..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/PipelineInstanceTypeEnum.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:PipelineInstanceTypeEnum - * @Date:2025/03/25 17:13 - * @Filename:PipelineInstanceTypeEnum - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum PipelineInstanceTypeEnum { - FREEDOM("FREEDOM"), - CONSTRAINT("CONSTRAINT"); - - private final String type; - - @Override - public String toString() { - return type; - } - - public static String getTemplateType(String type) { - return switch (type) { - case "FREEDOM" -> PipelineInstanceTypeEnum.FREEDOM.name(); - case "CONSTRAINT" -> PipelineInstanceTypeEnum.CONSTRAINT.name(); - default -> PipelineInstanceTypeEnum.FREEDOM.name(); - }; - } - -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/PipelineStorageType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/PipelineStorageType.java deleted file mode 100644 index c4762d94..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/PipelineStorageType.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:PipelineStorageType - * @Date:2025/03/25 17:13 - * @Filename:PipelineStorageType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum PipelineStorageType { - YAML("YAML编排", ".yaml"), - MODEL("JSON编排", ".json"); - - private final String desc; - private final String fileSuffix; - - public static PipelineStorageType getActionType(String type) { - return "YAML".equals(type) ? YAML : MODEL; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/Platform.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/Platform.java deleted file mode 100644 index f7d7c0c9..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/Platform.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:Platform - * @Date:2025/03/25 17:16 - * @Filename:Platform - * @description:Todo - */ -public enum Platform { - ANDROID, - IPHONE; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ProjectPipelineCallbackStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ProjectPipelineCallbackStatus.java deleted file mode 100644 index c5674be5..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ProjectPipelineCallbackStatus.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:ProjectPipelineCallbackStatus - * @Date:2025/03/25 17:17 - * @Filename:ProjectPipelineCallbackStatus - * @description:Todo - */ -public enum ProjectPipelineCallbackStatus { - SUCCESS, - FAILED -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepoYamlSyncStatusEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepoYamlSyncStatusEnum.java deleted file mode 100644 index 44cc1722..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepoYamlSyncStatusEnum.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname RepoYamlSyncStatusEnum - * @Description TODO - * @Date 2025/4/1 20:13 - */ -@AllArgsConstructor -@Getter -public enum RepoYamlSyncStatusEnum { - // 同步中 - SYNC("SYNC"), - // 同步成功 - SUCCEED("SUCCEED"), - // 同步失败 - FAILED("FAILED"); - - private final String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepositoryConfig.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepositoryConfig.java deleted file mode 100644 index 2646d888..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepositoryConfig.java +++ /dev/null @@ -1,68 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import cd.casic.framework.commons.exception.ServerException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import lombok.extern.slf4j.Slf4j; - -import java.net.URLEncoder; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:RepositoryConfig - * @Date:2025/03/26 10:27 - * @Filename:RepositoryConfig - * @description:Todo - */ -@Data -@Slf4j -@NoArgsConstructor -@AllArgsConstructor -public class RepositoryConfig { - private String repositoryHashId; - @Schema(title = "新版的git代码库名") - private String repositoryName; - @Schema(title = "新版的git插件的类型") - private RepositoryType repositoryType; - - public RepositoryConfig(String repositoryHashId, String repositoryName, TriggerRepositoryType triggerRepositoryType, String selfRepoHashId) { - this.repositoryHashId = triggerRepositoryType == TriggerRepositoryType.SELF ? selfRepoHashId : repositoryHashId; - this.repositoryName = repositoryName; - this.repositoryType = TriggerRepositoryType.toRepositoryType(triggerRepositoryType) != null ? TriggerRepositoryType.toRepositoryType(triggerRepositoryType) : RepositoryType.ID; - } - - @JsonIgnore - public String getRepositoryId() { - switch (repositoryType) { - case ID: - if (repositoryHashId == null || repositoryHashId.isBlank()) { - throw new ServerException(-1000, "代码库HashId为空"); - } - return repositoryHashId; - case NAME: - if (repositoryName == null || repositoryName.isBlank()) { - throw new ServerException(-1000, "代码库名为空"); - } - return repositoryName; - default: - throw new ServerException(-1000, "未知的代码库类型"); - } - } - - @JsonIgnore - public String getURLEncodeRepositoryId() { - try { - return URLEncoder.encode(getRepositoryId(), "UTF-8"); - } catch (Exception e) { - throw new ServerException(-1000, "编码失败: " + e.getMessage()); - } - } - - @Override - public String toString() { - return "[repositoryHashId=" + repositoryHashId + ", repositoryName=" + repositoryName + ", repositoryType=" + repositoryType + "]"; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepositoryType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepositoryType.java deleted file mode 100644 index 947c6694..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RepositoryType.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:RepositoryType - * @Date:2025/03/26 10:29 - * @Filename:RepositoryType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum RepositoryType { - ID, - NAME; - - public static RepositoryType parseType(String type) { - if (type == null || type.isBlank()) return ID; - return RepositoryType.valueOf(type); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RequestChannelTypeEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RequestChannelTypeEnum.java deleted file mode 100644 index 7dad7f66..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/RequestChannelTypeEnum.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:RequestChannelTypeEnum - * @Date:2025/03/26 10:30 - * @Filename:RequestChannelTypeEnum - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum RequestChannelTypeEnum { - USER, - SERVICE, - BUILD, - OP, - OPEN, - API; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SVNVersion.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SVNVersion.java deleted file mode 100644 index cb1337ee..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SVNVersion.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:SVNVersion - * @Date:2025/03/25 17:24 - * @Filename:SVNVersion - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum SVNVersion { - V_1_6(10), - V_1_7(29), - V_1_8(31); - - private final int version; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ScmCode.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ScmCode.java deleted file mode 100644 index d6a8653a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ScmCode.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:ScmCode - * @Date:2025/03/26 10:30 - * @Filename:ScmCode - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum ScmCode { - GITEA("GITEA", "GITEA"), // 内部Gitea - GITHUB("GITHUB", "GITHUB"), // github - GITLAB("GITLAB", "GITLAB"); // github - - private final String scmName; - private final String value; - - public ScmType convertScmType() { - switch (this) { - case GITEA: - return ScmType.CODE_GIT; - case GITHUB: - return ScmType.GITHUB; - case GITLAB: - return ScmType.CODE_TGIT; - default: - throw new IllegalArgumentException("Unknown ScmCode: " + this); - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ScmType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ScmType.java deleted file mode 100644 index 416937c9..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/ScmType.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; - -@AllArgsConstructor -public enum ScmType { - CODE_SVN("svn"), - CODE_GIT("git"), - CODE_GITLAB("gitlab"), - GITHUB("github"), - CODE_TGIT("tgit"), - CODE_P4("p4"); - - private final String alias; - - public static Short parse(ScmType type) { - switch (type) { - case CODE_SVN: - return 1; - case CODE_GIT: - return 2; - case CODE_GITLAB: - return 3; - case GITHUB: - return 4; - case CODE_TGIT: - return 5; - case CODE_P4: - return 6; - default: - return 0; - } - } - - public static ScmType parse(String alias) { - if (alias == null || alias.isBlank()) return null; - for (ScmType scmType : values()) { - if (scmType.alias.equals(alias)) { - return scmType; - } - } - return null; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SourceType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SourceType.java deleted file mode 100644 index be926082..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SourceType.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:SourceType - * @Date:2025/03/25 17:26 - * @Filename:SourceType - * @description:Todo - */ -public enum SourceType { - PIPELINE, - CUSTOMIZE -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/StageRunCondition.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/StageRunCondition.java deleted file mode 100644 index 84774231..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/StageRunCondition.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:StageRunCondition - * @Date:2025/03/25 17:17 - * @Filename:StageRunCondition - * @description:运行选项 - */ -public enum StageRunCondition { - AFTER_LAST_FINISHED, // 上个阶段执行结束 - CUSTOM_VARIABLE_MATCH, // 自定义变量全部满足时运行 - CUSTOM_VARIABLE_MATCH_NOT_RUN, // 自定义变量全部满足时不运行 - CUSTOM_CONDITION_MATCH // 满足以下自定义条件时运行 - ; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/StartType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/StartType.java deleted file mode 100644 index cd1ccf4a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/StartType.java +++ /dev/null @@ -1,102 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import cd.casic.ci.common.pipeline.pojo.element.trigger.*; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; -import org.slf4j.LoggerFactory; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:StartType - * @Date:2025/03/25 17:23 - * @Filename:StartType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum StartType { - MANUAL, - TIME_TRIGGER, - WEB_HOOK, - SERVICE, - PIPELINE, - REMOTE; - - public static String toReadableString(String type, ChannelCode channelCode, String language) { - String[] params = null; - String name = switch (type) { - case "MANUAL" -> MANUAL.name(); - case "TIME_TRIGGER" -> TIME_TRIGGER.name(); - case "WEB_HOOK" -> WEB_HOOK.name(); - case "REMOTE" -> REMOTE.name(); - case "SERVICE" -> { - if (channelCode != null) { - if (channelCode == ChannelCode.BS) { - yield SERVICE.name() + "_BS"; - } else { - params = new String[]{channelCode.name()}; - yield SERVICE.name() + "_CHANNEL"; - } - } else { - yield SERVICE.name() + "_NOT_CHANNEL"; - } - } - case "PIPELINE" -> PIPELINE.name(); - default -> ""; - }; - - return name.isBlank() ? name : MessageFormat.format("START_TYPE_" + name, language, params); - } - - public static StartType toStartType(String type) { - for (StartType startType : values()) { - if (type.equalsIgnoreCase(startType.name())) { - return startType; - } - } - LoggerFactory.getLogger(StartType.class).warn("Unknown start type(" + type + ")"); - return MANUAL; - } - - public static List getStartTypeMap(String language) { - List result = new ArrayList<>(); - for (StartType startType : values()) { - result.add(new IdValue(startType.name(), toReadableString(startType.name(), null, language))); - } - return result; - } - - public static String transform(String startType, String webhookType) { - return switch (startType) { - case "MANUAL" -> ManualTriggerElement.classType; - case "TIME_TRIGGER" -> TimerTriggerElement.classType; - case "WEB_HOOK" -> { - yield switch (webhookType) { - case "SVN" -> CodeSVNWebHookTriggerElement.classType; - case "GIT" -> CodeGitWebHookTriggerElement.classType; - case "GITLAB" -> CodeGitlabWebHookTriggerElement.classType; - case "GITHUB" -> CodeGithubWebHookTriggerElement.classType; - case "TGIT" -> CodeTGitWebHookTriggerElement.classType; - default -> RemoteTriggerElement.classType; - }; - } - default -> RemoteTriggerElement.classType; - }; - } - - @Data - @AllArgsConstructor - static class IdValue { - private String id; - private String value; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SubjectScopeType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SubjectScopeType.java deleted file mode 100644 index 63f3686b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SubjectScopeType.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - - -/** - * @Classname SubjectScopeType - * @Description 最大授权范围类型,这里先这样,后面要扩展 - * @Date 2025/3/18 11:26 - * @author mianbin - */ -public enum SubjectScopeType { - //院、所、中心 - ORGANIZATION("organization"), - // 部门、事业部、产线 - DEPARTMENT("depart"), - // 用户 - USER("user"); - - private final String value; - - SubjectScopeType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SvnDepth.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SvnDepth.java deleted file mode 100644 index 2fd7c510..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SvnDepth.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:SvnDepth - * @Date:2025/03/25 17:24 - * @Filename:SvnDepth - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum SvnDepth { - empty, - files, - immediates, - infinity; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SystemModuleEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SystemModuleEnum.java deleted file mode 100644 index 64368195..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/SystemModuleEnum.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -/** - * @author mianbin - * @Classname SystemModuleEnum - * @Description 最大授权范围类型,这里先这样,后面要扩展 - * @Date 2025/3/18 11:26 - */ -public enum SystemModuleEnum { - COMMON("00"), // 公共模块 - PROCESS("01"), // 流水线 - ARTIFACTORY("02"), // 版本仓库 - DISPATCH("03"), // 公共模块 - DOCKERHOST("04"), // DOCKER机器 - ENVIRONMENT("05"), // 环境 - EXPERIENCE("06"), // 版本体验 - IMAGE("07"), // 镜像 - LOG("08"), // 日志 - MEASURE("09"), // 度量 - MONITORING("10"), // 监控 - NOTIFY("11"), // 通知 - OPENAPI("12"), // 开放平台API - PLUGIN("13"), // 插件 - QUALITY("14"), // 质量红线 - REPOSITORY("15"), // 代码库 - SCM("16"), // 软件配置管理 - SUPPORT("17"), // 支撑服务 - TICKET("18"), // 证书凭据 - PROJECT("19"), // 项目管理 - STORE("20"), // 商店 - AUTH("21"), // 权限 - SIGN("22"), // 签名服务 - METRICS("23"), // 度量服务 - EXTERNAL("24"), // 外部扩展 - PREBUILD("25"), // 预构建 - DISPATCH_KUBERNETES("26"), // k8s分发服务 - BUILDLESS("27"), // buildless服务 - LAMBDA("28"), // lambda服务 - STREAM("29"), // stream服务 - WORKER("30"), // 度量服务 - DISPATCH_DOCKER("31"), // docker分发服务 - REMOTEDEV("32"); // 远程开发服务 - - private final String code; - - SystemModuleEnum(String code) { - this.code = code; - } - - public String getCode() { - return code; - } - - public static String getSystemModule(String code) { - for (SystemModuleEnum value : values()) { - if (value.getCode().equals(code)) { - return value.name(); - } - } - return COMMON.name(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TaskStatusEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TaskStatusEnum.java deleted file mode 100644 index 6dd402f3..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TaskStatusEnum.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:TaskStatusEnum - * @Date:2025/03/26 10:50 - * @Filename:TaskStatusEnum - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum TaskStatusEnum { - INIT, - HANDING, - FAIL, - SUCCESS, - PENDING_ROLLBACK, - ROLLBACKING, - ROLLBACK_SUCCESS, - ROLLBACK_FAIL; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TclsType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TclsType.java deleted file mode 100644 index 41f41642..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TclsType.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:TclsType - * @Date:2025/03/25 17:24 - * @Filename:TclsType - * @description:Todo - */ - -@Getter -@AllArgsConstructor -public enum TclsType { - TCLS, - MTCLS, - MTCLS2; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TriggerRepositoryType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TriggerRepositoryType.java deleted file mode 100644 index 4357690d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/TriggerRepositoryType.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.api.enums - * @Project:ops-pro - * @name:TriggerRepositoryType - * @Date:2025/03/26 10:51 - * @Filename:TriggerRepositoryType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum TriggerRepositoryType { - ID, - NAME, - SELF, - NONE; - - public static RepositoryType toRepositoryType(TriggerRepositoryType type) { - switch (type) { - case ID: - case SELF: - return RepositoryType.ID; - case NAME: - return RepositoryType.NAME; - default: - return null; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/UserTypeEnum.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/UserTypeEnum.java deleted file mode 100644 index 508a9088..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/UserTypeEnum.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import cd.casic.framework.commons.core.IntArrayValuable; -import cn.hutool.core.util.ArrayUtil; -import lombok.AllArgsConstructor; -import lombok.Getter; -import java.util.Arrays; - -/** - * @Classname UserTypeEnum - * @Description 全局用户类型枚举 - * @Date 2025/3/18 10:16 - * @author mianbin - */ -@AllArgsConstructor -@Getter -public enum UserTypeEnum implements IntArrayValuable { - - MEMBER(1, "普通用户"), - ADMIN(2, "管理员"); - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserTypeEnum::getValue).toArray(); - - /** - * 类型 - */ - private final Integer value; - /** - * 类型名 - */ - private final String name; - - public static UserTypeEnum valueOf(Integer value) { - return ArrayUtil.firstMatch(userType -> userType.getValue().equals(value), UserTypeEnum.values()); - } - - @Override - public int[] array() { - return ARRAYS; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VMBaseOS.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VMBaseOS.java deleted file mode 100644 index 7e6f0f3a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VMBaseOS.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:VMBaseOS - * @Date:2025/03/25 17:25 - * @Filename:VMBaseOS - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum VMBaseOS { - MACOS, - LINUX, - WINDOWS, - ALL; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VMBuildResult.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VMBuildResult.java deleted file mode 100644 index da2a95e6..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VMBuildResult.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:VMBuildResult - * @Date:2025/03/25 17:25 - * @Filename:VMBuildResult - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum VMBuildResult { - SUCCEED, - FAILED, - TIMEOUT, - CANCELED; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VersionStatus.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VersionStatus.java deleted file mode 100644 index 6fdcf9e0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/enums/VersionStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.common.pipeline.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.enums - * @Project:ops-pro - * @name:VersionStatus - * @Date:2025/03/25 17:24 - * @Filename:VersionStatus - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum VersionStatus { - RELEASED("已发布版本"), - COMMITTING("草稿版本"), - BRANCH("分支版本"), - BRANCH_RELEASE("通过分支版本发布(中间态)"), - DRAFT_RELEASE("通过草稿版本发布(中间态)"), - DELETE("被删除(无法查询)"); - - private final String statusName; - - public VersionStatus fix() { - return this == BRANCH_RELEASE ? BRANCH : this == DRAFT_RELEASE ? RELEASED : this; - } - - public boolean isReleasing() { - return this == RELEASED || this == BRANCH_RELEASE || this == DRAFT_RELEASE; - } - - public boolean isNotReleased() { - return this == COMMITTING || this == BRANCH; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/extend/ModelCheckPlugin.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/extend/ModelCheckPlugin.java deleted file mode 100644 index d2e879f5..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/extend/ModelCheckPlugin.java +++ /dev/null @@ -1,84 +0,0 @@ -package cd.casic.ci.common.pipeline.extend; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.dialect.IPipelineDialect; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.atom.BeforeDeleteParam; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.framework.commons.exception.ServerException; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.extend - * @Project:ops-pro - * @name:ModelCheckPlugin - * @Date:2025/03/27 10:39 - * @Filename:ModelCheckPlugin - * @description:Todo - */ -public interface ModelCheckPlugin { - - /** - * 检查[model]编排的完整性,并返回[JobSize + ElementSize = MetaSize]所有元素数量 - * - * @param userId 操作人 - * @param oauthUser 当前流水线权限代持人 - * @param pipelineDialect 流水线方言,只有新增/编辑流水线或模版时才需要传入 - * @throws ServerException 检查失败或异常 - */ - int checkModelIntegrity( - Model model, - String projectId, - String userId, - boolean isTemplate, - String oauthUser, - IPipelineDialect pipelineDialect, - String pipelineId - ) throws ServerException; - - /** - * 检查[setting]配置的完整性 - * - * @throws ServerException 检查失败或异常 - */ - void checkSettingIntegrity(PipelineSetting setting, String projectId) throws ServerException; - - /** - * 清理Model--不删除里面的Element内的逻辑 - */ - void clearUpModel(Model model); - - /** - * 在删除element前做的一些处理 - * 对比sourceModel,并清理model中与之不同的Element - * - * @param existModel 目标Model(要清理的Model) - * @param sourceModel 源要比较的Model - */ - void beforeDeleteElementInExistsModel( - Model existModel, - Model sourceModel, - BeforeDeleteParam param - ); - - /** - * 检查[container]下的[element]插件的超时配置是否合法。 - * 如果使用了变量,则从变量表[contextMap]进行替换,如果值不符合,则抛出异常[ErrorCodeException] - */ - void checkElementTimeoutVar(Container container, Element element, Map contextMap) throws ServerException; - - /** - * 检查[container]下互斥组配置是否合法, - * 如果使用了变量,则从变量表[contextMap]进行替换,如果值不符合,则抛出异常[ErrorCodeException] - */ - void checkMutexGroup(Container container, Map contextMap) throws ServerException; - - /** - * 检查是否是[finallyStage]Stage的Job[container]下[JobControlOption]配置是否合法。 - * 如果使用了变量,则从变量表[contextMap]进行替换,如果值不符合,则抛出异常[ErrorCodeException] - */ - void checkJobCondition(Container container, boolean finallyStage, Map contextMap) throws ServerException; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/ExpressionOutput.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/ExpressionOutput.java deleted file mode 100644 index 92f29e31..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/ExpressionOutput.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.common.pipeline.functions; - -/** - * @author by mianbin - * @Classname ExpressionOutput - * @Description TODO - * @Date 2025/3/31 11:30 - */ -public interface ExpressionOutput { - void writeDebugLog(String content); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/IFunctionInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/IFunctionInfo.java deleted file mode 100644 index a32794c8..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/IFunctionInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.functions; - -import java.util.function.Function; - -/** - * @author by mianbin - * @Classname IFunctionInfo - * @Description TODO - * @Date 2025/3/31 11:12 - */ -public interface IFunctionInfo { - // Obtain the function name - String getName(); - - // Obtain the minimum number of parameters - int getMinParameters(); - - // Obtain the maximum number of parameters - int getMaxParameters(); - - // Create a Function node - Function createNode(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/INamedValueInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/INamedValueInfo.java deleted file mode 100644 index 6e71738c..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/INamedValueInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.functions; - -/** - * @author by mianbin - * @Classname INamedValueInfo - * @Description TODO - * @Date 2025/3/31 11:25 - */ -public interface INamedValueInfo { - /** - * Get the name of the named value. - * - * @return The name of the named value. - */ - String getName(); - - /** - * Create a NamedValue node. - * - * @return A new NamedValue node. - */ -// NamedValue createNode(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/Preconditions.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/Preconditions.java deleted file mode 100644 index 1ceb928c..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/functions/Preconditions.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.functions; - -import lombok.SneakyThrows; - -/** - * 前置条件校验工具类 - */ -public class Preconditions { - - public static void checkNotNull(Object obj, Exception exception) throws Exception { - if (obj == null) { - throw exception; - } - } - - @SneakyThrows - public static void checkTrue(Boolean condition, Exception exception) { - if (!condition) { - throw exception; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/DispatchInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/DispatchInfo.java deleted file mode 100644 index 0c11be94..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/DispatchInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.common.pipeline.matrix; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import lombok.Data; - - -/** - * @author by mianbin - * @Classname DispatchInfo - * @Description TODO - * @Date 2025/3/29 15:35 - */ -@Data -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "dispatchInfo", - visible = false -) -@JsonSubTypes.Type(value = SampleDispatchInfo.class, name = "SAMPLE") -public abstract class DispatchInfo { - protected String name; - - public DispatchInfo(String name) { - this.name = name; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/MatrixConfig.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/MatrixConfig.java deleted file mode 100644 index b991c517..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/MatrixConfig.java +++ /dev/null @@ -1,155 +0,0 @@ -package cd.casic.ci.common.pipeline.matrix; -import cd.casic.ci.common.pipeline.utils.YamlUtil; -import cd.casic.ci.common.pipeline.utils.MatrixContextUtils; -import cn.hutool.core.lang.Pair; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.*; - - -/** - * @author by mianbin - * @Classname MatrixConfig - * @Description TODO - * @Date 2025/3/29 15:46 - */ - - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "矩阵的分裂计算配置") -public class MatrixConfig { - @Schema(title = "分裂策略", required = true) - private Map> strategy; - @Schema(title = "额外的参数组合", required = true) - private List> include; - @Schema(title = "排除的参数组合", required = false) - private List> exclude; - - public static final String MATRIX_CONTEXT_KEY_PREFIX = "matrix."; - - /** - * 根据[strategy], [include], [exclude]矩阵参数计算最终参数组合列表 - */ - public List> getAllCombinations() { - List> combinations = new ArrayList<>(); - Pair, List>> result = calculateContextMatrix(strategy); - List keyList = result.getKey(); - List> strategyCase = result.getValue(); - combinations.addAll(strategyCase); - - // 将额外添加的参数在匹配的组合内进行追加 - List> caseToAdd = new ArrayList<>(); - if (include != null) { - for (Map includeCase : include) { - // 如果strategy为空,直接添加include - if (strategyCase.isEmpty()) { - caseToAdd.add(new HashMap<>(includeCase)); - } - // 筛选出所有与矩阵匹配的key - List matchKey = new ArrayList<>(); - for (String key : includeCase.keySet()) { - if (keyList.contains(key)) { - matchKey.add(key); - } - } - // 如果没有匹配的key则直接丢弃 - if (matchKey.isEmpty()) { - continue; - } - boolean expanded = false; - List> caseToAddTmp = new ArrayList<>(); - for (Map var : combinations) { - if (keyValueMatch(var, includeCase, matchKey)) { - // 将全匹配的额外参数直接追加到匹配的组合 - var.putAll(includeCase); - expanded = true; - } else { - // 不能全匹配的额外参数作为一个新组合加入 - caseToAddTmp.add(new HashMap<>(includeCase)); - } - } - if (!expanded) { - caseToAdd.addAll(caseToAddTmp); - } - } - } - combinations.addAll(caseToAdd); - // 计算strategy和include后,再进行组合排除 - if (exclude != null) { - combinations.removeAll(exclude); - } - - List> finalResult = new ArrayList<>(); - for (Map contextCase : combinations) { - // 临时方案:支持解析value中的一级对象访问 - Map resultCase = new HashMap<>(); - for (Map.Entry entry : contextCase.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - resultCase.put(MATRIX_CONTEXT_KEY_PREFIX + key, value); - try { - Map map = YamlUtil.to(value, new com.fasterxml.jackson.core.type.TypeReference>() { - }); - if (map != null) { - for (Map.Entry pairEntry : map.entrySet()) { - String pair = pairEntry.getKey(); - String[] split = pair.split("="); - if (split.length == 2) { - resultCase.put(MATRIX_CONTEXT_KEY_PREFIX + key + "." + split[0], split[1]); - } - } - } - } catch (Exception e) { - // 忽略解析异常 - } - } - finalResult.add(resultCase); - } - // 去重 - List> distinctResult = new ArrayList<>(); - for (Map map : finalResult) { - if (!distinctResult.contains(map)) { - distinctResult.add(map); - } - } - return distinctResult; - } - - /** - * 根据[strategyMap]矩阵生成所有参数组合列表 - */ - private Pair, List>> calculateContextMatrix(Map> strategyMap) { - if (strategyMap == null || strategyMap.isEmpty()) { - return new Pair<>(Collections.emptyList(), Collections.emptyList()); - } - List> caseList = new ArrayList<>(); - List keyList = new ArrayList<>(strategyMap.keySet()); - ArrayList> valueLists = new ArrayList<>(strategyMap.values()); - MatrixContextUtils.loopCartesianProduct(valueLists).forEach(valueList -> { - Map var = new HashMap<>(); - for (int i = 0; i < keyList.size(); i++) { - var.put(keyList.get(i), valueList.get(i).toString()); - } - caseList.add(var); - }); - return new Pair<>(keyList, caseList); - } - - /** - * 对比[case]和[includeCase]中所有匹配key[matchKey]的值是否相同 - * 出现任意不同的情况则不是全匹配 - */ - private boolean keyValueMatch(Map var, Map includeCase, List matchKey) { - for (String key : matchKey) { - if (!Objects.equals(var.get(key), includeCase.get(key))) { - return false; - } - } - return true; - } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/SampleDispatchInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/SampleDispatchInfo.java deleted file mode 100644 index 9f6cb371..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/matrix/SampleDispatchInfo.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.common.pipeline.matrix; - -import cd.casic.ci.common.pipeline.enums.VMBaseOS; -import cd.casic.ci.common.pipeline.type.DispatchType; -import lombok.EqualsAndHashCode; -import lombok.Getter; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname SampleDispatchInfo - * @Description TODO - * @Date 2025/3/29 15:44 - */ - -@Getter -@EqualsAndHashCode(callSuper = true) -public class SampleDispatchInfo extends DispatchInfo { - private final DispatchType dispatchType; - private final VMBaseOS baseOS; - private final Map buildEnv; - - public SampleDispatchInfo(String name, DispatchType dispatchType, VMBaseOS baseOS, java.util.Map buildEnv) { - super(name); - this.dispatchType = dispatchType; - this.baseOS = baseOS; - this.buildEnv = buildEnv; - } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/model/SQLLimit.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/model/SQLLimit.java deleted file mode 100644 index e4385962..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/model/SQLLimit.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.common.pipeline.model; - -import lombok.Data; - -@Data -public class SQLLimit { - private Integer offset; - private Integer limit; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/model/SQLPage.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/model/SQLPage.java deleted file mode 100644 index a3c48534..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/model/SQLPage.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.common.pipeline.model; - -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -@Data -@AllArgsConstructor -public class SQLPage { - private Long count; - private List records; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/JobControlOption.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/JobControlOption.java deleted file mode 100644 index 2967c5b9..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/JobControlOption.java +++ /dev/null @@ -1,66 +0,0 @@ -package cd.casic.ci.common.pipeline.option; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.enums.DependOnType; -import cd.casic.ci.common.pipeline.enums.JobRunCondition; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.option - * @Project:ops-pro - * @name:JobControlOption - * @Date:2025/03/25 17:59 - * @Filename:JobControlOption - * @description:Todo - */ -@Data -@Accessors(chain = true) -@Schema(title = "job流程控制模型") -@NoArgsConstructor -@AllArgsConstructor -public class JobControlOption { - @Schema(title = "是否启用Job", required = false) - private Boolean enable = true; - @Schema(title = "Job准备环境的超时时间 分钟Minutes", required = false) - private Integer prepareTimeout; - @Schema(title = "Job执行的超时时间 分钟Minutes", required = false) - private Integer timeout = 900; - @Schema(title = "新的Job执行的超时时间,支持变量 分钟Minutes,出错则取timeout的值", required = false) - private String timeoutVar; - @Schema(title = "运行条件", required = false) - private JobRunCondition runCondition = JobRunCondition.STAGE_RUNNING; - @Schema(title = "自定义变量", required = false) - private List customVariables = List.of(); - @Schema(title = "自定义条件", required = false) - private String customCondition; - @Schema(title = "job依赖", required = false) - private DependOnType dependOnType; - @Schema(title = "需要过滤不存在的job,定义为var类型", required = false) - private List dependOnId; - @Schema(title = "job依赖名称", required = false) - private String dependOnName; - @Schema(title = "containerId与jobId映射,depend on运行时使用的是containerId", required = false) - private Map dependOnContainerId2JobIds; - @Schema(title = "是否失败继续", required = false) - private Boolean continueWhenFailed = false; - @Schema(title = "第三方构建机集群-单节点并发限制") - private Integer singleNodeConcurrency; - @Schema(title = "第三方构建机集群-所有节点并发限制") - private Integer allNodeConcurrency; - - public JobControlOption(boolean enable, Integer maxRunningMinutes, String s, JobRunCondition jobRunCondition, List conditions) { - this.enable = enable; - this.prepareTimeout = maxRunningMinutes; - this.runCondition = jobRunCondition; - this.customVariables = conditions; - - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/MatrixControlOption.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/MatrixControlOption.java deleted file mode 100644 index 1f37f5ee..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/MatrixControlOption.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.common.pipeline.option; - -import cd.casic.ci.common.pipeline.matrix.DispatchInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.regex.Pattern; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.option - * @Project:ops-pro - * @name:MatrixControlOption - * @Date:2025/03/25 17:59 - * @Filename:MatrixControlOption - * @description:Todo - */ -@Data -@Schema(title = "构建矩阵配置项模型") -public class MatrixControlOption { - private static final long serialVersionUID = 1L; - - private static final Pattern MATRIX_JSON_KEY_PATTERN = Pattern.compile("^(fromJSON\\()([^)]+)\\)$"); - private static final Logger logger = LoggerFactory.getLogger(MatrixControlOption.class); - private static final int MATRIX_CASE_MAX_COUNT = 256; - - @Schema(title = "分裂策略(支持变量、Json、参数映射表)", required = true) - private String strategyStr; // Map> - - @Schema(title = "额外的参数组合(变量名到特殊值映射的数组)", required = false) - private String includeCaseStr; // List> - - @Schema(title = "排除的参数组合(变量名到特殊值映射的数组)", required = false) - private String excludeCaseStr; // List> - - @Schema(title = "是否启用容器失败快速终止整个矩阵", required = false) - private Boolean fastKill = false; - - @Schema(title = "Job运行的最大并发量", required = false) - private Integer maxConcurrency = 5; - - @Schema(title = "自定义调度类型(用于生成DispatchType的任意对象)", required = false) - private DispatchInfo customDispatchInfo; // DispatchTypeParser的传入和解析保持一致即可 - - @Schema(title = "矩阵组的总数量", required = false) - private Integer totalCount; - - @Schema(title = "完成执行的数量", required = false) - private Integer finishCount; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/StageControlOption.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/StageControlOption.java deleted file mode 100644 index 966ced95..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/option/StageControlOption.java +++ /dev/null @@ -1,64 +0,0 @@ -package cd.casic.ci.common.pipeline.option; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.enums.StageRunCondition; -import cd.casic.ci.common.pipeline.pojo.element.atom.ManualReviewParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.option - * @Project:ops-pro - * @name:StageControlOption - * @Date:2025/03/25 18:06 - * @Filename:StageControlOption - * @description:Todo - */ -@Data -@Schema(title = "阶段流程控制模型") -public class StageControlOption { - @Schema(title = "是否启用该阶段", required = false) - private Boolean enable = true; // 是否启用该阶段 - - @Schema(title = "运行条件", required = false) - private StageRunCondition runCondition = StageRunCondition.AFTER_LAST_FINISHED; // 运行条件 - - @Schema(title = "自定义变量", required = false) - private List customVariables = List.of(); // 自定义变量 - - @Schema(title = "自定义条件", required = false) - private String customCondition; // 自定义条件 - - @Schema(title = "是否人工触发", required = false) - @Deprecated - //"被StagePauseCheck.manualTrigger代替" - private Boolean manualTrigger = false; - - @Schema(title = "可触发用户,支持引用变量", required = false) - @Deprecated - //"被StagePauseCheck.reviewGroups代替" - private List triggerUsers; // 可触发用户,支持引用变量 - - @Schema(title = "已通过审核", required = false) - @Deprecated - //"被StagePauseCheck.status代替" - private Boolean triggered; // 已通过审核 - - @Schema(title = "等待审核的超时时间", required = false) - @Deprecated - //"被StagePauseCheck.timeout代替" - private Integer timeout; // 等待审核的超时时间 - - @Schema(title = "审核变量", required = false) - @Deprecated - //"被StagePauseCheck.reviewParams代替" - private List reviewParams; // 审核变量 - - @Schema(title = "审核说明", required = false) - @Deprecated - //"被StagePauseCheck.reviewDesc代替" - private String reviewDesc; // 审核说明 -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/AtomBaseInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/AtomBaseInfo.java deleted file mode 100644 index 8d93c876..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/AtomBaseInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:AtomBaseInfo - * @Date:2025/03/25 15:38 - * @Filename:AtomBaseInfo - * @description:Todo - */ -@Data -@Schema(title = "插件基本信息") -public class AtomBaseInfo { - @Schema(title = "插件Id", required = true) - private String atomId; - @Schema(title = "插件代码", required = true) - private String atomCode; - @Schema(title = "插件版本号", required = true) - private String version; - @Schema(title = "插件状态", required = true) - private String atomStatus; - @Schema(title = "插件开发语言", required = false) - private String language; - @Schema(title = "分支", required = false) - private String branch; - @Schema(title = "代码提交ID", required = false) - private String commitId; - @Schema(title = "支持的操作系统名称", required = false) - private String osName; - @Schema(title = "支持的操作系统架构", required = false) - private String osArch; - @Schema(title = "不支持的操作系统组合信息", required = false) - private String invalidOsInfo; - @Schema(title = "运行时版本", required = false) - private String runtimeVersion; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildContainerType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildContainerType.java deleted file mode 100644 index df63e362..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildContainerType.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.type.BuildType; -import cn.hutool.http.useragent.OS; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildContainerType - * @Date:2025/03/25 15:38 - * @Filename:BuildContainerType - * @description:Todo - */ -@Data -public class BuildContainerType { - private BuildType buildType; - private OS os; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildEnv.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildEnv.java deleted file mode 100644 index fa80dcfa..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildEnv.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname BuildEnv - * @Description TODO - * @Date 2025/4/1 20:50 - */ -@Data -@Schema(title = "流水线模型-构建机环境变量") -public class BuildEnv { - @Schema(title = "名称") - private final String name; - @Schema(title = "版本") - private final String version; - @Schema(title = "路径") - private final String binPath; - @Schema(title = "Home 变量") - private final Map env; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildEnvParameters.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildEnvParameters.java deleted file mode 100644 index 484a345a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildEnvParameters.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildEnvParameters - * @Date:2025/03/25 15:39 - * @Filename:BuildEnvParameters - * @description:Todo - */ -@Schema(title = "构建-变量描述") -public class BuildEnvParameters { - @Schema(title = "名称") - private String name; - @Schema(title = "描述") - private String desc; - @Schema(title = "路径") - private String path; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildFormProperty.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildFormProperty.java deleted file mode 100644 index 2b03cc06..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildFormProperty.java +++ /dev/null @@ -1,72 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildFormPropertyType; -import cd.casic.ci.common.pipeline.enums.ScmType; -import cd.casic.ci.common.pipeline.pojo.cascade.BuildCascadeProps; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildFormProperty - * @Date:2025/03/25 15:42 - * @Filename:BuildFormProperty - * @description:Todo - */ -@Data -@Schema(title = "构建模型-表单元素属性") -public class BuildFormProperty { - @Schema(title = "元素ID-标识符", required = true) - private String id; - @Schema(title = "元素名称", required = true) - private String name; - @Schema(title = "是否必须(新前端的入参标识)", required = true) - private boolean required; - @Schema(title = "是否为常量", required = true) - private boolean constant; - @Schema(title = "元素类型", required = true) - private BuildFormPropertyType type; - @Schema(title = "默认值", required = true) - private Object defaultValue; - @Schema(title = "上次构建的取值", required = true) - private Object value; - @Schema(title = "下拉框列表", required = false) - private List options; - @Schema(title = "描述", required = false) - private String desc; - @Schema(title = "repoHashId", required = false) - private String repoHashId; - @Schema(title = "relativePath", required = false) - private String relativePath; - @Schema(title = "代码库类型下拉", required = false) - private ScmType scmType; - @Schema(title = "构建机类型下拉", required = false) - private BuildContainerType containerType; - @Schema(title = "自定义仓库通配符", required = false) - private String glob; - @Schema(title = "文件元数据", required = false) - private Map properties; - @Schema(title = "元素标签", required = false) - private String label; - @Schema(title = "元素placeholder", required = false) - private String placeholder; - @Schema(title = "元素模块", required = false) - private String propertyType; - @Schema(title = "搜索url, 当是下拉框选项时,列表值从url获取不再从option获取", required = false) - private String searchUrl; - @Schema(title = "替换搜索url中的搜素关键字", required = false) - private String replaceKey; - @Schema(title = "是否只读", required = false) - private boolean readOnly; - @Schema(title = "参数值是否必填", required = false) - private boolean valueNotEmpty; - @Schema(title = "页面所需内容,后台仅保存,不做处理", required = false) - private Object payload; - @Schema(title = "级联选择器属性", required = false) - private BuildCascadeProps cascadeProps; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildFormValue.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildFormValue.java deleted file mode 100644 index 24a0ed31..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildFormValue.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildFormValue - * @Date:2025/03/25 15:44 - * @Filename:BuildFormValue - * @description:Todo - */ -@Data -@Schema(title = "构建模型-下拉框表单元素值") -@AllArgsConstructor -public class BuildFormValue { - @Schema(title = "元素值ID-标识符", required = true) - private String key; - @Schema(title = "元素值名称-显示用", required = true) - private String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildNo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildNo.java deleted file mode 100644 index e17598c6..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildNo.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildNo - * @Date:2025/03/25 15:44 - * @Filename:BuildNo - * @description:Todo - */ -@Data -public class BuildNo { - private int buildNo; - private BuildNoType buildNoType; - private boolean required; - private Integer currentBuildNo; - - public enum BuildNoType { - CONSISTENT, - SUCCESS_BUILD_INCREMENT, - EVERY_BUILD_INCREMENT - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildNoUpdateReq.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildNoUpdateReq.java deleted file mode 100644 index 940efdb6..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildNoUpdateReq.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildNoUpdateReq - * @Date:2025/03/25 15:45 - * @Filename:BuildNoUpdateReq - * @description:Todo - */ -@Data -@Schema(title = "流水线构建推荐版本号更新") -public class BuildNoUpdateReq { - @Schema(title = "推荐版本号buildNo当前值", required = true) - private int currentBuildNo; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildParameterGroup.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildParameterGroup.java deleted file mode 100644 index f13908bc..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildParameterGroup.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildParameterGroup - * @Date:2025/03/25 15:45 - * @Filename:BuildParameterGroup - * @description:Todo - */ -@Data -@Schema(title = "构建-变量描述") -public class BuildParameterGroup { - @Schema(title = "名称(国际化)") - private String name; - @Schema(title = "描述") - private List params; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildParameters.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildParameters.java deleted file mode 100644 index 0dec43e0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/BuildParameters.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildFormPropertyType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:BuildParameters - * @Date:2025/03/25 16:05 - * @Filename:BuildParameters - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "构建模型-构建参数") -public class BuildParameters { - @Schema(title = "元素值ID-标识符", required = true) - private String key; - @Schema(title = "元素值名称-显示用", required = true) - private Object value; - @Schema(title = "元素值类型", required = false) - private BuildFormPropertyType valueType; - @Schema(title = "是否只读", required = false) - private boolean readOnly; - @Schema(title = "描述", required = false) - private String desc; - @Schema(title = "默认值", required = false) - private Object defaultValue; - - public BuildParameters(String key, Object value, BuildFormPropertyType valueType, String desc, Object defaultValue) { - this.key = key; - this.value = value; - this.valueType = valueType; - this.desc = desc; - this.defaultValue = defaultValue; - } - - public BuildParameters(String key, String value) { - this.key = key; - this.value = value; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/DependOnConfig.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/DependOnConfig.java deleted file mode 100644 index 28d9dd7f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/DependOnConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.enums.DependOnType; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:DependOnConfig - * @Date:2025/03/25 16:06 - * @Filename:DependOnConfig - * @description:Todo - */ - -@Data -@AllArgsConstructor -public class DependOnConfig { - private DependOnType dependOnType; - private List dependOnId; - private String dependOnName; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/ErrorInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/ErrorInfo.java deleted file mode 100644 index 8da43925..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/ErrorInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -/** - * @author by mianbin - * @Classname ErrorInfo - * @Description TODO - * @Date 2025/3/31 15:57 - */ - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "插件错误信息") -public class ErrorInfo { - @Schema(title = "阶段ID", required = false) - private String stageId = ""; - - @Schema(title = "作业ID", required = false) - private String containerId = ""; - - @Schema(title = "构建矩阵标识", required = false) - private Boolean matrixFlag = false; - - @Schema(title = "插件ID", required = false) - private String taskId; - - @Schema(title = "插件名称", required = false) - private String taskName; - - @Schema(title = "插件编号", required = false) - private String atomCode; - - @Schema(title = "错误类型", required = false) - private Integer errorType; - - @Schema(title = "错误码", required = true) - private Integer errorCode; - - @Schema(title = "错误信息", required = false) - private String errorMsg; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/ErrorType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/ErrorType.java deleted file mode 100644 index 601a8b7d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/ErrorType.java +++ /dev/null @@ -1,57 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -import java.text.MessageFormat; - -/** - * @author by mianbin - * @Classname ErrorType - * @Description TODO - * @Date 2025/4/1 14:50 - */ -@Getter -@AllArgsConstructor -public enum ErrorType { - SYSTEM("system", 0), // 0 系统运行报错 - USER("user", 1), // 1 用户配置报错 - THIRD_PARTY("thirdParty", 2), // 2 第三方系统接入错误 - PLUGIN("plugin", 3), // 3 插件执行错误 - BUILD_MACHINE("buildMachine", 4); // 4 构建机运行报错 - - private final String typeName; - private final int num; - - public static ErrorType getErrorType(String name) { - for (ErrorType enumObj : values()) { - if (enumObj.name().equals(name)) { - return enumObj; - } - } - return null; - } - - public static ErrorType getErrorType(Integer ordinal) { - if (ordinal == null) { - return PLUGIN; - } - switch (ordinal) { - case 0: - return SYSTEM; - case 1: - return USER; - case 2: - return THIRD_PARTY; - case 4: - return BUILD_MACHINE; - default: - return PLUGIN; - } - } - - public String getI18n(String language) { - return MessageFormat.format("errorType." + this.typeName, - language); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/IdValue.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/IdValue.java deleted file mode 100644 index f8ec7ee0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/IdValue.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname IdValue - * @Description TODO - * @Date 2025/4/1 20:39 - */ -@Data -@AllArgsConstructor -public class IdValue { - private String id; - private String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/JobHeartbeatRequest.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/JobHeartbeatRequest.java deleted file mode 100644 index 5a36a3d6..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/JobHeartbeatRequest.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:JobHeartbeatRequest - * @Date:2025/03/25 16:06 - * @Filename:JobHeartbeatRequest - * @description:Todo - */ -@Data -@Schema(title = "心跳请求报文体") -public class JobHeartbeatRequest { - @Schema(title = "task执行速率", required = false) - private Map task2ProgressRate; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/MatrixPipelineInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/MatrixPipelineInfo.java deleted file mode 100644 index 0392c834..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/MatrixPipelineInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:MatrixPipelineInfo - * @Date:2025/03/25 16:06 - * @Filename:MatrixPipelineInfo - * @description:Todo - */ -@Data -public class MatrixPipelineInfo { - @Schema(title = "作为输入值时:额外的参数组合(String)/作为输出值时:校验结果", required = false) - private String include; - @Schema(title = "作为输入值时:排除的参数组合(String)/作为输出值时:校验结果", required = false) - private String exclude; - @Schema(title = "作为输入值时:分裂策略(String)/作为输出值时:校验结果", required = false) - private String strategy; - -// public Map toMatrixConvert() { -// return Map.of( -// "include", !this.include.isNullOrBlank() ? parseYaml(this.include) : null, -// "exclude", !this.exclude.isNullOrBlank() ? parseYaml(this.exclude) : null, -// "strategy", !this.strategy.isNullOrBlank() ? parseYaml(this.strategy) : null -// ); -// } -// -// private Object parseYaml(String input) { -// Pattern pattern = Pattern.compile("^(\\\$\\{\\{[ ]*fromJSON\\()([^(^)]+)(\\)[ ]*\\}\\})$"); -// if (pattern.matcher(input).find()) { -// return null; -// } -// return YamlUtil.to(input); -// } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/NamedValueInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/NamedValueInfo.java deleted file mode 100644 index 9b0b4783..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/NamedValueInfo.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.functions.INamedValueInfo; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname NamedValueInfo - * @Description TODO - * @Date 2025/3/31 11:24 - */ -@Data -@AllArgsConstructor -public class NamedValueInfo implements INamedValueInfo { - private final String name; -// private final NamedValue ob; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/OS.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/OS.java deleted file mode 100644 index 237fbe48..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/OS.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -/** - * @author by mianbin - * @Classname OS - * @Description TODO - * @Date 2025/3/31 9:57 - */ -public enum OS { - MACOS, - WINDOWS, - LINUX; - - public static OS parse(String os) { - if (os != null) { - for (OS value : OS.values()) { - if (value.name().equals(os)) { - return value; - } - } - } - return null; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/Pagination.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/Pagination.java deleted file mode 100644 index 68981386..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/Pagination.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "分页数据包装模型") -public class Pagination { - - @Schema(title = "是否有下一页", required = true) - private boolean hasNext; - - @Schema(title = "数据", required = true) - private List records; - - @Schema(title = "总记录行数", required = false) - private Long count; -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/PipelineAsCodeSettings.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/PipelineAsCodeSettings.java deleted file mode 100644 index c3a9f4bf..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/PipelineAsCodeSettings.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PipelineAsCodeSettings - * @Description TODO - * @Date 2025/4/1 20:17 - */ -@Schema(title = "设置-YAML流水线功能设置") -@Data -public class PipelineAsCodeSettings { - @Schema(title = "是否支持YAML流水线功能", required = true) - private boolean enable = false; - - @Schema(title = "项目级流水线语法风格", required = false) - private String projectDialect; - - @Schema(title = "是否继承项目流水线语言风格", required = false) - private Boolean inheritedDialect = true; - - @Schema(title = "流水线语言风格", required = false) - private String pipelineDialect; - - public static PipelineAsCodeSettings initDialect(Boolean inheritedDialect, String pipelineDialect) { - PipelineAsCodeSettings settings = new PipelineAsCodeSettings(); - settings.setInheritedDialect(inheritedDialect == null ? true : inheritedDialect); - // 如果继承项目方言配置,置空pipelineDialect字段,防止数据库存储多余数据 - settings.setPipelineDialect(settings.getInheritedDialect() ? null : pipelineDialect); - return settings; - } - - /** - * 入库时,重置方言字段值 - */ - public void resetDialect() { - this.projectDialect = null; - if (this.inheritedDialect != false) { - this.pipelineDialect = null; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/PipelineModelAndSetting.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/PipelineModelAndSetting.java deleted file mode 100644 index c0b963a1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/PipelineModelAndSetting.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import lombok.Data; -import org.springframework.ui.Model; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:PipelineModelAndSetting - * @Date:2025/03/25 16:34 - * @Filename:PipelineModelAndSetting - * @description:Todo - */ -@Data -public class PipelineModelAndSetting { - @Schema(title = "流水线模型", required = true) - private Model model; - @Schema(title = "流水线设置", required = false) - @Valid - private PipelineSetting setting; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StagePauseCheck.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StagePauseCheck.java deleted file mode 100644 index b38ba4e5..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StagePauseCheck.java +++ /dev/null @@ -1,220 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.dialect.IPipelineDialect; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.ManualReviewAction; -import cd.casic.ci.common.pipeline.option.StageControlOption; -import cd.casic.ci.common.pipeline.pojo.element.atom.ManualReviewParam; -import cd.casic.framework.commons.util.date.DateUtils; -import cn.hutool.core.util.IdUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:StagePauseCheck - * @Date:2025/03/25 16:34 - * @Filename:StagePauseCheck - * @description:Todo - */ -@Data -@Builder -@Accessors(chain = true) -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "stage准入准出配置模型") -public class StagePauseCheck { - @Schema(title = "是否人工触发", required = false) - private Boolean manualTrigger = false; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "审核说明", required = false) - private String reviewDesc; - @Schema(title = "审核流配置", required = false) - private List reviewGroups; - @Schema(title = "审核变量", required = false) - private List reviewParams; - @Schema(title = "等待审核的超时时间,默认24小时兜底", required = false) - private Integer timeout = 24; - @Schema(title = "质量红线规则ID集合", required = false) - private List ruleIds; - @Schema(title = "记录本次构建质量红线规则的检查次数", required = false) - private Integer checkTimes; - @Schema(title = "是否以markdown格式发送审核说明", required = false) - private Boolean markdownContent = false; - @Schema(title = "发送的通知类型", required = false) - private List notifyType = List.of("RTX"); - @Schema(title = "企业微信群id", required = false) - private List notifyGroup; - - /** - * 获取当前等待中的审核组 - */ - public StageReviewGroup groupToReview() { - return reviewGroups.stream() - .filter(group -> group.getStatus() == null || group.getStatus().isBlank()) - .findFirst() - .orElse(null); - } - - /** - * 判断操作用户在不在当前审核人员名单中 - */ - public boolean reviewerContains(String userId) { - return reviewGroups.stream() - .anyMatch(group -> group.getStatus() == null && group.getReviewers().contains(userId)); - } - - /** - * 审核通过当前等待中的审核组 - */ - public StageReviewGroup reviewGroup(String userId, ManualReviewAction action, String groupId, List params, String suggest) { - StageReviewGroup group = getReviewGroupById(groupId); - if (group != null && group.getStatus() == null) { - group.setStatus(action.name()); - group.setOperator(userId); - group.setReviewTime(DateUtils.LocalDateTimeToMilli(LocalDateTime.now())); - group.setSuggest(suggest); - group.setParams(parseReviewParams(params)); - if (groupToReview() == null) { - status = BuildStatus.REVIEW_PROCESSED.name(); - } else if (action == ManualReviewAction.ABORT) { - status = BuildStatus.REVIEW_ABORT.name(); - } - } - return group; - } - - /** - * 获取指定ID的审核组 - */ - public StageReviewGroup getReviewGroupById(String groupId) { - if (groupId == null || groupId.isBlank()) { - return reviewGroups.get(0); - } - return reviewGroups.stream() - .filter(group -> groupId.equals(group.getId())) - .findFirst() - .orElse(null); - } - - /** - * 初始化状态并,填充审核组ID - */ - public void fixReviewGroups(boolean init) { - reviewGroups.forEach(group -> { - if (group.getId() == null || group.getId().isBlank()) { - group.setId(IdUtil.fastSimpleUUID()); - } - if (init) { - group.setStatus(null); - group.setReviewTime(null); - group.setOperator(null); - group.setParams(null); - group.setSuggest(null); - } - }); - if (init) { - status = null; - checkTimes = null; - } - } - - /** - * 处理审核参数 - 与默认值相同的变量不显示 - */ - public List parseReviewParams(List params) { - try { - if (reviewParams == null || params == null) { - return null; - } - Map originMap = reviewParams.stream() - .collect(Collectors.toMap(ManualReviewParam::getKey, param -> param)); - List diff = new ArrayList<>(); - for (ManualReviewParam param : params) { - if (!originMap.containsKey(param.getKey())) { - continue; - } - if (!originMap.get(param.getKey()).getValue().equals(param.getValue())) { - diff.add(param); - originMap.get(param.getKey()).setValue(param.getValue()); - } - } - reviewParams.forEach(param -> param.setValue(originMap.get(param.getKey()).getValue())); - return diff; - } catch (Exception ignore) { - return null; - } - } - - /** - * 进入审核流程前完成所有审核人变量替换 - */ - public void parseReviewVariables(Map variables, IPipelineDialect dialect) { -// Map contextPair = EnvReplacementParser.getCustomExecutionContextByMap(variables); -// reviewGroups.forEach(group -> { -// if (group.getStatus() != null) { -// return; -// } -// if (!group.getReviewers().isEmpty()) { -// String reviewers = String.join(",", group.getReviewers()); -// List realReviewers = EnvReplacementParser.parse(reviewers, variables, dialect.supportUseExpression(), contextPair) -// .split(",") -// .toList(); -// group.setReviewers(realReviewers); -// } -// if (!group.getGroups().isEmpty()) { -// String groups = String.join(",", group.getGroups()); -// List realGroups = EnvReplacementParser.parse(groups, variables, dialect.supportUseExpression(), contextPair) -// .split(",") -// .toList(); -// group.setGroups(realGroups); -// } -// }); -// reviewDesc = EnvReplacementParser.parse(reviewDesc, variables, dialect.supportUseExpression(), contextPair); -// notifyGroup = notifyGroup.stream() -// .map(group -> EnvReplacementParser.parse(group, variables, dialect.supportUseExpression(), contextPair)) -// .collect(Collectors.toList()); -// reviewParams.forEach(param -> param.parseValueWithType(variables)); - } - - /** - * 重新恢复所有准入/准出状态 - */ - public void retryRefresh() { - status = null; - reviewGroups.forEach(group -> { - group.setStatus(null); - group.setParams(null); - group.setOperator(null); - group.setReviewTime(null); - group.setSuggest(null); - }); - } - - public static StagePauseCheck convertControlOption(StageControlOption stageControlOption) { - return new StagePauseCheck() - .setManualTrigger(stageControlOption.getManualTrigger()) - .setStatus(stageControlOption.getTriggered() ? BuildStatus.REVIEW_PROCESSED.name() : null) - .setReviewGroups(List.of(new StageReviewGroup() - .setId(IdUtil.fastUUID()) - .setReviewers(stageControlOption.getTriggerUsers()) - .setStatus(stageControlOption.getTriggered() ? ManualReviewAction.PROCESS.name() : null) - .setParams(stageControlOption.getReviewParams()))) - .setReviewDesc(stageControlOption.getReviewDesc()) - .setReviewParams(stageControlOption.getReviewParams()) - .setTimeout(stageControlOption.getTimeout()); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StageReviewGroup.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StageReviewGroup.java deleted file mode 100644 index 9ed9abd1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StageReviewGroup.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.pojo.element.atom.ManualReviewParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:StageReviewGroup - * @Date:2025/03/25 16:36 - * @Filename:StageReviewGroup - * @description:Todo - */ -@Data -@Accessors(chain = true) -@Schema(title = "Stage审核组信息") -public class StageReviewGroup { - @Schema(title = "审核组ID(后台生成)", required = false) - private String id; - @Schema(title = "审核组名称", required = true) - private String name = "Flow 1"; - @Schema(title = "审核人员", required = true) - private List reviewers = new ArrayList<>(); - @Schema(title = "审核用户组", required = false) - private List groups = new ArrayList<>(); - @Schema(title = "审核结果(枚举)", required = false) - private String status; - @Schema(title = "审核操作人", required = false) - private String operator; - @Schema(title = "审核操作时间", required = false) - private Long reviewTime; - @Schema(title = "审核建议", required = false) - private String suggest; - @Schema(title = "审核传入变量", required = false) - private List params; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StageReviewRequest.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StageReviewRequest.java deleted file mode 100644 index 4d29e69b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StageReviewRequest.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.pojo.element.atom.ManualReviewParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:StageReviewRequest - * @Date:2025/03/25 16:38 - * @Filename:StageReviewRequest - * @description:Todo - */ -@Data -@Schema(title = "人工审核-自定义参数审核体") -public class StageReviewRequest { - @Schema(title = "审核参数", required = true) - private List reviewParams; - @Schema(title = "审核组ID", required = false) - private String id; - @Schema(title = "审核建议", required = false) - private String suggest; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StoreInitPipelineReq.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StoreInitPipelineReq.java deleted file mode 100644 index 0b26d325..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StoreInitPipelineReq.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:StoreInitPipelineReq - * @Date:2025/03/25 16:38 - * @Filename:StoreInitPipelineReq - * @description:Todo - */ -@Data -@Schema(title = "研发商店初始化流水线请求报文体") -public class StoreInitPipelineReq { - @Schema(title = "流水线模型", required = true) - private String pipelineModel; - @Schema(title = "流水线启动参数", required = true) - private Map startParams; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StoreInitPipelineResp.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StoreInitPipelineResp.java deleted file mode 100644 index eb24e9f4..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/StoreInitPipelineResp.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:StoreInitPipelineResp - * @Date:2025/03/25 16:38 - * @Filename:StoreInitPipelineResp - * @description:Todo - */ -@Data -@Schema(title = "研发商店初始化流水线报文响应体") -public class StoreInitPipelineResp { - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "构建ID", required = false) - private String buildId; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/TemplateInstanceCreateRequest.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/TemplateInstanceCreateRequest.java deleted file mode 100644 index cad62363..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/TemplateInstanceCreateRequest.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import cd.casic.ci.common.pipeline.enums.PipelineInstanceTypeEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo - * @Project:ops-pro - * @name:TemplateInstanceCreateRequest - * @Date:2025/03/25 16:38 - * @Filename:TemplateInstanceCreateRequest - * @description:Todo - */ -@Data -public class TemplateInstanceCreateRequest { - @Schema(title = "模板ID", required = true) - private String templateId; - @Schema(title = "模板版本号(为空时默认最新)", required = true) - private Long templateVersion; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "是否使用通知配置", required = false) - private Boolean useSubscriptionSettings; - @Schema(title = "是否使用标签配置", required = false) - private Boolean useLabelSettings; - @Schema(title = "是否使用并发组配置", required = false) - private Boolean useConcurrencyGroup; - @Schema(title = "创建实例的模式", required = false) - private String instanceType = PipelineInstanceTypeEnum.FREEDOM.getType(); - @Schema(title = "是否为空模板", required = false) - private Boolean emptyTemplate; - @Schema(title = "静态流水线组", required = false) - private List staticViews = new ArrayList<>(); - @Schema(title = "是否继承项目流水线语言风格", required = false) - private Boolean inheritedDialect = true; - @Schema(title = "流水线语言风格", required = false) - private String pipelineDialect; - @Schema(title = "流水线标签", required = false) - private List labels = new ArrayList<>(); -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/Zone.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/Zone.java deleted file mode 100644 index 8556e7ad..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/Zone.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname Zone - * @Description TODO - * @Date 2025/4/1 19:47 - */ -@Getter -@AllArgsConstructor -public enum Zone { - DEFAULT("默认"), - ERYUAN("二院"), - SHANGHAI("上海"), - CHENGDU("成都"), - CHANGSHA("长沙"), - GITHUB("GitHub"), - GITEE("Gitee"), - EXTERNAL("外网"); - - private final String name; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentArchType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentArchType.java deleted file mode 100644 index acf39b7b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentArchType.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname AgentArchType - * @Description TODO - * @Date 2025/4/8 19:25 - */ -@Getter -@AllArgsConstructor -public enum AgentArchType { - ARM64("arm64"), - MIPS64("mips64"), - AMD64("amd64"); - - private final String arch; - - public static AgentArchType parse(String arch) { - if (AMD64.arch.equals(arch)) { - return AMD64; - } - if (ARM64.arch.equals(arch)) { - return ARM64; - } - if (MIPS64.arch.equals(arch)) { - return MIPS64; - } - return null; - } -} - diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentErrorExitData.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentErrorExitData.java deleted file mode 100644 index 99cce0bd..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentErrorExitData.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname AgentErrorExitData - * @Description TODO - * @Date 2025/4/8 19:27 - */ -@Data -@AllArgsConstructor -public class AgentErrorExitData { - private final String errorEnum; - private final String message; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentPropsInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentPropsInfo.java deleted file mode 100644 index 2b99a1c2..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentPropsInfo.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @author by mianbin - * @Classname AgentPropsInfo - * @Description TODO - * @Date 2025/4/8 19:28 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Schema(name = "Agent属性信息") -public class AgentPropsInfo { - @Schema(description = "agent运行系统的架构信息") - private String arch; - - @Schema(description = "jdk版本信息") - private List jdkVersion; - - @Schema(description = "docker init 文件升级信息") - private DockerInitFileInfo dockerInitFileInfo; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentType.java deleted file mode 100644 index b25b15c2..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/AgentType.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type.agent - * @Project:ops-pro - * @name:AgentType - * @Date:2025/03/27 10:47 - * @Filename:AgentType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum AgentType { - ID, // This is only for old pipeline, new pipelines will use name - NAME, - REUSE_JOB_ID; // 是否复用其他job的Agent节点 - - public boolean isReuse() { - return this == REUSE_JOB_ID; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/Credential.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/Credential.java deleted file mode 100644 index 6ae5db37..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/Credential.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Getter; -import lombok.Setter; - -/** - * @author by mianbin - * @Classname Credential - * @Description TODO - * @Date 2025/4/8 16:30 - */ -@Getter -@Setter -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class Credential { - private String user; - private String password; - private String credentialId; - private String acrossTemplateId; - private String jobId; - private String credentialProjectId; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/DockerInitFileInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/DockerInitFileInfo.java deleted file mode 100644 index 6b5a5d86..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/DockerInitFileInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname DockerInitFileInfo - * @Description TODO - * @Date 2025/4/8 19:30 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Schema(name = "docker init 文件升级信息") -public class DockerInitFileInfo { - @Schema(description = "文件md5值") - private String fileMd5; - @Schema(description = "目前只支持linux机器,所以其他系统不需要检查") - private boolean needUpgrade; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/DockerOptions.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/DockerOptions.java deleted file mode 100644 index a8e4c4ff..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/DockerOptions.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Getter; -import lombok.Setter; - -import java.util.List; - -/** - * @author by mianbin - * @Classname DockerOptions - * @Description TODO - * @Date 2025/4/8 16:30 - */ -@Getter -@Setter -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class DockerOptions { - private List volumes; - private List mounts; - private String gpus; - private Boolean privileged; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/NewHeartbeatInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/NewHeartbeatInfo.java deleted file mode 100644 index 763dbc97..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/NewHeartbeatInfo.java +++ /dev/null @@ -1,79 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.assertj.core.util.Lists; - -import java.util.List; - -/** - * @author by mianbin - * @Classname NewHeartbeatInfo - * @Description TODO - * @Date 2025/4/8 19:31 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Schema(name = "心跳信息模型") -public class NewHeartbeatInfo { - @Schema(description = "主版本") - private String masterVersion; - @Schema(description = "从属版本") - private String slaveVersion; - @Schema(description = "主机名") - private String hostName; - @Schema(description = "构建机模型") - private String agentIp; - @Schema(description = "并行任务计数") - private int parallelTaskCount; - @Schema(description = "构建机安装路径") - private String agentInstallPath; - @Schema(description = "启动者") - private String startedUser; - @Schema(description = "第三方构建信息列表") - private List taskList; - @Schema(description = "Agent属性信息") - private AgentPropsInfo props; - @Schema(description = "构建机id") - private Long agentId; - @Schema(description = "项目id") - private String projectId; - @Schema(description = "心跳时间戳") - private Long heartbeatTime; - @Schema(description = "忙碌运行中任务数量") - @Builder.Default - private int busyTaskSize = 0; - @Schema(description = "docker并行任务计数") - private Integer dockerParallelTaskCount; - @Schema(description = "docker构建信息列表") - private List dockerTaskList; - @Schema(description = "忙碌运行docker中任务数量") - @Builder.Default - private int dockerBusyTaskSize = 0; - @Schema(description = "Agent退出的错误信息") - private AgentErrorExitData errorExitData; - - public static NewHeartbeatInfo dummyHeartbeat(String projectId, Long agentId) { - return NewHeartbeatInfo.builder() - .masterVersion("") - .slaveVersion("") - .hostName("") - .agentIp("") - .parallelTaskCount(0) - .agentInstallPath("") - .startedUser("") - .taskList(Lists.emptyList()) - .props(new AgentPropsInfo("", null, null)) - .agentId(agentId) - .projectId(projectId) - .heartbeatTime(System.currentTimeMillis()) - .dockerParallelTaskCount(0) - .dockerTaskList(List.of()) - .build(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDispatch.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDispatch.java deleted file mode 100644 index c32c1ced..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDispatch.java +++ /dev/null @@ -1,64 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import cd.casic.ci.common.pipeline.type.DispatchType; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.Getter; -import lombok.Setter; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type.agent - * @Project:ops-pro - * @name:ThirdPartyAgentDispatch - * @Date:2025/03/27 10:47 - * @Filename:ThirdPartyAgentDispatch - * @description:Todo - */ -@Getter -@Setter -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public abstract class ThirdPartyAgentDispatch extends DispatchType { - private String value; - private AgentType agentType; - private String workspace; - private ThirdPartyAgentDockerInfo dockerInfo; - private ReusedInfo reusedInfo; - - - public boolean idType() { - return (agentType == AgentType.ID) || (reusedInfo != null && reusedInfo.getAgentType() == AgentType.ID) || - (agentType == AgentType.REUSE_JOB_ID && reusedInfo == null); - } - - public boolean hasReuseMutex() { - return this.agentType.isReuse() || this.reusedInfo != null; - } - - public boolean isEnv() { - return this instanceof ThirdPartyAgentEnvDispatchType; - } - - public boolean isSingle() { - return this instanceof ThirdPartyAgentIDDispatchType; - } - - @Override - public abstract void replaceField(Map variables); - - @Override - public abstract void cleanDataBeforeSave(); - - @Data - @AllArgsConstructor - @JsonIgnoreProperties(ignoreUnknown = true) - class ReusedInfo { - private final String value; - private final AgentType agentType; - private final String jobId; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfo.java deleted file mode 100644 index c1c47443..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import cd.casic.ci.common.pipeline.type.docker.ImageType; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Getter; -import lombok.Setter; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type.agent - * @Project:ops-pro - * @name:ThirdPartyAgentDockerInfo - * @Date:2025/03/27 10:47 - * @Filename:ThirdPartyAgentDockerInfo - */ -@Getter -@Setter -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ThirdPartyAgentDockerInfo { - private String image; - private Credential credential; - private DockerOptions options; - private String imagePullPolicy; - private ImageType imageType = ImageType.THIRD; - private ThirdPartyAgentDockerInfoStoreImage storeImage; - - public void replaceField(Map variables) { - image = EnvUtils.parseEnv(image, variables); - if (credential != null) { - if (!credential.getUser().isBlank()) { - credential.setUser(EnvUtils.parseEnv(credential.getUser(), variables)); - } - if (!credential.getPassword().isBlank()) { - credential.setPassword(EnvUtils.parseEnv(credential.getPassword(), variables)); - } - if (!credential.getCredentialId().isBlank()) { - credential.setCredentialId(EnvUtils.parseEnv(credential.getCredentialId(), variables)); - } - } - if (options != null) { - options.setVolumes(options.getVolumes().stream().map(v -> EnvUtils.parseEnv(v, variables)).toList()); - options.setMounts(options.getMounts().stream().map(m -> EnvUtils.parseEnv(m, variables)).toList()); - options.setGpus(EnvUtils.parseEnv(options.getGpus(), variables)); - options.setPrivileged(Boolean.parseBoolean(EnvUtils.parseEnv(String.valueOf(options.getPrivileged()), variables))); - } - if (imagePullPolicy != null) { - imagePullPolicy = EnvUtils.parseEnv(imagePullPolicy, variables); - } - } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfoDispatch.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfoDispatch.java deleted file mode 100644 index b7a65c86..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfoDispatch.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Getter; -import lombok.Setter; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentDockerInfoDispatch - * @Description TODO - * @Date 2025/4/8 16:31 - */ -@Getter -@Setter -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ThirdPartyAgentDockerInfoDispatch { - private String agentId; - private String secretKey; - private String image; - private Credential credential; - private DockerOptions options; - private String imagePullPolicy; - - public ThirdPartyAgentDockerInfoDispatch(String agentId, String secretKey, ThirdPartyAgentDockerInfo info) { - this.agentId = agentId; - this.secretKey = secretKey; - this.image = info.getImage(); - this.credential = info.getCredential(); - this.options = info.getOptions(); - this.imagePullPolicy = info.getImagePullPolicy(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfoStoreImage.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfoStoreImage.java deleted file mode 100644 index ddddb8b3..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentDockerInfoStoreImage.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Getter; -import lombok.Setter; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentDockerInfoStoreImage - * @Description TODO - * @Date 2025/4/8 16:31 - */ -@Getter -@Setter -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ThirdPartyAgentDockerInfoStoreImage { - private String imageName; - private String imageCode; - private String imageVersion; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentEnvDispatchType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentEnvDispatchType.java deleted file mode 100644 index c29fd1c8..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentEnvDispatchType.java +++ /dev/null @@ -1,63 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import cd.casic.ci.common.pipeline.type.BuildType; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Getter; -import lombok.Setter; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type.agent - * @Project:ops-pro - * @name:ThirdPartyAgentEnvDispatchType - * @Date:2025/03/27 10:48 - * @Filename:ThirdPartyAgentEnvDispatchType - * @description:Todo - */ -@Getter -@Setter -public class ThirdPartyAgentEnvDispatchType extends ThirdPartyAgentDispatch { - @JsonProperty("value") - private String envName; - private String workspace; - private String envProjectId; - private AgentType agentType = AgentType.NAME; - private ThirdPartyAgentDockerInfo dockerInfo; - private ReusedInfo reusedInfo; - - public ThirdPartyAgentEnvDispatchType(String envName, String workspace, String envProjectId, ThirdPartyAgentDockerInfo dockerInfo, ReusedInfo reusedInfo) { - super(envName, AgentType.NAME, workspace, dockerInfo, reusedInfo); - this.envName = envName; - this.workspace = workspace; - this.envProjectId = envProjectId; - this.dockerInfo = dockerInfo; - this.reusedInfo = reusedInfo; - } - - @Override - public void cleanDataBeforeSave() { - this.envName = this.envName.trim(); - this.envProjectId = this.envProjectId != null ? this.envProjectId.trim() : null; - this.workspace = this.workspace != null ? this.workspace.trim() : null; - } - - @Override - public void replaceField(Map variables) { - envName = EnvUtils.parseEnv(envName, variables); - envProjectId = EnvUtils.parseEnv(envProjectId, variables); - if (workspace != null && !workspace.isBlank()) { - workspace = EnvUtils.parseEnv(workspace, variables); - } - if (dockerInfo != null) { - dockerInfo.replaceField(variables); - } - } - - @Override - public BuildType buildType() { - return BuildType.THIRD_PARTY_AGENT_ENV; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentIDDispatchType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentIDDispatchType.java deleted file mode 100644 index a2587573..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentIDDispatchType.java +++ /dev/null @@ -1,59 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import cd.casic.ci.common.pipeline.type.BuildType; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Getter; -import lombok.Setter; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type.agent - * @Project:ops-pro - * @name:ThirdPartyAgentIDDispatchType - * @Date:2025/03/27 10:48 - * @Filename:ThirdPartyAgentIDDispatchType - * @description:Todo - */ -@Getter -@Setter -public class ThirdPartyAgentIDDispatchType extends ThirdPartyAgentDispatch { - @JsonProperty("value") - private String displayName; - private String workspace; - private AgentType agentType = AgentType.NAME; - private ThirdPartyAgentDockerInfo dockerInfo; - private ReusedInfo reusedInfo; - - public ThirdPartyAgentIDDispatchType(String displayName, String workspace, ThirdPartyAgentDockerInfo dockerInfo, ReusedInfo reusedInfo) { - super(displayName, AgentType.NAME, workspace, dockerInfo, reusedInfo); - this.displayName = displayName; - this.workspace = workspace; - this.dockerInfo = dockerInfo; - this.reusedInfo = reusedInfo; - } - - @Override - public void cleanDataBeforeSave() { - this.displayName = this.displayName.trim(); - this.workspace = this.workspace != null ? this.workspace.trim() : null; - } - - @Override - public void replaceField(Map variables) { - displayName = EnvUtils.parseEnv(displayName, variables); - if (workspace != null && !workspace.isBlank()) { - workspace = EnvUtils.parseEnv(workspace, variables); - } - if (dockerInfo != null) { - dockerInfo.replaceField(variables); - } - } - - @Override - public BuildType buildType() { - return BuildType.THIRD_PARTY_AGENT_ID; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentUpgradeByVersionInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentUpgradeByVersionInfo.java deleted file mode 100644 index d1dd0e7d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyAgentUpgradeByVersionInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentUpgradeByVersionInfo - * @Description TODO - * @Date 2025/4/9 10:58 - */ -@Data -public class ThirdPartyAgentUpgradeByVersionInfo { - @Schema(description = "worker版本") - private String workerVersion; - - @Schema(description = "go agent 版本") - private String goAgentVersion; - - @Schema(description = "jdk版本") - private List jdkVersion; - - @Schema(description = "docker init 文件升级信息") - private DockerInitFileInfo dockerInitFileInfo; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyBuildInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyBuildInfo.java deleted file mode 100644 index cb0f664b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyBuildInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyBuildInfo - * @Description TODO - * @Date 2025/4/8 19:41 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Schema(name = "第三方构建信息") -public class ThirdPartyBuildInfo { - @Schema(description = "项目id") - private String projectId; - @Schema(description = "构建id") - private String buildId; - @Schema(description = "构建机编排序号") - private String vmSeqId; - @Schema(description = "工作空间") - private String workspace; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyDockerBuildInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyDockerBuildInfo.java deleted file mode 100644 index 397b83c9..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/ThirdPartyDockerBuildInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyDockerBuildInfo - * @Description TODO - * @Date 2025/4/8 19:42 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Schema(name = "第三方构建Docker信息") -public class ThirdPartyDockerBuildInfo { - @Schema(description = "项目id") - private String projectId; - @Schema(description = "构建id") - private String buildId; - @Schema(description = "构建机编排序号") - private String vmSeqId; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/UpgradeItem.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/UpgradeItem.java deleted file mode 100644 index f9c37dec..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/agent/UpgradeItem.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.agent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname UpgradeItem - * @Description TODO - * @Date 2025/4/8 19:42 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Schema(name = "需要升级的项") -public class UpgradeItem { - @Schema(description = "升级go agent") - private boolean agent; - - @Schema(description = "升级worker") - private boolean worker; - - @Schema(description = "升级jdk") - private boolean jdk; - - @Schema(description = "升级docker init 脚本") - private boolean dockerInitFile; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/auth/ProjectConditionDTO.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/auth/ProjectConditionDTO.java deleted file mode 100644 index 6ab3ad70..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/auth/ProjectConditionDTO.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.auth; - - -import cd.casic.ci.common.pipeline.enums.AuthSystemType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "筛选项目条件实体") -public class ProjectConditionDTO { - - @Schema(title = "中心ID") - private Long centerId; - - @Schema(title = "部门ID") - private Long deptId; - - @Schema(title = "bgId") - private Long bgId; - - @Schema(title = "bg列表") - private List bgIdList; - - @Schema(title = "项目创建人") - private String projectCreator; - - @Schema(title = "排除项目code") - private List excludedProjectCodes; - - @Schema(title = "项目ID列表") - private List projectCodes; - - @Schema(title = "资源类型") - private String resourceType; - - @Schema(title = "路由tag") - private AuthSystemType routerTag; - - @Schema(title = "是否包含router_tag为null") - private Boolean includeNullRouterTag = false; - - @Schema(title = "是否关联产品") - private Boolean relatedProduct; - - @Schema(title = "排除创建时间大于该值的项目") - private String excludedCreateTime; - - @Schema(title = "是否启用") - private Boolean enabled; - - @Schema(title = "渠道代码") - private String channelCode; - - @Schema(title = "remoteDev相关") - private Boolean queryRemoteDevFlag; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/BuildCascadeProps.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/BuildCascadeProps.java deleted file mode 100644 index 66449340..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/BuildCascadeProps.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.cascade; - -import cd.casic.ci.common.pipeline.pojo.BuildFormValue; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.cascade - * @Project:ops-pro - * @name:BuildCascadeProps - * @Date:2025/03/26 10:04 - * @Filename:BuildCascadeProps - * @description:Todo - */ -@Data -@Schema(title = "构建模型-表单元素属性") -@AllArgsConstructor -public class BuildCascadeProps { - // 级联ID - private String id; - // 级联下拉框值 - private List options; - // 后端搜索url - private String searchUrl; - // 搜索key - private String replaceKey; - // 级联子级 - private BuildCascadeProps children; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/CascadeParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/CascadeParam.java deleted file mode 100644 index c0a2e120..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/CascadeParam.java +++ /dev/null @@ -1,67 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.cascade; - -import cd.casic.ci.common.pipeline.enums.BuildFormPropertyType; -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.utils.CascadePropertyUtils; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.cascade - * @Project:ops-pro - * @name:CascadeParam - * @Date:2025/03/26 10:05 - * @Filename:CascadeParam - * @description:Todo - */ - -@Data -@Slf4j -@AllArgsConstructor -public abstract class CascadeParam { - private final BuildFormPropertyType type; - private final List chain; - - public BuildCascadeProps getProps(BuildFormProperty prop, String projectId) { - if (chain.size() < 2 || chain.size() != chainHandler().size()) { - // 最少两个链路节点,且节点数和链式处理器数量相等 - throw new IllegalArgumentException("chain size must be 2 and equal to chainHandler size"); - } - Map defaultValue = getDefaultValue(prop); - Map map = new HashMap<>(); - for (String key : chain) { - CascadeParamPropsHandler propsHandler = chainHandler().get(key); - if (propsHandler == null) { - throw new IllegalArgumentException("can not find handler for " + key + "|" + type); - } - map.put(key, propsHandler.handle(key, defaultValue.getOrDefault(key, ""), projectId)); - } - // 链式关系处理 - for (int i = chain.size() - 1; i > 0; i--) { - map.get(chain.get(i - 1)).setChildren(map.get(chain.get(i))); - } - return map.get(chain.get(0)); - } - - private Map getDefaultValue(BuildFormProperty prop) { - Map defaultValue = CascadePropertyUtils.parseDefaultValue(prop.getId(), prop.getDefaultValue(), prop.getType()); - return chain.stream().allMatch(defaultValue::containsKey) ? defaultValue : Collections.emptyMap(); - } - - public abstract Map chainHandler(); - - public interface CascadeParamPropsHandler { - BuildCascadeProps handle(String key, String defaultValue, String projectId); - } - - private static final Logger logger = LoggerFactory.getLogger(CascadeParam.class); -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/RepoRefCascadeParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/RepoRefCascadeParam.java deleted file mode 100644 index 01d1c212..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/cascade/RepoRefCascadeParam.java +++ /dev/null @@ -1,82 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.cascade; - -import cd.casic.ci.common.pipeline.enums.BuildFormPropertyType; -import cd.casic.ci.common.pipeline.enums.ScmType; -import cd.casic.ci.common.pipeline.pojo.BuildFormValue; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.cascade - * @Project:ops-pro - * @name:RepoRefCascadeParam - * @Date:2025/03/26 10:06 - * @Filename:RepoRefCascadeParam - * @description:Todo - */ - -public class RepoRefCascadeParam extends CascadeParam { - public static final String SELECTOR_KEY_REPO_NAME = "repo-name"; - public static final String SELECTOR_KEY_BRANCH = "branch"; - private static final List SUPPORT_REPO_TYPE = Arrays.asList( - ScmType.CODE_GIT, - ScmType.GITHUB, - ScmType.CODE_SVN, - ScmType.CODE_TGIT, - ScmType.CODE_GITLAB - ); - - public RepoRefCascadeParam() { - super(BuildFormPropertyType.REPO_REF, Arrays.asList(SELECTOR_KEY_REPO_NAME, SELECTOR_KEY_BRANCH)); - } - - @Override - public Map chainHandler() { - return Map.of( - SELECTOR_KEY_REPO_NAME, repoNameHandler(), - SELECTOR_KEY_BRANCH, branchHandler() - ); - } - - private CascadeParamPropsHandler repoNameHandler() { - return (key, defaultValue, projectId) -> { - String repositoryTypes = SUPPORT_REPO_TYPE.stream().map(Enum::name).collect(Collectors.joining(",")); - return new BuildCascadeProps( - key, - Collections.singletonList(new BuildFormValue(defaultValue, defaultValue)), - "process/api/user/buildParam/repository/" + projectId + "/aliasName?aliasName={words}&permission=LIST&repositoryType=" + repositoryTypes, - "{words}", - null - ); - }; - } - - private CascadeParamPropsHandler branchHandler() { - return (key, defaultValue, projectId) -> new BuildCascadeProps( - key, - Collections.singletonList(new BuildFormValue(defaultValue, defaultValue)), - "/process/api/user/buildParam/" + projectId + "/repository/refs?search={branch}&repositoryType=NAME&repositoryId={parentValue}", - "{branch}", - null - ); - } - - public static Map variableKeyMap(String key) { - return Map.of( - SELECTOR_KEY_REPO_NAME, key + "." + SELECTOR_KEY_REPO_NAME, - SELECTOR_KEY_BRANCH, key + "." + SELECTOR_KEY_BRANCH - ); - } - - public static Map defaultValue() { - return Map.of( - SELECTOR_KEY_REPO_NAME, "", - SELECTOR_KEY_BRANCH, "" - ); - } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/Element.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/Element.java deleted file mode 100644 index d5b91cf4..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/Element.java +++ /dev/null @@ -1,187 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element; - -import cd.casic.ci.common.pipeline.IModelTemplate; -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.pojo.element.agent.*; -import cd.casic.ci.common.pipeline.pojo.element.market.MarketBuildAtomElement; -import cd.casic.ci.common.pipeline.pojo.element.market.MarketBuildLessAtomElement; -import cd.casic.ci.common.pipeline.pojo.element.market.MarketCheckImageElement; -import cd.casic.ci.common.pipeline.pojo.element.matrix.MatrixStatusElement; -import cd.casic.ci.common.pipeline.pojo.element.quality.QualityGateInElement; -import cd.casic.ci.common.pipeline.pojo.element.quality.QualityGateOutElement; -import cd.casic.ci.common.pipeline.pojo.element.trigger.*; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import cd.casic.ci.common.pipeline.pojo.transfer.PreStep; -import cd.casic.ci.common.pipeline.utils.ElementUtils; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element - * @Project:ops-pro - * @name:Element - * @Date:2025/03/26 16:17 - * @Filename:Element - * @description:Todo - */ - -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "@type", - defaultImpl = EmptyElement.class -) -@JsonSubTypes({ - @JsonSubTypes.Type(value = MatrixStatusElement.class, name = MatrixStatusElement.classType), - @JsonSubTypes.Type(value = CodeGitWebHookTriggerElement.class, name = CodeGitWebHookTriggerElement.classType), - @JsonSubTypes.Type(value = CodeGitlabWebHookTriggerElement.class, name = CodeGitlabWebHookTriggerElement.classType), - @JsonSubTypes.Type(value = CodeSVNWebHookTriggerElement.class, name = CodeSVNWebHookTriggerElement.classType), - @JsonSubTypes.Type(value = CodeGithubWebHookTriggerElement.class, name = CodeGithubWebHookTriggerElement.classType), - @JsonSubTypes.Type(value = CodeGitElement.class, name = CodeGitElement.classType), - @JsonSubTypes.Type(value = CodeGitlabElement.class, name = CodeGitlabElement.classType), - @JsonSubTypes.Type(value = GithubElement.class, name = GithubElement.classType), - @JsonSubTypes.Type(value = CodeSvnElement.class, name = CodeSvnElement.classType), - @JsonSubTypes.Type(value = LinuxScriptElement.class, name = LinuxScriptElement.classType), - @JsonSubTypes.Type(value = WindowsScriptElement.class, name = WindowsScriptElement.classType), - @JsonSubTypes.Type(value = ManualTriggerElement.class, name = ManualTriggerElement.classType), - @JsonSubTypes.Type(value = RemoteTriggerElement.class, name = RemoteTriggerElement.classType), - @JsonSubTypes.Type(value = TimerTriggerElement.class, name = TimerTriggerElement.classType), - @JsonSubTypes.Type(value = ManualReviewUserTaskElement.class, name = ManualReviewUserTaskElement.classType), - @JsonSubTypes.Type(value = SubPipelineCallElement.class, name = SubPipelineCallElement.classType), - @JsonSubTypes.Type(value = MarketBuildAtomElement.class, name = MarketBuildAtomElement.classType), - @JsonSubTypes.Type(value = MarketBuildLessAtomElement.class, name = MarketBuildLessAtomElement.classType), - @JsonSubTypes.Type(value = MarketCheckImageElement.class, name = MarketCheckImageElement.classType), - @JsonSubTypes.Type(value = QualityGateInElement.class, name = QualityGateInElement.classType), - @JsonSubTypes.Type(value = QualityGateOutElement.class, name = QualityGateOutElement.classType), - @JsonSubTypes.Type(value = CodeTGitWebHookTriggerElement.class, name = CodeTGitWebHookTriggerElement.classType), - @JsonSubTypes.Type(value = CodeP4WebHookTriggerElement.class, name = CodeP4WebHookTriggerElement.classType) -}) -@NoArgsConstructor -@Data -@Schema(title = "Element 基类") -public abstract class Element implements IModelTemplate { - @Schema(title = "任务名称", required = false) - private String name; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private String status; - @Schema(title = "执行次数(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private int executeCount = 1; - @Schema(title = "是否重试(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private Boolean canRetry; - @Schema(title = "是否跳过(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private Boolean canSkip; - @Schema(title = "执行时间(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private Long elapsed;//"即将被timeCost代替" - @Schema(title = "启动时间(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private Long startEpoch;//"即将被timeCost代替" - @Schema(title = "插件原始版本(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private String originVersion; - @Schema(title = "插件版本", required = true) - private String version = "1.*"; - @Schema(title = "模板对比的时候是不是有变更(temporary field)", required = false) - private Boolean templateModify; - @Schema(title = "附加参数", required = false) - private ElementAdditionalOptions additionalOptions; - @Schema(title = "用户自定义ID,用于上下文键值设置", required = false) - private String stepId; - @Schema(title = "各项耗时", required = true) - private BuildRecordTimeCost timeCost; - @Schema(title = "用户自定义环境变量(插件运行时写入环境)", required = false) - private List customEnv; - @Schema(title = "错误类型(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private String errorType; - @Schema(title = "错误代码(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private Integer errorCode; - @Schema(title = "错误信息(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private String errorMsg; - @Schema(title = "插件名称,构建结束后的快照名称(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private String atomName; - @Schema(title = "所属插件分类代码(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private String classifyCode; - @Schema(title = "所属插件分类名称(仅在运行构建时有用的中间参数,不要在编排保存阶段设置值)", required = false) - private String classifyName; - @Schema(title = "任务运行进度", required = false) - private Double progressRate; - private String template; - private String ref; - private Map variables; - private String asyncStatus; - - public String getAtomCode() { - return getClassType(); - } - - public abstract String getClassType(); - - public String getTaskAtom() { - return ""; - } - - public Map genTaskParams() { - return JSONUtil.parseObj(this).toBean(Map.class); - } - - public void cleanUp() { - } - - public PreStep transferYaml(JSONObject defaultValue) { - return null; - } - - public boolean elementEnabled() { - return additionalOptions == null || additionalOptions.isEnable(); - } - - public void transformCompatibility() { - if (additionalOptions != null && (additionalOptions.getTimeoutVar() == null || additionalOptions.getTimeoutVar().isBlank())) { - additionalOptions.setTimeoutVar(String.valueOf(additionalOptions.getTimeout())); - } - } - - public String findFirstTaskIdByStartType(StartType startType) { - return ""; - } - - public BuildStatus initStatus(boolean rerun) { - if (!elementEnabled()) { - return BuildStatus.SKIP; - } else if (rerun) { - return BuildStatus.QUEUE; - } else if (status != null && status.equals(BuildStatus.SKIP.name())) { - return BuildStatus.SKIP; - } else { - return BuildStatus.QUEUE; - } - } - - public void disableBySkipVar(Map variables) { - ElementPostInfo elementPostInfo = additionalOptions != null ? additionalOptions.getElementPostInfo() : null; - boolean postFlag = elementPostInfo != null; - String elementId = postFlag ? elementPostInfo.getParentElementId() : id; - if (variables.get(ElementUtils.getSkipElementVariableName(elementId)) != null && "true".equals(variables.get(ElementUtils.getSkipElementVariableName(elementId)))) { - if (additionalOptions == null) { - ElementAdditionalOptions elementAdditionalOptions = new ElementAdditionalOptions(); - elementAdditionalOptions.setRunCondition(ElementAdditionalOptions.RunCondition.PRE_TASK_SUCCESS); - additionalOptions = elementAdditionalOptions; - } - additionalOptions.setEnable(false); - } - } - - public Map initTaskVar() { - return new java.util.HashMap<>(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementAdditionalOptions.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementAdditionalOptions.java deleted file mode 100644 index 849a43bc..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementAdditionalOptions.java +++ /dev/null @@ -1,84 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element; - -import cd.casic.ci.common.pipeline.NameAndValue; -import com.fasterxml.jackson.annotation.JsonIgnore; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element - * @Project:ops-pro - * @name:ElementAdditionalOptions - * @Date:2025/03/26 16:24 - * @Filename:ElementAdditionalOptions - * @description:Todo - */ -@Data -@Schema(title = "插件级别流程控制模型") -@AllArgsConstructor -@NoArgsConstructor -public class ElementAdditionalOptions { - @Schema(title = "是否启用", required = false) - private boolean enable = true; - @Schema(title = "是否失败时继续", required = false) - private boolean continueWhenFailed = false; - @Schema(title = "是否出现跳过按钮(手动继续)", required = false) - private Boolean manualSkip; - @Schema(title = "是否失败时重试", required = false) - private boolean retryWhenFailed = false; - @Schema(title = "重试计数", required = false) - private int retryCount = 0; - @Schema(title = "是否允许手动重试", required = false) - private boolean manualRetry = true; - @Schema(title = "超时分钟", required = false) - private Long timeout = 100L; - @Schema(title = "新的执行的超时时间,支持变量(分钟Minutes),出错则取timeout的值", required = false) - private String timeoutVar; - @JsonIgnore - private boolean change = false; - @Schema(title = "执行条件", required = false) - private RunCondition runCondition; - @Schema(title = "是否配置前置暂停", required = false) - private Boolean pauseBeforeExec = false; - @Schema(title = "订阅暂停通知用户", required = false) - private String subscriptionPauseUser = ""; - @Schema(title = "", required = false) - private String otherTask; - @Schema(title = "自定义变量", required = false) - private List customVariables; - @Schema(title = "自定义条件", required = false) - private String customCondition; - @Schema(title = "插件post信息", required = false) - private ElementPostInfo elementPostInfo; - @Schema(title = "是否设置自定义环境变量", required = false) - @Deprecated - private Boolean enableCustomEnv = true; - @Schema(title = "用户自定义环境变量(插件运行时写入环境)", required = false) - @Deprecated - private List customEnv; - - public ElementAdditionalOptions(boolean continueWhenFailed, Long timeout, RunCondition runCondition, ElementPostInfo elementPostInfo) { - this.continueWhenFailed = continueWhenFailed; - this.timeout = timeout; - this.runCondition = runCondition; - this.elementPostInfo = elementPostInfo; - } - - public enum RunCondition { - PRE_TASK_SUCCESS, - PRE_TASK_FAILED_BUT_CANCEL, - PRE_TASK_FAILED_EVEN_CANCEL, - PRE_TASK_FAILED_ONLY, - OTHER_TASK_RUNNING, - CUSTOM_VARIABLE_MATCH, - CUSTOM_VARIABLE_MATCH_NOT_RUN, - CUSTOM_CONDITION_MATCH, - PARENT_TASK_CANCELED_OR_TIMEOUT, - PARENT_TASK_FINISH - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementBaseInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementBaseInfo.java deleted file mode 100644 index db59d839..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementBaseInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element - * @Project:ops-pro - * @name:ElementBaseInfo - * @Date:2025/03/26 16:25 - * @Filename:ElementBaseInfo - * @description:Todo - */ -@Data -@Schema(title = "元素基本信息") -public class ElementBaseInfo { - @Schema(title = "元素ID", required = true) - private String elementId; - @Schema(title = "元素名称", required = true) - private String elementName; - @Schema(title = "插件代码", required = true) - private String atomCode; - @Schema(title = "插件版本号", required = true) - private String version; - @Schema(title = "元素在job中的位置") - private int elementJobIndex; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementPostInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementPostInfo.java deleted file mode 100644 index 092c804f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementPostInfo.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element - * @Project:ops-pro - * @name:ElementPostInfo - * @Date:2025/03/26 16:25 - * @Filename:ElementPostInfo - * @description:Todo - */ -@Data -@Schema(title = "元素post信息") -@AllArgsConstructor -public class ElementPostInfo { - @Schema(title = "入口参数") - private String postEntryParam; - @Schema(title = "执行条件") - private String postCondition; - @Schema(title = "父元素ID") - private String parentElementId; - @Schema(title = "父元素名称") - private String parentElementName; - @Schema(title = "父元素在job中的位置") - private int parentElementJobIndex; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementProp.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementProp.java deleted file mode 100644 index 2dde6217..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/ElementProp.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element - * @Project:ops-pro - * @name:ElementProp - * @Date:2025/03/26 16:26 - * @Filename:ElementProp - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "插件属性") -public class ElementProp { - private String name; - private Object value; - private ElementPropType type; - - public enum ElementPropType { - VUEX_INPUT("vuex-input"), - STAFF_INPUT("staff-input"), - SELECTOR("selector"); - - private final String value; - - ElementPropType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/EmptyElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/EmptyElement.java deleted file mode 100644 index 7e765ba7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/EmptyElement.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element; - -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element - * @Project:ops-pro - * @name:EmptyElement - * @Date:2025/03/26 16:26 - * @Filename:EmptyElement - * @description:Todo - */ -@NoArgsConstructor -public class EmptyElement extends Element { - public EmptyElement(String name, String id) { - super(); - } - - @Override - public String getClassType() { - return "unknownType"; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/SubPipelineCallElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/SubPipelineCallElement.java deleted file mode 100644 index aac7b4b8..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/SubPipelineCallElement.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element; - -import cd.casic.ci.common.pipeline.pojo.element.atom.SubPipelineType; -import io.swagger.v3.oas.annotations.media.Schema; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element - * @Project:ops-pro - * @name:SubPipelineCallElement - * @Date:2025/03/26 16:28 - * @Filename:SubPipelineCallElement - * @description:Todo - */ -@Schema(title = "子流水线调用", description = SubPipelineCallElement.classType) -public class SubPipelineCallElement extends Element { - public static final String classType = "subPipelineCall"; - public static final String TASK_ATOM = "subPipelineCallAtom"; - - @Schema(title = "任务名称", required = true) - private String name = "自流水线调用"; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "子流水线ID", required = true) - private String subPipelineId = ""; - @Schema(title = "是否异步", required = true) - private boolean asynchronous; - @Schema(title = "新版的子流水线原子的类型") - private SubPipelineType subPipelineType = SubPipelineType.ID; - @Schema(title = "新版的子流水线名") - private String subPipelineName; - @Schema(title = "启动参数", required = false) - private Map parameters; - - @Override - public String getTaskAtom() { - return TASK_ATOM; - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeGitElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeGitElement.java deleted file mode 100644 index 2f21dea9..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeGitElement.java +++ /dev/null @@ -1,68 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.agent; - -import cd.casic.ci.common.pipeline.enums.CodePullStrategy; -import cd.casic.ci.common.pipeline.enums.RepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.git.GitPullMode; -import cn.hutool.json.JSONUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.NoArgsConstructor; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.agent - * @Project:ops-pro - * @name:CodeGitElement - * @Date:2025/03/26 16:33 - * @Filename:CodeGitElement - * @description:Todo - */ -@NoArgsConstructor -@Schema(title = "拉取Git仓库代码", description = CodeGitElement.classType) -public class CodeGitElement extends Element { - public static final String classType = "CODE_GIT"; - public static final String modeType = "mode.type"; - public static final String modeValue = "mode.value"; - - @Schema(title = "任务名称", required = true) - private String name = ""; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "代码库哈希ID", required = true) - private String repositoryHashId; - @Schema(title = "分支名称", required = false) - private String branchName; - @Schema(title = "revision 用于强制指定commitId", required = false) - private String revision; - @Schema(title = "checkout 策略", required = false) - private CodePullStrategy strategy = CodePullStrategy.INCREMENT_UPDATE; - @Schema(title = "代码存放路径", required = false) - private String path; - @Schema(title = "启动Submodule", required = false) - private Boolean enableSubmodule = true; - @Schema(title = "Git指定拉取方式", required = false) - private GitPullMode gitPullMode; - @Schema(title = "新版的git插件的类型") - private RepositoryType repositoryType; - @Schema(title = "新版的git代码库名") - private String repositoryName; - - @Override - public Map genTaskParams() { - Map paramMap = JSONUtil.toBean(JSONUtil.toJsonStr(this), Map.class); - if (gitPullMode != null) { - paramMap.put(modeType, gitPullMode.getType().name()); - paramMap.put(modeValue, gitPullMode.getValue()); - } - return paramMap; - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeGitlabElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeGitlabElement.java deleted file mode 100644 index c2c74630..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeGitlabElement.java +++ /dev/null @@ -1,68 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.agent; - -import cd.casic.ci.common.pipeline.enums.CodePullStrategy; -import cd.casic.ci.common.pipeline.enums.RepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.git.GitPullMode; -import cn.hutool.json.JSONUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.NoArgsConstructor; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.agent - * @Project:ops-pro - * @name:CodeGitlabElement - * @Date:2025/03/26 16:34 - * @Filename:CodeGitlabElement - * @description:Todo - */ -@NoArgsConstructor -@Schema(title = "拉取Gitlab仓库代码", description = CodeGitlabElement.classType) -public class CodeGitlabElement extends Element { - public static final String classType = "CODE_GITLAB"; - public static final String modeType = "mode.type"; - public static final String modeValue = "mode.value"; - - @Schema(title = "任务名称", required = true) - private String name = ""; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "代码库哈希ID", required = true) - private String repositoryHashId; - @Schema(title = "分支名称", required = false) - private String branchName; - @Schema(title = "revision 用于强制指定commitId", required = false) - private String revision; - @Schema(title = "checkout 策略", required = false) - private CodePullStrategy strategy = CodePullStrategy.INCREMENT_UPDATE; - @Schema(title = "代码存放路径", required = false) - private String path; - @Schema(title = "启动Submodule", required = false) - private Boolean enableSubmodule = true; - @Schema(title = "Git指定拉取方式", required = false) - private GitPullMode gitPullMode; - @Schema(title = "新版的gitlab原子的类型") - private RepositoryType repositoryType; - @Schema(title = "新版的gitlab代码库名") - private String repositoryName; - - @Override - public Map genTaskParams() { - Map paramMap = JSONUtil.toBean(JSONUtil.toJsonStr(this), Map.class); - if (gitPullMode != null) { - paramMap.put(modeType, gitPullMode.getType().name()); - paramMap.put(modeValue, gitPullMode.getValue()); - } - return paramMap; - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeSvnElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeSvnElement.java deleted file mode 100644 index 403008ac..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/CodeSvnElement.java +++ /dev/null @@ -1,60 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.agent; - -import cd.casic.ci.common.pipeline.enums.CodePullStrategy; -import cd.casic.ci.common.pipeline.enums.RepositoryType; -import cd.casic.ci.common.pipeline.enums.SVNVersion; -import cd.casic.ci.common.pipeline.enums.SvnDepth; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.agent - * @Project:ops-pro - * @name:CodeSvnElement - * @Date:2025/03/26 16:36 - * @Filename:CodeSvnElement - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "拉取SVN仓库代码", description = CodeSvnElement.classType) -public class CodeSvnElement extends Element { - public static final String classType = "CODE_SVN"; - - @Schema(title = "任务名称", required = true) - private String name; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "代码库哈希ID", required = true) - private String repositoryHashId; - @Schema(title = "revision 用于强制指定commitId", required = false) - private String revision; - @Schema(title = "checkout 策略", required = false) - private CodePullStrategy strategy; - @Schema(title = "代码存放路径", required = false) - private String path; - @Schema(title = "启动Submodule", required = false) - private Boolean enableSubmodule; - @Schema(title = "指定版本号", required = false) - private Boolean specifyRevision; - @Schema(title = "拉取仓库深度", required = false) - private SvnDepth svnDepth; - @Schema(title = "SVN相对路径", required = false) - private String svnPath; - @Schema(title = "SVN的版本", required = false) - private SVNVersion svnVersion; - @Schema(title = "新版的svn原子的类型") - private RepositoryType repositoryType; - @Schema(title = "新版的svn代码库名") - private String repositoryName; - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/GithubElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/GithubElement.java deleted file mode 100644 index efcd967c..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/GithubElement.java +++ /dev/null @@ -1,70 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.agent; - -import cd.casic.ci.common.pipeline.enums.CodePullStrategy; -import cd.casic.ci.common.pipeline.enums.RepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.git.GitPullMode; -import cn.hutool.json.JSONUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.agent - * @Project:ops-pro - * @name:GithubElement - * @Date:2025/03/26 16:37 - * @Filename:GithubElement - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "拉取Github仓库代码", description = GithubElement.classType) -public class GithubElement extends Element { - public static final String classType = "GITHUB"; - public static final String modeType = "mode.type"; - public static final String modeValue = "mode.value"; - - @Schema(title = "任务名称", required = true) - private String name = ""; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "代码库哈希ID", required = true) - private String repositoryHashId; - @Schema(title = "checkout 策略", required = false) - private CodePullStrategy strategy = CodePullStrategy.INCREMENT_UPDATE; - @Schema(title = "代码存放路径", required = false) - private String path; - @Schema(title = "启动Submodule", required = false) - private Boolean enableSubmodule = true; - @Schema(title = "revision 用于强制指定commitId", required = false) - private String revision; - @Schema(title = "指定拉取方式", required = false) - private GitPullMode gitPullMode; - @Schema(title = "支持虚拟合并分支", required = false) - private Boolean enableVirtualMergeBranch = false; - @Schema(title = "新版的github原子的类型") - private RepositoryType repositoryType; - @Schema(title = "新版的github代码库名") - private String repositoryName; - - @Override - public Map genTaskParams() { - Map paramMap = JSONUtil.toBean(JSONUtil.toJsonStr(this), Map.class); - if (gitPullMode != null) { - paramMap.put(modeType, gitPullMode.getType().name()); - paramMap.put(modeValue, gitPullMode.getValue()); - } - return paramMap; - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/LinuxScriptElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/LinuxScriptElement.java deleted file mode 100644 index 72c47105..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/LinuxScriptElement.java +++ /dev/null @@ -1,91 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.agent; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.enums.BuildScriptType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import cd.casic.ci.common.pipeline.pojo.transfer.PreStep; -import com.alibaba.fastjson.JSONObject; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.agent - * @Project:ops-pro - * @name:LinuxScriptElement - * @Date:2025/03/26 16:37 - * @Filename:LinuxScriptElement - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "脚本任务(linux和macOS环境)", description = LinuxScriptElement.classType) -public class LinuxScriptElement extends Element { - public static final String classType = "linuxScript"; - - @Schema(title = "任务名称", required = true) - private String name = "执行Linux脚本"; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "用户自定义ID", required = false) - private String stepId; - @Schema(title = "用户自定义环境变量(插件运行时写入环境)", required = false) - private List customEnv; - @Schema(title = "FAQ url链接", required = false) - private String errorFAQUrl; - @Schema(title = "脚本类型", required = true) - private BuildScriptType scriptType; - @Schema(title = "脚本内容", required = true) - private String script; - @Schema(title = "某次执行为非0时(失败)是否继续执行脚本", required = false) - private Boolean continueNoneZero; - @Schema(title = "启用脚本执行失败时归档的文件", required = false) - private Boolean enableArchiveFile = false; - @Schema(title = "脚本执行失败时归档的文件", required = false) - private String archiveFile; - @Schema(title = "附加参数", required = false) - private ElementAdditionalOptions additionalOptions; - - @Override - public Map genTaskParams() { - Map mutableMap = super.genTaskParams(); - try { - mutableMap.put("script", URLEncoder.encode(script, "UTF-8")); - } catch (Exception e) { - mutableMap.put("script", script); - } - return mutableMap; - } - - public PreStep transferYaml(JSONObject defaultValue) { - Map res = new HashMap<>(); - res.put("script", script); - if (continueNoneZero != null && continueNoneZero) { - res.put("continueNoneZero", true); - } - if (enableArchiveFile != null && enableArchiveFile && archiveFile != null) { - res.put("enableArchiveFile", true); - res.put("archiveFile", archiveFile); - } - return new PreStep( - name, - stepId, - getAtomCode() + "@" + getVersion(), - res - ); - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/ManualReviewUserTaskElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/ManualReviewUserTaskElement.java deleted file mode 100644 index 6be988e7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/ManualReviewUserTaskElement.java +++ /dev/null @@ -1,107 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.agent; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.atom.ManualReviewParam; -import cd.casic.ci.common.pipeline.pojo.transfer.PreStep; -import cd.casic.ci.common.pipeline.utils.TransferUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.json.JSONObject; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.agent - * @Project:ops-pro - * @name:ManualReviewUserTaskElement - * @Date:2025/03/26 16:44 - * @Filename:ManualReviewUserTaskElement - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "人工审核", description = ManualReviewUserTaskElement.classType) -public class ManualReviewUserTaskElement extends Element { - public static final String classType = "manualReviewUserTask"; - - @Schema(title = "任务名称", required = true) - private String name = "人工审核"; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "审核人", required = true) - private List reviewUsers; - @Schema(title = "描述", required = false) - private String desc; - @Schema(title = "审核意见", required = false) - private String suggest; - @Schema(title = "参数列表", required = false) - private List params; - @Schema(title = "输出变量名空间", required = false) - private String namespace; - @Schema(title = "发送的通知类型", required = false) - private List notifyType; - @Schema(title = "发送通知的标题", required = false) - private String notifyTitle; - @Schema(title = "是否以markdown格式发送审核说明", required = false) - private Boolean markdownContent; - @Schema(title = "企业微信群id", required = false) - private List notifyGroup; - @Schema(title = "审核提醒时间(小时),支持每隔x小时提醒一次", required = false) - private Integer reminderTime; - - @Override - public String getTaskAtom() { - return "manualReviewTaskAtom"; - } - - public PreStep transferYaml(JSONObject defaultValue) { - Map input = new HashMap<>(); - if (reviewUsers != null && !reviewUsers.isEmpty()) { - input.put("reviewUsers", reviewUsers); - } - if (desc != null && !desc.isEmpty()) { - input.put("desc", desc); - } - if (suggest != null && !suggest.isEmpty()) { - input.put("suggest", suggest); - } - if (params != null && !params.isEmpty()) { - input.put("params", params); - } - if (namespace != null && !namespace.isEmpty()) { - input.put("namespace", namespace); - } - if (notifyType != null && !notifyType.isEmpty()) { - input.put("notifyType", notifyType); - } - if (notifyTitle != null && !notifyTitle.isEmpty()) { - input.put("notifyTitle", notifyTitle); - } - if (markdownContent != null) { - input.put("markdownContent", markdownContent); - } - if (notifyGroup != null && !notifyGroup.isEmpty()) { - input.put("notifyGroup", notifyGroup); - } - if (reminderTime != null) { - input.put("reminderTime", reminderTime); - } - return new PreStep( - name, - id, - getAtomCode() + "@" + getVersion(), - TransferUtil.simplifyParams(defaultValue, input) - ); - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/WindowsScriptElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/WindowsScriptElement.java deleted file mode 100644 index 63721255..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/agent/WindowsScriptElement.java +++ /dev/null @@ -1,79 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.agent; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.enums.BuildScriptType; -import cd.casic.ci.common.pipeline.enums.CharsetType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.transfer.PreStep; -import com.alibaba.fastjson.JSONObject; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.NoArgsConstructor; - -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.agent - * @Project:ops-pro - * @name:WindowsScriptElement - * @Date:2025/03/26 16:44 - * @Filename:WindowsScriptElement - * @description:Todo - */ -@NoArgsConstructor -@Schema(title = "脚本任务(windows环境)", description = WindowsScriptElement.classType) -public class WindowsScriptElement extends Element { - public static final String classType = "windowsScript"; - - @Schema(title = "任务名称", required = true) - private String name = "执行Windows的bat脚本"; - @Schema(title = "id", required = false) - private String id; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "用户自定义ID", required = false) - private String stepId; - @Schema(title = "用户自定义环境变量(插件运行时写入环境)", required = false) - private List customEnv; - @Schema(title = "FAQ url链接", required = false) - private String errorFAQUrl; - @Schema(title = "脚本内容", required = true) - private String script; - @Schema(title = "脚本类型", required = true) - private BuildScriptType scriptType; - @Schema(title = "字符集类型", required = false) - private CharsetType charsetType; - - @Override - public Map genTaskParams() { - Map mutableMap = super.genTaskParams(); - try { - mutableMap.put("script", URLEncoder.encode(script, "UTF-8")); - } catch (Exception e) { - mutableMap.put("script", script); - } - return mutableMap; - } - - public PreStep transferYaml(JSONObject defaultValue) { - Map res = new HashMap<>(); - res.put("script", script); - if (charsetType != null && !charsetType.equals(CharsetType.DEFAULT)) { - res.put("charsetType", charsetType.name()); - } - return new PreStep( - name, - stepId, - getAtomCode() + "@" + getVersion(), - res - ); - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/BeforeDeleteParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/BeforeDeleteParam.java deleted file mode 100644 index fbee8cb7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/BeforeDeleteParam.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:BeforeDeleteParam - * @Date:2025/03/26 17:11 - * @Filename:BeforeDeleteParam - * @description:Todo - */ -@Data -public class BeforeDeleteParam { - private String userId; - private String projectId; - private String pipelineId; - private ChannelCode channelCode = ChannelCode.BS; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementBatchCheckParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementBatchCheckParam.java deleted file mode 100644 index b1b464e1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementBatchCheckParam.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:ElementBatchCheckParam - * @Date:2025/03/26 17:11 - * @Filename:ElementBatchCheckParam - * @description:Todo - */ -@Data -public class ElementBatchCheckParam { - @Schema(description = "项目ID", required = true) - private String projectId; - @Schema(description = "流水线ID", required = true) - private String pipelineId; - @Schema(description = "用户ID", required = true) - private String userId; - @Schema(description = "上下文映射", required = true) - private Map contextMap; - @Schema(description = "是否为模板", required = true) - private boolean isTemplate; - @Schema(description = "OAuth用户", required = false) - private String oauthUser; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementCheckResult.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementCheckResult.java deleted file mode 100644 index e46cf81a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementCheckResult.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:ElementCheckResult - * @Date:2025/03/26 17:11 - * @Filename:ElementCheckResult - * @description:Todo - */ -@Data -public class ElementCheckResult { - @Schema(description = "校验结果", required = true) - private boolean result; - @Schema(description = "失败标题", required = false) - private String errorTitle; - @Schema(description = "失败详情", required = false) - private String errorMessage; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementHolder.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementHolder.java deleted file mode 100644 index adf9adb1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ElementHolder.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:ElementHolder - * @Date:2025/03/26 17:12 - * @Filename:ElementHolder - * @description:Todo - */ -@Data -public class ElementHolder { - private Element element; - private Stage stage; - private Container container; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParam.java deleted file mode 100644 index f8d49b2f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParam.java +++ /dev/null @@ -1,71 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:ManualReviewParam - * @Date:2025/03/26 17:12 - * @Filename:ManualReviewParam - * @description:Todo - */ -@Data -@NoArgsConstructor -public class ManualReviewParam { - @Schema(description = "参数名", required = true) - private String key = ""; - - @Schema(description = "参数内容", required = true) - private Object value = null; - - @Schema(description = "参数类型", required = false) - private ManualReviewParamType valueType = ManualReviewParamType.STRING; - - @Schema(description = "是否必填", required = true) - private boolean required = false; - - @Schema(description = "参数描述", required = false) - private String desc = ""; - - @Schema(description = "下拉框列表", required = false) - private List options = null; - - @Schema(description = "中文名称", required = false) - private String chineseName = null; - - @Schema(description = "变量形式的options", required = false) - private String variableOption = null; - - public void parseValueWithType(Map variables) { - if (variables.containsKey(key) && variables.get(key) != null && !variables.get(key).isBlank()) { - switch (valueType) { - case BOOLEAN: - case CHECKBOX: - value = Boolean.parseBoolean(variables.get(key)); - break; - default: - value = variables.get(key); - break; - } - } else { - // TODO: Implement ObjectReplaceEnvVarUtil.replaceEnvVar in Java - // value = ObjectReplaceEnvVarUtil.replaceEnvVar(value, variables); - } - if (variableOption != null && !variableOption.isBlank()) { - // TODO: Implement EnvUtils.parseEnv and JsonUtil.to in Java - // options = EnvUtils.parseEnv(variableOption, variables).let { - // List optionList = JsonUtil.to>(it).stream() - // .map(item -> new ManualReviewParamPair(item.toString(), item.toString())) - // .collect(Collectors.toList()); - // optionList; - // }; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParamPair.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParamPair.java deleted file mode 100644 index f8cd2b44..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParamPair.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:ManualReviewParamPair - * @Date:2025/03/26 17:18 - * @Filename:ManualReviewParamPair - * @description:Todo - */ -@Data -public class ManualReviewParamPair { - @Schema(description = "参数名", required = true) - private String key; - @Schema(description = "参数内容", required = true) - private String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParamType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParamType.java deleted file mode 100644 index 99699248..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/ManualReviewParamType.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:ManualReviewParamType - * @Date:2025/03/26 17:18 - * @Filename:ManualReviewParamType - * @description:Todo - */ -public enum ManualReviewParamType { - STRING("string"), - TEXTAREA("textarea"), - BOOLEAN("boolean"), - ENUM("enum"), - CHECKBOX("checkbox"), - MULTIPLE("multiple"); - - private final String value; - - ManualReviewParamType(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/PipelineCheckFailedReason.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/PipelineCheckFailedReason.java deleted file mode 100644 index 7cdfa142..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/PipelineCheckFailedReason.java +++ /dev/null @@ -1,60 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:PipelineCheckFailedReason - * @Date:2025/03/26 17:19 - * @Filename:PipelineCheckFailedReason - * @description:Todo - */ -@Data -@NoArgsConstructor -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = PipelineCheckFailedMsg.class, name = PipelineCheckFailedMsg.CLASS_TYPE), - @JsonSubTypes.Type(value = PipelineCheckFailedErrors.class, name = PipelineCheckFailedErrors.CLASS_TYPE) -}) -public abstract class PipelineCheckFailedReason { - @Schema(description = "失败信息描述", required = true) - protected String message; -} - -class PipelineCheckFailedMsg extends PipelineCheckFailedReason { - public static final String CLASS_TYPE = "msg"; - - public PipelineCheckFailedMsg(String message) { - this.message = message; - } -} - -class PipelineCheckFailedErrors extends PipelineCheckFailedReason { - public static final String CLASS_TYPE = "errors"; - - @Schema(description = "失败详情", required = true) - private List errors; - - public PipelineCheckFailedErrors(String message, List errors) { - this.message = message; - this.errors = errors; - } - - @Data - public static class ErrorInfo { - @Schema(description = "失败标题", required = true) - private String errorTitle; - - @Schema(description = "失败详情", required = true) - private Set errorDetails; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/SubPipelineType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/SubPipelineType.java deleted file mode 100644 index 5f3e6017..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/atom/SubPipelineType.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.atom; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.atom - * @Project:ops-pro - * @name:SubPipelineType - * @Date:2025/03/26 17:20 - * @Filename:SubPipelineType - * @description:Todo - */ -public enum SubPipelineType { - ID, - NAME -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/AtomBuildArchiveElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/AtomBuildArchiveElement.java deleted file mode 100644 index e91f32e4..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/AtomBuildArchiveElement.java +++ /dev/null @@ -1,61 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.market; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.EqualsAndHashCode; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.market - * @Project:ops-pro - * @name:AtomBuildArchiveElement - * @Date:2025/03/26 17:31 - * @Filename:AtomBuildArchiveElement - * @description:Todo - */ -@EqualsAndHashCode(callSuper = true) -@Schema(title = "插件发布归档", description = AtomBuildArchiveElement.CLASS_TYPE) -public class AtomBuildArchiveElement extends Element { - public static final String CLASS_TYPE = "atomBuildArchive"; - - @Schema(title = "任务名称", required = true) - private String name = "插件发布归档"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "插件发布包名称", required = true) - private String packageName = "${packageName}"; - - @Schema(title = "插件发布包所在相对路径", required = true) - private String filePath = "${filePath}"; - - @Schema(title = "插件发布包上传至仓库的目标路径", required = true) - private String destPath = "${atomCode}/${version}/${packageName}"; - - @Schema(title = "插件自定义UI前端文件所在相对路径", required = false) - private String frontendFilePath = "${BK_CI_CUSTOM_FRONTEND_DIST_PATH}"; - - @Schema(title = "插件自定义UI前端文件上传至仓库的目标路径", required = false) - private String frontendDestPath = "${atomCode}/${version}"; - - @Schema(title = "操作系统名称", required = false) - private String osName = "${matrixOsName}"; - - @Schema(title = "操作系统cpu架构", required = false) - private String osArch = "${matrixOsArch}"; - - @Schema(title = "是否有可用的操作系统名称配置", required = false) - private String validOsNameFlag; - - @Schema(title = "是否有可用的操作系统cpu架构配置", required = false) - private String validOsArchFlag; - - @Override - public String getClassType() { - return CLASS_TYPE; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketBuildAtomElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketBuildAtomElement.java deleted file mode 100644 index 05e8c731..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketBuildAtomElement.java +++ /dev/null @@ -1,78 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.market; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import cd.casic.ci.common.pipeline.pojo.transfer.PreStep; -import cd.casic.ci.common.pipeline.utils.TransferUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.json.JSONObject; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.market - * @Project:ops-pro - * @name:MarketBuildAtomElement - * @Date:2025/03/26 17:32 - * @Filename:MarketBuildAtomElement - * @description:Todo - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Schema(title = "流水线模型-插件市场第三方构建环境类插件", description = MarketBuildAtomElement.classType) -public class MarketBuildAtomElement extends Element { - public static final String classType = "marketBuild"; - - @Schema(title = "任务名称", required = true) - private String name = "任务名称由用户自己填写"; - - @Schema(title = "id将由后台生成", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "插件的唯一标识", required = true) - private String atomCode; - - @Schema(title = "插件版本", required = false) - private String version = "1.*"; - - @Schema(title = "用户自定义ID", required = false) - private String stepId; - - @Schema(title = "用户自定义环境变量(插件运行时写入环境)", required = false) - private List customEnv; - - @Schema(title = "插件参数数据", required = true) - private Map data = new HashMap<>(); - - @Schema(title = "附加参数", required = false) - private ElementAdditionalOptions additionalOptions; - - @Override - public String getAtomCode() { - return atomCode; - } - - public PreStep transferYaml(JSONObject defaultValue) { - Map input = (Map) data.getOrDefault("input", new HashMap<>()); - return new PreStep( - name, - stepId, - getAtomCode() + "@" + version, - TransferUtil.simplifyParams(defaultValue, input).isEmpty() ? null : TransferUtil.simplifyParams(defaultValue, input) - ); - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketBuildLessAtomElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketBuildLessAtomElement.java deleted file mode 100644 index ce1d5e55..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketBuildLessAtomElement.java +++ /dev/null @@ -1,74 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.market; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.transfer.PreStep; -import cd.casic.ci.common.pipeline.utils.TransferUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.json.JSONObject; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.market - * @Project:ops-pro - * @name:MarketBuildLessAtomElement - * @Date:2025/03/26 17:32 - * @Filename:MarketBuildLessAtomElement - * @description:Todo - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Schema(title = "流水线模型-插件市场第三方无构建环境类插件", description = MarketBuildLessAtomElement.classType) -public class MarketBuildLessAtomElement extends Element { - public static final String classType = "marketBuildLess"; - - @Schema(title = "任务名称", required = true) - private String name = "任务名称由用户自己填写"; - - @Schema(title = "id将由后台生成", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "插件的唯一标识", required = true) - private String atomCode; - - @Schema(title = "插件版本", required = false) - private String version = "1.*"; - - @Schema(title = "用户自定义ID", required = false) - private String stepId; - - @Schema(title = "用户自定义环境变量(插件运行时写入环境)", required = false) - private List customEnv; - - @Schema(title = "插件参数数据", required = true) - private Map data = new HashMap<>(); - - @Override - public String getAtomCode() { - return atomCode; - } - - public PreStep transferYaml(JSONObject defaultValue) { - Map input = (Map) data.getOrDefault("input", new HashMap<>()); - return new PreStep( - name, - stepId, - getAtomCode() + "@" + version, - TransferUtil.simplifyParams(defaultValue, input).isEmpty() ? null : TransferUtil.simplifyParams(defaultValue, input) - ); - } - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketCheckImageElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketCheckImageElement.java deleted file mode 100644 index d482ea33..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/market/MarketCheckImageElement.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.market; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.market - * @Project:ops-pro - * @name:MarketCheckImageElement - * @Date:2025/03/26 17:34 - * @Filename:MarketCheckImageElement - * @description:Todo - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Schema(title = "验证镜像合法性", description = MarketCheckImageElement.classType) -public class MarketCheckImageElement extends Element { - public static final String classType = "marketCheckImage"; - - @Schema(title = "任务名称", required = true) - private String name = "验证镜像合法性"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "用户名", required = false) - private String registryUser; - - @Schema(title = "密码", required = false) - private String registryPwd; - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/matrix/MatrixStatusElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/matrix/MatrixStatusElement.java deleted file mode 100644 index 5261b156..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/matrix/MatrixStatusElement.java +++ /dev/null @@ -1,83 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.matrix; - -import cd.casic.ci.common.pipeline.NameAndValue; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.matrix - * @Project:ops-pro - * @name:MatrixStatusElement - * @Date:2025/03/26 17:37 - * @Filename:MatrixStatusElement - * @description:Todo - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Schema(title = "流水线模型-矩阵纯运行状态插件", description = MatrixStatusElement.classType) -public class MatrixStatusElement extends Element { - public static final String classType = "matrixStatus"; - - @Schema(title = "任务名称", required = true) - private String name = "状态插件"; - - @Schema(title = "插件ID", required = false) - private String id; - - @Schema(title = "执行状态", required = false) - private String status; - - @Schema(title = "执行次数", required = false) - private int executeCount = 1; - - @Schema(title = "执行时间", required = false) - private Long elapsed; - - @Schema(title = "启动时间", required = false) - private Long startEpoch; - - @Schema(title = "上下文标识", required = false) - private String stepId; - - @Schema(title = "用户自定义环境变量(插件运行时写入环境)", required = false) - private List customEnv; - - @Schema(title = "原插件的类型标识") - private String originClassType; - - @Schema(title = "原插件的市场标识") - private String originAtomCode; - - @Schema(title = "原插件的内置标识") - private String originTaskAtom; - - @Schema(title = "审核人", required = true) - private List reviewUsers = new ArrayList<>(); - - @Schema(title = "拦截原子", required = false) - private String interceptTask; - - @Schema(title = "拦截原子名称", required = false) - private String interceptTaskName; - - @Override - public String getClassType() { - return classType; - } - - @Override - public String getTaskAtom() { - return originTaskAtom != null ? originTaskAtom : ""; - } - - @Override - public String getAtomCode() { - return originAtomCode != null ? originAtomCode : ""; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/quality/QualityGateInElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/quality/QualityGateInElement.java deleted file mode 100644 index 48ae1577..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/quality/QualityGateInElement.java +++ /dev/null @@ -1,76 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.quality; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import static cd.casic.ci.common.pipeline.constant.CommonConstants.*; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.quality - * @Project:ops-pro - * @name:QualityGateInElement - * @Date:2025/03/26 17:39 - * @Filename:QualityGateInElement - * @description:Todo - */ -@Data -@EqualsAndHashCode(callSuper = true) -@Schema(title = "质量红线(准入)", description = QualityGateInElement.classType) -public class QualityGateInElement extends Element { - public static final String classType = "qualityGateInTask"; - - @Schema(title = "任务名称", required = true) - private String name = "质量红线(准入)"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "拦截原子", required = false) - private String interceptTask; - - @Schema(title = "拦截原子名称", required = false) - private String interceptTaskName; - - @Schema(title = "审核人", required = false) - private Set reviewUsers = new HashSet<>(); - - @Override - public String getTaskAtom() { - return "qualityGateInTaskAtom"; - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public Map initTaskVar() { - Map taskVar = new java.util.HashMap<>(); - taskVar.put("name", name); - taskVar.put("version", getVersion()); - taskVar.put(KEY_TASK_ATOM, getTaskAtom()); - taskVar.put("classType", getClassType()); - taskVar.put(KEY_ELEMENT_ENABLE, elementEnabled()); - if (interceptTask != null) { - taskVar.put("interceptTask", interceptTask); - } - if (interceptTaskName != null) { - taskVar.put("interceptTaskName", interceptTaskName); - } - if (reviewUsers != null) { - taskVar.put("reviewUsers", reviewUsers); - } - return taskVar; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/quality/QualityGateOutElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/quality/QualityGateOutElement.java deleted file mode 100644 index 295d59a3..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/quality/QualityGateOutElement.java +++ /dev/null @@ -1,75 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.quality; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.EqualsAndHashCode; - -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import static cd.casic.ci.common.pipeline.constant.CommonConstants.KEY_ELEMENT_ENABLE; -import static cd.casic.ci.common.pipeline.constant.CommonConstants.KEY_TASK_ATOM; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.quality - * @Project:ops-pro - * @name:QualityGateOutElement - * @Date:2025/03/26 17:41 - * @Filename:QualityGateOutElement - * @description:Todo - */ -@EqualsAndHashCode(callSuper = true) -@Schema(title = "质量红线(准出)", description = QualityGateOutElement.classType) -public class QualityGateOutElement extends Element { - public static final String classType = "qualityGateOutTask"; - - @Schema(title = "任务名称", required = true) - private String name = "质量红线(准出)"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "拦截原子", required = false) - private String interceptTask; - - @Schema(title = "拦截原子名称", required = false) - private String interceptTaskName; - - @Schema(title = "审核人", required = false) - private Set reviewUsers = new HashSet<>(); - - @Override - public String getTaskAtom() { - return "qualityGateOutTaskAtom"; - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public Map initTaskVar() { - Map taskVar = new java.util.HashMap<>(); - taskVar.put("name", name); - taskVar.put("version", getVersion()); - taskVar.put(KEY_TASK_ATOM, getTaskAtom()); - taskVar.put("classType", getClassType()); - taskVar.put(KEY_ELEMENT_ENABLE, elementEnabled()); - if (interceptTask != null) { - taskVar.put("interceptTask", interceptTask); - } - if (interceptTaskName != null) { - taskVar.put("interceptTaskName", interceptTaskName); - } - if (reviewUsers != null) { - taskVar.put("reviewUsers", reviewUsers); - } - return taskVar; - } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGitWebHookTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGitWebHookTriggerElement.java deleted file mode 100644 index dd46d935..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGitWebHookTriggerElement.java +++ /dev/null @@ -1,221 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.enums.TriggerRepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.ElementProp; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeEventType; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.PathFilterType; -import cd.casic.ci.common.pipeline.utils.TriggerElementPropUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:CodeGitWebHookTriggerElement - * @Date:2025/03/27 10:20 - * @Filename:CodeGitWebHookTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "Git事件触发", description = CodeGitWebHookTriggerElement.classType) -public class CodeGitWebHookTriggerElement extends WebHookTriggerElement { - public static final String classType = "codeGitWebHookTrigger"; - public static final String MERGE_ACTION_OPEN = "open"; - public static final String MERGE_ACTION_CLOSE = "close"; - public static final String MERGE_ACTION_REOPEN = "reopen"; - public static final String MERGE_ACTION_PUSH_UPDATE = "push-update"; - public static final String MERGE_ACTION_MERGE = "merge"; - public static final String PUSH_ACTION_CREATE_BRANCH = "new-branch"; - public static final String PUSH_ACTION_PUSH_FILE = "push-file"; - - @Schema(title = "任务名称", required = true) - private String name = "Git事件触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "仓库ID", required = true) - private String repositoryHashId; - - @Schema(title = "分支名称", required = false) - private String branchName; - - @Schema(title = "用于排除的分支名", required = false) - private String excludeBranchName; - - @Schema(title = "路径过滤类型", required = true) - private PathFilterType pathFilterType = PathFilterType.NamePrefixFilter; - - @Schema(title = "用于包含的路径", required = false) - private String includePaths; - - @Schema(title = "用于排除的路径", required = false) - private String excludePaths; - - @Schema(title = "用户白名单", required = false) - private List includeUsers; - - @Schema(title = "用于排除的user id", required = false) - private List excludeUsers; - - @Schema(title = "事件类型", required = false) - private CodeEventType eventType; - - @Schema(title = "是否为block", required = false) - private Boolean block; - - @Schema(title = "新版的git原子的类型") - private TriggerRepositoryType repositoryType; - - @Schema(title = "新版的git代码库名") - private String repositoryName; - - @Schema(title = "tag名称", required = false) - private String tagName; - - @Schema(title = "用于排除的tag名称", required = false) - private String excludeTagName; - - @Schema(title = "tag从哪条分支创建", required = false) - private String fromBranches; - - @Schema(title = "用于排除的源分支名称", required = false) - private String excludeSourceBranchName; - - @Schema(title = "用于包含的源分支名称", required = false) - private String includeSourceBranchName; - - @Schema(title = "webhook队列", required = false) - private Boolean webhookQueue = false; - - @Schema(title = "code review 状态", required = false) - private List includeCrState; - - @Schema(title = "code review 类型", required = false) - private List includeCrTypes; - - @Schema(title = "code note comment", required = false) - private String includeNoteComment; - - @Schema(title = "code note 类型", required = false) - private List includeNoteTypes; - - @Schema(title = "是否启用回写") - private Boolean enableCheck = true; - - @Schema(title = "issue事件action") - private List includeIssueAction; - - @Schema(title = "mr事件action") - private List includeMrAction; - - @Schema(title = "push事件action") - private List includePushAction; - - @Schema(title = "是否启用第三方过滤") - private Boolean enableThirdFilter = false; - - @Schema(title = "第三方应用地址") - private String thirdUrl; - - @Schema(title = "第三方应用鉴权token") - private String thirdSecretToken; - - @Schema(title = "跳过WIP") - private Boolean skipWip = false; - - public CodeGitWebHookTriggerElement(String name, String id, String status) { - super(name, id, status); - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return StartType.WEB_HOOK.name().equals(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } - - @Override - public List triggerCondition() { - List props; - switch (eventType) { - case PUSH: - props = List.of( - TriggerElementPropUtils.vuexInput("action", joinToString(includePushAction)), - TriggerElementPropUtils.vuexInput("branchName", branchName), - TriggerElementPropUtils.vuexInput("excludeBranchName", excludeBranchName), - TriggerElementPropUtils.vuexInput("includePaths", includePaths), - TriggerElementPropUtils.vuexInput("excludePaths", excludePaths), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ); - break; - case MERGE_REQUEST: - props = List.of( - TriggerElementPropUtils.vuexInput("action", joinToString(includeMrAction)), - TriggerElementPropUtils.selector("skip-wip", List.of((skipWip != null ? skipWip.toString() : "false"))), - TriggerElementPropUtils.vuexInput("branchName", branchName), - TriggerElementPropUtils.vuexInput("excludeBranchName", excludeBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includePaths", includePaths), - TriggerElementPropUtils.vuexInput("excludePaths", excludePaths), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ); - break; - case MERGE_REQUEST_ACCEPT: - props = List.of( - TriggerElementPropUtils.vuexInput("action", "merge"), - TriggerElementPropUtils.vuexInput("branchName", branchName), - TriggerElementPropUtils.vuexInput("excludeBranchName", excludeBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includePaths", includePaths), - TriggerElementPropUtils.vuexInput("excludePaths", excludePaths), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ); - break; - case TAG_PUSH: - props = List.of( - TriggerElementPropUtils.vuexInput("tagName", tagName), - TriggerElementPropUtils.vuexInput("excludeTagName", excludeTagName), - TriggerElementPropUtils.vuexInput("fromBranches", fromBranches), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ); - break; - case REVIEW: - props = List.of( - TriggerElementPropUtils.selector("includeCrState", includeCrState), - TriggerElementPropUtils.selector("includeCrTypes", includeCrTypes) - ); - break; - case ISSUES: - props = List.of( - TriggerElementPropUtils.selector("includeIssueAction", includeIssueAction) - ); - break; - case NOTE: - props = List.of( - TriggerElementPropUtils.selector("includeNoteTypes", includeNoteTypes), - TriggerElementPropUtils.vuexInput("includeNoteComment", includeNoteComment) - ); - break; - default: - props = List.of(); - } - return props.stream().filter(java.util.Objects::nonNull).toList(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGithubWebHookTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGithubWebHookTriggerElement.java deleted file mode 100644 index 605b15bb..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGithubWebHookTriggerElement.java +++ /dev/null @@ -1,131 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.enums.TriggerRepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeEventType; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.PathFilterType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:CodeGithubWebHookTriggerElement - * @Date:2025/03/27 9:42 - * @Filename:CodeGithubWebHookTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "Github事件触发", description = CodeGithubWebHookTriggerElement.classType) -public class CodeGithubWebHookTriggerElement extends WebHookTriggerElement { - public static final String classType = "codeGithubWebHookTrigger"; - public static final String MERGE_ACTION_OPEN = "open"; - public static final String MERGE_ACTION_CLOSE = "close"; - public static final String MERGE_ACTION_REOPEN = "reopen"; - public static final String MERGE_ACTION_PUSH_UPDATE = "push-update"; - public static final String MERGE_ACTION_MERGE = "merge"; - - @Schema(title = "任务名称", required = true) - private String name = "GitHub事件触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "仓库ID", required = true) - private String repositoryHashId; - - @Schema(title = "分支名称", required = false) - private String branchName; - - @Schema(title = "用于排除的分支名称", required = false) - private String excludeBranchName; - - @Schema(title = "路径过滤类型", required = true) - private PathFilterType pathFilterType = PathFilterType.NamePrefixFilter; - - @Schema(title = "用于包含的路径", required = false) - private String includePaths; - - @Schema(title = "用于排除的路径", required = false) - private String excludePaths; - - @Schema(title = "用户白名单", required = false) - private List includeUsers; - - @Schema(title = "用于排除的user id", required = false) - private String excludeUsers; - - @Schema(title = "tag名称", required = false) - private String tagName; - - @Schema(title = "用于排除的tag名称", required = false) - private String excludeTagName; - - @Schema(title = "tag从哪条分支创建", required = false) - private String fromBranches; - - @Schema(title = "用于排除的源分支名称", required = false) - private String excludeSourceBranchName; - - @Schema(title = "用于包含的源分支名称", required = false) - private String includeSourceBranchName; - - @Schema(title = "webhook队列", required = false) - private Boolean webhookQueue = false; - - @Schema(title = "code review 类型", required = false) - private List includeCrTypes; - - @Schema(title = "是否启用回写") - private Boolean enableCheck = true; - - @Schema(title = "push事件action") - private List includePushAction; - - @Schema(title = "是否启用第三方过滤") - private Boolean enableThirdFilter = false; - - @Schema(title = "事件类型", required = false) - private CodeEventType eventType; - - @Schema(title = "新版的github原子的类型") - private TriggerRepositoryType repositoryType; - - @Schema(title = "新版的github代码库名") - private String repositoryName; - - @Schema(title = "code review 状态", required = false) - private List includeCrState; - - @Schema(title = "code note comment", required = false) - private String includeNoteComment; - - @Schema(title = "code note 类型", required = false) - private List includeNoteTypes; - - @Schema(title = "issue事件action") - private List includeIssueAction; - - @Schema(title = "pull request事件action") - private List includeMrAction = List.of(MERGE_ACTION_OPEN, MERGE_ACTION_REOPEN, MERGE_ACTION_PUSH_UPDATE); - - public CodeGithubWebHookTriggerElement(String name, String id, String status) { - super(name, id, status); - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return StartType.WEB_HOOK.name().equals(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGitlabWebHookTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGitlabWebHookTriggerElement.java deleted file mode 100644 index a9cd46a8..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeGitlabWebHookTriggerElement.java +++ /dev/null @@ -1,163 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.enums.TriggerRepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.ElementProp; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeEventType; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.PathFilterType; -import cd.casic.ci.common.pipeline.utils.TriggerElementPropUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:CodeGitlabWebHookTriggerElement - * @Date:2025/03/27 10:22 - * @Filename:CodeGitlabWebHookTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "GitLab仓库代码提交触发", description = CodeGitlabWebHookTriggerElement.classType) -public class CodeGitlabWebHookTriggerElement extends WebHookTriggerElement { - public static final String classType = "codeGitlabWebHookTrigger"; - - @Schema(title = "任务名称", required = true) - private String name = "Gitlab变更触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "仓库ID", required = true) - private String repositoryHashId; - - @Schema(title = "分支名称", required = false) - private String branchName; - - @Schema(title = "新版的gitlab原子的类型") - private TriggerRepositoryType repositoryType; - - @Schema(title = "新版的gitlab代码库名") - private String repositoryName; - - @Schema(title = "事件类型", required = false) - private CodeEventType eventType = CodeEventType.PUSH; - - @Schema(title = "用于排除的分支名", required = false) - private String excludeBranchName; - - @Schema(title = "路径过滤类型", required = true) - private PathFilterType pathFilterType = PathFilterType.NamePrefixFilter; - - @Schema(title = "用于包含的路径", required = false) - private String includePaths; - - @Schema(title = "用于排除的路径", required = false) - private String excludePaths; - - @Schema(title = "用于包含的user id", required = false) - private List includeUsers; - - @Schema(title = "用于排除的user id", required = false) - private List excludeUsers; - - @Schema(title = "是否为block", required = false) - private Boolean block; - - @Schema(title = "tag名称", required = false) - private String tagName; - - @Schema(title = "用于排除的tag名称", required = false) - private String excludeTagName; - - @Schema(title = "用于排除的源分支名称", required = false) - private String excludeSourceBranchName; - - @Schema(title = "用于包含的源分支名称", required = false) - private String includeSourceBranchName; - - @Schema(title = "用于包含的提交信息", required = false) - private String includeCommitMsg; - - @Schema(title = "用于排除的提交信息", required = false) - private String excludeCommitMsg; - - @Schema(title = "push事件action") - private List includePushAction; - - @Schema(title = "mr事件action") - private List includeMrAction; - - public CodeGitlabWebHookTriggerElement(String name, String id, String status) { - super(name, id, status); - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return StartType.WEB_HOOK.name().equals(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } - - @Override - public List triggerCondition() { - List props; - switch (eventType) { - case PUSH: - props = List.of( - TriggerElementPropUtils.vuexInput("action", joinToString(includePushAction)), - TriggerElementPropUtils.vuexInput("branchName", branchName), - TriggerElementPropUtils.vuexInput("excludeBranchName", excludeBranchName), - TriggerElementPropUtils.vuexInput("includePaths", includePaths), - TriggerElementPropUtils.vuexInput("excludePaths", excludePaths), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ); - break; - case MERGE_REQUEST: - props = List.of( - TriggerElementPropUtils.vuexInput("action", joinToString(includeMrAction)), - TriggerElementPropUtils.vuexInput("branchName", branchName), - TriggerElementPropUtils.vuexInput("excludeBranchName", excludeBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includePaths", includePaths), - TriggerElementPropUtils.vuexInput("excludePaths", excludePaths), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ); - break; - case MERGE_REQUEST_ACCEPT: - props = List.of( - TriggerElementPropUtils.vuexInput("action", "merge"), - TriggerElementPropUtils.vuexInput("branchName", branchName), - TriggerElementPropUtils.vuexInput("excludeBranchName", excludeBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", includeSourceBranchName), - TriggerElementPropUtils.vuexInput("includePaths", includePaths), - TriggerElementPropUtils.vuexInput("excludePaths", excludePaths), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ); - break; - case TAG_PUSH: - props = List.of( - TriggerElementPropUtils.vuexInput("tagName", tagName), - TriggerElementPropUtils.vuexInput("excludeTagName", excludeTagName) - ); - break; - default: - props = List.of(); - } - return props.stream().filter(java.util.Objects::nonNull).toList(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeP4WebHookTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeP4WebHookTriggerElement.java deleted file mode 100644 index 36d8a9c2..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeP4WebHookTriggerElement.java +++ /dev/null @@ -1,103 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.enums.TriggerRepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.ElementProp; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeEventType; -import cd.casic.ci.common.pipeline.utils.TriggerElementPropUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:CodeP4WebHookTriggerElement - * @Date:2025/03/27 10:20 - * @Filename:CodeP4WebHookTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "p4事件触发", description = CodeP4WebHookTriggerElement.classType) -public class CodeP4WebHookTriggerElement extends WebHookTriggerElement { - public static final String classType = "codeP4WebHookTrigger"; - - @Schema(title = "任务名称", required = true) - private String name = "P4事件触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "数据", required = true) - private CodeP4WebHookTriggerData data; - - public CodeP4WebHookTriggerElement(String name, String id, String status) { - super(name, id, status); - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return StartType.WEB_HOOK.name().equals(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } - - @Override - public List triggerCondition() { - CodeP4WebHookTriggerInput input = data.getInput(); - List props; - switch (input.getEventType()) { - case CHANGE_COMMIT: - case CHANGE_SUBMIT: - case CHANGE_CONTENT: - case SHELVE_COMMIT: - case SHELVE_SUBMIT: - case SHELVE_DELETE: - props = List.of( - TriggerElementPropUtils.vuexInput("includePaths", input.getIncludePaths()), - TriggerElementPropUtils.vuexInput("excludePaths", input.getExcludePaths()) - ); - break; - default: - props = List.of(); - } - return props.stream().filter(java.util.Objects::nonNull).toList(); - } -} - -@Data -@Accessors(chain = true) -class CodeP4WebHookTriggerData { - private CodeP4WebHookTriggerInput input; -} - -@Data -@Accessors(chain = true) -class CodeP4WebHookTriggerInput { - @Schema(title = "仓库ID", required = true) - private String repositoryHashId; - - @Schema(title = "新版的git原子的类型") - private TriggerRepositoryType repositoryType; - - @Schema(title = "新版的git代码库名") - private String repositoryName; - - @Schema(title = "用于包含的路径", required = false) - private String includePaths; - - @Schema(title = "用于排除的路径", required = false) - private String excludePaths; - - @Schema(title = "事件类型", required = false) - private CodeEventType eventType; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeSVNWebHookTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeSVNWebHookTriggerElement.java deleted file mode 100644 index 03fca4f5..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeSVNWebHookTriggerElement.java +++ /dev/null @@ -1,83 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.enums.TriggerRepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.ElementProp; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.PathFilterType; -import cd.casic.ci.common.pipeline.utils.TriggerElementPropUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:CodeSVNWebHookTriggerElement - * @Date:2025/03/27 10:09 - * @Filename:CodeSVNWebHookTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "SVN仓库代码提交触发", description = CodeSVNWebHookTriggerElement.classType) -public class CodeSVNWebHookTriggerElement extends WebHookTriggerElement { - public static final String classType = "codeSVNWebHookTrigger"; - - @Schema(title = "任务名称", required = true) - private String name = "SVN事件触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "仓库ID", required = true) - private String repositoryHashId; - - @Schema(title = "路径过滤类型", required = true) - private PathFilterType pathFilterType = PathFilterType.NamePrefixFilter; - - @Schema(title = "相对路径", required = true) - private String relativePath; - - @Schema(title = "排除的路径", required = false) - private String excludePaths; - - @Schema(title = "用户黑名单", required = false) - private List excludeUsers; - - @Schema(title = "用户白名单", required = false) - private List includeUsers; - - @Schema(title = "新版的svn原子的类型") - private TriggerRepositoryType repositoryType; - - @Schema(title = "新版的svn代码库名") - private String repositoryName; - - public CodeSVNWebHookTriggerElement(String name, String id, String status) { - super(name, id, status); - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return StartType.WEB_HOOK.name().equals(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } - - @Override - public List triggerCondition() { - return List.of( - TriggerElementPropUtils.vuexInput("relativePath", relativePath), - TriggerElementPropUtils.vuexInput("excludePaths", excludePaths), - TriggerElementPropUtils.staffInput("includeUsers", includeUsers), - TriggerElementPropUtils.staffInput("excludeUsers", excludeUsers) - ).stream().filter(java.util.Objects::nonNull).toList(); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeTGitWebHookTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeTGitWebHookTriggerElement.java deleted file mode 100644 index 5beb029a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/CodeTGitWebHookTriggerElement.java +++ /dev/null @@ -1,222 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.enums.TriggerRepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.ElementProp; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeEventType; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.PathFilterType; -import cd.casic.ci.common.pipeline.utils.TriggerElementPropUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:CodeTGitWebHookTriggerElement - * @Date:2025/03/27 10:05 - * @Filename:CodeTGitWebHookTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "TGit事件触发", description = CodeTGitWebHookTriggerElement.classType) -public class CodeTGitWebHookTriggerElement extends WebHookTriggerElement { - public static final String classType = "codeTGitWebHookTrigger"; - - @Schema(title = "任务名称", required = true) - private String name = "TGit事件触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "数据", required = true) - private CodeTGitWebHookTriggerData data; - - public CodeTGitWebHookTriggerElement(String name, String id, String status) { - super(name, id, status); - } - - @Override - public String getClassType() { - return classType; - } - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return StartType.WEB_HOOK.name().equals(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } - - @Override - public List triggerCondition() { - CodeTGitWebHookTriggerInput input = data.getInput(); - List props; - switch (input.getEventType()) { - case PUSH: - props = List.of( - TriggerElementPropUtils.vuexInput("action", joinToString(input.getIncludePushAction())), - TriggerElementPropUtils.vuexInput("branchName", input.getBranchName()), - TriggerElementPropUtils.vuexInput("excludeBranchName", input.getExcludeBranchName()), - TriggerElementPropUtils.vuexInput("includePaths", input.getIncludePaths()), - TriggerElementPropUtils.vuexInput("excludePaths", input.getExcludePaths()), - TriggerElementPropUtils.staffInput("includeUsers", input.getIncludeUsers()), - TriggerElementPropUtils.staffInput("excludeUsers", input.getExcludeUsers()) - ); - break; - case MERGE_REQUEST: - props = List.of( - TriggerElementPropUtils.vuexInput("action", joinToString(input.getIncludeMrAction())), - TriggerElementPropUtils.selector("skip-wip", List.of((input.getSkipWip() != null ? input.getSkipWip().toString() : "false"))), - TriggerElementPropUtils.vuexInput("branchName", input.getBranchName()), - TriggerElementPropUtils.vuexInput("excludeBranchName", input.getExcludeBranchName()), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", input.getIncludeSourceBranchName()), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", input.getIncludeSourceBranchName()), - TriggerElementPropUtils.vuexInput("includePaths", input.getIncludePaths()), - TriggerElementPropUtils.vuexInput("excludePaths", input.getExcludePaths()), - TriggerElementPropUtils.staffInput("includeUsers", input.getIncludeUsers()), - TriggerElementPropUtils.staffInput("excludeUsers", input.getExcludeUsers()) - ); - break; - case MERGE_REQUEST_ACCEPT: - props = List.of( - TriggerElementPropUtils.vuexInput("action", "merge"), - TriggerElementPropUtils.vuexInput("branchName", input.getBranchName()), - TriggerElementPropUtils.vuexInput("excludeBranchName", input.getExcludeBranchName()), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", input.getIncludeSourceBranchName()), - TriggerElementPropUtils.vuexInput("includeSourceBranchName", input.getIncludeSourceBranchName()), - TriggerElementPropUtils.vuexInput("includePaths", input.getIncludePaths()), - TriggerElementPropUtils.vuexInput("excludePaths", input.getExcludePaths()), - TriggerElementPropUtils.staffInput("includeUsers", input.getIncludeUsers()), - TriggerElementPropUtils.staffInput("excludeUsers", input.getExcludeUsers()) - ); - break; - case TAG_PUSH: - props = List.of( - TriggerElementPropUtils.vuexInput("tagName", input.getTagName()), - TriggerElementPropUtils.vuexInput("excludeTagName", input.getExcludeTagName()), - TriggerElementPropUtils.vuexInput("fromBranches", input.getFromBranches()), - TriggerElementPropUtils.staffInput("includeUsers", input.getIncludeUsers()), - TriggerElementPropUtils.staffInput("excludeUsers", input.getExcludeUsers()) - ); - break; - case REVIEW: - props = List.of( - TriggerElementPropUtils.selector("includeCrState", input.getIncludeCrState()) - ); - break; - case ISSUES: - props = List.of( - TriggerElementPropUtils.selector("includeIssueAction", input.getIncludeIssueAction()) - ); - break; - case NOTE: - props = List.of( - TriggerElementPropUtils.selector("includeNoteTypes", input.getIncludeNoteTypes()), - TriggerElementPropUtils.vuexInput("includeNoteComment", input.getIncludeNoteComment()) - ); - break; - default: - props = List.of(); - } - return props.stream().filter(java.util.Objects::nonNull).toList(); - } -} - -@Data -@Accessors(chain = true) -class CodeTGitWebHookTriggerData { - private CodeTGitWebHookTriggerInput input; -} - -@Data -@Accessors(chain = true) -class CodeTGitWebHookTriggerInput { - @Schema(title = "仓库ID", required = true) - private String repositoryHashId; - - @Schema(title = "分支名称", required = false) - private String branchName; - - @Schema(title = "用于排除的分支名", required = false) - private String excludeBranchName; - - @Schema(title = "路径过滤类型", required = true) - private PathFilterType pathFilterType = PathFilterType.NamePrefixFilter; - - @Schema(title = "用于包含的路径", required = false) - private String includePaths; - - @Schema(title = "用于排除的路径", required = false) - private String excludePaths; - - @Schema(title = "用户白名单", required = false) - private List includeUsers; - - @Schema(title = "用于排除的user id", required = false) - private List excludeUsers; - - @Schema(title = "事件类型", required = false) - private CodeEventType eventType; - - @Schema(title = "是否为block", required = false) - private Boolean block; - - @Schema(title = "新版的git原子的类型") - private TriggerRepositoryType repositoryType; - - @Schema(title = "新版的git代码库名") - private String repositoryName; - - @Schema(title = "tag名称", required = false) - private String tagName; - - @Schema(title = "用于排除的tag名称", required = false) - private String excludeTagName; - - @Schema(title = "tag从哪条分支创建", required = false) - private String fromBranches; - - @Schema(title = "用于排除的源分支名称", required = false) - private String excludeSourceBranchName; - - @Schema(title = "用于包含的源分支名称", required = false) - private String includeSourceBranchName; - - @Schema(title = "webhook队列", required = false) - private Boolean webhookQueue = false; - - @Schema(title = "code review 状态", required = false) - private List includeCrState; - - @Schema(title = "code review 类型", required = false) - private List includeCrTypes; - - @Schema(title = "code note comment", required = false) - private String includeNoteComment; - - @Schema(title = "code note 类型", required = false) - private List includeNoteTypes; - - @Schema(title = "是否启用回写") - private Boolean enableCheck = true; - - @Schema(title = "issue事件action") - private List includeIssueAction; - - @Schema(title = "mr事件action") - private List includeMrAction; - - @Schema(title = "push事件action") - private List includePushAction; - - @Schema(title = "是否启用第三方过滤") - private Boolean enableThirdFilter = false; - - @Schema(title = "跳过WIP") - private Boolean skipWip = false; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/ManualTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/ManualTriggerElement.java deleted file mode 100644 index 15cb7142..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/ManualTriggerElement.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:ManualTriggerElement - * @Date:2025/03/27 10:04 - * @Filename:ManualTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "手动触发") -public class ManualTriggerElement extends Element { - public static final String classType = "manualTrigger"; - - @Schema(title = "任务名称", required = true) - private String name = "手动触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "是否可跳过插件", required = false) - private Boolean canElementSkip; - - @Schema(title = "是否使用最近一次的参数进行构建", required = false) - private Boolean useLatestParameters; - - @Override - public String getClassType() { - return classType; - } - - private Set startTypeSet = Set.of(StartType.MANUAL.name(), StartType.SERVICE.name(), StartType.PIPELINE.name()); - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return startTypeSet.contains(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/RemoteTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/RemoteTriggerElement.java deleted file mode 100644 index 8f1d3f6d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/RemoteTriggerElement.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:RemoteTriggerElement - * @Date:2025/03/27 10:01 - * @Filename:RemoteTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "远程触发触发") -public class RemoteTriggerElement extends Element { - - public static final String classType = "remoteTrigger"; - - @Schema(title = "任务名称", required = true) - private String name = "远程触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "是否可跳过插件", required = false) - private Boolean canElementSkip; - - @Schema(title = "远程触发token", required = true) - private String remoteToken; - - @Override - public String getClassType() { - return classType; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/TimerTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/TimerTriggerElement.java deleted file mode 100644 index 7110a883..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/TimerTriggerElement.java +++ /dev/null @@ -1,91 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.enums.TriggerRepositoryType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -import java.util.Arrays; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:TimerTriggerElement - * @Date:2025/03/27 10:00 - * @Filename:TimerTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "定时触发") -public class TimerTriggerElement extends Element { - public static final String classType = "timerTrigger"; - - @Schema(title = "任务名称", required = true) - private String name = "定时触发"; - - @Schema(title = "id", required = false) - private String id; - - @Schema(title = "状态", required = false) - private String status; - - @Schema(title = "定时表达式", required = false) - @Deprecated - private String expression; - - @Schema(title = "改进后的表达式", required = false) - private List newExpression; - - @Schema(title = "高级定时表达式", required = false) - private List advanceExpression; - - @Schema(title = "源代码未更新则不触发构建", required = false) - private Boolean noScm; - - @Schema(title = "指定代码库分支", required = false) - private List branches; - - @Schema(title = "代码库类型", required = false) - private TriggerRepositoryType repositoryType; - - @Schema(title = "代码库HashId", required = false) - private String repoHashId; - - @Schema(title = "指定代码库别名", required = false) - private String repoName; - - @Override - public String getClassType() { - return classType; - } - - private boolean isOldExpress() { - return (newExpression == null || newExpression.isEmpty()) && - (advanceExpression == null || advanceExpression.isEmpty()); - } - - private String checkAndSetSecond(String expression) { - String trimmedExpression = expression.trim(); - String[] expressionParts = trimmedExpression.split(" "); - if (!"0".equals(expressionParts[0])) { - List newExpressionParts = Arrays.asList(expressionParts); - newExpressionParts.set(0, "0"); - return String.join(" ", newExpressionParts); - } - return trimmedExpression; - } - - @Override - public String findFirstTaskIdByStartType(StartType startType) { - return StartType.TIME_TRIGGER.name().equals(startType.name()) ? this.id : super.findFirstTaskIdByStartType(startType); - } - - public boolean enableRepoConfig() { - return TriggerRepositoryType.SELF.equals(repositoryType) || - (TriggerRepositoryType.ID.equals(repositoryType) && repoHashId != null && !repoHashId.isBlank()) || - (TriggerRepositoryType.NAME.equals(repositoryType) && repoName != null && !repoName.isBlank()); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/WebHookTriggerElement.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/WebHookTriggerElement.java deleted file mode 100644 index bfc4a334..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/WebHookTriggerElement.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.ElementProp; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.experimental.Accessors; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger - * @Project:ops-pro - * @name:WebHookTriggerElement - * @Date:2025/03/27 9:59 - * @Filename:WebHookTriggerElement - * @description:Todo - */ -@Accessors(chain = true) -@Schema(title = "Webhook基础类") -public abstract class WebHookTriggerElement extends Element { - public WebHookTriggerElement(String name, String id, String status) { - //super(name, id, status); - } - - public List triggerCondition() { - return List.of(); - } - - public String joinToString(List list) { - return list == null || list.isEmpty() ? "" : String.join(",", list); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/CodeEventType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/CodeEventType.java deleted file mode 100644 index 2a502f2f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/CodeEventType.java +++ /dev/null @@ -1,104 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger.enums; - - -import cd.casic.ci.common.pipeline.enums.ScmType; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger.enums - * @Project:ops-pro - * @name:CodeEventType - * @Date:2025/03/27 10:26 - * @Filename:CodeEventType - * @description:Todo - */ -public enum CodeEventType { - // Git events - PUSH, - TAG_PUSH, - MERGE_REQUEST, - MERGE_REQUEST_ACCEPT, - ISSUES, - NOTE, - REVIEW, - // GitHub events - CREATE, - PULL_REQUEST, - // SVN events - POST_COMMIT, - LOCK_COMMIT, - PRE_COMMIT, - // Perforce (P4) events - CHANGE_COMMIT, - PUSH_SUBMIT, - CHANGE_CONTENT, - CHANGE_SUBMIT, - PUSH_CONTENT, - PUSH_COMMIT, - FIX_ADD, - FIX_DELETE, - FORM_COMMIT, - SHELVE_COMMIT, - SHELVE_DELETE, - SHELVE_SUBMIT, - - // Sub-pipeline - PARENT_PIPELINE; - - public static final String MESSAGE_CODE_PREFIX = "EVENT_TYPE"; - - // Git events - public static final List CODE_GIT_EVENTS = List.of( - PUSH, MERGE_REQUEST, MERGE_REQUEST_ACCEPT, TAG_PUSH, NOTE, REVIEW, ISSUES - ); - - // GitHub events - public static final List CODE_GITHUB_EVENTS = List.of( - PUSH, PULL_REQUEST, CREATE, REVIEW, ISSUES, NOTE - ); - - // Perforce (P4) events - public static final List CODE_P4_EVENTS = List.of( - CHANGE_COMMIT, CHANGE_SUBMIT, CHANGE_CONTENT, SHELVE_COMMIT, SHELVE_SUBMIT - ); - - // GitLab events - public static final List CODE_GITLAB_EVENTS = List.of( - PUSH, MERGE_REQUEST, MERGE_REQUEST_ACCEPT, TAG_PUSH - ); - - // Tencent Git (TGit) events - public static final List CODE_TGIT_EVENTS = List.of( - PUSH, MERGE_REQUEST, MERGE_REQUEST_ACCEPT, TAG_PUSH, NOTE, ISSUES - ); - - // SVN events - public static final List CODE_SVN_EVENTS = List.of( - POST_COMMIT, PRE_COMMIT, LOCK_COMMIT - ); - - public static List getEventsByScmType(ScmType scmType) { - if (scmType == null) { - return List.of(values()); - } - switch (scmType) { - case CODE_GIT: - return new ArrayList<>(CODE_GIT_EVENTS); - case CODE_TGIT: - return new ArrayList<>(CODE_TGIT_EVENTS); - case GITHUB: - return new ArrayList<>(CODE_GITHUB_EVENTS); - case CODE_GITLAB: - return new ArrayList<>(CODE_GITLAB_EVENTS); - case CODE_SVN: - return new ArrayList<>(CODE_SVN_EVENTS); - case CODE_P4: - return new ArrayList<>(CODE_P4_EVENTS); - default: - return List.of(values()); - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/CodeType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/CodeType.java deleted file mode 100644 index bc1caa2d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/CodeType.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger.enums - * @Project:ops-pro - * @name:CodeType - * @Date:2025/03/27 10:28 - * @Filename:CodeType - * @description:Todo - */ -public enum CodeType { - SVN, - GIT, - GITLAB, - GITHUB, - TGIT, - P4 -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/PathFilterType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/PathFilterType.java deleted file mode 100644 index a6f6d86b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/element/trigger/enums/PathFilterType.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.element.trigger.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.element.trigger.enums - * @Project:ops-pro - * @name:PathFilterType - * @Date:2025/03/27 10:28 - * @Filename:PathFilterType - * @description:Todo - */ -public enum PathFilterType { - NamePrefixFilter, - RegexBasedFilter -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/CallBackData.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/CallBackData.java deleted file mode 100644 index 9eb238c2..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/CallBackData.java +++ /dev/null @@ -1,129 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.event; - -import cd.casic.ci.common.pipeline.enums.CallBackEvent; -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname CallBackData - * @Description TODO - * @Date 2025/4/2 9:46 - */ -@Data -class CallBackData { - private final CallBackEvent event; - private final T data; - - // 构造函数 - public CallBackData(CallBackEvent event, T data) { - this.event = event; - this.data = data; - } -} - -@Data -class PipelineEvent { - private final String pipelineId; - private final String pipelineName; - private final String userId; - private final long updateTime; - private final String projectId; -} - -@Data -class StreamEnabledEvent { - private final String userId; - private final long gitProjectId; - private final String gitProjectUrl; - private final boolean enable; -} - -@Data -class BuildEvent { - private final String buildId; - private final String pipelineId; - private final String pipelineName; - private final String userId; - private final String triggerUser; - private final String cancelUserId; - private final String status; - private final long startTime; - private final long endTime; - private final SimpleModel model; - private final String projectId; - private final String trigger; - private final String stageId; - private final String taskId; - private final int buildNo; - private final Boolean debug; - - // 构造函数,使用了默认值的设置 - public BuildEvent(String buildId, String pipelineId, String pipelineName, String userId, String triggerUser, String cancelUserId, String status, long startTime, long endTime, SimpleModel model, String projectId, String trigger, String stageId, String taskId, int buildNo, Boolean debug) { - this.buildId = buildId; - this.pipelineId = pipelineId; - this.pipelineName = pipelineName; - this.userId = userId; - this.triggerUser = triggerUser; - this.cancelUserId = cancelUserId; - this.status = status; - this.startTime = startTime; - this.endTime = endTime; - this.model = model; - this.projectId = projectId; - this.trigger = trigger; - this.stageId = stageId; - this.taskId = taskId; - this.buildNo = buildNo; - this.debug = debug; - } -} - -@Data -class SimpleModel { - private final List stages; -} - -@Data -class SimpleStage { - private final String stageName; - private final String name; - private String status; - private long startTime; - private long endTime; - private final List jobs; -} - -@Data -class SimpleJob { - private final String jobName; - private final String status; - private final long startTime; - private final long endTime; - private final List tasks; -} - -@Data -class SimpleTask { - private final String taskId; - private final String taskName; - private final String atomCode; - private final String status; - private final long startTime; - private final long endTime; -} - -@Data -class ProjectCallbackEvent { - private final String projectId; - private final String projectName; - private final boolean enable; - private final String userId; -} - -// 定义回调常量的类 -class CallbackConstants { - // 项目级回调标志位 - static final String DEVOPS_ALL_PROJECT = "DEVOPS_ALL_PROJECT"; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/CallBackNetWorkRegionType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/CallBackNetWorkRegionType.java deleted file mode 100644 index 4bf9af9a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/CallBackNetWorkRegionType.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.event; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname CallBackNetWorkRegionType - * @Description TODO - * @Date 2025/4/2 9:42 - */ -@AllArgsConstructor -@Getter -public enum CallBackNetWorkRegionType { - DEVNET("DEVNET"), - OSS("OSS"), - IDC("IDC"); - - private final String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/IEvent.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/IEvent.java deleted file mode 100644 index 4c966fd1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/IEvent.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.event; - -import lombok.Data; - -@Data -public class IEvent { - private Integer delayMills; - private Integer retryTime; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/PipelineCallbackEvent.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/PipelineCallbackEvent.java deleted file mode 100644 index e5080366..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/PipelineCallbackEvent.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.event; - -import cd.casic.ci.common.pipeline.enums.CallBackEvent; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PipelineCallbackEvent - * @Description TODO - * @Date 2025/4/2 9:43 - */ -@Data -public class PipelineCallbackEvent { - private final CallBackEvent callbackEvent; - private String callbackUrl; - private final String secretToken; - private final String callbackName; - private final CallBackNetWorkRegionType region; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/ProjectPipelineCallBack.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/ProjectPipelineCallBack.java deleted file mode 100644 index d3ff3e31..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/event/ProjectPipelineCallBack.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.event; - -import cd.casic.ci.common.pipeline.pojo.secret.ISecretParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.LocalDateTime; - -/** - * @author by mianbin - * @Classname ProjectPipelineCallBack - * @Description TODO - * @Date 2025/4/2 9:43 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "项目的流水线回调配置") -public class ProjectPipelineCallBack { - @Schema(title = "流水线id", required = false) - private Long id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "回调url地址", required = false) - private String callBackUrl; - @Schema(title = "事件", required = false) - private String events; - @Schema(title = "密钥", required = false) - private String secretToken; - @Schema(title = "回调是否启用", required = false) - private Boolean enable = true; - @Schema(title = "回调是否启用", required = false) - private LocalDateTime failureTime; - @Schema(title = "凭证参数", required = false) - private ISecretParam secretParam; - @Schema(title = "回调名称", required = false) - private String name; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/git/GitPullMode.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/git/GitPullMode.java deleted file mode 100644 index e03d5b75..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/git/GitPullMode.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.git; - -import cd.casic.ci.common.pipeline.enums.GitPullModeType; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.git - * @Project:ops-pro - * @name:GitPullMode - * @Date:2025/03/27 10:24 - * @Filename:GitPullMode - * @description:Todo - */ -@Data -@AllArgsConstructor -public class GitPullMode { - private GitPullModeType type; - private String value; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/secret/HeaderSecretParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/secret/HeaderSecretParam.java deleted file mode 100644 index 98a4e043..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/secret/HeaderSecretParam.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.secret; - -import lombok.Data; -import okhttp3.Request; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname HeaderSecretParam - * @Description TODO - * @Date 2025/4/2 9:45 - */ -@Data -class HeaderSecretParam implements ISecretParam { - private Map headers; - - @Override - public void secret(Request.Builder builder) { - for (Map.Entry header : headers.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - } - - public static final String classType = "header"; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/secret/ISecretParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/secret/ISecretParam.java deleted file mode 100644 index 5c35e206..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/secret/ISecretParam.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.secret; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import okhttp3.Request; - -/** - * @author by mianbin - * @Classname ISecretParam - * @Description TODO - * @Date 2025/4/2 9:44 - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = HeaderSecretParam.class, name = HeaderSecretParam.classType) -}) -public interface ISecretParam { - void secret(Request.Builder builder); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineRunLockType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineRunLockType.java deleted file mode 100644 index eb63f4eb..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineRunLockType.java +++ /dev/null @@ -1,53 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.setting - * @Project:ops-pro - * @name:PipelineRunLockType - * @Date:2025/03/26 14:14 - * @Filename:PipelineRunLockType - * @description:Todo - */ -@Getter -@Schema(title = "流水线运行锁定方式") -public enum PipelineRunLockType { - @Schema(title = "可同时运行多个构建任务(默认)") - MULTIPLE, - @Schema(title = "同一时间最多只能运行一个构建任务") - SINGLE, - @Schema(title = "最多只能运行一个构建任务,且失败时锁定") - SINGLE_LOCK, - @Schema(title = "锁定流水线,任何触发方式都无法运行") - LOCK, - @Schema(title = "并发组锁定,项目级别,同一组的构建为SINGLE模式") - GROUP_LOCK; - - /** - * 注意,数字与枚举的ordinal不一样,ordinal是下标为0开始 ,而这以1为开始 - */ - public static int toValue(PipelineRunLockType type) { - return switch (type) { - case MULTIPLE -> 1; - case SINGLE -> 2; - case SINGLE_LOCK -> 3; - case LOCK -> 4; - case GROUP_LOCK -> 5; - }; - } - - public static PipelineRunLockType valueOf(int value) { - return switch (value) { - case 1 -> MULTIPLE; - case 2 -> SINGLE; - case 3 -> SINGLE_LOCK; - case 4 -> LOCK; - case 5 -> GROUP_LOCK; - default -> MULTIPLE; - }; - } -} - diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineSetting.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineSetting.java deleted file mode 100644 index 4edda3dd..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineSetting.java +++ /dev/null @@ -1,153 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.setting; - -import cd.casic.ci.common.pipeline.pojo.PipelineAsCodeSettings; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -import static cd.casic.ci.common.pipeline.utils.Constants.*; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.setting - * @Project:ops-pro - * @name:PipelineSetting - * @Date:2025/03/26 14:18 - * @Filename:PipelineSetting - */ -@Data -@Accessors(chain = true) -@Schema(title = "流水线配置") -public class PipelineSetting { - @Schema(title = "项目id", required = false, readOnly = true) - private String projectId = ""; - @Schema(title = "流水线id", required = false, readOnly = true) - private String pipelineId = ""; - // 流水线基础配置 - @Schema(title = "流水线名称", required = false) - private String pipelineName = ""; - @Schema(title = "版本", required = false) - private int version = 1; - @Schema(title = "描述", required = false) - private String desc = ""; - @Schema(title = "标签ID列表", required = false) - private List labels = List.of(); - @Schema(title = "标签名称列表(仅用于前端展示,不参与数据保存)", required = false) - private List labelNames = List.of(); - @Schema(title = "构建号生成规则", required = false) - private String buildNumRule; // 构建号生成规则 - // 通知订阅相关配置 - //"被successSubscriptionList取代" - @Schema(title = "订阅成功相关", required = false) - private Subscription successSubscription = new Subscription(); - //"被failSubscriptionList取代" - @Schema(title = "订阅失败相关", required = false) - private Subscription failSubscription = new Subscription(); - @Schema(title = "订阅成功通知组", required = false) - private List successSubscriptionList = null; - @Schema(title = "订阅失败通知组", required = false) - private List failSubscriptionList = null; - // 运行控制、流水线禁用相关配置 - @Schema(title = "Lock 类型", required = false) - private PipelineRunLockType runLockType = PipelineRunLockType.SINGLE_LOCK; - @Schema(title = "最大排队时长", required = false) - private int waitQueueTimeMinute = PIPELINE_SETTING_WAIT_QUEUE_TIME_MINUTE_DEFAULT; - @Schema(title = "最大排队数量", required = false) - private int maxQueueSize = PIPELINE_SETTING_MAX_QUEUE_SIZE_DEFAULT; - @Schema(title = "并发时,设定的group", required = false) - private String concurrencyGroup = PIPELINE_SETTING_CONCURRENCY_GROUP_DEFAULT; - @Schema(title = "并发时,是否相同group取消正在执行的流水线", required = false) - private boolean concurrencyCancelInProgress = false; - @Schema(title = "并发构建数量限制", required = false) - private Integer maxConRunningQueueSize = null; // MULTIPLE类型时,并发构建数量限制 - // 平台系统控制相关配置 —— 不作为生成版本的配置 - @Schema(title = "保存流水线编排的最大个数", required = false) - private int maxPipelineResNum = PIPELINE_RES_NUM_MIN; // 保存流水线编排的最大个数 - @Schema(title = "重试时清理引擎变量表", required = false) - private Boolean cleanVariablesWhenRetry = false; - @Schema(title = "YAML流水线特殊配置", required = false) - private PipelineAsCodeSettings pipelineAsCodeSettings; - - public static PipelineSetting defaultSetting( - String projectId, - String pipelineId, - String pipelineName, - Integer maxPipelineResNum, - Subscription failSubscription, - Boolean inheritedDialectSetting, - String pipelineDialectSetting - ) { - - return new PipelineSetting() - .setProjectId(projectId) - .setPipelineId(pipelineId) - .setPipelineName(pipelineName) - .setVersion(1) - .setDesc(pipelineName) - .setMaxPipelineResNum(maxPipelineResNum != null ? maxPipelineResNum : PIPELINE_RES_NUM_MIN) - .setWaitQueueTimeMinute(PIPELINE_SETTING_WAIT_QUEUE_TIME_MINUTE_DEFAULT) - .setMaxQueueSize(PIPELINE_SETTING_MAX_QUEUE_SIZE_DEFAULT) - .setRunLockType(PipelineRunLockType.MULTIPLE) - .setSuccessSubscription(null) - .setFailSubscription(null) - .setSuccessSubscriptionList(List.of()) - .setFailSubscriptionList(failSubscription != null ? List.of(failSubscription) : null) - .setPipelineAsCodeSettings(PipelineAsCodeSettings.initDialect( - inheritedDialectSetting, - pipelineDialectSetting - )); - } - - // 校验流水线的通知设置是否为空,即用户未配置或使用默认配置 - public boolean notifySettingIsNull() { - boolean res = true; - if (successSubscriptionList != null && !successSubscriptionList.isEmpty() && - successSubscriptionList.stream().anyMatch(subscription -> !subscription.getTypes().isEmpty())) { - res = false; - } - if (failSubscriptionList != null && !failSubscriptionList.isEmpty() && - failSubscriptionList.stream().anyMatch(subscription -> !subscription.getTypes().isEmpty())) { - res = false; - } - if (successSubscription != null && !successSubscription.getTypes().isEmpty()) { - res = false; - } - if (failSubscription != null && !failSubscription.getTypes().isEmpty()) { - res = false; - } - return res; - } - - // 校验流水线的并发组设置是否为空,即用户未配置或使用默认配置 - public boolean concurrencySettingIsNull() { - return runLockType != PipelineRunLockType.GROUP_LOCK; - } - - public void fixSubscriptions() { - // 只有旧数据向新数据的更新,取消旧数据的保存 - if (successSubscriptionList == null && successSubscription != null) { - successSubscriptionList = List.of(successSubscription); - } - successSubscription = successSubscriptionList != null ? successSubscriptionList.get(0) : null; - if (failSubscriptionList == null && failSubscription != null) { - failSubscriptionList = List.of(failSubscription); - } - failSubscription = failSubscriptionList != null ? failSubscriptionList.get(0) : null; - } - - public void copySubscriptionSettings(PipelineSetting other) { - this.successSubscription = other.getSuccessSubscription(); - this.successSubscriptionList = other.getSuccessSubscriptionList(); - this.failSubscription = other.getFailSubscription(); - this.failSubscriptionList = other.getFailSubscriptionList(); - } - - public void copyConcurrencyGroup(PipelineSetting other) { - this.concurrencyGroup = other.getConcurrencyGroup(); - this.concurrencyCancelInProgress = other.concurrencyCancelInProgress; - this.maxConRunningQueueSize = PIPELINE_SETTING_MAX_CON_QUEUE_SIZE_MAX; - } - -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineSubscriptionType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineSubscriptionType.java deleted file mode 100644 index ba9d51a4..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/PipelineSubscriptionType.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.setting - * @Project:ops-pro - * @name:PipelineSubscriptionType - * @Date:2025/03/26 14:19 - * @Filename:PipelineSubscriptionType - * @description:Todo - */ -@Getter -@Schema(title = "流水线-订阅-消息类型") -public enum PipelineSubscriptionType { - EMAIL, - RTX, - WECHAT, - SMS, - WEWORK, - VOICE, - // 企业微信群通知 - WEWORK_GROUP -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/Subscription.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/Subscription.java deleted file mode 100644 index a8c9edc1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/Subscription.java +++ /dev/null @@ -1,53 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.HashSet; -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.setting - * @Project:ops-pro - * @name:Subscription - * @Date:2025/03/26 14:20 - * @Filename:Subscription - * @description:Todo - */ -@Data -@Accessors(chain = true) -@Schema(title = "设置-订阅消息") -public class Subscription { - @Schema(title = "通知方式(email, rtx)", required = true) - private Set types = Set.of(); - @Schema(title = "分组", required = false) - private Set groups = Set.of(); - @Schema(title = "通知人员", required = false) - private String users = ""; - @Schema(title = "企业微信群通知开关", required = false) - private boolean wechatGroupFlag = false; - @Schema(title = "企业微信群通知群ID", required = false) - private String wechatGroup = ""; - @Schema(title = "企业微信群通知转为Markdown格式开关", required = false) - private boolean wechatGroupMarkdownFlag = false; - @Schema(title = "通知的流水线详情连接开关", required = false) - private boolean detailFlag = false; - @Schema(title = "自定义通知内容", required = false) - private String content = ""; - - // 转换企业微信组通知 - public Subscription fixWeworkGroupType() { - Set fixTypes; - if (wechatGroupFlag && !types.contains(PipelineSubscriptionType.WEWORK_GROUP)) { - fixTypes = new HashSet<>(types); - fixTypes.add(PipelineSubscriptionType.WEWORK_GROUP); - } else { - fixTypes = types; - } - return new Subscription() - .setTypes(fixTypes) - .setWechatGroupFlag(false); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/SubscriptionGroup.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/SubscriptionGroup.java deleted file mode 100644 index 9998e3d0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/setting/SubscriptionGroup.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.setting; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.setting - * @Project:ops-pro - * @name:SubscriptionGroup - * @Date:2025/03/26 14:20 - * @Filename:SubscriptionGroup - * @description:Todo - */ -@Data -public class SubscriptionGroup { - private String id; - private String name; -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildRecordTimeCost.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildRecordTimeCost.java deleted file mode 100644 index 9966930e..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildRecordTimeCost.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.time; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.time - * @Project:ops-pro - * @name:BuildRecordTimeCost - * @Date:2025/03/26 11:11 - * @Filename:BuildRecordTimeCost - * @description:Todo - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "各项执行耗时(单位毫秒)") -public class BuildRecordTimeCost { - @Schema(title = "系统耗时(由总耗时减去其他得出)", required = true) - private long systemCost = 0; - @Schema(title = "执行耗时", required = true) - private long executeCost = 0; - @Schema(title = "等待耗时(包括了排队和等待人工审核操作时间)", required = true) - private long waitCost = 0; - @Schema(title = "只处于排队的耗时(流水线并发、Stage下Job并发和Job互斥)", required = true) - private long queueCost = 0; - @Schema(title = "总耗时(结束时间-开始时间)", required = true) - private long totalCost = 0; - - - public BuildRecordTimeCost(long totalCost, long waitCost, long executeCost) { - this.totalCost = totalCost; - this.waitCost = waitCost; - this.executeCost = executeCost; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildRecordTimeLine.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildRecordTimeLine.java deleted file mode 100644 index 609211de..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildRecordTimeLine.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.time; - -import cd.casic.framework.commons.util.date.DateUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.time - * @Project:ops-pro - * @name:BuildRecordTimeLine - * @Date:2025/03/26 11:11 - * @Filename:BuildRecordTimeLine - * @description:Todo - */ -@Data -@Schema(title = "各项执行耗时时刻") -public class BuildRecordTimeLine { - @Schema(title = "执行耗时时刻,计算结果需成对", required = false) - private List executeCostMoments; - @Schema(title = "等待耗时时刻,计算结果需成对", required = false) - private List waitCostMoments; - @Schema(title = "排队耗时(流水线并发和Job互斥)时刻,计算结果需成对", required = false) - private List queueCostMoments; - - @Data - @AllArgsConstructor - @Schema(title = "时间戳对") - public static class Moment { - @Schema(title = "开始时间") - private long startTime; - - @Schema(title = "结束时间") - private long endTime; - - public Moment(LocalDateTime startTime, LocalDateTime endTime) { - this.startTime = DateUtils.LocalDateTimeToMilli(startTime); - this.endTime = DateUtils.LocalDateTimeToMilli(endTime); - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildTimestampType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildTimestampType.java deleted file mode 100644 index 970ddd3e..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/time/BuildTimestampType.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.time; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.time - * @Project:ops-pro - * @name:BuildTimestampType - * @Date:2025/03/26 11:12 - * @Filename:BuildTimestampType - * @description:Todo - */ -@Getter -@AllArgsConstructor -@Schema(title = "构建详情记录-时间戳类型(勿随意删除)") -public enum BuildTimestampType { - - BUILD_REVIEW_WAITING("buildReviewWaiting"), // 流水线触发审核等待 - BUILD_CONCURRENCY_QUEUE("buildConcurrencyQueue"), // 流水线并发排队 - STAGE_CHECK_IN_WAITING("stageCheckInWaiting"), // stage准入等待 - STAGE_CHECK_OUT_WAITING("stageCheckOutWaiting"), // stage准出等待 - JOB_MUTEX_QUEUE("jobMutexQueue"), // job互斥并发排队 - JOB_AGENT_REUSE_MUTEX_QUEUE("jobAgentReuseMutexQueue"), // jobAgent复用互斥排队 - JOB_THIRD_PARTY_QUEUE("jobThirdPartyQueue"), // job第三方构建机资源排队 - JOB_CONTAINER_STARTUP("jobContainerStartup"), // job构建机启动(包含了第三方构建机资源等待) - JOB_CONTAINER_SHUTDOWN("jobContainerShutdown"), // job构建机关闭 - TASK_REVIEW_PAUSE_WAITING("taskReviewPauseWaiting"); // task等待(包括插件暂停、人工审核、质量红线审核) - - private final String action; - - // 使插件处于等待的类型 - public boolean taskCheckWait() { - return this == TASK_REVIEW_PAUSE_WAITING; - } - - // 使container处于排队的类型 - public boolean containerCheckQueue() { - return this == JOB_MUTEX_QUEUE || this == JOB_THIRD_PARTY_QUEUE || this == JOB_AGENT_REUSE_MUTEX_QUEUE; - } - - // 使stage处于等待的类型 - public boolean stageCheckWait() { - return this == STAGE_CHECK_IN_WAITING || this == STAGE_CHECK_OUT_WAITING; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/ElementInsertBody.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/ElementInsertBody.java deleted file mode 100644 index ea9ff64b..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/ElementInsertBody.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:ElementInsertBody - * @Date:2025/03/26 11:00 - * @Filename:ElementInsertBody - * @description:Todo - */ -@Data -@Schema(title = "yaml中插入插件入口") -public class ElementInsertBody { - @Schema(title = "当前yaml内容") - private String yaml = ""; - - @Schema(title = "需要插入的插件") - private Element data; - - @Schema(title = "操作类型,INSERT为插入,UPDATE为更新") - private ElementInsertType type; - - public enum ElementInsertType { - INSERT, - UPDATE - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/ElementInsertResponse.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/ElementInsertResponse.java deleted file mode 100644 index f31c8410..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/ElementInsertResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:ElementInsertResponse - * @Date:2025/03/26 11:00 - * @Filename:ElementInsertResponse - * @description:Todo - */ -@Data -@Schema(title = "yaml中插入插件返回") -public class ElementInsertResponse { - @Schema(title = "yaml内容") - private String yaml = ""; - - @Schema(title = "插入的插件定位坐标") - private TransferMark mark; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/IfType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/IfType.java deleted file mode 100644 index 4cf5c5f7..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/IfType.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:IfType - * @Date:2025/03/26 11:01 - * @Filename:IfType - * @description:Todo - */ -@Getter -@AllArgsConstructor -@Schema(title = "IfType") -public enum IfType { - @Schema(title = "Success") - SUCCESS, - @Schema(title = "Failure") - FAILURE, - @Schema(title = "Cancelled") - CANCELLED, - @Schema(title = "Canceled") - CANCELED, - @Schema(title = "Always") - ALWAYS, - @Schema(title = "Always unless cancelled") - ALWAYS_UNLESS_CANCELLED -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/MetaData.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/MetaData.java deleted file mode 100644 index f2b92c81..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/MetaData.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:MetaData - * @Date:2025/03/26 11:07 - * @Filename:MetaData - * @description:Todo - */ -@Data -public class MetaData { - private TemplateInfo templateInfo; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PositionBody.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PositionBody.java deleted file mode 100644 index e0432dbd..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PositionBody.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:PositionBody - * @Date:2025/03/26 11:01 - * @Filename:PositionBody - * @description:Todo - */ - -@Data -@Schema(title = "定位入口") -public class PositionBody { - @Schema(title = "当前yaml内容") - private String yaml = ""; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PositionResponse.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PositionResponse.java deleted file mode 100644 index 3b893cc2..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PositionResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:PositionResponse - * @Date:2025/03/26 11:01 - * @Filename:PositionResponse - * @description:Todo - */ -@Data -@Schema(title = "yaml定位") -public class PositionResponse { - @Schema(title = "定位类型,非error时应当必有") - private PositionType type; - - @Schema(title = "当定位到JOB,STEP时有效,表示当前stage的os类型") - private TransferVMBaseOS jobBaseOs; - - @Schema(title = "当定位到STAGE,JOB,STEP时有效,表示stage下标, -1 表示finally stage") - private Integer stageIndex; - - @Schema(title = "当定位到JOB,STEP时有效,表示container下标") - private Integer containerIndex; - - @Schema(title = "当定位到JOB,STEP时有效,表示job的id") - private String jobId; - - @Schema(title = "当定位到STEP时有效,表示step下标") - private Integer stepIndex; - - @Schema(title = "当定位到STEP时有效,拿到对应的element元素") - private Element element; - - @Schema(title = "转换错误") - private String error; - - public enum PositionType { - SETTING, - STAGE, - JOB, - STEP - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PreStep.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PreStep.java deleted file mode 100644 index f69c804f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PreStep.java +++ /dev/null @@ -1,77 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import com.fasterxml.jackson.annotation.JsonFilter; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:PreStep - * @Date:2025/03/26 11:01 - * @Filename:PreStep - * @description:Todo - */ -@Data -@JsonFilter("yamlMetaDataJsonFilter") -@Schema(title = "PreStep") -public class PreStep implements YamlMetaData { - private Boolean enable; - private Object checkout; - private String name; - private String id; - - @Schema(title = "if") - @JsonProperty("if") - private Object ifField; - - @Schema(title = "if-modify") - @JsonProperty("if-modify") - private List ifModify; - - private String uses; - private Map with; - - @Schema(title = "timeout-minutes") - @JsonProperty("timeout-minutes") - private String timeoutMinutes; - - @Schema(title = "continue-on-error") - @JsonProperty("continue-on-error") - private Object continueOnError; - - @Schema(title = "retry-times") - @JsonProperty("retry-times") - private Integer retryTimes; - - private Map env = new HashMap<>(); - - private String run; - private String shell; - - @Schema(title = "can-manually-retry") - @JsonProperty("can-manually-retry") - private Boolean manualRetry; - - public PreStep(String name, String stepId, String s, Map stringObjectMap) { - this.name = name; - this.id = stepId; - this.uses = s; - this.with = stringObjectMap; - } - - @Override - public MetaData getYamlMetaData() { - return yamlMetaData; - } - - private MetaData yamlMetaData; - - -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PreviewResponse.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PreviewResponse.java deleted file mode 100644 index 85a45521..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/PreviewResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:PreviewResponse - * @Date:2025/03/26 11:02 - * @Filename:PreviewResponse - * @description:Todo - */ - -@Data -@Schema(title = "流水线 yaml 带定位信息") -public class PreviewResponse { - @Schema(title = "yaml内容") - private String yaml; - - @Schema(title = "流水线编排") - private List pipeline = new ArrayList<>(); - - @Schema(title = "触发器配置") - private List trigger = new ArrayList<>(); - - @Schema(title = "通知配置") - private List notice = new ArrayList<>(); - - @Schema(title = "基础设置") - private List setting = new ArrayList<>(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/Resources.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/Resources.java deleted file mode 100644 index a1a77628..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/Resources.java +++ /dev/null @@ -1,53 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:Resources - * @Date:2025/03/26 11:02 - * @Filename:Resources - * @description:Todo - */ -@Data -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -@Schema(title = "Resources") -public class Resources { - private List repositories; - private List pools; - - @Data - public static class Repositories { - private String repository; - private String name; - private String ref; - private ResCredentials credentials; - } - - @Data - public static class ResCredentials { - @Schema(title = "personal-access-token") - @JsonProperty("personal-access-token") - private String personalAccessToken; - } - - @Data - public static class ResourcesPools { - private String from; - private String name; - - @Override - public String toString() { - return from + "+" + name; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/RunAtomParam.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/RunAtomParam.java deleted file mode 100644 index 908c3d29..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/RunAtomParam.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:RunAtomParam - * @Date:2025/03/26 11:02 - * @Filename:RunAtomParam - * @description:Todo - */ -@Data -public class RunAtomParam { - private String shell; - private String script; - private CharsetType charsetType; - - public enum CharsetType { - DEFAULT, - UTF_8, - GBK; - - public static CharsetType parse(String charset) { - for (CharsetType type : values()) { - if (type.name().equals(charset)) { - return type; - } - } - return DEFAULT; - } - } - - - public enum ShellType { - BASH("bash"), - CMD("cmd"), - POWERSHELL_CORE("pwsh"), - POWERSHELL_DESKTOP("powershell"), - PYTHON("python"), - SH("sh"), - WIN_BASH("win_bash"), - AUTO("auto"); - - private final String shellName; - - ShellType(String shellName) { - this.shellName = shellName; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TemplateInfo.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TemplateInfo.java deleted file mode 100644 index c8b1d027..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TemplateInfo.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:TemplateInfo - * @Date:2025/03/26 11:07 - * @Filename:TemplateInfo - * @description:Todo - */ -@Data -public class TemplateInfo { - private boolean remote; - private String remoteTemplateProjectId; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferActionType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferActionType.java deleted file mode 100644 index 708fc28d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferActionType.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:TransferActionType - * @Date:2025/03/26 11:03 - * @Filename:TransferActionType - * @description:Todo - */ -@Getter -@AllArgsConstructor -@Schema(title = "流水线互转操作类型") -public enum TransferActionType { - @Schema(title = "完整转换:model -> yaml") - FULL_MODEL2YAML, - @Schema(title = "完整转换:yaml -> model") - FULL_YAML2MODEL, - @Schema(title = "yaml 中插入的插件") - YAML_INSERT_TASK; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferBody.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferBody.java deleted file mode 100644 index a0059dce..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferBody.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import cd.casic.ci.common.pipeline.pojo.PipelineModelAndSetting; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:TransferBody - * @Date:2025/03/26 11:03 - * @Filename:TransferBody - * @description:Todo - */ -@Data -@Schema(title = "互转入口") -public class TransferBody { - @Schema(title = "当前modelAndSetting,model转yaml时需带上") - private PipelineModelAndSetting modelAndSetting; - @Schema(title = "当前yaml内容,model转yaml以及yaml转model都需要带上,如果首次互转没有就传空") - private String oldYaml = ""; - @Schema(title = "yaml内容的来源yaml文件名(用于流水线名称的缺省值)") - private String yamlFileName; -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferMark.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferMark.java deleted file mode 100644 index c43ac4db..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferMark.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:TransferMark - * @Date:2025/03/26 11:04 - * @Filename:TransferMark - * @description:Todo - */ -@Data -@Schema(title = "互转yaml定位") -public class TransferMark { - @Schema(title = "标记头") - private Mark startMark; - @Schema(title = "标记尾") - private Mark endMark; - - @Data - public static class Mark { - @Schema(title = "行数 0开始") - private int line; - @Schema(title = "列数 0开始") - private int column; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferResponse.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferResponse.java deleted file mode 100644 index 108f9a58..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferResponse.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import cd.casic.ci.common.pipeline.pojo.PipelineModelAndSetting; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:TransferResponse - * @Date:2025/03/26 11:04 - * @Filename:TransferResponse - * @description:Todo - */ -@Data -@Schema(title = "流水线互转-Response") -public class TransferResponse { - @Schema(title = "modelAndSetting") - private PipelineModelAndSetting modelAndSetting; - @Schema(title = "当前yaml内容") - private YamlWithVersion yamlWithVersion; - @Schema(title = "定位") - private TransferMark mark; - @Schema(title = "互转报错信息") - private String error; - @Schema(title = "是否支持YAML解析", required = true) - private boolean yamlSupported = true; - @Schema(title = "YAML解析异常信息") - private String yamlInvalidMsg; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferVMBaseOS.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferVMBaseOS.java deleted file mode 100644 index ac73eb8d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/TransferVMBaseOS.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:TransferVMBaseOS - * @Date:2025/03/26 11:05 - * @Filename:TransferVMBaseOS - * @description:Todo - */ - -@Getter -@AllArgsConstructor -@Schema(title = "TransferVMBaseOS") -public enum TransferVMBaseOS { - MACOS, - LINUX, - WINDOWS, - BUILD_LESS -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlMetaData.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlMetaData.java deleted file mode 100644 index bd784b5c..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlMetaData.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:YamlMetaData - * @Date:2025/03/26 11:09 - * @Filename:YamlMetaData - * @description:Todo - */ -public interface YamlMetaData { - MetaData getYamlMetaData(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlMetaDataJsonFilter.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlMetaDataJsonFilter.java deleted file mode 100644 index fb031f93..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlMetaDataJsonFilter.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:YamlMetaDataJsonFilter - * @Date:2025/03/26 11:07 - * @Filename:YamlMetaDataJsonFilter - * @description:Todo - */ -public class YamlMetaDataJsonFilter { - public static final String YAML_META_DATA_JSON_FILTER = "yamlMetaData"; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlWithVersion.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlWithVersion.java deleted file mode 100644 index e6f954d3..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/pojo/transfer/YamlWithVersion.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.common.pipeline.pojo.transfer; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.pojo.transfer - * @Project:ops-pro - * @name:YamlWithVersion - * @Date:2025/03/26 11:05 - * @Filename:YamlWithVersion - * @description:Todo - */ -@Data -@Schema(title = "通过解析后的YAML对象") -public class YamlWithVersion { - @Schema(title = "当前yaml内容") - private String yamlStr; - @Schema(title = "当前yaml的版本标识") - private String versionTag; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/service/utils/LogUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/service/utils/LogUtils.java deleted file mode 100644 index 4aead409..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/service/utils/LogUtils.java +++ /dev/null @@ -1,98 +0,0 @@ -package cd.casic.ci.common.pipeline.service.utils; - - - -import cd.casic.framework.commons.util.watcher.Watcher; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 日志工具类 - */ -public final class LogUtils { - - private static final Logger LOG = LoggerFactory.getLogger(LogUtils.class); - private static final int DEFAULT_MAX_LENGTH = 16384; - - private LogUtils() { - // 私有构造函数,防止实例化 - } - - /** - * 记录耗时信息 - * @param message 日志消息 - * @param startTime 开始时间 - * @param warnThreshold 警告阈值,默认1000ms - * @param errorThreshold 错误阈值,默认5000ms - */ - public static void costTime(String message, long startTime, long warnThreshold, long errorThreshold) { - long cost = System.currentTimeMillis() - startTime; - if (cost < warnThreshold) { - LOG.info("{} cost {} ms", message, cost); - } else if (cost < errorThreshold) { - LOG.warn("{} cost {} ms", message, cost); - } else { - LOG.error("{} cost {} ms", message, cost); - } - } - - /** - * 记录耗时信息(使用默认阈值) - * @param message 日志消息 - * @param startTime 开始时间 - */ - public static void costTime(String message, long startTime) { - costTime(message, startTime, 1000L, 5000L); - } - - /** - * 计算watcher的耗时并打印日志 - * @param watcher 监控器 - * @param warnThreshold 警告阈值 - * @param errorThreshold 错误阈值 - */ - public static void printCostTimeWE(Watcher watcher, long warnThreshold, long errorThreshold) { - watcher.stop(); - long cost = System.currentTimeMillis() - watcher.getCreateTime(); - if (cost >= warnThreshold) { - if (cost > errorThreshold) { - LOG.error("{} cost {} ms", watcher, cost); - } else { - LOG.warn("{} cost {} ms", watcher, cost); - } - } - } - - /** - * 计算watcher的耗时并打印日志(使用默认阈值) - * @param watcher 监控器 - */ - public static void printCostTimeWE(Watcher watcher) { - printCostTimeWE(watcher, 1000L, 5000L); - } - - /** - * 获取有限长度的日志内容(使用默认最大长度16K) - * @param logStr 原始日志内容 - * @return 截取后的日志 - */ - public static String getLogWithLengthLimit(String logStr) { - return getLogWithLengthLimit(logStr, DEFAULT_MAX_LENGTH); - } - - /** - * 获取有限长度的日志内容 - * @param logStr 原始日志内容 - * @param maxLength 最大长度,若小于0则不生效,返回原始日志 - * @return 截取后的日志 - */ - public static String getLogWithLengthLimit(String logStr, int maxLength) { - if (logStr == null) { - return null; - } - if (maxLength < 0) { - return logStr; - } - return logStr.length() > maxLength ? logStr.substring(0, maxLength) : logStr; - } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/BuildType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/BuildType.java deleted file mode 100644 index f3bbeb1d..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/BuildType.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.common.pipeline.type; - - -import cd.casic.ci.common.pipeline.pojo.OS; -import lombok.AllArgsConstructor; -import lombok.Getter; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type - * @Project:ops-pro - * @name:BuildType - * @Date:2025/03/27 10:45 - * @Filename:BuildType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum BuildType { - ESXI("公共构建资源", List.of(OS.MACOS), false, false, false), - MACOS("云托管: MacOS on DevCloud", List.of(OS.MACOS), false, false, false), - WINDOWS("云托管:Windows on DevCloud", List.of(OS.WINDOWS), false, false, false), - KUBERNETES("Kubernetes构建资源", List.of(OS.LINUX), false, false, false), - PUBLIC_DEVCLOUD("公共:Docker on DevCloud", List.of(OS.LINUX), true, false, false), - PUBLIC_BCS("公共:Docker on Bcs", List.of(OS.LINUX), false, false, false), - THIRD_PARTY_AGENT_ID("私有:单构建机", List.of(OS.MACOS, OS.LINUX, OS.WINDOWS), false, true, true), - THIRD_PARTY_AGENT_ENV("私有:构建集群", List.of(OS.MACOS, OS.LINUX, OS.WINDOWS), false, true, true), - THIRD_PARTY_PCG("PCG公共构建资源", List.of(OS.LINUX), false, false, false), - THIRD_PARTY_DEVCLOUD("腾讯自研云(云devnet资源)", List.of(OS.LINUX), false, false, false), - GIT_CI("工蜂CI", List.of(OS.LINUX), false, false, false), - DOCKER("Docker公共构建机", List.of(OS.LINUX), true, true, true), - STREAM("stream", List.of(OS.LINUX), false, false, false), - AGENT_LESS("无编译环境", List.of(OS.LINUX), false, false, false); - - private final String value; - private final List osList; - private final boolean enableApp; - private final boolean clickable; - private final boolean visible; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/DispatchRouteKeySuffix.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/DispatchRouteKeySuffix.java deleted file mode 100644 index 7a076a49..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/DispatchRouteKeySuffix.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.common.pipeline.type; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type - * @Project:ops-pro - * @name:DispatchRouteKeySuffix - * @Date:2025/03/27 10:45 - * @Filename:DispatchRouteKeySuffix - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum DispatchRouteKeySuffix { - DOCKER_VM(".docker.vm"), - DOCKER_VM_DEMOTE(".docker.vm.demote"), - KUBERNETES(".kubernetes"), - KUBERNETES_DEMOTE(".kubernetes.demote"), - PCG(".pcg.sumeru"), - DEVCLOUD(".devcloud.public"), - BCS(".bcs.public"), - IDC(".idc.public"), - GITCI(".gitci.public"), - STREAM(".stream.docker"), - STREAM_DEMOTE(".stream.docker.demote"), - CODECC(".codecc.scan"), - MACOS(".macos"), - WINDOWS(".windows"); - - private final String routeKeySuffix; -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/DispatchType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/DispatchType.java deleted file mode 100644 index 99d101bd..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/DispatchType.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.common.pipeline.type; - -import cd.casic.ci.common.pipeline.pojo.agent.ThirdPartyAgentEnvDispatchType; -import cd.casic.ci.common.pipeline.pojo.agent.ThirdPartyAgentIDDispatchType; -import cd.casic.ci.common.pipeline.type.docker.DockerDispatchType; -import cd.casic.ci.common.pipeline.type.kubernetes.KubernetesDispatchType; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type - * @Project:ops-pro - * @name:DispatchType - * @Date:2025/03/27 10:45 - * @Filename:DispatchType - * @description:Todo - */ - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "buildType", visible = false) -@JsonSubTypes({ - @JsonSubTypes.Type(value = DockerDispatchType.class, name = "DOCKER"), - @JsonSubTypes.Type(value = KubernetesDispatchType.class, name = "KUBERNETES"), - @JsonSubTypes.Type(value = ThirdPartyAgentIDDispatchType.class, name = "THIRD_PARTY_AGENT_ID"), - @JsonSubTypes.Type(value = ThirdPartyAgentEnvDispatchType.class, name = "THIRD_PARTY_AGENT_ENV") -}) -@Data -@AllArgsConstructor -@NoArgsConstructor -public abstract class DispatchType { - private String value; - private DispatchRouteKeySuffix routeKeySuffix; - - public void replaceVariable(Map variables) { - this.value = EnvUtils.parseEnv(value, variables); - replaceField(variables); - } - - public abstract BuildType buildType(); - - protected abstract void replaceField(Map variables); - - public abstract void cleanDataBeforeSave(); -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/StoreDispatchType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/StoreDispatchType.java deleted file mode 100644 index 5fe17348..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/StoreDispatchType.java +++ /dev/null @@ -1,64 +0,0 @@ -package cd.casic.ci.common.pipeline.type; - -import cd.casic.ci.common.pipeline.type.docker.ImageType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; - -import java.util.Optional; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.type - * @Project:ops-pro - * @name:StoreDispatchType - * @Date:2025/03/27 10:45 - * @Filename:StoreDispatchType - * @description:Todo - */ -@AllArgsConstructor -public abstract class StoreDispatchType extends DispatchType { - @Schema(title = "docker构建版本", required = false) - private String dockerBuildVersion; - - @Schema(title = "镜像类型", required = false) - private ImageType imageType = ImageType.BKDEVOPS; - - @Schema(title = "凭证id", required = false) - private String credentialId = ""; - - @Schema(title = "凭证项目id", required = false) - private String credentialProject = ""; - - @Schema(title = "商店镜像代码", required = false) - private String imageCode = ""; - - @Schema(title = "商店镜像版本", required = false) - private String imageVersion = ""; - - @Schema(title = "商店镜像名称", required = false) - private String imageName = ""; - - @Schema(title = "商店镜像公共标识", required = false) - private Boolean imagePublicFlag = false; - - @Schema(title = "商店镜像研发来源", required = false) - private String imageRDType = ""; - - @Schema(title = "商店镜像是否推荐", required = false) - private Boolean recommendFlag = true; - - public StoreDispatchType(String dockerBuildVersion, DispatchRouteKeySuffix routeKeySuffix) { - super(Optional.ofNullable(dockerBuildVersion).orElse("StoreDispatchType empty image"), routeKeySuffix); - this.dockerBuildVersion = dockerBuildVersion; - } - - public StoreDispatchType(String s, DispatchRouteKeySuffix dispatchRouteKeySuffix, ImageType imageType, String credentialId, String credentialProject, String imageCode, String imageVersion, String imageName) { - super(s, dispatchRouteKeySuffix); - this.imageType = imageType; - this.credentialId = credentialId; - this.credentialProject = credentialProject; - this.imageCode = imageCode; - this.imageVersion = imageVersion; - this.imageName = imageName; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/docker/DockerDispatchType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/docker/DockerDispatchType.java deleted file mode 100644 index eef35ce5..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/docker/DockerDispatchType.java +++ /dev/null @@ -1,99 +0,0 @@ -package cd.casic.ci.common.pipeline.type.docker; - -import cd.casic.ci.common.pipeline.type.BuildType; -import cd.casic.ci.common.pipeline.type.DispatchRouteKeySuffix; -import cd.casic.ci.common.pipeline.type.StoreDispatchType; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname DockerDispatchType - * @Description TODO - * @Date 2025/3/31 9:44 - */ -@Getter -@Setter -@EqualsAndHashCode(callSuper = true) -public class DockerDispatchType extends StoreDispatchType { - @JsonProperty("value") - @Schema(title = "docker构建版本", required = false) - private String dockerBuildVersion; - - @Schema(title = "镜像类型", required = false) - private ImageType imageType = ImageType.BKDEVOPS; - - @Schema(title = "凭证id", required = false) - private String credentialId = ""; - - @Schema(title = "凭证项目id", required = false) - private String credentialProject = ""; - - @Schema(title = "商店镜像代码", required = false) - private String imageCode = ""; - - @Schema(title = "商店镜像版本", required = false) - private String imageVersion = ""; - - @Schema(title = "商店镜像名称", required = false) - private String imageName = ""; - - @Schema(title = "docker资源配置ID", required = false) - private int performanceConfigId = 0; - - @Schema(title = "镜像仓库用户名", required = false) - private String imageRepositoryUserName = ""; - - @Schema(title = "镜像仓库密码", required = false) - private String imageRepositoryPassword = ""; - - public DockerDispatchType(String dockerBuildVersion, ImageType imageType, String credentialId, String credentialProject, String imageCode, String imageVersion, String imageName, int performanceConfigId, String imageRepositoryUserName, String imageRepositoryPassword) { - super( - dockerBuildVersion == null || dockerBuildVersion.isBlank() ? imageCode : dockerBuildVersion, - DispatchRouteKeySuffix.DOCKER_VM, - imageType, - credentialId, - credentialProject, - imageCode, - imageVersion, - imageName - ); - this.dockerBuildVersion = dockerBuildVersion; - this.imageType = imageType; - this.credentialId = credentialId; - this.credentialProject = credentialProject; - this.imageCode = imageCode; - this.imageVersion = imageVersion; - this.imageName = imageName; - this.performanceConfigId = performanceConfigId; - this.imageRepositoryUserName = imageRepositoryUserName; - this.imageRepositoryPassword = imageRepositoryPassword; - } - - @Override - public void cleanDataBeforeSave() { - this.dockerBuildVersion = this.dockerBuildVersion != null ? this.dockerBuildVersion.trim() : null; - this.credentialId = this.credentialId != null ? this.credentialId.trim() : null; - this.credentialProject = this.credentialProject != null ? this.credentialProject.trim() : null; - this.imageCode = this.imageCode != null ? this.imageCode.trim() : null; - this.imageVersion = this.imageVersion != null ? this.imageVersion.trim() : null; - this.imageName = this.imageName != null ? this.imageName.trim() : null; - } - - @Override - public BuildType buildType() { - return BuildType.valueOf(BuildType.DOCKER.name()); - } - - @Override - public void replaceField(Map variables) { - this.dockerBuildVersion = EnvUtils.parseEnv(this.dockerBuildVersion, variables); - this.credentialId = EnvUtils.parseEnv(this.credentialId, variables); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/docker/ImageType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/docker/ImageType.java deleted file mode 100644 index 7425094f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/docker/ImageType.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.type.docker; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname ImageType - * @Description TODO - * @Date 2025/3/31 9:42 - */ -@Getter -@AllArgsConstructor -public enum ImageType { - BKDEVOPS("devops"), // ops镜像 - BKSTORE("ops_store"), // ops镜像市场镜像,存储于artifactory的项目{projectCode}路径下 - THIRD("third"); // 第三方镜像 - - private final String type; - - public static ImageType getType(String type) { - if (type == null) { - return BKDEVOPS; - } - for (ImageType imageType : ImageType.values()) { - if (imageType.type.equalsIgnoreCase(type)) { - return imageType; - } - } - return BKDEVOPS; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/kubernetes/KubernetesDispatchType.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/kubernetes/KubernetesDispatchType.java deleted file mode 100644 index 302e326a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/type/kubernetes/KubernetesDispatchType.java +++ /dev/null @@ -1,130 +0,0 @@ -package cd.casic.ci.common.pipeline.type.kubernetes; - -/** - * @author by mianbin - * @Classname KubernetesDispatchType - * @Description TODO - * @Date 2025/3/31 9:41 - */ - -import cd.casic.ci.common.pipeline.type.BuildType; -import cd.casic.ci.common.pipeline.type.DispatchRouteKeySuffix; -import cd.casic.ci.common.pipeline.type.StoreDispatchType; -import cd.casic.ci.common.pipeline.type.docker.ImageType; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.EqualsAndHashCode; - -import java.util.Map; - - -@EqualsAndHashCode(callSuper = true) -public class KubernetesDispatchType extends StoreDispatchType { - - /** - * Kubernetes构建版本 - */ - @JsonProperty("value") - private String kubernetesBuildVersion; - - /** - * 镜像类型,默认为BKDEVOPS - */ - private ImageType imageType = ImageType.BKDEVOPS; - - /** - * 凭证ID - */ - private String credentialId = ""; - - /** - * 凭证所属项目 - */ - private String credentialProject = ""; - - /** - * 商店镜像代码 - */ - private String imageCode = ""; - - /** - * 商店镜像版本 - */ - private String imageVersion = ""; - - /** - * 商店镜像名称 - */ - private String imageName = ""; - - /** - * Docker资源配置ID,默认为0 - */ - private int performanceConfigId = 0; - - /** - * 构造函数,初始化Kubernetes调度类型的相关参数 - * @param kubernetesBuildVersion Kubernetes构建版本 - * @param imageType 镜像类型 - * @param credentialId 凭证ID - * @param credentialProject 凭证所属项目 - * @param imageCode 商店镜像代码 - * @param imageVersion 商店镜像版本 - * @param imageName 商店镜像名称 - * @param performanceConfigId Docker资源配置ID - */ - public KubernetesDispatchType(String kubernetesBuildVersion, ImageType imageType, String credentialId, - String credentialProject, String imageCode, String imageVersion, String imageName, - int performanceConfigId) { - super( - kubernetesBuildVersion == null || kubernetesBuildVersion.isEmpty() ? imageCode : kubernetesBuildVersion, - DispatchRouteKeySuffix.KUBERNETES, - imageType, - credentialId, - credentialProject, - imageCode, - imageVersion, - imageName - ); - this.kubernetesBuildVersion = kubernetesBuildVersion; - this.imageType = imageType; - this.credentialId = credentialId; - this.credentialProject = credentialProject; - this.imageCode = imageCode; - this.imageVersion = imageVersion; - this.imageName = imageName; - this.performanceConfigId = performanceConfigId; - } - - /** - * 在保存数据之前清理数据,去除字符串字段的首尾空格 - */ - @Override - public void cleanDataBeforeSave() { - this.kubernetesBuildVersion = this.kubernetesBuildVersion != null ? this.kubernetesBuildVersion.trim() : null; - this.credentialId = this.credentialId != null ? this.credentialId.trim() : null; - this.credentialProject = this.credentialProject != null ? this.credentialProject.trim() : null; - this.imageCode = this.imageCode != null ? this.imageCode.trim() : null; - this.imageVersion = this.imageVersion != null ? this.imageVersion.trim() : null; - this.imageName = this.imageName != null ? this.imageName.trim() : null; - } - - /** - * 获取构建类型,返回Kubernetes类型 - * @return 构建类型 - */ - @Override - public BuildType buildType() { - return BuildType.valueOf(BuildType.KUBERNETES.name()); - } - - /** - * 根据变量映射替换字段值 - * @param variables 变量映射 - */ - @Override - public void replaceField(Map variables) { - this.kubernetesBuildVersion = EnvUtils.parseEnv(this.kubernetesBuildVersion, variables); - this.credentialId = EnvUtils.parseEnv(this.credentialId, variables); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/BuildStatusSwitcher.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/BuildStatusSwitcher.java deleted file mode 100644 index 6d8b3537..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/BuildStatusSwitcher.java +++ /dev/null @@ -1,184 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import lombok.Getter; - -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:BuildStatusSwitcher - * @Date:2025/03/26 14:59 - * @Filename:BuildStatusSwitcher - * @description:Todo - */ -@Getter -public class BuildStatusSwitcher { - public static BuildStatus readyToSkipWhen(BuildStatus buildStatus) { - return buildStatus.isFailure() || buildStatus.isCancel() ? BuildStatus.UNEXEC : BuildStatus.SKIP; - } - - private static final PipelineBuildStatusMaker pipelineStatusMaker = new PipelineBuildStatusMaker(); - private static final StageBuildStatusMaker stageStatusMaker = new StageBuildStatusMaker(); - private static final JobBuildStatusMaker jobStatusMaker = new JobBuildStatusMaker(); - private static final TaskBuildStatusMaker taskStatusMaker = new TaskBuildStatusMaker(); - - public interface BuildStatusMaker { - Set statusSet(); - - default BuildStatus cancel(BuildStatus currentBuildStatus) { - BuildStatus canceled = BuildStatus.CANCELED; - if (currentBuildStatus == BuildStatus.UNKNOWN) { - return canceled; - } - if (currentBuildStatus.isReadyToRun()) { - return canceled; - } - if (currentBuildStatus.isRunning()) { - return canceled; - } - if (currentBuildStatus.isFinish()) { - return statusSet().contains(currentBuildStatus) ? currentBuildStatus : canceled; - } - return canceled; - } - - default BuildStatus finish(BuildStatus currentBuildStatus) { - if (currentBuildStatus.isFinish() || currentBuildStatus == BuildStatus.STAGE_SUCCESS) { - if (statusSet().contains(currentBuildStatus)) { - return currentBuildStatus; - } else { - return currentBuildStatus.isFailure() ? BuildStatus.FAILED : BuildStatus.SUCCEED; - } - } else if (currentBuildStatus.isReadyToRun()) { - return BuildStatus.CANCELED; - } else { - return BuildStatus.SUCCEED; - } - } - - default BuildStatus forceFinish(BuildStatus currentBuildStatus, boolean fastKill) { - if (currentBuildStatus.isFinish() || currentBuildStatus == BuildStatus.STAGE_SUCCESS) { - if (statusSet().contains(currentBuildStatus) && !fastKill) { - return currentBuildStatus; - } else { - return currentBuildStatus.isSuccess() ? BuildStatus.SUCCEED : BuildStatus.FAILED; - } - } else { - return BuildStatus.FAILED; - } - } - - default BuildStatus switchByErrorCode(BuildStatus currentBuildStatus, Integer errorCode) { - return currentBuildStatus; - } - } - - public static class TaskBuildStatusMaker implements BuildStatusMaker { - private static final Set timeoutCodeSet = Set.of(2103006); - - @Override - public Set statusSet() { - return Set.of( - BuildStatus.QUEUE, - BuildStatus.QUEUE_CACHE, - BuildStatus.RETRY, - BuildStatus.RUNNING, - BuildStatus.CALL_WAITING, - BuildStatus.REVIEWING, - BuildStatus.REVIEW_ABORT, - BuildStatus.REVIEW_PROCESSED, - BuildStatus.PAUSE, - BuildStatus.CANCELED, - BuildStatus.SUCCEED, - BuildStatus.FAILED, - BuildStatus.TERMINATE, - BuildStatus.SKIP, - BuildStatus.UNEXEC, - BuildStatus.QUEUE_TIMEOUT, - BuildStatus.QUALITY_CHECK_FAIL - ); - } - - @Override - public BuildStatus forceFinish(BuildStatus currentBuildStatus, boolean fastKill) { - if (currentBuildStatus.isFinish()) { - return statusSet().contains(currentBuildStatus) ? currentBuildStatus : (currentBuildStatus.isSuccess() ? BuildStatus.SUCCEED : BuildStatus.FAILED); - } - if (currentBuildStatus.isRunning() && !fastKill) { - return BuildStatus.TERMINATE; - } - return BuildStatus.FAILED; - } - - @Override - public BuildStatus switchByErrorCode(BuildStatus currentBuildStatus, Integer errorCode) { - if (timeoutCodeSet.contains(errorCode)) { - return BuildStatus.QUEUE_TIMEOUT; - } - return currentBuildStatus; - } - } - - public static class PipelineBuildStatusMaker implements BuildStatusMaker { - @Override - public Set statusSet() { - return Set.of( - BuildStatus.QUEUE, - BuildStatus.QUEUE_CACHE, - BuildStatus.RUNNING, - BuildStatus.CANCELED, - BuildStatus.SUCCEED, - BuildStatus.FAILED, - BuildStatus.TERMINATE, - BuildStatus.QUEUE_TIMEOUT, - BuildStatus.STAGE_SUCCESS - ); - } - } - - public static class StageBuildStatusMaker implements BuildStatusMaker { - @Override - public Set statusSet() { - return Set.of( - BuildStatus.QUEUE, - BuildStatus.QUEUE_CACHE, - BuildStatus.RUNNING, - BuildStatus.REVIEWING, - BuildStatus.PAUSE, - BuildStatus.CANCELED, - BuildStatus.SUCCEED, - BuildStatus.FAILED, - BuildStatus.TERMINATE, - BuildStatus.SKIP, - BuildStatus.UNEXEC, - BuildStatus.QUEUE_TIMEOUT, - BuildStatus.STAGE_SUCCESS - ); - } - } - - public static class JobBuildStatusMaker implements BuildStatusMaker { - @Override - public Set statusSet() { - return Set.of( - BuildStatus.QUEUE, - BuildStatus.QUEUE_CACHE, - BuildStatus.DEPENDENT_WAITING, - BuildStatus.LOOP_WAITING, - BuildStatus.PREPARE_ENV, - BuildStatus.RUNNING, - BuildStatus.CANCELED, - BuildStatus.SUCCEED, - BuildStatus.FAILED, - BuildStatus.TERMINATE, - BuildStatus.SKIP, - BuildStatus.UNEXEC, - BuildStatus.QUEUE_TIMEOUT, - BuildStatus.HEARTBEAT_TIMEOUT - ); - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/CascadePropertyUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/CascadePropertyUtils.java deleted file mode 100644 index 0ef46cec..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/CascadePropertyUtils.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.ci.common.pipeline.enums.BuildFormPropertyType; -import cd.casic.ci.common.pipeline.pojo.cascade.RepoRefCascadeParam; -import cd.casic.framework.commons.util.json.JsonUtils; -import cn.hutool.json.JSONUtil; -import com.fasterxml.jackson.core.type.TypeReference; -import lombok.extern.slf4j.Slf4j; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:CascadePropertyUtils - * @Date:2025/03/26 15:02 - * @Filename:CascadePropertyUtils - * @description:Todo - */ -@Slf4j -public class CascadePropertyUtils { - public static Map getCascadeVariableKeyMap(String key, BuildFormPropertyType type) { - return type == BuildFormPropertyType.REPO_REF ? RepoRefCascadeParam.variableKeyMap(key) : Map.of(); - } - - public static Map parseDefaultValue(String key, Object defaultValue, BuildFormPropertyType type) { - try { - if (defaultValue instanceof String) { - return JsonUtils.parseObject((String) defaultValue, new TypeReference>() { - }); - } else { - return (Map) defaultValue; - } - } catch (Exception ignored) { - log.warn("parse repo ref error, key: {}, defaultValue: {}", key, defaultValue); - return getDefaultValue(type); - } - } - - private static Map getDefaultValue(BuildFormPropertyType type) { - return type == BuildFormPropertyType.REPO_REF ? RepoRefCascadeParam.defaultValue() : Map.of(); - } - - public static boolean supportCascadeParam(BuildFormPropertyType type) { - return type == BuildFormPropertyType.REPO_REF; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/Constants.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/Constants.java deleted file mode 100644 index 41485c7f..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/Constants.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:Constants - * @Date:2025/03/26 15:39 - * @Filename:Constants - * @description:Todo - */ -public class Constants { - public static final int PIPELINE_SETTING_MAX_QUEUE_SIZE_DEFAULT = 10; - public static final int PIPELINE_SETTING_MAX_CON_QUEUE_SIZE_MAX = 200; - public static final int PIPELINE_SETTING_WAIT_QUEUE_TIME_MINUTE_DEFAULT = 10; - public static final String PIPELINE_SETTING_CONCURRENCY_GROUP_DEFAULT = "${{ci.pipeline_id}}"; - public static final int PIPELINE_RES_NUM_MIN = 50; -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ElementUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ElementUtils.java deleted file mode 100644 index ad4a20c4..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ElementUtils.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.quality.QualityGateInElement; -import cd.casic.ci.common.pipeline.pojo.element.quality.QualityGateOutElement; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:ElementUtils - * @Date:2025/03/26 15:42 - * @Filename:ElementUtils - * @description:Todo - */ -public class ElementUtils { - public static final String skipPrefix = "devops_container_condition_skip_atoms_"; - - public static String getSkipElementVariableName(String elementId) { - return skipPrefix + elementId; - } - - public static boolean getTaskAddFlag(Element element, boolean stageEnableFlag, boolean containerEnableFlag, boolean originMatrixContainerFlag) { - if (originMatrixContainerFlag) { - return false; - } - var elementPostInfo = element.getAdditionalOptions().getElementPostInfo(); - var qualityAtomFlag = element instanceof QualityGateInElement || element instanceof QualityGateOutElement; - var enableFlag = stageEnableFlag && containerEnableFlag && element.elementEnabled(); - return enableFlag || elementPostInfo != null || qualityAtomFlag; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/EnvUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/EnvUtils.java deleted file mode 100644 index f0744074..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/EnvUtils.java +++ /dev/null @@ -1,79 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:EnvUtils - * @Date:2025/03/27 15:20 - * @Filename:EnvUtils - * @description:Todo - */ -public class EnvUtils { - private static final Pattern tPattern = Pattern.compile("(\\$[{](?[^$^{}]+)})|(\\$[{]{2}(?[^$^{}]+)[}]{2})"); - - public static String parseEnv(String command, Map data) { - return parseEnv(command, data, false, false); - } - - public static String parseEnv(String command, Map data, boolean replaceWithEmpty, boolean isEscape) { - return parseEnv(command, data, replaceWithEmpty, isEscape, new HashMap<>()); - } - - public static String parseEnv(String command, Map data, boolean replaceWithEmpty, boolean isEscape, Map contextMap) { - if (command == null || command.isEmpty()) { - return command == null ? "" : command; - } - return parseTokenTwice(command, data, contextMap, replaceWithEmpty, isEscape, 1); - } - - private static String parseTokenTwice(String command, Map data, Map contextMap, boolean replaceWithEmpty, boolean isEscape, int depth) { - if (depth < 0) { - return command; - } - Matcher matcher = tPattern.matcher(command); - StringBuffer buff = new StringBuffer(); - while (matcher.find()) { - String key = matcher.group("single"); - if (key == null) { - key = matcher.group("double"); - } - key = key.trim(); - String value = data.get(key); - if (value == null && contextMap != null) { - value = contextMap.get(key); - } - if (value == null) { - value = !replaceWithEmpty ? matcher.group() : ""; - } else { - if (depth > 0 && tPattern.matcher(value).find()) { - value = parseTokenTwice(value, data, contextMap, replaceWithEmpty, isEscape, depth - 1); - } else if (isEscape) { - value = escapeSpecialWord(value); - } - } - matcher.appendReplacement(buff, Matcher.quoteReplacement(value)); - } - matcher.appendTail(buff); - return buff.toString(); - } - - private static String escapeSpecialWord(String keyword) { - String replaceWord = keyword; - if (!keyword.isEmpty()) { - String[] wordList = {"\\", "\""}; - for (String word : wordList) { - if (replaceWord.contains(word)) { - replaceWord = replaceWord.replace(word, "\\" + word); - } - } - } - return replaceWord; - } -} \ No newline at end of file diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/HeartBeatUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/HeartBeatUtils.java deleted file mode 100644 index b64653f3..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/HeartBeatUtils.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:HeartBeatUtils - * @Date:2025/03/26 15:47 - * @Filename:HeartBeatUtils - * @description:Todo - */ -public class HeartBeatUtils { - public static String genHeartBeatKey(String buildId, String vmSeqId, Integer executeCount) { - if (executeCount != null) { - return "heartbeat:" + buildId + ":" + vmSeqId + ":" + executeCount; - } else { - return "heartbeat:" + buildId + ":" + vmSeqId; - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/MatrixContextUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/MatrixContextUtils.java deleted file mode 100644 index d4980fb0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/MatrixContextUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.framework.commons.exception.ServerException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.networknt.schema.JsonSchema; -import com.networknt.schema.JsonSchemaFactory; -import com.networknt.schema.SpecVersion; -import com.networknt.schema.ValidationMessage; -import org.yaml.snakeyaml.Yaml; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -public class MatrixContextUtils { - - private static final String strategyJsonPattern = "^(\\$\\{\\{[ ]*fromJSON\\()([^()]+)(\\)[ ]*}})$"; - - private static final String schemaJson = "{\n" + - " \"type\": \"object\",\n" + - " \"required\": [],\n" + - " \"properties\": {\n" + - " \"include\": {\n" + - " \"description\": \"值格式为:List,用于给 matrix 的指定组合增加额外的属性,或者新增1个或多个组合,每个元素为一个 Object,或是一个'$'{{fromJSON(xxx)}}上下文\",\n" + - " \"oneOf\": [\n" + - " {\n" + - " \"type\": \"array\",\n" + - " \"items\": {\n" + - " \"type\": \"object\",\n" + - " \"required\": [],\n" + - " \"additionalProperties\": {\n" + - " \"anyOf\": [\n" + - " {\n" + - " \"type\": \"string\"\n" + - " },\n" + - " {\n" + - " \"type\": \"integer\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " }\n" + - " },\n" + - " {\n" + - " \"type\": \"string\",\n" + - " \"pattern\": \"" + strategyJsonPattern + "\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"exclude\": {\n" + - " \"description\": \"值格式为:List,用于排除 matrix 中的一些组合,每个元素为一个 Object,或是一个'$'{{fromJSON(xxx)}}上下文\",\n" + - " \"oneOf\": [\n" + - " {\n" + - " \"type\": \"array\",\n" + - " \"items\": {\n" + - " \"type\": \"object\",\n" + - " \"required\": [],\n" + - " \"additionalProperties\": {\n" + - " \"anyOf\": [\n" + - " {\n" + - " \"type\": \"string\"\n" + - " },\n" + - " {\n" + - " \"type\": \"integer\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " }\n" + - " },\n" + - " {\n" + - " \"type\": \"string\",\n" + - " \"pattern\": \"" + strategyJsonPattern + "\"\n" + - " }\n" + - " ]\n" + - " },\n" + - " \"strategy\": {\n" + - " \"description\": \"值格式为:Object,,或是一个'$'{{fromJSON(xxx)}}上下文,定义的每个选项都有键和值,键将作为 matrix 上下文中的属性\",\n" + - " \"oneOf\": [\n" + - " {\n" + - " \"type\": \"object\",\n" + - " \"additionalProperties\": {\n" + - " \"anyOf\": [\n" + - " {\n" + - " \"type\": \"array\"\n" + - " },\n" + - " {\n" + - " \"type\": \"string\",\n" + - " \"pattern\": \"" + strategyJsonPattern + "\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " },\n" + - " {\n" + - " \"type\": \"string\",\n" + - " \"pattern\": \"" + strategyJsonPattern + "\"\n" + - " }\n" + - " ]\n" + - " }\n" + - " }\n" + - "}"; - - private static final ThreadLocal yaml = ThreadLocal.withInitial(Yaml::new); - - private static final JsonSchemaFactory schemaFactory = JsonSchemaFactory - .builder(JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7)) - .yamlMapper(YamlUtil.objectMapper) - .build(); - - /** - * 使用循环遍历笛卡尔乘积算法 - */ - public static List> loopCartesianProduct(List> input) { - List> acc = new ArrayList<>(); - acc.add(new ArrayList<>()); - for (List nextList : input) { - List> newAcc = new ArrayList<>(); - for (List list : acc) { - for (Object element : nextList) { - List newList = new ArrayList<>(list); - newList.add(element); - newAcc.add(newList); - } - } - acc = newAcc; - } - return acc; - } - - /** - * 使用递归遍历实现的笛卡尔乘积算法,因为容易导致堆栈溢出,仅用于单测校验 - */ - public static List> recursiveCartesianProduct(List> input) { - List> output = new ArrayList<>(); - product(input, output, 0, new ArrayList<>()); - return output; - } - - public static void schemaCheck(String originYaml) { - if (originYaml.isBlank()) { - return; - } - JsonNode yamlJson = YamlUtil.objectMapper.convertValue(yaml.get().load(originYaml), JsonNode.class); - yamlJson = replaceOn(yamlJson); - JsonSchema schema = schemaFactory.getSchema(schemaJson); - check(schema, yamlJson); - } - - private static void check(JsonSchema schema, JsonNode yaml) { - Set errors = schema.validate(yaml); - if (!errors.isEmpty()) { - throw new ServerException(-1000, errors.toString()); - } - } - - // Yaml规则下会将on当成true在消除锚点时会将On替换为true - private static JsonNode replaceOn(JsonNode node) { - JsonNode realOn = node.get("true"); - if (realOn == null) { - return node; - } - ObjectNode objectNode = (ObjectNode) node; - objectNode.set("on", realOn); - objectNode.remove("true"); - return objectNode; - } - - /** - * 笛卡尔乘积递归遍历操作: - * 原二维数组[input], 通过乘积转化后的数组[output], - * 层级参数[layer], 当前操作数组[currentList] - */ - private static void product(List> input, List> output, int layer, List currentList) { - if (layer < input.size() - 1) { - if (input.get(layer).isEmpty()) { - product(input, output, layer + 1, currentList); - } else { - for (Object element : input.get(layer)) { - List newList = new ArrayList<>(currentList); - newList.add(element); - product(input, output, layer + 1, newList); - } - } - } else if (layer == input.size() - 1) { - if (input.get(layer).isEmpty()) { - output.add(currentList); - } else { - for (Object element : input.get(layer)) { - List newList = new ArrayList<>(currentList); - newList.add(element); - output.add(newList); - } - } - } - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ModelUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ModelUtils.java deleted file mode 100644 index 2557aaa1..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ModelUtils.java +++ /dev/null @@ -1,190 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.container.*; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.JobRunCondition; -import cd.casic.ci.common.pipeline.option.JobControlOption; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import cd.casic.ci.common.pipeline.pojo.element.trigger.ManualTriggerElement; -import cd.casic.ci.common.pipeline.pojo.element.trigger.RemoteTriggerElement; -import cd.casic.framework.commons.util.reflect.ReflectUtil; -import cn.hutool.json.JSON; -import cn.hutool.json.JSONUtil; - -import java.util.*; - -import static cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions.RunCondition.*; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:ModelUtils - * @Date:2025/03/26 15:53 - * @Filename:ModelUtils - * @description:Todo - */ -public class ModelUtils { - public static void initContainerOldData(Container c) { - if (c instanceof NormalContainer) { - NormalContainer var = (NormalContainer) c; - if (var.getJobControlOption() == null) { - - var.setJobControlOption(new JobControlOption( - true, - var.getMaxRunningMinutes(), - String.valueOf(var.getMaxRunningMinutes()), - var.getEnableSkip() ? (var.getConditions() != null && !var.getConditions().isEmpty() ? JobRunCondition.CUSTOM_VARIABLE_MATCH_NOT_RUN : JobRunCondition.STAGE_RUNNING) : JobRunCondition.STAGE_RUNNING, - var.getConditions() - )); - } - } else if (c instanceof VMBuildContainer) { - VMBuildContainer var = (VMBuildContainer) c; - if (var.getJobControlOption() == null) { - var.setJobControlOption(new JobControlOption( - true, - var.getMaxRunningMinutes(), - String.valueOf(var.getMaxRunningMinutes()), - JobRunCondition.STAGE_RUNNING, - null - )); - } - } - } - - public static boolean canManualStartup(TriggerContainer triggerContainer) { - return triggerContainer.getElements().stream().anyMatch(element -> element instanceof ManualTriggerElement && ((ManualTriggerElement) element).elementEnabled()); - } - - public static boolean canRemoteStartup(TriggerContainer triggerContainer) { - return triggerContainer.getElements().stream().anyMatch(element -> element instanceof RemoteTriggerElement && ((RemoteTriggerElement) element).elementEnabled()); - } - - public static boolean stageNeedPause(TriggerContainer triggerContainer) { - return triggerContainer.getElements().stream().anyMatch(element -> element instanceof RemoteTriggerElement && ((RemoteTriggerElement) element).elementEnabled()); - } - - public static void refreshCanRetry(Model model) { - List stages = model.getStages(); - if (stages.isEmpty()) { - return; - } - Stage lastStage = stages.get(stages.size() - 1); - if (lastStage.getFinallyStage() && BuildStatus.parse(lastStage.getStatus()).isRunning()) { - return; - } - for (Stage s : stages) { - BuildStatus stageStatus = BuildStatus.parse(s.getStatus()); - s.setCanRetry(stageStatus.isFailure() || stageStatus.isCancel()); - for (Container c : s.getContainers()) { - initContainerOldData(c); - BuildStatus jobStatus = BuildStatus.parse(c.getStatus()); - c.setCanRetry(jobStatus.isFailure() || jobStatus.isCancel()); - if (c.getCanRetry() != null && c.getCanRetry()) { - refreshContainer(c); - } - } - } - } - - private static void refreshContainer(Container container) { - var failElements = new ArrayList(); - container.getElements().forEach(element -> refreshElement(element, failElements)); - } - - private static void refreshElement(Element element, List failElements) { - ElementAdditionalOptions additionalOptions = element.getAdditionalOptions(); - if (additionalOptions == null || !additionalOptions.isEnable()) { - return; - } - var taskStatus = BuildStatus.parse(element.getStatus()); - if (!taskStatus.isFailure() && !taskStatus.isCancel()) { - element.setCanRetry(null); - element.setCanSkip(null); - return; - } - element.setCanRetry(additionalOptions.isManualRetry()); - if (additionalOptions.isContinueWhenFailed()) { - if (additionalOptions.getManualSkip()) { - element.setCanSkip(true); - } else { - element.setCanRetry(null); - } - } else if (additionalOptions.getRunCondition() == PRE_TASK_FAILED_ONLY || - additionalOptions.getRunCondition() == PRE_TASK_FAILED_BUT_CANCEL || - additionalOptions.getRunCondition() == PRE_TASK_FAILED_EVEN_CANCEL) { - element.setCanRetry(null); - element.setCanSkip(null); - failElements.forEach(e -> { - e.setCanSkip(null); - e.setCanRetry(null); - }); - } - if (element.getCanRetry()) { - failElements.add(element); - } - } - - public static Model generatePipelineBuildModel(Map baseModelMap, Map modelFieldRecordMap) { - JSON parse = JSONUtil.parse(generateBuildModelDetail(baseModelMap, modelFieldRecordMap)); - return JSONUtil.toBean(JSONUtil.toJsonStr(parse), Model.class); - } - - public static Map generateBuildModelDetail(Map baseModelMap, Map modelFieldRecordMap) { - modelFieldRecordMap.forEach((fieldRecordName, fieldRecordValue) -> { - if (!ReflectUtil.isCollectionType(fieldRecordValue)) { - baseModelMap.put(fieldRecordName, fieldRecordValue); - } else if (baseModelMap.get(fieldRecordName) == null) { - baseModelMap.put(fieldRecordName, fieldRecordValue); - } else { - if (fieldRecordValue instanceof Map && !((Map) fieldRecordValue).isEmpty()) { - var baseDataMap = (Map) baseModelMap.get(fieldRecordName); - var varDataMap = (Map) fieldRecordValue; - baseModelMap.put(fieldRecordName, generateBuildModelDetail(baseDataMap, varDataMap)); - } else if (fieldRecordValue instanceof List && !((List) fieldRecordValue).isEmpty()) { - var baseDataList = (List) baseModelMap.get(fieldRecordName); - var varDataList = (List) fieldRecordValue; - handleListFieldMergeBus(baseDataList, varDataList); - } - } - }); - return baseModelMap; - } - - private static void handleListFieldMergeBus(List baseDataList, List recordDataList) { - for (int index = 0; index < recordDataList.size(); index++) { - var listItemObj = recordDataList.get(index); - if (!ReflectUtil.isCollectionType(listItemObj)) { - if (index > baseDataList.size() - 1) { - baseDataList.add(listItemObj); - } else { - baseDataList.set(index, listItemObj); - } - } else { - if (listItemObj instanceof Map && !((Map) listItemObj).isEmpty()) { - var baseListItemDataMap = index > baseDataList.size() - 1 ? new HashMap() : (Map) baseDataList.get(index); - var varListItemDataMap = (Map) listItemObj; - baseDataList.set(index, generateBuildModelDetail(baseListItemDataMap, varListItemDataMap)); - } else if (listItemObj instanceof List && !((List) listItemObj).isEmpty()) { - var baseListItemDataList = index > baseDataList.size() - 1 ? new ArrayList() : (List) baseDataList.get(index); - var varListItemDataList = (List) listItemObj; - handleListFieldMergeBus(baseListItemDataList, varListItemDataList); - } - } - } - } - - public static Set getModelAtoms(Model model) { - var atomCodes = new HashSet(); - for (var stage : model.getStages()) { - for (Container container : stage.getContainers()) { - for (Element element : container.getElements()) { - atomCodes.add(element.getAtomCode()); - } - } - } - return atomCodes; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ObjectReplaceEnvVarUtil.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ObjectReplaceEnvVarUtil.java deleted file mode 100644 index 37dad70a..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ObjectReplaceEnvVarUtil.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.framework.commons.util.reflect.ReflectUtil; -import cn.hutool.json.JSONUtil; - -import java.util.*; - -public class ObjectReplaceEnvVarUtil { - /** - * 把对象字段值中的占位符替换成环境变量 - * - * @param obj 需要把占位符替换环境变量的对象(对象如果是集合对象,注意要选择支持增加、删除等操作的集合类型,不要选择类似SingletonMap这种) - * @param envMap 环境变量Map - * @return 变量替换后的对象 - */ - @SuppressWarnings("all") - public static Object replaceEnvVar(Object obj, Map envMap) { - if (obj instanceof Map) { - // 递归替换map对象中的变量 - Set> entrySet = ((Map) obj).entrySet(); - for (Map.Entry entry : entrySet) { - Object value = entry.getValue(); - if (!isNormalReplaceEnvVar(value)) { - entry.setValue(replaceEnvVar(value, envMap)); - } else { - entry.setValue(handleNormalEnvVar(value, envMap)); - } - } - } else if (obj instanceof List) { - // 递归替换list对象中的变量 - List dataList = (List) obj; - for (int i = 0; i < dataList.size(); i++) { - Object value = dataList.get(i); - if (!isNormalReplaceEnvVar(value)) { - dataList.set(i, replaceEnvVar(value, envMap)); - } else { - dataList.set(i, handleNormalEnvVar(value, envMap)); - } - } - } else if (obj instanceof Set) { - // 递归替换set对象中的变量 - Set objSet = (Set) obj; - Set replaceObjSet = new HashSet(objSet); - Iterator it = replaceObjSet.iterator(); - while (it.hasNext()) { - Object value = it.next(); - objSet.remove(value); - if (!isNormalReplaceEnvVar(value)) { - objSet.add(replaceEnvVar(value, envMap)); - } else { - objSet.add(handleNormalEnvVar(value, envMap)); - } - } - } else if (isNormalReplaceEnvVar(obj)) { - // 替换基本类型对象或字符串对象中的变量 - obj = handleNormalEnvVar(obj, envMap); - } else { - try { - // 把对象转换成map后进行递归替换变量 - Map dataMap = JSONUtil.toBean(JSONUtil.toJsonStr(obj), Map.class); - replaceEnvVar(dataMap, envMap); - obj = JSONUtil.toBean(JSONUtil.toJsonStr(dataMap), obj.getClass()); - } catch (Throwable e) { - // 转换不了map的对象则进行直接替换 - obj = EnvUtils.parseEnv(JSONUtil.toJsonStr(obj), envMap, false, false); - } - } - return obj; - } - - private static Object handleNormalEnvVar(Object obj, Map envMap) { - // 只有字符串参数才需要进行变量替换,其它基本类型参数无需进行变量替换 - if (obj instanceof String) { - String objStr = ((String) obj).trim(); - if (JSONUtil.isJsonObj(objStr)) { - try { - Object dataObj = JSONUtil.toBean((String) obj, Map.class); - // string能正常转换成map,则说明是json串,那么把dataObj进行递归替换变量后再转成json串 - dataObj = replaceEnvVar(dataObj, envMap); - obj = JSONUtil.toJsonStr(dataObj); - } catch (Throwable e) { - // 转换不了map的字符串对象则直接替换 - obj = EnvUtils.parseEnv(JSONUtil.toJsonStr(obj), envMap, false, false); - } - } else if (JSONUtil.isJsonObj(objStr)) { - try { - JSONUtil.toList(JSONUtil.parseArray((String) obj), Object.class); - Object dataObj = JSONUtil.toList((String) obj, List.class); - // string能正常转成list,说明是json串,把dataObj进行递归替换变量后再转成json串 - dataObj = replaceEnvVar(dataObj, envMap); - obj = JSONUtil.toJsonStr(dataObj); - } catch (Throwable e1) { - // 转换不了list的字符串对象则直接替换 - obj = EnvUtils.parseEnv(JSONUtil.toJsonStr(obj), envMap, false, false); - } - } else { - // 转换不了map或者list的字符串对象则直接替换 - obj = EnvUtils.parseEnv(JSONUtil.toJsonStr(obj), envMap, false, false); - } - } - return obj; - } - - /** - * 判断对象是否是普通替换对象 - * - * @param obj 需要把占位符替换环境变量的对象(对象如果是集合对象,注意要选择支持增加、删除等操作的集合类型,不要选择类似SingletonMap这种) - * @return 是否是普通替换对象 - */ - private static Boolean isNormalReplaceEnvVar(Object obj) { - return obj == null || ReflectUtil.isNativeType(obj) || obj instanceof String; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ParameterUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ParameterUtils.java deleted file mode 100644 index 56e5f1a0..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/ParameterUtils.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.framework.commons.util.json.JsonUtils; -import cn.hutool.json.JSONUtil; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:ParameterUtils - * @Date:2025/03/26 15:57 - * @Filename:ParameterUtils - * @description:Todo - */ -public class ParameterUtils { - public static String getListValueByKey(List list, String key) { - var valueMap = list.stream().filter(params -> params.getKey().equals(key)).map(BuildParameters::getValue).collect(Collectors.toList()); - return !valueMap.isEmpty() ? valueMap.get(0).toString() : null; - } - - public static String element2Str(Element element) { - var elementStr = JsonUtils.toJsonString(element); - return elementStr.length() > 65534 ? null : elementStr; - } - - public static Map getElementInput(Element element) { - return getParamInputs(element.genTaskParams()); - } - - public static Map getParamInputs(Map taskParams) { - var json = taskParams.get("data"); - if (json == null) { - return null; - } - Map var = JSONUtil.toBean(JSONUtil.toJsonStr(json), Map.class); - var inputData = var.get("input"); - if (inputData == null) { - return null; - } - return var; - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/TransferUtil.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/TransferUtil.java deleted file mode 100644 index e54a431e..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/TransferUtil.java +++ /dev/null @@ -1,72 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - - -import org.json.JSONObject; - -import java.util.HashMap; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:TransferUtil - * @Date:2025/03/26 16:09 - * @Filename:TransferUtil - * @description:Todo - */ -public class TransferUtil { - - /** - * 简化input, 如果是默认值则去掉 - * - * @param defaultValue 默认值的 JSONObject - * @param input 输入的参数 Map - * @return 简化后的可变 Map - */ - public static Map simplifyParams(JSONObject defaultValue, Map input) { - Map out = new HashMap<>(input); - if (defaultValue != null) { - java.util.Iterator keys = defaultValue.keys(); - while (keys.hasNext()) { - String key = keys.next(); - Object inputValue = out.get(key); - if (inputValue == null) { - continue; - } - JSONObject defaultObj = new JSONObject(); - defaultObj.put(key, defaultValue.get(key)); - JSONObject inputObj = new JSONObject(); - inputObj.put(key, inputValue); - if (defaultObj.similar(inputObj)) { - out.remove(key); - } - } - } - return out; - } - - /** - * 填充input,如果input没有,defaultValueMap有,则填充进去。 - * - * @param defaultValue 默认值的 JSONObject - * @param input 输入的参数 Map - * @return 合并后的可变 Map - */ - public static Map mixParams(JSONObject defaultValue, Map input) { - Map out = new HashMap<>(input != null ? input : new HashMap<>()); - if (defaultValue != null) { - java.util.Iterator keys = defaultValue.keys(); - while (keys.hasNext()) { - String key = keys.next(); - Object value = out.get(key); - if (value == null) { - out.put(key, defaultValue.get(key)); - } - } - } - return out; - } - - -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/TriggerElementPropUtils.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/TriggerElementPropUtils.java deleted file mode 100644 index 48b1f825..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/TriggerElementPropUtils.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.ci.common.pipeline.pojo.element.ElementProp; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.common.pipeline.utils - * @Project:ops-pro - * @name:TriggerElementPropUtils - * @Date:2025/03/26 16:09 - * @Filename:TriggerElementPropUtils - * @description:Todo - */ -public class TriggerElementPropUtils { - public static ElementProp vuexInput(String name, String value) { - if (value == null || value.isBlank()) { - return null; - } - return new ElementProp(name, value.split(","), ElementProp.ElementPropType.VUEX_INPUT); - } - - public static ElementProp staffInput(String name, List value) { - if (value == null || value.isEmpty()) { - return null; - } - return new ElementProp(name, value, ElementProp.ElementPropType.STAFF_INPUT); - } - - public static ElementProp selector(String name, List value) { - if (value == null || value.isEmpty()) { - return null; - } - return new ElementProp(name, value, ElementProp.ElementPropType.SELECTOR); - } -} diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/YamlUtil.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/YamlUtil.java deleted file mode 100644 index 4ec92713..00000000 --- a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/utils/YamlUtil.java +++ /dev/null @@ -1,86 +0,0 @@ -package cd.casic.ci.common.pipeline.utils; - -import cd.casic.framework.commons.util.reflect.ReflectUtil; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import lombok.Getter; -import org.yaml.snakeyaml.Yaml; - -import java.lang.reflect.Method; - -/** - * @author by mianbin - * @Classname YamlUtil - * @Description TODO - * @Date 2025/3/29 16:13 - */ -@Getter -public class YamlUtil { - public static final ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.SPLIT_LINES)).registerModule(new JavaTimeModule()); - - private static final int RETRY_TIME = 3; - - public static String toYaml(Object bean) { - if (isNativeType(bean) || bean instanceof String) { - return bean.toString(); - } - try { - return getObjectMapper().writeValueAsString(bean); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private static ObjectMapper getObjectMapper() { - return objectMapper; - } - - public static T to(String yamlStr, TypeReference valueTypeRef) { - if (valueTypeRef == null) { - valueTypeRef = new TypeReference() { - }; - } - String obj = loadYamlRetryOnAccident(yamlStr); - try { - return getObjectMapper().readValue(obj, valueTypeRef); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public static String loadYamlRetryOnAccident(String yamlStr, int retryTime, long retryPeriodMills) { - try { - String yml = (RETRY_TIME != retryTime) ? "# auto fix " + "+".repeat(retryTime) + "\n" + yamlStr : yamlStr; - Yaml yaml = new Yaml(); - return toYaml(yaml.load(yml)); - } catch (Throwable re) { - if (retryTime - 1 < 0) { - throw new RuntimeException(re); - } - if (retryPeriodMills > 0) { - try { - Thread.sleep(retryPeriodMills); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - return loadYamlRetryOnAccident(yamlStr, retryTime - 1, retryPeriodMills); - } - } - - public static String loadYamlRetryOnAccident(String yamlStr) { - return loadYamlRetryOnAccident(yamlStr, RETRY_TIME, 50); - } - - private static boolean isNativeType(Object obj) { - try { - Method method = ReflectUtil.class.getMethod("isNativeType", Object.class); - return (boolean) method.invoke(null, obj); - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/modules/module-ci-dispatch-api/pom.xml b/modules/module-ci-dispatch-api/pom.xml deleted file mode 100644 index c685aecf..00000000 --- a/modules/module-ci-dispatch-api/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-dispatch-api - - ${revision} - - jar - - - - cd.casic.boot - module-ci-common-pipeline - - - - cd.casic.boot - spring-boot-starter-web - - - cd.casic.boot - module-ci-environment - - - - - - \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildAgentBuildResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildAgentBuildResource.java deleted file mode 100644 index 284d4c6f..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildAgentBuildResource.java +++ /dev/null @@ -1,128 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - - -import cd.casic.ci.common.pipeline.pojo.agent.ThirdPartyAgentUpgradeByVersionInfo; -import cd.casic.ci.common.pipeline.pojo.agent.UpgradeItem; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.dispatch.pojo.thirdpartyagent.*; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*; - - -@Tag(name = "BUILD_AGENT_BUILD", description = "第三方接入agent资源") -@RestController -@RequestMapping("/buildAgent/agent/thirdPartyAgent") -public interface BuildAgentBuildResource { - - @Operation(summary = "尝试启动构建") - @GetMapping("/startup") - CommonResult startBuild( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "尝试启动构建的类型", required = false) - @RequestParam("buildType") String buildType); - - @Operation(summary = "是否更新") - @GetMapping("/upgrade") - CommonResult upgrade( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "Agent 版本号", required = false) - @RequestParam("version") String version, - @Parameter(description = "masterAgent 版本号", required = false) - @RequestParam("masterVersion") String masterVersion); - - @Operation(summary = "是否更新NEW") - @PostMapping("/upgradeNew") - CommonResult upgradeNew( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "检查版本升级上报的信息", required = false) - ThirdPartyAgentUpgradeByVersionInfo info); - - @Operation(summary = "更新完成") - @DeleteMapping("/upgrade") - CommonResult finishUpgrade( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "升级是否成功", required = true) - @RequestParam("success") boolean success); - - @Operation(summary = "worker构建结束") - @PostMapping("/workerBuildFinish") - CommonResult workerBuildFinish( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "构建信息", required = true) - ThirdPartyBuildWithStatus buildInfo); - - @Operation(summary = "尝试启动Docker登录调试") - @GetMapping("/docker/startupDebug") - CommonResult dockerStartDebug( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey); - - @Operation(summary = "启动Docker登录完成") - @PostMapping("/docker/startupDebug") - CommonResult dockerStartDebugDone( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "构建信息", required = true) - ThirdPartyDockerDebugDoneInfo debugInfo); - - @Operation(summary = "获取登录调试任务状态") - @GetMapping("/docker/debug/status") - CommonResult dockerDebugStatus( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "debugId", required = true) - @RequestParam("debugId") long debugId); - - @Operation(summary = "第三方构建机请求") - @PostMapping("/ask") - CommonResult thirdPartyAgentAsk( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "Agent ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_ID) String agentId, - @Parameter(description = "秘钥", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_AGENT_SECRET_KEY) String secretKey, - @Parameter(description = "ask信息", required = true) - ThirdPartyAskInfo data); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildJobQuotaBusinessResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildJobQuotaBusinessResource.java deleted file mode 100644 index aec8c438..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildJobQuotaBusinessResource.java +++ /dev/null @@ -1,49 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*; - -@Tag(name = "BUILD_JOBS_PROJECT_QUOTA", description = "Job配额管理") -@RestController -@RequestMapping("/build/quotas/running") -public interface BuildJobQuotaBusinessResource { - - @Operation(summary = "上报一个Agent启动") - @PostMapping("/agent/start") - CommonResult addRunningAgent( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "流水线ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PIPELINE_ID) String pipelineId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建job序号", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "executeCount", required = true) - @RequestParam("executeCount") Integer executeCount - ); - - @Operation(summary = "上报一个Agent结束") - @DeleteMapping("/agent/shutdown") - CommonResult removeRunningAgent( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "流水线ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PIPELINE_ID) - String pipelineId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "构建job序号", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) - String vmSeqId, - @Parameter(description = "executeCount", required = true) - @RequestParam("executeCount") - Integer executeCount - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildScriptResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildScriptResource.java deleted file mode 100644 index c46917f0..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildScriptResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "BUILD_CUSTOM_SCRIPT", description = "构建-自定义脚本资源") -@RestController -@RequestMapping("/build/scripts") -public interface BuildScriptResource { - - @Operation(summary = "下载插件") - @GetMapping("/") - @ApiResponses({@ApiResponse(responseCode = "304", description = "本地插件已是最新,无需下载")}) - CommonResult download( - @Parameter(description = "插件标识符", required = true) - @RequestParam("scriptName") String scriptName, - @Parameter(description = "本地eTag标签", required = false) - @RequestParam("eTag") String eTag - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildWorkerResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildWorkerResource.java deleted file mode 100644 index 06d5c2fe..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/BuildWorkerResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.responses.ApiResponses; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "BUILD_WORKER", description = "构建-构建执行器资源") -@RestController -@RequestMapping("/build/workers") -public interface BuildWorkerResource { - - @Operation(summary = "下载构建执行器") - @GetMapping("/") - @ApiResponses({@ApiResponse(responseCode = "304", description = "本地的构建执行器已是最新,无需下载")}) - CommonResult download( - @Parameter(description = "本地eTag标签", required = false) - @RequestParam("eTag") String eTag - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpAgentResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpAgentResource.java deleted file mode 100644 index 0d33ffb5..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpAgentResource.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.Set; - -@Tag(name = "OP_AGENT", description = "agent相关") -@RestController -@RequestMapping("/op/agent") -public interface OpAgentResource { - - @Operation(summary = "修改灰度排队功能的项目或者流水线") - @PostMapping("/update_gray_queue") - void updateGrayQueue( - @RequestParam("projectId") String projectId, - @RequestParam("operate") String operate, - Set pipelineIds - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpJobQuotaProjectResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpJobQuotaProjectResource.java deleted file mode 100644 index a769eac0..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpJobQuotaProjectResource.java +++ /dev/null @@ -1,80 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.dispatch.pojo.JobQuotaProject; -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - - -@Tag(name = "OP_JOBS_PROJECT_QUOTA", description = "Job配额管理") -@RestController -@RequestMapping("/op/jobs/quota") -public interface OpJobQuotaProjectResource { - - @Operation(summary = "获取全部的JOB配额信息") - @GetMapping("/list/project/quota") - CommonResult> list( - @Parameter(description = "项目ID", required = false) - @RequestParam("projectId") String projectId - ); - - @Operation(summary = "获取项目的JOB配额信息") - @GetMapping("/{projectId}/{vmType}") - CommonResult get( - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") String projectId, - @Parameter(description = "构建机类型", required = true) - @PathVariable("vmType") JobQuotaVmType vmType, - @Parameter(description = "构建来源", required = false) - @RequestParam("channelCode") String channelCode - ); - - @Operation(summary = "添加项目的JOB配额信息") - @PutMapping("/{projectId}") - CommonResult add( - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") String projectId, - @Parameter(description = "Job配额信息", required = true) - JobQuotaProject jobQuota - ); - - @Operation(summary = "删除项目的JOB配额信息") - @DeleteMapping("/{projectId}/{vmType}") - CommonResult delete( - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") String projectId, - @Parameter(description = "构建机类型", required = true) - @PathVariable("vmType") JobQuotaVmType vmType, - @Parameter(description = "构建来源", required = false) - @RequestParam("channelCode") String channelCode - ); - - @Operation(summary = "更新项目的JOB配额信息") - @PostMapping("/{projectId}/{vmType}") - CommonResult update( - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") String projectId, - @Parameter(description = "构建机类型", required = true) - @PathVariable("vmType") JobQuotaVmType vmType, - @Parameter(description = "Job配额信息", required = true) - JobQuotaProject jobQuota - ); - - @Operation(summary = "清零异常的构建配额记录") - @PostMapping("/project/{projectId}/vm/{vmType}") - CommonResult restoreProjectRunningJobs( - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") String projectId, - @Parameter(description = "构建机类型", required = true) - @PathVariable("vmType") JobQuotaVmType vmType, - @Parameter(description = "构建时间", required = true) - @RequestParam("createTime") String createTime, - @Parameter(description = "构建来源", required = false) - @RequestParam("channelCode") String channelCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpJobQuotaSystemResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpJobQuotaSystemResource.java deleted file mode 100644 index 6ecf93c7..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/OpJobQuotaSystemResource.java +++ /dev/null @@ -1,71 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.dispatch.pojo.JobQuotaSystem; -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.Map; - -@Tag(name = "OP_JOBS_SYSTEM_QUOTA", description = "Job默认配额管理") -@RestController -@RequestMapping("/op/jobs/system/quota") -public interface OpJobQuotaSystemResource { - - @Operation(summary = "统计已运行的配额信息") - @GetMapping("/all/statistics") - CommonResult> statistics( - @Parameter(description = "分页大小", required = false) - @RequestParam("limit") Integer limit, - @Parameter(description = "偏移", required = false) - @RequestParam("offset") Integer offset - ); - - @Operation(summary = "获取全部的JOB配额信息") - @GetMapping("/all/list") - CommonResult> list(); - - @Operation(summary = "获取系统默认JOB配额信息") - @GetMapping("/{jobQuotaVmType}") - CommonResult> get( - @Parameter(description = "构建机类型", required = false) - @PathVariable("jobQuotaVmType") JobQuotaVmType jobQuotaVmType, - @Parameter(description = "构建来源", required = false) - @RequestParam("channelCode") String channelCode - ); - - @Operation(summary = "添加系统默认JOB配额信息") - @PutMapping("/") - CommonResult add( - @Parameter(description = "Job配额信息", required = true) - JobQuotaSystem jobQuota - ); - - @Operation(summary = "删除系统默认JOB配额信息") - @DeleteMapping("/{jobQuotaVmType}") - CommonResult delete( - @Parameter(description = "构建机类型", required = true) - @PathVariable("jobQuotaVmType") JobQuotaVmType jobQuotaVmType, - @Parameter(description = "构建来源", required = false) - @RequestParam("channelCode") String channelCode - ); - - @Operation(summary = "更新系统的JOB配额信息") - @PostMapping("/{jobQuotaVmType}") - CommonResult update( - @Parameter(description = "构建机类型", required = true) - @PathVariable("jobQuotaVmType") JobQuotaVmType jobQuotaVmType, - @Parameter(description = "Job配额信息", required = true) - JobQuotaSystem jobQuota - ); - - @Operation(summary = "清零当月已运行时间") - @PostMapping("/clear/vm/{vmType}") - CommonResult restore( - @Parameter(description = "构建机类型", required = true) - @PathVariable("vmType") JobQuotaVmType vmType - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceAgentResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceAgentResource.java deleted file mode 100644 index a8999136..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceAgentResource.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.framework.commons.pojo.PageResult; -import cd.casic.pipeline.dispatch.pojo.thirdpartyagent.AgentBuildInfo; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@Tag(name = "SERVICE_AGENT", description = "服务-Agent") -@RestController -@RequestMapping("/service/agents") -public interface ServiceAgentResource { - - @Operation(summary = "获取agent构建信息") - @GetMapping("/{agentId}/listBuilds") - PageResult listAgentBuild( - @Parameter(description = "agent Hash ID", required = true) - @PathVariable("agentId") String agentId, - @Parameter(description = "筛选此状态,支持4种输入(QUEUE,RUNNING,DONE,FAILURE)", required = false) - @RequestParam("status") String status, - @Parameter(description = "筛选此pipelineId", required = false) - @RequestParam("pipelineId") String pipelineId, - @Parameter(description = "第几页", required = false) - @RequestParam("page") Integer page, - @Parameter(description = "每页条数", required = false) - @RequestParam("pageSize") Integer pageSize - ); - - @Operation(summary = "批量获取构建机最近执行记录") - @GetMapping("listLatestBuildPipelines") - CommonResult> listLatestBuildPipelines( - @Parameter(description = "agent Hash ID", required = true) - @RequestParam("agentIds") List agentIds - ); - - @Operation(summary = "获取agent登录调试url") - @GetMapping("/docker/debug/url") - CommonResult getDockerDebugUrl( - @RequestParam("userId") String userId, - @RequestParam("projectId") String projectId, - @RequestParam("pipelineId") String pipelineId, - @RequestParam("buildId") String buildId, - @RequestParam("vmSeqId") String vmSeqId - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceDispatchJobResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceDispatchJobResource.java deleted file mode 100644 index f4913479..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceDispatchJobResource.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import cd.casic.pipeline.dispatch.pojo.AgentStartMonitor; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "SERVICE_AGENT", description = "服务-Agent") -@RestController -@RequestMapping("/service/dispatch/jobs") -public interface ServiceDispatchJobResource { - - @Operation(summary = "监控") - @PostMapping("/monitor") - void monitor( - @Parameter(description = "agent 事件", required = true) - AgentStartMonitor agentStartMonitor - ); -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceJobQuotaBusinessResource.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceJobQuotaBusinessResource.java deleted file mode 100644 index 8fd76cf3..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/api/ServiceJobQuotaBusinessResource.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.pipeline.dispatch.api; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - - -@Tag(name = "BUILD_JOBS_PROJECT_QUOTA", description = "Job配额管理") -@RestController -@RequestMapping("/service/quotas/running") -public interface ServiceJobQuotaBusinessResource { - - @Operation(summary = "上报一个JOB启动") - @PostMapping("/job/projects/{projectId}/vmTypes/{vmType}/builds/{buildId}/vmSeqs/{vmSeqId}") - CommonResult checkAndAddRunningJob( - @Parameter(description = "projectId", required = true) - @PathVariable("projectId") String projectId, - @Parameter(description = "vmType", required = true) - @PathVariable("vmType") JobQuotaVmType vmType, - @Parameter(description = "buildId", required = true) - @PathVariable("buildId") String buildId, - @Parameter(description = "vmSeqId", required = true) - @PathVariable("vmSeqId") String vmSeqId, - @Parameter(description = "executeCount", required = true) - @RequestParam("executeCount") Integer executeCount, - @Parameter(description = "containerId", required = true) - @RequestParam("containerId") String containerId, - @Parameter(description = "containerHashId", required = false) - @RequestParam("containerHashId") String containerHashId, - @Parameter(description = "channelCode", required = false) - @RequestParam("channelCode") String channelCode - ); - - @Operation(summary = "上报一个JOB结束") - @DeleteMapping("/job/projects/{projectId}/pipelines/{pipelineId}/builds/{buildId}/vmSeqs/{vmSeqId}") - CommonResult removeRunningJob( - @Parameter(description = "projectId", required = true) - @PathVariable("projectId") String projectId, - @Parameter(description = "pipelineId", required = true) - @PathVariable("pipelineId") String pipelineId, - @Parameter(description = "buildId", required = true) - @PathVariable("buildId") String buildId, - @Parameter(description = "vmSeqId", required = false) - @PathVariable("vmSeqId") String vmSeqId, - @Parameter(description = "executeCount", required = true) - @RequestParam("executeCount") Integer executeCount - ); -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/constants/DispatchConstants.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/constants/DispatchConstants.java deleted file mode 100644 index d365eab0..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/constants/DispatchConstants.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.pipeline.dispatch.constants; - -public class DispatchConstants { - public static final String QUEUE_BUILD = "queue_build"; - public static final String QUEUE_BUILD_NEED_END = "queue_build_need_end"; - public static final String EXCHANGE_BUILD = "exchange_build"; - public static final String ROUTE_BUILD = "build"; - public static final String ROUTE_BUILD_NEED_END = "build_need_end"; - public static final String EXCHANGE_BUILD_ABORT = "exchange_build_abort"; - public static final String ROUTE_BUILD_ABORT = "route_build_abort"; - public static final String QUEUE_BUILD_ABORT = "queue_build_abort"; - public static final String QUEUE_TASK_BEGIN = "queue_dispatch_vm_task_begin"; - public static final String QUEUE_TASK_END = "queue_dispatch_vm_task_end"; - public static final String QUEUE_TASK_NEDD_END = "queue_dispatch_vm_task_need_end"; - public static final String EXCHANGE_TASK = "exchange_vm_task"; - public static final String ROUTE_TASK_BEGIN = "dispatch_vm_task_begin"; - public static final String ROUTE_TASK_END = "dispatch_vm_task_end"; - public static final String ROUTE_TASK_NEDD_END = "dispatch_vm_task_need_end"; - // |Docker构建|最大并行构建量(maximum parallelism)/当前正在运行构建数量(Running): - public static final String DOCKER_BUILD_VOLUME = "DockerBuildVolume"; - // |最大并行构建量(maximum parallelism)/当前正在运行构建数量(Running): - public static final String MAXIMUM_PARALLELISM = "MaximumParallelism"; - public static final String UNLIMITED = "Unlimited"; // 无限制(unlimited), 注意负载(Attention) - public static final String HEARTBEAT_TIME = "HeartbeatTime"; // 构建机最近心跳时间(heartbeat Time) - public static final String DOCKER_WAS_RECENTLY_BUILT = "DockerWasRecentlyBuilt"; // |Docker构建|最近{0}次运行中的构建: - public static final String WAS_RECENTLY_BUILT = "WasRecentlyBuilt"; // |最近{0}次运行中的构建: - public static final String TASK_FETCHING_TIMEOUT = "TaskFetchingTimeout"; // 任务领取超过{0} 分钟没有启动, 可能存在异常,开始重置 - public static final String SCHEDULING_SELECTED_AGENT = "SchedulingSelectedAgent"; // 调度构建机(Scheduling selected Agent): {0}/{1} - public static final String SEARCHING_AGENT = "SearchingAgent"; // 开始查找最近使用过并且当前没有任何任务的空闲构建机... - public static final String MAX_BUILD_SEARCHING_AGENT = "MaxBuildSearchingAgent"; // 查找最近使用过并且未达到最大构建数的构建机... - public static final String SEARCHING_AGENT_MOST_IDLE = "SearchingAgentMostIdle"; // 开始查找没有任何任务的空闲构建机... - public static final String SEARCHING_AGENT_PARALLEL_AVAILABLE = "SearchingAgentParallelAvailable"; // 开始查找当前构建任务还没到达最大并行数构建机... - public static final String NO_AGENT_AVAILABLE = "NoAgentAvailable"; // 没有可用Agent,等待Agent释放... - public static final String ENV_BUSY = "EnvBusy"; // 构建环境并发保护,稍后重试... - public static final String QUEUE_TIMEOUT_MINUTES = "QueueTimeoutMinutes"; // 构建环境无可分配构建机,等待超时(queue-timeout-minutes={0}) - public static final String AGENT_IS_BUSY = "AgentIsBusy"; // 构建机繁忙,继续重试(Agent is busy) - public static final String BUILD_AGENT_DETAIL_LINK_ERROR = "BuildAgentDetailLinkError"; // 构建机Agent详情链接 - public static final String ENV_WORKER_ERROR_IGNORE = "EnvWorkerErrorIgnore"; // 构建机环境中{0}节点启动构建进程失败,自动切换其他节点重试 - public static final String AGENT_REUSE_MUTEX_REDISPATCH = "agentReuseMuteXRedispatch"; // 构建机复用互斥,节点 {0} 已被 {1} 构建使用,重新调度 - // 构建机复用互斥,等待被依赖的节点 {0} 调度到具体节点后再进行复用调度 - public static final String AGENT_REUSE_MUTEX_WAIT_REUSED_ENV = "agentReuseMuteXWaitReusedEnv"; // 构建机复用互斥,等待被依赖的节点 {0} 调度到具体节点后再进行复用调度 - public static final String ENV_NODE_DISABLE = "EnvNodeDisable"; - public static final String THIRD_JOB_ENV_CURR = "ThirdJobEnvCurr"; // 当前环境下所有构建机并发{0}已经超过配置的{1},排队{2}分钟 - public static final String THIRD_JOB_NODE_CURR = "ThirdJobNodeCurr"; // 当前环境下所有节点运行任务都超过了配置的{0},排队{1}分钟 -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/AgentStartMonitor.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/AgentStartMonitor.java deleted file mode 100644 index 90c43f91..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/AgentStartMonitor.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname AgentStartMonitor - * @Description TODO - * @Date 2025/4/8 16:36 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class AgentStartMonitor { - private String projectId; - private String pipelineId; - private String userId; - private String buildId; - private String vmSeqId; - private String containerHashId; - private Integer executeCount; - private String stepId; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/BuildAbortMessage.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/BuildAbortMessage.java deleted file mode 100644 index acdce315..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/BuildAbortMessage.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname BuildAbortMessage - * @Description TODO - * @Date 2025/4/8 16:36 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "停止构建信息") -public class BuildAbortMessage { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "用户ID", required = true) - private String userId; - @Schema(title = "虚拟Hash ID", required = true) - private String vmHashId; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/BuildNeedEndMessage.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/BuildNeedEndMessage.java deleted file mode 100644 index 169dede7..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/BuildNeedEndMessage.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname BuildNeedEndMessage - * @Description TODO - * @Date 2025/4/8 16:37 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "构建结束信息") -public class BuildNeedEndMessage { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "构建开始时间", required = true) - private long startTime; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaProject.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaProject.java deleted file mode 100644 index 213db4c7..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaProject.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname JobQuotaProject - * @Description TODO - * @Date 2025/4/8 16:38 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "项目的JOB配额") -public class JobQuotaProject { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "构建机类型", required = true) - private JobQuotaVmType vmType; - @Schema(title = "构建来源,默认BS", required = true) - private String channelCode = ChannelCode.BS.name(); - @Schema(title = "项目最大并发JOB数, 默认50", required = false) - private int runningJobMax; - @Schema(title = "项目单JOB最大执行时间,默认8小时", required = false) - private int runningTimeJobMax; - @Schema(title = "项目所有JOB最大执行时间,默认40小时/月", required = false) - private int runningTimeProjectMax; - @Schema(title = "创建时间", required = false) - private Long createdTime; - @Schema(title = "修改时间", required = false) - private Long updatedTime; - @Schema(title = "操作人", required = false) - private String operator; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaStatus.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaStatus.java deleted file mode 100644 index ae143037..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaStatus.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname JobQuotaStatus - * @Description TODO - * @Date 2025/4/8 16:38 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "项目的JOB状态") -public class JobQuotaStatus { - @Schema(title = "项目JOB数量配额", required = true) - private int jobQuota; - @Schema(title = "已运行JOB数量", required = true) - private int runningJobCount; - @Schema(title = "JOB告警阈值,百分比0-100", required = true) - private int jobThreshold; - @Schema(title = "项目job时间配额,单位:小时", required = true) - private long timeQuota; - @Schema(title = "当月已运行JOB时间, 单位:毫秒", required = true) - private long runningJobTime; - @Schema(title = "时间告警阈值,百分比0-100", required = true) - private int timeThreshold; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaSystem.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaSystem.java deleted file mode 100644 index 05d83a6b..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobQuotaSystem.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname JobQuotaSystem - * @Description TODO - * @Date 2025/4/8 16:38 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "系统默认JOB配额") -public class JobQuotaSystem { - @Schema(title = "构建机类型", required = true) - private JobQuotaVmType vmType; - @Schema(title = "构建来源,默认BS", required = true) - private String channelCode = ChannelCode.BS.name(); - @Schema(title = "蓝盾系统最大并发JOB数,默认5000", required = false) - private int runningJobMaxSystem; - @Schema(title = "单项目默认最大并发JOB数, 默认500", required = false) - private int runningJobMaxProject; - @Schema(title = "系统默认所有单个JOB最大执行时间,默认24小时", required = false) - private int runningTimeJobMax; - @Schema(title = "默认单项目所有JOB最大执行时间,默认5000小时/月", required = false) - private int runningTimeJobMaxProject; - @Schema(title = "项目执行job数量告警阈值,百分比,默认80", required = false) - private int projectRunningJobThreshold; - @Schema(title = "项目执行job时间告警阈值,百分比,默认80", required = false) - private int projectRunningTimeThreshold; - @Schema(title = "系统执行job数量告警阈值,百分比,默认80", required = false) - private int systemRunningJobThreshold; - @Schema(title = "创建时间", required = false) - private String createdTime; - @Schema(title = "修改时间", required = false) - private String updatedTime; - @Schema(title = "操作人", required = false) - private String operator; -} \ No newline at end of file diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobRunningCountProject.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobRunningCountProject.java deleted file mode 100644 index 8e1a867e..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobRunningCountProject.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname JobRunningCountProject - * @Description TODO - * @Date 2025/4/8 16:39 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "项目的JOB运行数量") -public class JobRunningCountProject { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "构建机类型", required = true) - private JobQuotaVmType vmType; - @Schema(title = "项目当前并发JOB数", required = true) - private Integer runningJobs; - @Schema(title = "项目当前所有JOB当月已经执行时间,小时", required = true) - private Integer runningTimeProject; - @Schema(title = "工蜂CI当前并发JOB数量", required = true) - private Integer runningJobsGitCi; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobRunningCountSystem.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobRunningCountSystem.java deleted file mode 100644 index dc63cefa..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/JobRunningCountSystem.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname JobRunningCountSystem - * @Description TODO - * @Date 2025/4/8 16:39 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "系统的JOB运行数量") -public class JobRunningCountSystem { - @Schema(title = "构建机类型", required = true) - private JobQuotaVmType vmType; - @Schema(title = "系统当前并发JOB数", required = true) - private Integer runningJob; - @Schema(title = "工蜂CI当前并发JOB数量", required = true) - private Integer runningJobMaxGitCiSystem; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/Machine.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/Machine.java deleted file mode 100644 index fc369669..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/Machine.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname Machine - * @Description TODO - * @Date 2025/4/8 16:39 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机主机信息") -public class Machine { - @Schema(title = "主机 ID", required = true) - private int id; - @Schema(title = "主机 IP", required = true) - private String ip; - @Schema(title = "主机名", required = true) - private String name; - @Schema(title = "主机用户名", required = true) - private String username; - @Schema(title = "主机密码", required = true) - private String password; - @Schema(title = "当前运行数", required = true) - private int currentRunNum; - @Schema(title = "最大运行数", required = true) - private int maxVMRun; - @Schema(title = "创建时间", required = true) - private long createdTime; - @Schema(title = "修改时间", required = true) - private long updatedTime; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/MachineCreate.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/MachineCreate.java deleted file mode 100644 index 42b45407..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/MachineCreate.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname MachineCreate - * @Description TODO - * @Date 2025/4/8 16:39 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机主机-创建信息") -public class MachineCreate { - @Schema(title = "主机 ID", required = true) - private int id; - @Schema(title = "主机 IP", required = true) - private String ip; - @Schema(title = "主机名", required = true) - private String name; - @Schema(title = "主机用户名", required = true) - private String username; - @Schema(title = "主机密码", required = true) - private String password; - @Schema(title = "最多允许允许的虚拟机台数", required = true) - private int maxVMRun; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/PipelineBuild.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/PipelineBuild.java deleted file mode 100644 index 95415a30..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/PipelineBuild.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineBuild - * @Description TODO - * @Date 2025/4/8 16:40 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class PipelineBuild { - private String projectId; - private String pipelineId; - private String buildId; - private String vmBuildId; - private Long vmId; - private Long createTime; - private Integer status; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/PipelineBuildCreate.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/PipelineBuildCreate.java deleted file mode 100644 index 1d9361f3..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/PipelineBuildCreate.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineBuildCreate - * @Description TODO - * @Date 2025/4/8 16:40 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class PipelineBuildCreate { - private String projectId; - private String pipelineId; - private String buildId; - private String vmSeqId; - private Long vmId; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/RunningJobVO.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/RunningJobVO.java deleted file mode 100644 index c0913882..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/RunningJobVO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import cd.casic.pipeline.dispatch.pojo.enums.JobQuotaVmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname RunningJobVO - * @Description TODO - * @Date 2025/4/8 16:40 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "项目的JOB配额") -public class RunningJobVO { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "构建机类型", required = true) - private JobQuotaVmType vmType; - @Schema(title = "项目最大并发JOB数, 默认50", required = false) - private Integer runningJobMax; - @Schema(title = "项目单JOB最大执行时间,默认8小时", required = false) - private Integer runningTimeJobMax; - @Schema(title = "项目所有JOB最大执行时间,默认40小时/月", required = false) - private Integer runningTimeProjectMax; - @Schema(title = "创建时间", required = false) - private Long createdTime; - @Schema(title = "修改时间", required = false) - private Long updatedTime; - @Schema(title = "操作人", required = false) - private String operator; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/Task.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/Task.java deleted file mode 100644 index bfc568fb..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/Task.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname Task - * @Description TODO - * @Date 2025/4/8 16:41 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机主机任务信息") -public class Task { - @Schema(title = "主机任务 ID", required = true) - private Integer id; - @Schema(title = "主机任务名字", required = true) - private String name; - @Schema(title = "主机任务 脚本", required = true) - private String script; - @Schema(title = "主机任务 开始时间", required = true) - private Long beginTime; - @Schema(title = "主机任务 结束时间", required = true) - private Long endTime; - @Schema(title = "主机任务 状态", required = true) - private Byte status; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskCreate.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskCreate.java deleted file mode 100644 index 79a559f5..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskCreate.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @author by mianbin - * @Classname TaskCreate - * @Description TODO - * @Date 2025/4/8 16:41 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机主机-创建任务") -public class TaskCreate { - @Schema(title = "用户id", required = true) - private String userid; - @Schema(title = "任务名", required = true) - private String name; - @Schema(title = "任务脚本", required = false) - private String script; - @Schema(title = "机器列表", required = true) - private List vmList; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskDetail.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskDetail.java deleted file mode 100644 index b77fb295..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskDetail.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname TaskDetail - * @Description TODO - * @Date 2025/4/8 16:41 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机主机-任务详情") -public class TaskDetail { - @Schema(title = "任务详情ID", required = true) - private Integer id; - @Schema(title = "任务详情对应的任务ID", required = true) - private Integer taskId; - @Schema(title = "任务详情对应的虚拟主机ID", required = true) - private Integer vmId; - @Schema(title = "任务详情对应的虚拟主机名字", required = true) - private String vmName; - @Schema(title = "任务详情内容", required = true) - private String message; - @Schema(title = "任务详情开始时间", required = true) - private Long time; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskMessage.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskMessage.java deleted file mode 100644 index 2bc7678f..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/TaskMessage.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import cd.casic.pipeline.dispatch.pojo.enums.TaskPhase; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname TaskMessage - * @Description TODO - * @Date 2025/4/8 16:41 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "TASK信息") -public class TaskMessage { - @Schema(title = "TASK ID", required = true) - private Integer taskId; - @Schema(title = "TASK VM ID", required = true) - private Integer vmId; - @Schema(title = "TASK 执行的脚本", required = true) - private String script; - @Schema(title = "TASK 执行完信息", required = true) - private String message; - @Schema(title = "TASK 执行的脚本结果", required = true) - private TaskPhase status; - @Schema(title = "TASK 执行的脚本结果", required = true) - private Integer retryCount; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VM.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VM.java deleted file mode 100644 index 032e33d6..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VM.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname VM - * @Description TODO - * @Date 2025/4/8 16:13 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "VM-基本信息") -public class VM { - @Schema(title = "VM ID", required = true) - private Long id; - @Schema(title = "VM 对应母机ID", required = true) - private Integer machineId; - @Schema(title = "VM 类型ID", required = true) - private Integer typeId; - @Schema(title = "VM IP地址", required = true) - private String ip; - @Schema(title = "VM 名称", required = true) - private String name; - @Schema(title = "VM 系统信息", required = true) - private String os; - @Schema(title = "VM 系统信息版本", required = true) - private String osVersion; - @Schema(title = "VM CPU信息", required = true) - private String cpu; - @Schema(title = "VM 内存信息", required = true) - private String memory; - @Schema(title = "VM 是否在维护状态", required = true) - private Boolean inMaintain; - @Schema(title = "VM 管理员用户名", required = true) - private String vmManagerUsername; - @Schema(title = "VM 管理员密码", required = true) - private String vmManagerPassword; - @Schema(title = "VM 非管理员用户名", required = true) - private String vmUsername; - @Schema(title = "VM 非管理员密码", required = true) - private String vmPassword; - @Schema(title = "创建时间", required = true) - private Long createdTime; - @Schema(title = "修改时间", required = true) - private Long updatedTime; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMCreate.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMCreate.java deleted file mode 100644 index 3580997f..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMCreate.java +++ /dev/null @@ -1,47 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname VMCreate - * @Description TODO - * @Date 2025/4/8 16:42 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "VM-创建-基本信息") -public class VMCreate { - @Schema(title = "VM ID", required = true) - private Long id; - @Schema(title = "VM 对应母机ID", required = true) - private Integer machineId; - @Schema(title = "VM 类型ID", required = true) - private Integer typeId; - @Schema(title = "VM IP地址", required = true) - private String ip; - @Schema(title = "VM 名称", required = true) - private String name; - @Schema(title = "VM 系统信息", required = true) - private String os; - @Schema(title = "VM 系统版本", required = true) - private String osVersion; - @Schema(title = "VM CPU信息", required = true) - private String cpu; - @Schema(title = "VM 内存信息", required = true) - private String memory; - @Schema(title = "VM 是否在维护状态", required = true) - private Boolean inMaintain; - @Schema(title = "VM 管理员用户名", required = true) - private String vmManagerUsername; - @Schema(title = "VM 管理员密码", required = true) - private String vmManagerPassword; - @Schema(title = "VM 非管理员用户名", required = true) - private String vmUsername; - @Schema(title = "VM 非管理员密码", required = true) - private String vmPassword; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMResponse.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMResponse.java deleted file mode 100644 index 9229974d..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMResponse.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname VMResponse - * @Description TODO - * @Date 2025/4/8 16:42 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "VM-基本信息") -public class VMResponse { - @Schema(title = "VM ID", required = true) - private Integer id; - @Schema(title = "VM 对应母机ID", required = true) - private Integer machineId; - @Schema(title = "VM 对应母机名称", required = true) - private String machineName; - @Schema(title = "VM 类型ID", required = true) - private Integer typeId; - @Schema(title = "VM 类型名称", required = true) - private String typeName; - @Schema(title = "VM IP地址", required = true) - private String ip; - @Schema(title = "VM 名称", required = true) - private String name; - @Schema(title = "VM 系统信息", required = true) - private String os; - @Schema(title = "VM 系统信息版本", required = true) - private String osVersion; - @Schema(title = "VM CPU信息", required = true) - private String cpu; - @Schema(title = "VM 内存信息", required = true) - private String memory; - @Schema(title = "VM 是否在维护状态", required = true) - private Boolean inMaintain; - @Schema(title = "VM 管理员用户名", required = true) - private String vmManagerUsername; - @Schema(title = "VM 管理员密码", required = true) - private String vmManagerPassword; - @Schema(title = "VM 非管理员用户名", required = true) - private String vmUsername; - @Schema(title = "VM 非管理员密码", required = true) - private String vmPassword; - @Schema(title = "创建时间", required = true) - private Long createdTime; - @Schema(title = "修改时间", required = true) - private Long updatedTime; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMTaskResult.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMTaskResult.java deleted file mode 100644 index c72f64a2..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMTaskResult.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname VMTaskResult - * @Description TODO - * @Date 2025/4/8 16:43 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机主机-任务结束后置处理") -public class VMTaskResult { - @Schema(title = "task id", required = true) - private Integer taskId; - @Schema(title = "脚本执行信息", required = true) - private String message; - @Schema(title = "脚本执行结果", required = true) - private Boolean success; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMType.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMType.java deleted file mode 100644 index 5257749c..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMType.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname VMType - * @Description TODO - * @Date 2025/4/8 16:43 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机类型") -public class VMType { - @Schema(title = "类型ID", required = true) - private Integer id; - @Schema(title = "类型名称", required = true) - private String typeName; - @Schema(title = "创建时间", required = true) - private Long createdTime; - @Schema(title = "修改时间", required = true) - private Long updatedTime; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMTypeCreate.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMTypeCreate.java deleted file mode 100644 index 62364cb4..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMTypeCreate.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname VMTypeCreate - * @Description TODO - * @Date 2025/4/8 16:43 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "虚拟机创建类型") -public class VMTypeCreate { - @Schema(title = "类型名称", required = true) - private String typeName; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMWithPage.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMWithPage.java deleted file mode 100644 index f97999d2..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMWithPage.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @author by mianbin - * @Classname VMWithPage - * @Description TODO - * @Date 2025/4/8 16:43 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "VM-分页-基本信息") -public class VMWithPage { - @Schema(title = "VM总数", required = true) - private Integer total; - @Schema(title = "VM列表", required = true) - private List vms; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMWithPrivateProject.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMWithPrivateProject.java deleted file mode 100644 index 3a183c04..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/VMWithPrivateProject.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname VMWithPrivateProject - * @Description TODO - * @Date 2025/4/8 16:44 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "VM-专机信息") -public class VMWithPrivateProject { - @Schema(title = "VM ID", required = true) - private long id; - @Schema(title = "VM 对应母机ID", required = true) - private int machineId; - @Schema(title = "VM 类型ID", required = true) - private int typeId; - @Schema(title = "VM IP地址", required = true) - private String ip; - @Schema(title = "VM 名称", required = true) - private String name; - @Schema(title = "工程ID", required = true) - private String projectId; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/JobQuotaVmType.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/JobQuotaVmType.java deleted file mode 100644 index 90b5f0cf..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/JobQuotaVmType.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.enums; - -import cd.casic.ci.common.pipeline.type.DispatchType; -import cd.casic.ci.common.pipeline.type.docker.DockerDispatchType; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname JobQuotaVmType - * @Description TODO - * @Date 2025/4/8 16:14 - */ -@Getter -@AllArgsConstructor -public enum JobQuotaVmType { - DOCKER_VM("Docker on VM"), - KUBERNETES("kubernetes"), - DOCKER_DEVCLOUD("Docker on DevCloud"), - MACOS_DEVCLOUD("MacOS on DevCloud"), - WINDOWS_DEVCLOUD("Windows on DevCloud"), - OTHER("私有构建机或集群"), - BUILD_LESS("无编译环境"), - DOCKER_GITCI("工蜂CI构建机"), - DOCKER_STREAM("STREAM构建机"), - DOCKER_BCS("Docker on Bcs"), - DOCKER_PCG("PCG公共构建资源"), - ALL("所有类型"); - - private final String displayName; - - public static JobQuotaVmType parse(String vmType) { - for (JobQuotaVmType jobQuotaVmType : values()) { - if (jobQuotaVmType.name().equals(vmType)) { - return jobQuotaVmType; - } - } - return null; - } - - public static JobQuotaVmType parse(DispatchType dispatchType) { - if (dispatchType instanceof DockerDispatchType) { - return DOCKER_VM; - } - // 其他类型暂时不限制 - return null; - } -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/PipelineTaskStatus.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/PipelineTaskStatus.java deleted file mode 100644 index 32458678..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/PipelineTaskStatus.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname PipelineTaskStatus - * @Description TODO - * @Date 2025/4/8 16:15 - */ -@Getter -@AllArgsConstructor -public enum PipelineTaskStatus { - QUEUE(1), - RUNNING(2), - DONE(3), - FAILURE(4); - - private final int status; - - public static PipelineTaskStatus toStatus(int status) { - for (PipelineTaskStatus taskStatus : values()) { - if (taskStatus.getStatus() == status) { - return taskStatus; - } - } - throw new RuntimeException("Can't find the pipeline task status(" + status + ")"); - } - - public static PipelineTaskStatus parse(String input) { - for (PipelineTaskStatus taskStatus : values()) { - if (taskStatus.name().equals(input)) { - return taskStatus; - } - } - return DONE; - } -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/TaskPhase.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/TaskPhase.java deleted file mode 100644 index c55b32ca..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/enums/TaskPhase.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.ToString; - -/** - * @author by mianbin - * @Classname TaskPhase - * @Description TODO - * @Date 2025/4/8 16:16 - */ -@Getter -@ToString -@AllArgsConstructor -public enum TaskPhase { - READY((byte) 0), - QUEUE((byte) 1), - RUNNING((byte) 3), - SUCCESS((byte) 101), - FAIL((byte) 102), - ABORT((byte) 104), - QUEUE_TIMEOUT((byte) 105), // 排队超时 - TASK_TIMEOUT((byte) 106); // 构建超时 - - private final byte value; - - public static TaskPhase fromShort(byte value) { - for (TaskPhase taskPhase : values()) { - if (taskPhase.getValue() == value) { - return taskPhase; - } - } - return null; - } - - public static boolean isFinish(byte value) { - return value >= SUCCESS.getValue(); - } -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/reids/RedisBuild.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/reids/RedisBuild.java deleted file mode 100644 index b35ba91a..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/reids/RedisBuild.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.reids; - -import cd.casic.ci.common.pipeline.pojo.Zone; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname RedisBuild - * @Date 2025/4/8 16:17 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(description = "RedisBuild 对象,用于存储构建信息") -public class RedisBuild { - - @JsonProperty("vmName") - @Schema(description = "虚拟机名称", required = true) - private String vmName; - @JsonProperty("projectId") - @Schema(description = "项目ID", required = true) - private String projectId; - @JsonProperty("pipelineId") - @Schema(description = "流水线ID", required = true) - private String pipelineId; - @JsonProperty("buildId") - @Schema(description = "构建ID", required = true) - private String buildId; - @JsonProperty("vmSeqId") - @Schema(description = "虚拟机序列ID", required = true) - private String vmSeqId; - @JsonProperty("channelCode") - @Schema(description = "通道代码") - private String channelCode; - @JsonProperty("zone") - @Schema(description = "区域信息") - private Zone zone; - @JsonProperty("atoms") - @Schema(description = "用插件框架开发的插件信息,key为插件code,value为下载路径", defaultValue = "{}") - private Map atoms = Map.of(); -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/AgentBuildInfo.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/AgentBuildInfo.java deleted file mode 100644 index 35c365b5..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/AgentBuildInfo.java +++ /dev/null @@ -1,43 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname AgentBuildInfo - * @Description TODO - * @Date 2025/4/8 16:18 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "构建机构建信息") -public class AgentBuildInfo { - @Schema(title = "项目id") - private String projectId; - @Schema(title = "构建机id") - private String agentId; - @Schema(title = "流水线id") - private String pipelineId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "构建id") - private String buildId; - @Schema(title = "构建计数") - private int buildNum; - @Schema(title = "构建机编排序号") - private String vmSeqId; - @Schema(title = "任务名") - private String taskName; - @Schema(title = "状态") - private String status; - @Schema(title = "创建时间") - private long createdTime; - @Schema(title = "更新时间") - private long updatedTime; - @Schema(title = "工作空间") - private String workspace; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/AskEnable.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/AskEnable.java deleted file mode 100644 index b440eaf8..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/AskEnable.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname AskEnable - * @Description TODO - * @Date 2025/4/8 16:28 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class AskEnable { - private String build; - private boolean upgrade; - private boolean dockerDebug; - private boolean pipeline; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/BuildJobType.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/BuildJobType.java deleted file mode 100644 index 9b000dcb..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/BuildJobType.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -/** - * @author by mianbin - * @Classname BuildJobType - * @Description TODO - * @Date 2025/4/8 16:24 - */ -public enum BuildJobType { - ALL, - DOCKER, - BINARY, - NONE; - - public static BuildJobType toEnum(String type) { - if (type == null) { - return ALL; - } - switch (type) { - case "ALL": - return ALL; - case "DOCKER": - return DOCKER; - case "BINARY": - return BINARY; - case "NONE": - return NONE; - default: - return ALL; - } - } -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyAskInfo.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyAskInfo.java deleted file mode 100644 index 0455f5d2..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyAskInfo.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import cd.casic.ci.common.pipeline.pojo.agent.NewHeartbeatInfo; -import cd.casic.ci.common.pipeline.pojo.agent.ThirdPartyAgentUpgradeByVersionInfo; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyAskInfo - * @Description TODO - * @Date 2025/4/8 16:24 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class ThirdPartyAskInfo { - private AskEnable askEnable; - private NewHeartbeatInfo heartbeat; - private ThirdPartyAgentUpgradeByVersionInfo upgrade; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyAskResp.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyAskResp.java deleted file mode 100644 index 861a95c7..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyAskResp.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import cd.casic.ci.common.pipeline.pojo.agent.UpgradeItem; -import cd.casic.pipeline.environment.pojo.thirdpartyagent.AskHeartbeatResponse; -import cd.casic.pipeline.environment.pojo.thirdpartyagent.ThirdPartyAgentPipeline; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyAskResp - * @Description TODO - * @Date 2025/4/8 16:28 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ThirdPartyAskResp { - private AskHeartbeatResponse heartbeat; - private ThirdPartyBuildInfo build; - private UpgradeItem upgrade; - private ThirdPartyAgentPipeline pipeline; - private ThirdPartyDockerDebugInfo debug; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildDockerInfo.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildDockerInfo.java deleted file mode 100644 index f79f02bb..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildDockerInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - - -import cd.casic.ci.common.pipeline.pojo.agent.DockerOptions; -import cd.casic.ci.common.pipeline.pojo.agent.ThirdPartyAgentDockerInfoDispatch; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyBuildDockerInfo - * @Description TODO - * @Date 2025/4/8 16:27 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ThirdPartyBuildDockerInfo { - private String agentId; - private String secretKey; - private String image; - private ThirdPartyBuildDockerInfoCredential credential; - private DockerOptions options; - private String imagePullPolicy; - - public ThirdPartyBuildDockerInfo(ThirdPartyAgentDockerInfoDispatch input) { - this.agentId = input.getAgentId(); - this.secretKey = input.getSecretKey(); - this.image = input.getImage(); - this.credential = new ThirdPartyBuildDockerInfoCredential(input.getCredential()); - this.options = input.getOptions(); - this.imagePullPolicy = input.getImagePullPolicy(); - } -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildDockerInfoCredential.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildDockerInfoCredential.java deleted file mode 100644 index 1588a8e3..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildDockerInfoCredential.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import cd.casic.ci.common.pipeline.pojo.agent.Credential; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyBuildDockerInfoCredential - * @Date 2025/4/8 16:33 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -public class ThirdPartyBuildDockerInfoCredential { - private String user; - private String password; - private String errMsg; - - public ThirdPartyBuildDockerInfoCredential(Credential input) { - this.user = input != null ? input.getUser() : null; - this.password = input != null ? input.getPassword() : null; - this.errMsg = null; - } -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildInfo.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildInfo.java deleted file mode 100644 index a8f0b897..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyBuildInfo - * @Description TODO - * @Date 2025/4/8 16:35 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "第三方构建信息") -public class ThirdPartyBuildInfo { - @Schema(title = "项目id") - private String projectId; - @Schema(title = "构建id") - private String buildId; - @Schema(title = "构建机编排序号") - private String vmSeqId; - @Schema(title = "工作空间") - private String workspace; - @Schema(title = "流水线ID") - private String pipelineId; - @Schema(title = "docker构建相关信息") - private ThirdPartyBuildDockerInfo dockerBuildInfo; - @Schema(title = "流水线执行次数") - private Integer executeCount; - @Schema(title = "容器hashId日志使用") - private String containerHashId; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildWithStatus.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildWithStatus.java deleted file mode 100644 index 3188bee2..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyBuildWithStatus.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyBuildWithStatus - * @Description TODO - * @Date 2025/4/8 16:35 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "第三方构建信息模型") -public class ThirdPartyBuildWithStatus { - @Schema(title = "项目id") - private String projectId; - @Schema(title = "构建id") - private String buildId; - @Schema(title = "构建环境id") - private String vmSeqId; - @Schema(title = "工作空间") - private String workspace; - @Schema(title = "流水线id") - private String pipelineId; - @Schema(title = "是否成功") - private boolean success; - @Schema(title = "message信息") - private String message; - @Schema(title = "错误信息") - private Error error; - @Schema(title = "流水线执行次数") - private Integer executeCount; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyDockerDebugDoneInfo.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyDockerDebugDoneInfo.java deleted file mode 100644 index 7727af35..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyDockerDebugDoneInfo.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyDockerDebugDoneInfo - * @Description TODO - * @Date 2025/4/8 16:35 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "第三方构建Docker登录调试完成信息") -public class ThirdPartyDockerDebugDoneInfo { - @Schema(title = "项目id") - private String projectId; - @Schema(title = "debugId") - private Long debugId; - @Schema(title = "流水线id") - private String pipelineId; - @Schema(title = "debug链接") - private String debugUrl; - @Schema(title = "是否成功") - private boolean success; - @Schema(title = "错误信息") - private Error error; -} diff --git a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyDockerDebugInfo.java b/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyDockerDebugInfo.java deleted file mode 100644 index ee8cba62..00000000 --- a/modules/module-ci-dispatch-api/src/main/java/cd/casic/pipeline/dispatch/pojo/thirdpartyagent/ThirdPartyDockerDebugInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.pipeline.dispatch.pojo.thirdpartyagent; - -import cd.casic.ci.common.pipeline.pojo.agent.DockerOptions; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ThirdPartyDockerDebugInfo - * @Description TODO - * @Date 2025/4/8 16:36 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "第三方构建Docker登录调试信息") -public class ThirdPartyDockerDebugInfo { - @Schema(title = "项目id") - private String projectId; - @Schema(title = "构建id") - private String buildId; - @Schema(title = "构建机编排序号") - private String vmSeqId; - @Schema(title = "工作空间") - private String workspace; - @Schema(title = "流水线ID") - private String pipelineId; - @Schema(title = "调试用户") - private String debugUserId; - @Schema(title = "debugId") - private Long debugId; - private String image; - private ThirdPartyBuildDockerInfoCredential credential; - private DockerOptions options; -} diff --git a/modules/module-ci-environment/pom.xml b/modules/module-ci-environment/pom.xml deleted file mode 100644 index 07d69302..00000000 --- a/modules/module-ci-environment/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-environment - - jar - - - - - cd.casic.boot - module-ci-process-api - - - - cd.casic.boot - module-ci-market - - - - cd.casic.boot - spring-boot-starter-mybatis - - - - \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/constant/Constants.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/constant/Constants.java deleted file mode 100644 index fc96178a..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/constant/Constants.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.pipeline.environment.constant; - -/** - * @author by mianbin - * @Classname Constants - * @Description TODO - * @Date 2025/4/8 19:56 - */ -public final class Constants { - public static final long THIRD_PARTY_AGENT_HEARTBEAT_INTERVAL = 5L; - public static final String DEFAULT_SYTEM_USER = "devops"; - public static final String BK_PROJECT_NO_ENVIRONMENT = "bkProjectNoEnvironment"; // 项目下无环境 - public static final String BK_PROJECT_NO_NODE = "bkProjectNoNode"; // 项目下无节点 - public static final String T_NODE_NODE_IP = "nodeIp"; - public static final String T_NODE_HOST_ID = "hostId"; - public static final String T_NODE_NODE_ID = "nodeId"; - public static final String T_NODE_NODE_TYPE = "nodeType"; - public static final String T_NODE_CLOUD_AREA_ID = "cloudAreaId"; - public static final String T_NODE_NODE_STATUS = "nodeStatus"; - public static final String T_NODE_AGENT_VERSION = "agentVersion"; - public static final String T_NODE_AGENT_STATUS = "agentStatus"; - public static final String T_NODE_PROJECT_ID = "projectId"; - public static final String T_NODE_CREATED_USER = "createdUser"; - public static final String T_NODE_OS_TYPE = "osType"; - public static final String T_NODE_OS_NAME = "osName"; - public static final String T_NODE_SERVER_ID = "serverId"; - public static final String T_NODE_OPERATOR = "operator"; - public static final String T_NODE_BAK_OPERATOR = "bakOperator"; - public static final String T_ENV_ENV_ID = "envId"; - public static final String T_ENVIRONMENT_THIRDPARTY_AGENT_NODE_ID = "nodeId"; - public static final String T_ENVIRONMENT_THIRDPARTY_AGENT_MASTER_VERSION = "masterVersion"; - public static final String BATCH_TOKEN_HEADER = "X-DEVOPS-AGENT-INSTALL-TOKEN"; // 批量安装agent token的header - - private Constants() { - } -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/constant/EnvironmentMessageCode.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/constant/EnvironmentMessageCode.java deleted file mode 100644 index 44b1e109..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/constant/EnvironmentMessageCode.java +++ /dev/null @@ -1,83 +0,0 @@ -package cd.casic.pipeline.environment.constant; - -/** - * @author by mianbin - * @Classname EnvironmentMessageCode - * @Description TODO - * @Date 2025/4/8 19:57 - */ -public final class EnvironmentMessageCode { - public static final String ERROR_ENV_NOT_EXISTS = "2105000"; // 环境管理:[{0}] 环境不存在 - public static final String ERROR_NODE_INSUFFICIENT_PERMISSIONS = "2105001"; // 环境管理:环境权限不足 [{0}] - public static final String ERROR_NODE_NOT_EXISTS = "2105002"; // 环境管理:[{0}] 节点不存在 - public static final String ERROR_NODE_NAME_DUPLICATE = "2105003"; // 环境管理:环境名称已存在: [{0}] - public static final String ERROR_ENV_BUILD_2_DEPLOY_DENY = "2105004"; // 环境管理:构建环境不能修改为部署环境 - public static final String ERROR_ENV_DEPLOY_2_BUILD_DENY = "2105005"; // 环境管理:部署环境不能修改为构建环境 - public static final String ERROR_ENV_NO_CREATE_PERMISSSION = "2105006"; // 环境管理:没有环境创建权限 - public static final String ERROR_ENV_NO_EDIT_PERMISSSION = "2105007"; // 环境管理:没有环境编辑权限 - public static final String ERROR_ENV_NO_VIEW_PERMISSSION = "2105008"; // 环境管理:没有环境查看权限 - public static final String ERROR_ENV_NO_DEL_PERMISSSION = "2105009"; // 环境管理:没有环境删除权限 - public static final String ERROR_ENV_ID_NULL = "2105010"; // 环境管理:环境ID不能为空 - public static final String ERROR_ENV_NAME_NULL = "2105011"; // 环境管理:环境名称不能为空 - public static final String ERROR_ENV_NAME_TOO_LONG = "2105012"; // 环境管理:环境名称太长 - public static final String ERROR_ENV_NODE_HASH_ID_ILLEGAL = "2105013"; // 环境管理:环境下的节点ID不合法 - public static final String ERROR_NODE_NO_CREATE_PERMISSSION = "2105014"; // 环境管理:没有节点创建权限 - public static final String ERROR_NODE_NO_EDIT_PERMISSSION = "2105015"; // 环境管理:没有节点编辑权限 - public static final String ERROR_NODE_NO_VIEW_PERMISSSION = "2105016"; // 环境管理:没有节点查看权限 - public static final String ERROR_NODE_NO_DEL_PERMISSSION = "2105017"; // 环境管理:没有节点删除权限 - public static final String ERROR_NODE_AGENT_STATUS_EXCEPTION = "2105018"; // 环境管理:构建机状态异常 - public static final String ERROR_NODE_AGENT_SECRET_KEY_INVALID = "2105019"; // 环境管理:构建机密钥不对 - public static final String ERROR_ENV_EXPIRED_DAYS = "2105020"; // 环境管理:有效期不能超过[{0}]天 - public static final String ERROR_ENV_BUILD_CAN_NOT_ADD_SVR = "2105021"; // 服务器节点[{0}]不能添加到构建环境 - public static final String ERROR_ENV_DEPLOY_CAN_NOT_ADD_AGENT = "2105022"; // 构建节点[{0}]不能添加到非构建环境 - public static final String ERROR_NODE_CHANGE_USER_NOT_SUPPORT = "2105023"; // 节点类型【{0}】不支持修改导入人 - public static final String ERROR_NODE_IMPORT_EXCEED = "2105024"; // 环境管理:导入节点数不能超过配额[{0}] - public static final String ERROR_NODE_IP_ILLEGAL_USER = "2105025"; // 环境管理:非法 IP [{0}], 请确认当前用户[{1}]是否是服务器的主备负责人 - 测试机导入|重新导入 - public static final String ERROR_QUOTA_LIMIT = "2105026"; // 环境管理:配额不足,总量{0}, 已使用: {1} - public static final String ERROR_VM_CAN_NOT_DESTROY = "2105027"; // 环境管理:虚拟机状态为:{0}, 不允许销毁!请稍后操作! - public static final String ERROR_VM_CAN_NOT_IMAGED = "2105028"; // 环境管理:虚拟机状态为:{0}, 无法制作镜像! - public static final String ERROR_NODE_HAD_BEEN_ASSIGN = "2105029"; // 环境管理:节点已被分配,不能重新分配 - public static final String ERROR_ENV_BCS_NOT_ACTIVED = "2105030"; // 环境管理:项目[{0}]没有开通过BCS虚拟机功能 - public static final String ERROR_NODE_INFLUX_QUERY_HOST_INFO_FAIL = "2105031"; // 环境管理:查询构建机主机信息失败: {0} - public static final String ERROR_NODE_INFLUX_QUERY_CPU_INFO_FAIL = "2105032"; // 环境管理:查询构建机CPU信息失败: {0} - public static final String ERROR_NODE_INFLUX_QUERY_MEM_INFO_FAIL = "2105033"; // 环境管理:查询构建机内存信息失败: {0} - public static final String ERROR_NODE_INFLUX_QUERY_DISK_INFO_FAIL = "2105034"; // 环境管理:查询构建机磁盘信息失败: {0} - public static final String ERROR_NODE_INFLUX_QUERY_NET_INFO_FAIL = "2105035"; // 环境管理:查询构建机网络信息失败: {0} - public static final String ERROR_NODE_SHARE_PROJECT_EMPTY = "2105036"; // 环境管理:共享的项目列表为空 - public static final String ERROR_NODE_SHARE_PROJECT_TYPE_ERROR = "2105037"; // 环境管理:仅构建环境支持共享 - public static final String ERROR_NODE_NAME_INVALID_CHARACTER = "2105038"; // 环境管理:环境名称包含非法字符@ - public static final String ERROR_NODE_NAME_OR_ID_INVALID = "2105039"; // 环境管理:获取节点失败,请求节点hash id或别名有误 - public static final String ERROR_NOT_THIRD_PARTY_BUILD_MACHINE = "2105040"; // 环境管理:这个节点不是第三方构建机 - public static final String THIRD_PARTY_BUILD_ENVIRONMENT_NOT_EXIST = "2105041"; // 第三方构建机环境不存在 - public static final String ERROR_NO_PERMISSION_TO_USE_THIRD_PARTY_BUILD_ENV = "2105042"; // 无权限使用第三方构建机环境 - public static final String ERROR_THIRD_PARTY_BUILD_ENV_NODE_NOT_EXIST = "2105043"; // 第三方构建机环境节点不存在 - public static final String ERROR_PIPE_NOT_FOUND = "2105044"; // 环境管理:不存在该管道信息 - public static final String ERROR_NODE_NO_USE_PERMISSSION = "2105045"; // 环境管理:节点[{0}]没有使用权限 - public static final String ERROR_NODE_IP_ILLEGAL = "2105046"; // 环境管理: 不在CMDB中的IP [{0}]; 无权限的IP [{1}], 请确认当前用户[{2}]或节点导入人[{3}]是否为这些节点的主备负责人 - 脚本执行|文件分发 - public static final String ERROR_CMDB_INTERFACE_TIME_OUT = "2105047"; // 环境管理: CMDB接口请求超时,请重试 - public static final String ERROR_CMDB_RESPONSE = "2105048"; // 环境管理: CMDB接口请求异常,请重试 - public static final String ERROR_SCRIPT_EXECUTE_HOST_EMPTY = "2105049"; // 环境管理: 脚本执行: 主机为空 - public static final String ERROR_DISTRIBUTE_FILE_EXECUTE_TARGET_HOST_EMPTY = "2105050"; // 环境管理: 文件分发: 执行目标主机为空 - public static final String ERROR_DISTRIBUTE_FILE_FILE_SOURCE_HOST_EMPTY = "2105051"; // 环境管理: 文件分发: 文件源主机为空 - public static final String ERROR_ENV_LIST_NODE_NOT_IN_CC_OR_CMDB = "2105052"; // 环境管理: 环境中的[{0}]不在CC/CMDB中 - public static final String ERROR_NODE_LIST_NODE_NOT_IN_CC_OR_CMDB = "2105053"; // 环境管理: 节点中的[{0}]不在CC/CMDB中 - public static final String ERROR_JOB_INSTANCE_NOT_BELONG_TO_PROJECT = "2105054"; // 环境管理: 请求的job实例不属于当前项目或已过期(超过一个月) - public static final String ERROR_FAIL_TO_CREATE_AGENT_INSTALL_TASK = "2105055"; // 环境管理: 创建Agent安装任务失败:{0} - public static final String ERROR_INPUT_TOO_MANY_IP = "2105056"; // 环境管理: 输入的IP数量不可超过{0} - public static final String ERROR_NODE_NOT_BELONG_TO_PROJECT = "2105057"; // 环境管理: IP {0} 未被作为节点导入项目 {1},请到【环境管理-节点】导入测试机后重试 - - public static final String BK_NORMAL_VERSION = "bkNormalVersion"; // 8核16G(普通版) - public static final String BK_INTEL_XEON_SKYLAKE_PROCESSOR = "bkIntelXeonSkylakeProcessor"; // 2.5GHz 64核 Intel Xeon Skylake 6133处理器 - public static final String BK_MEMORY = "bkMemory"; // 32GB*12 DDR3 内存 - public static final String BK_SOLID_STATE_DISK = "bkSolidStateDisk"; // {0}GB 固态硬盘 - public static final String BK_ESTIMATED_DELIVERY_TIME = "bkEstimatedDeliveryTime"; // 预计交付周期:{0}分钟 - public static final String BK_HIGH_END_VERSION = "bkHighEndVersion"; // 32核64G(高配版) - public static final String AGENT_VERSION = "agentVersion"; // Agent版本 - public static final String AGENT_STATUS = "agentStatus"; // Agent版本 - public static final String OS_TYPE = "osType"; // 操作系统 - public static final String NODE_USAGE_BUILD = "nodeUsageBuild"; // 构建 - public static final String NODE_USAGE_DEPLOYMENT = "nodeUsageDeployment"; // 部署 - - private EnvironmentMessageCode() { - } -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AddSharedProjectInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AddSharedProjectInfo.java deleted file mode 100644 index 655cdd2a..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AddSharedProjectInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import cd.casic.pipeline.environment.pojo.enums.SharedEnvType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname AddSharedProjectInfo - * @Description TODO - * @Date 2025/4/8 19:58 - */ -@Getter -@AllArgsConstructor -@Schema(title = "VM虚拟机配额") -public class AddSharedProjectInfo { - @Deprecated - @Schema(title = "工蜂项目ID", required = false) - private final String gitProjectId; - - @Schema(title = "项目名称,工蜂项目则为groupName/projectName", required = true) - private final String name; - - @Schema(title = "类型,预留", required = true) - private final SharedEnvType type; - - @Schema(title = "项目ID", required = true) - private final String projectId; - - @SuppressWarnings("TooGenericExceptionThrown") - public String getFinalProjectId() { - if (projectId != null) { - return projectId; - } - if (gitProjectId != null) { - return gitProjectId; - } - throw new RuntimeException("Project id must not null."); - } -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentPipelineRefInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentPipelineRefInfo.java deleted file mode 100644 index 96c9ef00..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentPipelineRefInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -@Schema(title = "agent流水线引用信息") -public class AgentPipelineRefInfo { - @Schema(title = "agentHashId", required = true) - private final String agentHashId; - @Schema(title = "流水线ID", required = true) - private final String pipelineId; - @Schema(title = "流水线名称", required = true) - private final String pipelineName; - @Schema(title = "Vm Seq ID", required = true) - private final String vmSeqId; - @Schema(title = "Job ID", required = true) - private final String jobId; - @Schema(title = "Job Name", required = true) - private final String jobName; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentPipelineRefRequest.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentPipelineRefRequest.java deleted file mode 100644 index e1239f18..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentPipelineRefRequest.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -import java.util.List; - -@Getter -@AllArgsConstructor -@Schema(title = "agent流水线引用请求") -public class AgentPipelineRefRequest { - @Schema(title = "action", required = true) - private final String action; - - @Schema(title = "pipelineId", required = true) - private final String pipelineId; - - @Schema(title = "PipelineId", required = true) - private final List pipelineRefInfos; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentUpgradeType.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentUpgradeType.java deleted file mode 100644 index f53304bd..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/AgentUpgradeType.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import lombok.Getter; - -@Getter -public enum AgentUpgradeType { - WORKER, - GO_AGENT, - JDK, - DOCKER_INIT_FILE; - - public static AgentUpgradeType find(String type) { - if (type == null) { - return null; - } - switch (type) { - case "WORKER": - return WORKER; - case "GO_AGENT": - return GO_AGENT; - case "JDK": - return JDK; - case "DOCKER_INIT_FILE": - return DOCKER_INIT_FILE; - default: - return null; - } - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/CcNode.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/CcNode.java deleted file mode 100644 index 8999fd2e..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/CcNode.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -@Schema(title = "CC节点信息") -public class CcNode { - @Schema(title = "节点名称", required = true) - private String name; - - @Schema(title = "固资编号", required = true) - private String assetID; - - @Schema(title = "责任人", required = true) - private String operator; - - @Schema(title = "备份责任人", required = true) - private String bakOperator; - - @Schema(title = "节点IP", required = true) - private String ip; - - @Schema(title = "显示IP", required = true) - private String displayIp; - - @Schema(title = "Agent状态", required = true) - private Boolean agentStatus; - - @Schema(title = "操作系统", required = true) - private String osName; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/CmdbNode.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/CmdbNode.java deleted file mode 100644 index 832ee1d1..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/CmdbNode.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -@Schema(title = "CMDB节点信息") -public class CmdbNode { - @Schema(title = "节点名称", required = true) - private final String name; - - @Schema(title = "责任人", required = true) - private final String operator; - - @Schema(title = "备份责任人", required = true) - private final String bakOperator; - - @Schema(title = "节点IP", required = true) - private final String ip; - - @Schema(title = "显示IP", required = true) - private final String displayIp; - - @Schema(title = "操作系统", required = true) - private final String osName; - - @Schema(title = "所属业务") - private final Long bizId; - - @Schema(title = "节点状态") - private String nodeStatus; - - @Schema(title = "是否已导入") - private Boolean importStatus; - - @Schema(title = "主机id") - private final Long serverId; - - public CmdbNode(String name, String operator, String bakOperator, String ip, - String displayIp, String osName, Long bizId, String nodeStatus, - Boolean importStatus, Long serverId) { - this.name = name; - this.operator = operator; - this.bakOperator = bakOperator; - this.ip = ip; - this.displayIp = displayIp; - this.osName = osName; - this.bizId = bizId; - this.nodeStatus = nodeStatus; - this.importStatus = importStatus; - this.serverId = serverId; - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudImageParam.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudImageParam.java deleted file mode 100644 index e8188c16..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudImageParam.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -@Schema(title = "DevCloud制作镜像参数") -public class DevCloudImageParam { - @Schema(title = "镜像名", required = true) - private final String name; - - @Schema(title = "镜像TAG", required = true) - private final String tag; - - @Schema(title = "描述", required = true) - private final String description; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudModel.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudModel.java deleted file mode 100644 index 0d5c5e0d..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudModel.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -import java.util.List; - -@Getter -@Schema(title = "DevCloud容器机型") -public class DevCloudModel { - @Schema(title = "moduleId", required = true) - private String moduleId; - - @Schema(title = "机型名称", required = true) - private String moduleName; - - @Schema(title = "CPU", required = true) - private Integer cpu; - - @Schema(title = "Memory", required = true) - private String memory; - - @Schema(title = "Disk", required = true) - private String disk; - - @Schema(title = "description", required = true) - private List description; - - @Schema(title = "description", required = true) - private String produceTime; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudVmParam.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudVmParam.java deleted file mode 100644 index c81fce98..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DevCloudVmParam.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import cd.casic.ci.common.pipeline.pojo.Zone; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -@Schema(title = "DevCloud虚拟机参数") -public class DevCloudVmParam { - @Schema(title = "镜像Id", required = true) - private String imageId; - - @Schema(title = "机型", required = true) - private String modelId; - - @Schema(title = "数量", required = true) - private Integer instanceCount; - - @Schema(title = "区域", required = true) - private Zone zone; - - @Schema(title = "有效期", required = true) - private Integer validity; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DisplayName.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DisplayName.java deleted file mode 100644 index 97c25b41..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/DisplayName.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -@Schema(title = "显示名称") -public class DisplayName { - @Schema(title = "显示名称", required = true) - private final String displayName; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvCreateInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvCreateInfo.java deleted file mode 100644 index 8e5f6891..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvCreateInfo.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import cd.casic.pipeline.environment.pojo.enums.EnvType; -import cd.casic.pipeline.environment.pojo.enums.NodeSource; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -import java.util.List; - -@Getter -@AllArgsConstructor -@Schema(title = "环境信息") -public class EnvCreateInfo { - @Schema(title = "环境名称", required = true) - private final String name; - - @Schema(title = "环境描述", required = true) - private final String desc; - - @Schema(title = "环境类型(开发环境{DEV}|测试环境{TEST}|构建环境{BUILD})", required = true) - private final EnvType envType; - - @Schema(title = "环境变量", required = false) - private final List envVars; - - @Schema(title = "节点来源(已有节点{EXISTING}|快速生成{CREATE})", required = true) - private final NodeSource source; - - @Schema(title = "节点 HashId 列表", required = false) - private final List nodeHashIds; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvUpdateInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvUpdateInfo.java deleted file mode 100644 index 9668c75d..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvUpdateInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import cd.casic.pipeline.environment.pojo.enums.EnvType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.Getter; - -import java.util.List; - -@Getter -@Data -@Schema(title = "环境基本信息") -public class EnvUpdateInfo { - @Schema(title = "环境名称", required = true) - private final String name; - - @Schema(title = "环境描述", required = true) - private final String desc; - - @Schema(title = "环境类型(构建环境{BUILD}|部署-开发/测试环境{DEV}|部署-生产环境{PROD}|)", required = true) - private final EnvType envType; - - @Schema(title = "环境变量", required = false) - private final List envVars; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvVar.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvVar.java deleted file mode 100644 index bccdd954..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvVar.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -@Schema(title = "环境变量") -@JsonIgnoreProperties(ignoreUnknown = true) -public class EnvVar { - @Schema(title = "变量名", required = true) - private final String name; - - @Schema(title = "变量值", required = true) - private final String value; - - @Schema(title = "是否安全变量", required = true) - private final Boolean secure; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithNode.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithNode.java deleted file mode 100644 index 48670041..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithNode.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -@Schema(title = "环境信息-Node数量") -public class EnvWithNode { - @Schema(title = "环境 Id", required = true) - private Long envId; - - @Schema(title = "环境名称", required = true) - private String envName; - - @Schema(title = "源项目", required = false) - private String sharedProjectId; - - @Schema(title = "分享人", required = false) - private String sharedUserId; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithNodeCount.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithNodeCount.java deleted file mode 100644 index 7800eb7c..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithNodeCount.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -@Data -@AllArgsConstructor -@Schema(title = "环境信息-Node数量") -public class EnvWithNodeCount { - @Schema(title = "环境所属项目Id", required = true) - private final String projectId; - - @Schema(title = "环境 HashId", required = true) - private final String envHashId; - - @Schema(title = "环境名称", required = true) - private final String name; - - @Schema(title = "正常节点数量", required = true) - private final Integer normalNodeCount; - - @Schema(title = "异常节点数量", required = true) - private final Integer abnormalNodeCount; - - @Schema(title = "源项目", required = false) - private final String sharedProjectId; - - @Schema(title = "分享人", required = false) - private final String sharedUserId; - - @Schema(title = "节点hash id", required = false) - private final List nodeHashIds; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithPermission.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithPermission.java deleted file mode 100644 index db7faeb0..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvWithPermission.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -@Data -@AllArgsConstructor -@Schema(title = "环境信息(权限)") -public class EnvWithPermission { - @Schema(title = "环境 HashId", required = true) - private String envHashId; - - @Schema(title = "环境名称", required = true) - private String name; - - @Schema(title = "环境描述", required = true) - private String desc; - - @Schema(title = "环境类型(开发环境{DEV}|测试环境{TEST}|构建环境{BUILD})", required = true) - private String envType; - - @Schema(title = "节点数量", required = false) - private Integer nodeCount; - - @Schema(title = "环境变量", required = true) - private List envVars; - - @Schema(title = "创建人", required = true) - private String createdUser; - - @Schema(title = "创建时间", required = true) - private Long createdTime; - - @Schema(title = "更新人", required = true) - private String updatedUser; - - @Schema(title = "更新时间", required = true) - private Long updatedTime; - - @Schema(title = "是否可以编辑", required = false) - private Boolean canEdit; - - @Schema(title = "是否可以删除", required = false) - private Boolean canDelete; - - @Schema(title = "是否可以使用", required = false) - private Boolean canUse; - - @Schema(title = "项目名称", required = false) - private String projectName; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvironmentId.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvironmentId.java deleted file mode 100644 index 72045d81..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/EnvironmentId.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -@Schema(title = "环境-ID") -public class EnvironmentId { - @Schema(title = "环境哈希ID", required = true) - private final String hashId; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeBaseInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeBaseInfo.java deleted file mode 100644 index 48a03526..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeBaseInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -@Schema(title = "NodeBaseInfo-节点信息(权限)") -public class NodeBaseInfo { - @Schema(title = "环境 HashId", required = true) - private String nodeHashId; - - @Schema(title = "节点 Id", required = true) - private String nodeId; - - @Schema(title = "节点名称", required = true) - private String name; - - @Schema(title = "IP", required = true) - private String ip; - - @Schema(title = "节点状态", required = true) - private String nodeStatus; - - @Schema(title = "agent状态", required = false) - private Boolean agentStatus; - - @Schema(title = "节点类型", required = true) - private String nodeType; - - @Schema(title = "操作系统", required = false) - private String osName; - - @Schema(title = "创建人", required = true) - private String createdUser; - - @Schema(title = "责任人", required = false) - private String operator; - - @Schema(title = "备份责任人", required = false) - private String bakOperator; - - @Schema(title = "网关地域", required = false) - private String gateway; - - @Schema(title = "显示名称", required = false) - private String displayName; - - @Schema(title = "所属业务, 默认-1表示没有绑定业务") - private Long bizId; - - @Schema(title = "当前环境是否启用这个 node") - private Boolean envEnableNode; - - @Schema(title = "最后更新时间") - private Long lastModifyTime; - - @Schema(title = "机型") - private String size; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeDevCloudInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeDevCloudInfo.java deleted file mode 100644 index fa332164..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeDevCloudInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -@Schema(title = "devCloud节点信息") -public class NodeDevCloudInfo { - @Schema(title = "环境 HashId", required = true) - private final String nodeHashId; - - @Schema(title = "节点 Id", required = true) - private final String nodeId; - - @Schema(title = "节点名称", required = true) - private final String name; - - @Schema(title = "IP", required = true) - private final String ip; - - @Schema(title = "节点状态", required = true) - private final String nodeStatus; - - @Schema(title = "agent状态", required = false) - private final Boolean agentStatus; - - @Schema(title = "节点类型", required = true) - private final String nodeType; - - @Schema(title = "操作系统", required = false) - private final String osName; - - @Schema(title = "创建人", required = true) - private final String createdUser; - - @Schema(title = "projectId", required = false) - private final String projectId; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodePage.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodePage.java deleted file mode 100644 index dda77069..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodePage.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -@Data -@AllArgsConstructor -@Schema(title = "节点(分页)") -public class NodePage { - @Schema(title = "节点总数", required = true) - private final Integer total; - - @Schema(title = "节点详情", required = true) - private final List data; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeWithPermission.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeWithPermission.java deleted file mode 100644 index a4359ab4..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/NodeWithPermission.java +++ /dev/null @@ -1,112 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import cd.casic.pipeline.environment.pojo.thirdpartyagent.AgentBuildDetail; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -import java.util.List; - -@Getter -@AllArgsConstructor -@Schema(title = "NodeWithPermission-节点信息(权限)") -public class NodeWithPermission { - @Schema(title = "环境 HashId", required = true) - private final String nodeHashId; - - @Schema(title = "节点 Id", required = true) - private final String nodeId; - - @Schema(title = "节点名称", required = true) - private final String name; - - @Schema(title = "IP", required = true) - private final String ip; - - @Schema(title = "节点状态", required = true) - private final String nodeStatus; - - @Schema(title = "节点类型", required = true) - private final String nodeType; - - @Schema(title = "操作系统", required = false) - private final String osName; - - @Schema(title = "创建人", required = true) - private final String createdUser; - - @Schema(title = "责任人", required = false) - private final String operator; - - @Schema(title = "备份责任人", required = false) - private final String bakOperator; - - @Schema(title = "是否可以使用", required = false) - private final Boolean canUse; - - @Schema(title = "是否可以编辑", required = false) - private final Boolean canEdit; - - @Schema(title = "是否可以删除", required = false) - private final Boolean canDelete; - - @Schema(title = "是否可以查看", required = false) - private final Boolean canView; - - @Schema(title = "网关地域", required = false) - private final String gateway; - - @Schema(title = "显示名称", required = false) - private final String displayName; - - @Schema(title = "创建/导入时间", required = false) - private final String createTime; - - @Schema(title = "最后修改时间", required = false) - private final String lastModifyTime; - - @Schema(title = "最后修改人", required = false) - private final String lastModifyUser; - - @Schema(title = "所属业务, 默认-1表示没有绑定业务") - private final Long bizId; - - @Schema(title = "流水线Job引用数") - private final Integer pipelineRefCount; - - @Schema(title = "流水线Job引用数") - private final String lastBuildTime; - - @Schema(title = "agent状态", required = true) - private final Boolean agentStatus; - - @Schema(title = "agent版本") - private final String agentVersion; - - @Schema(title = "agent hash id") - private final String agentHashId; - - @Schema(title = "云区域ID") - private final Long cloudAreaId; - - @Schema(title = "操作系统类型") - private final String osType; - - @Schema(title = "hostID") - private final Long bkHostId; - - @Schema(title = "job任务ID") - private final Long taskId; - - @Schema(title = "主机serverId") - private final Long serverId; - - @Schema(title = "机型") - private final String size; - - @Schema(title = "该节点所属环境名") - private final List envNames; - - @Schema(title = "最近构建信息") - private AgentBuildDetail latestBuildDetail; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfig.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfig.java deleted file mode 100644 index f7a2573c..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -@Schema(title = "项目配置") -public class ProjectConfig { - @Schema(title = "项目Id", required = true) - private String projectId; - - @Schema(title = "更新人", required = true) - private String updatedUser; - - @Schema(title = "更新时间", required = true) - private Long updatedTime; - - @Schema(title = "允许使用BCS虚拟机功能", required = true) - private Boolean bcsVmEnabled; - - @Schema(title = "BCS虚拟机配额", required = true) - private Integer bcsVmQuota; - - @Schema(title = "导入服务器配额", required = true) - private Integer importQuota; - - @Schema(title = "允许使用DevCloud功能", required = true) - private Boolean devCloudEnable; - - @Schema(title = "DevCloud配额", required = true) - private Integer devCloudQuota; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfigPage.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfigPage.java deleted file mode 100644 index 5a384317..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfigPage.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -@Data -@AllArgsConstructor -@Schema(title = "项目配置(分页)") -public class ProjectConfigPage { - @Schema(title = "projectConfig总数", required = true) - private final Integer total; - - @Schema(title = "projectConfig详情", required = true) - private final List data; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfigParam.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfigParam.java deleted file mode 100644 index cec3e2d2..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectConfigParam.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -@Schema(title = "项目配置") -public class ProjectConfigParam { - @Schema(title = "项目Id", required = true) - private String projectId; - - @Schema(title = "更新人", required = true) - private String updatedUser; - - @Schema(title = "允许使用BCS虚拟机功能", required = true) - private Boolean bcsVmEnabled; - - @Schema(title = "BCS虚拟机配额", required = true) - private Integer bcsVmQuota; - - @Schema(title = "导入服务器配额", required = true) - private Integer importQuota; - - @Schema(title = "允许使用DevCloud功能", required = true) - private Boolean devCloudEnable; - - @Schema(title = "DevCloud配额", required = true) - private Integer devCloudQuota; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectInfo.java deleted file mode 100644 index b6c68e0f..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/ProjectInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -@Schema(title = "VM虚拟机配额") -public class ProjectInfo { - @Schema(title = "允许使用BCS虚拟机功能", required = true) - private final Boolean bcsVmEnabled; - - @Schema(title = "BCS虚拟机配额", required = true) - private final Integer bcsVmQuota; - - @Schema(title = "BCS虚拟机已用数量", required = true) - private final Integer bcsVmUsedCount; - - @Schema(title = "BCS虚拟机可用数量", required = true) - private final Integer bcsVmRestCount; - - @Schema(title = "导入服务器配额", required = true) - private final Integer importQuota; - - @Schema(title = "允许使用DevCloud虚拟机功能", required = true) - private final Boolean devCloudVmEnabled; - - @Schema(title = "DevCloud虚拟机配额", required = true) - private final Integer devCloudVmQuota; - - @Schema(title = "DevCloud虚拟机已用数量", required = true) - private final Integer devCloudVmUsedCount; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/SharedProjectInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/SharedProjectInfo.java deleted file mode 100644 index 3f1b5fed..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/SharedProjectInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import cd.casic.pipeline.environment.pojo.enums.SharedEnvType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -@Schema(title = "VM虚拟机配额") -public class SharedProjectInfo { - @Schema(title = "蓝盾项目Id", required = true) - private String projectId; - - @Schema(title = "工蜂项目ID", required = true) - private String gitProjectId; - - @Schema(title = "项目名称,工蜂项目则为groupName/projectName", required = true) - private String name; - - @Schema(title = "类型,预留", required = true) - private SharedEnvType type; - - @Schema(title = "导入服务器配额", required = true) - private String creator; - - @Schema(title = "允许使用DevCloud虚拟机功能", required = true) - private Long createTime; - - @Schema(title = "DevCloud虚拟机配额", required = true) - private Long updateTime; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/SharedProjectInfoWrap.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/SharedProjectInfoWrap.java deleted file mode 100644 index da0b1c43..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/SharedProjectInfoWrap.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -@Data -@AllArgsConstructor -@Schema(title = "共享的项目列表") -public class SharedProjectInfoWrap { - @Parameter(description = "共享的项目列表", required = true) - private final List sharedProjects; - -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/TEnvShareProjectInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/TEnvShareProjectInfo.java deleted file mode 100644 index 1ef32da4..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/TEnvShareProjectInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.pipeline.environment.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; - -@Data -@Schema(title = "T_ENV_SHARE_PROJECT POJO") -public class TEnvShareProjectInfo { - @Schema(title = "环境ID") - private Long envId; - - @Schema(title = "名称") - private String envName; - - @Schema(title = "主项目ID") - private String mainProjectId; - - @Schema(title = "共享的目标项目ID") - private String sharedProjectId; - - @Schema(title = "目标项目名称") - private String sharedProjectName; - - @Schema(title = "类型") - private String type; - - @Schema(title = "创建者") - private String creator; - - private LocalDateTime createTime; - - private LocalDateTime updateTime; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/EnvType.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/EnvType.java deleted file mode 100644 index b282c20e..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/EnvType.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.pipeline.environment.pojo.enums; - -import lombok.Getter; - -/** - * @author by mianbin - * @Classname EnvType - * @Description TODO - * @Date 2025/4/8 19:59 - */ -@Getter -public enum EnvType { - DEV, - TEST, - PROD, - BUILD -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeSource.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeSource.java deleted file mode 100644 index 48a2e5ab..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeSource.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.pipeline.environment.pojo.enums; - -import lombok.Getter; - -/** - * @author by mianbin - * @Classname NodeSource - * @Description TODO - * @Date 2025/4/8 20:00 - */ -@Getter -public enum NodeSource { - EXISTING, - CREATE, - CMDB -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeStatus.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeStatus.java deleted file mode 100644 index 44a63272..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeStatus.java +++ /dev/null @@ -1,67 +0,0 @@ -package cd.casic.pipeline.environment.pojo.enums; - -import lombok.Getter; - -import java.text.MessageFormat; -import java.util.Locale; - -/** - * @author by mianbin - * @Classname NodeStatus - * @Description TODO - * @Date 2025/4/8 20:00 - */ -@Getter -public enum NodeStatus { - NORMAL("normal"), // 正常 - ABNORMAL("abnormal"), // 异常(节点类型:构建 - 蓝盾agent异常,部署 - GSE agent异常) - NOT_INSTALLED("notInstall"), // 未安装agent - DELETED("deleted"), // 已删除 - LOST("lost"), // 失联 - CREATING("creating"), // 正在创建中 - RUNNING("running"), // 安装Agent - STARTING("starting"), // 正在开机中 - STOPPING("stopping"), // 正在关机中 - STOPPED("stopped"), // 已关机 - RESTARTING("restarting"), // 正在重启中 - DELETING("deleting"), // 正在销毁中 - BUILDING_IMAGE("buildingImage"), // 正在制作镜像中 - BUILD_IMAGE_SUCCESS("buildImageSuccess"), // 制作镜像成功 - BUILD_IMAGE_FAILED("buildImageFailed"), // 制作镜像失败 - NOT_IN_CC("notInCC"), // CC中不存在(仅部署类型节点) - NOT_IN_CMDB("notInCmdb"), // CMDB中不存在(仅部署类型节点) - UNKNOWN("unknown"); // 未知 - - private final String statusName; - - NodeStatus(String statusName) { - this.statusName = statusName; - } - - public static String getStatusName(String status) { - for (NodeStatus nodeStatus : values()) { - if (nodeStatus.name().equals(status.toUpperCase(Locale.getDefault()))) { - return MessageFormat.format("envNodeStatus.{0}", nodeStatus.name()); - } - } - return MessageFormat.format("envNodeStatus.{0}", UNKNOWN.name()); - } - - public static NodeStatus parseByName(String name) { - for (NodeStatus nodeStatus : values()) { - if (nodeStatus.name().equals(name)) { - return nodeStatus; - } - } - return UNKNOWN; - } - - public static NodeStatus parseByStatusName(String statusName) { - for (NodeStatus nodeStatus : values()) { - if (nodeStatus.getStatusName().equals(statusName)) { - return nodeStatus; - } - } - return UNKNOWN; - } -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeType.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeType.java deleted file mode 100644 index 4142569d..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/NodeType.java +++ /dev/null @@ -1,47 +0,0 @@ -package cd.casic.pipeline.environment.pojo.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -import java.util.Arrays; -import java.util.List; - -/** - * @author by mianbin - * @Classname NodeType - * @Description TODO - * @Date 2025/4/8 20:03 - */ -@Getter -@AllArgsConstructor -public enum NodeType { - CMDB("CMDB"), - DEVCLOUD("DevCloud虚拟机"), - THIRDPARTY("第三方构建机"), - OTHER("其他"), - UNKNOWN("未知"); - - private final String typeName; - - public static List coreTypesName() { - return Arrays.asList(CMDB.name(), DEVCLOUD.name(), THIRDPARTY.name(), OTHER.name(), UNKNOWN.name()); - } - - public static String getTypeName(String nodeType) { - for (NodeType type : values()) { - if (type.name().equals(nodeType)) { - return type.getTypeName(); - } - } - return UNKNOWN.getTypeName(); - } - - public static NodeType parseByTypeName(String typeName) { - for (NodeType type : values()) { - if (type.getTypeName().equals(typeName)) { - return type; - } - } - return UNKNOWN; - } -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/OsType.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/OsType.java deleted file mode 100644 index 0546382f..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/OsType.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.pipeline.environment.pojo.enums; - -import lombok.Getter; - -/** - * @author by mianbin - * @Classname OsType - * @Description TODO - * @Date 2025/4/8 20:04 - */ -@Getter -public enum OsType { // CC中能查到的所有os类型+OTHER - LINUX, - WINDOWS, - AIX, - SOLARIS, - UNIX, - FREEBSD, - OTHER -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/SharedEnvType.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/SharedEnvType.java deleted file mode 100644 index 82345666..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/enums/SharedEnvType.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.pipeline.environment.pojo.enums; - -/** - * @author by mianbin - * @Classname SharedEnvType - * @Description TODO - * @Date 2025/4/8 20:16 - */ -public enum SharedEnvType { - PROJECT, - GROUP -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentBuildDetail.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentBuildDetail.java deleted file mode 100644 index 029f5c16..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentBuildDetail.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Date; -/** - * @author by mianbin - * @Classname AgentBuildDetail - * @Description TODO - * @Date 2025/4/8 21:13 - */ - -@Data -public class AgentBuildDetail { - @Schema(title = "节点 Hash ID", required = true) - private String nodeId; - @Schema(title = "Agent Hash ID", required = true) - private String agentId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "构建号", required = true) - private int buildNumber; - @Schema(title = "VM_SET_ID", required = true) - private String vmSetId; - @Schema(title = "构建任务名称", required = true) - private String taskName; - @Schema(title = "状态", required = true) - private String status; - @Schema(title = "创建时间", required = true) - private Date createdTime; - @Schema(title = "更新时间", required = true) - private Date updatedTime; - @Schema(title = "工作空间", required = true) - private String workspace; - @Schema(title = "agent任务", required = false) - private AgentTask agentTask; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentPipelineRef.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentPipelineRef.java deleted file mode 100644 index d0321114..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentPipelineRef.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname AgentPipelineRef - * @Description TODO - * @Date 2025/4/8 21:13 - */ -@Data -public class AgentPipelineRef { - @Schema(title = "Node ID", required = true) - private Long nodeId; - @Schema(title = "Node Hash ID", required = true) - private String nodeHashId; - @Schema(title = "Agent ID", required = true) - private Long agentId; - @Schema(title = "Agent Hash ID", required = true) - private String agentHashId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "Vm Seq ID", required = true) - private String vmSeqId; - @Schema(title = "Job ID", required = true) - private String jobId; - @Schema(title = "Job Name", required = true) - private String jobName; - @Schema(title = "上次构建时间", required = false) - private String lastBuildTime; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentShared.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentShared.java deleted file mode 100644 index 6946be8a..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentShared.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname AgentShared - * @Description TODO - * @Date 2025/4/8 21:13 - */ -@Data -public class AgentShared { - private Long agentId; - private String mainProjectId; - private List sharedProjectId; - private String userId; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentTask.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentTask.java deleted file mode 100644 index cba03165..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AgentTask.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname AgentTask - * @Description TODO - * @Date 2025/4/8 21:14 - */ -@Data -public class AgentTask { - @Schema(title = "Task状态", required = true) - private String status; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AskHeartbeatResponse.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AskHeartbeatResponse.java deleted file mode 100644 index d5aeb8cf..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/AskHeartbeatResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname AskHeartbeatResponse - * @Description TODO - * @Date 2025/4/8 21:14 - */ -@Data -public class AskHeartbeatResponse { - @Schema(title = "主版本") - private String masterVersion; - @Schema(title = "从属版本") - private String slaveVersion; - @Schema(title = "构建机状态") - private String agentStatus; - @Schema(title = "通道数量") - private int parallelTaskCount; - @Schema(title = "环境变量") - private Map envs; - @Schema(title = "网关地址") - private String gateway; - @Schema(title = "文件网关路径") - private String fileGateway; - @Schema(title = "Agent的一些属性配置") - private Map props; - @Schema(title = "docker最大任务数量") - private int dockerParallelTaskCount; - @Schema(title = "用户国际化语言") - private String language; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/BatchFetchAgentData.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/BatchFetchAgentData.java deleted file mode 100644 index ce5d49e4..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/BatchFetchAgentData.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Set; - -/** - * @author by mianbin - * @Classname BatchFetchAgentData - * @Description TODO - * @Date 2025/4/8 21:14 - */ -@Data -public class BatchFetchAgentData { - @Schema(title = "Node Hash ID列表,和 agentHashId 选其一即可", required = false) - private Set nodeHashIds; - @Schema(title = "agent Hash ID列表,和 nodeHashId 选其一即可", required = false) - private Set agentHashIds; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/EnvNodeAgent.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/EnvNodeAgent.java deleted file mode 100644 index 6525c9cc..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/EnvNodeAgent.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import lombok.Data; - -/** - * @author by mianbin - * @Classname EnvNodeAgent - * @Description TODO - * @Date 2025/4/8 21:14 - */ -@Data -public class EnvNodeAgent { - private ThirdPartyAgent agent; - private boolean enableNode; - private String nodeDisplayName; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/HeartbeatInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/HeartbeatInfo.java deleted file mode 100644 index 8fdbd79c..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/HeartbeatInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import cd.casic.ci.common.pipeline.pojo.agent.ThirdPartyBuildInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname HeartbeatInfo - * @Description TODO - * @Date 2025/4/8 21:15 - */ -@Data -@AllArgsConstructor -public class HeartbeatInfo { - @Schema(title = "主版本") - private String masterVersion; - @Schema(title = "从属版本") - private String slaveVersion; - @Schema(title = "主机名") - private String hostName; - @Schema(title = "Agent IP") - private String agentIp; - @Schema(title = "通道数量") - private int parallelTaskCount; - @Schema(title = "Agent安装路径") - private String agentInstallPath; - @Schema(title = "启动用户") - private String startedUser; - @Schema(title = "任务列表") - private List taskList; - @Schema(title = "Agent ID") - private Long agentId; - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "心跳时间") - private Long heartbeatTime; - public static HeartbeatInfo dummyHeartbeat(String projectId, Long agentId) { - return new HeartbeatInfo( - "", - "", - "", - "", - 0, - "", - "", - List.of(), - agentId, - projectId, - System.currentTimeMillis() - ); - } -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/HeartbeatResponse.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/HeartbeatResponse.java deleted file mode 100644 index 36717c50..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/HeartbeatResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname HeartbeatResponse - * @Description TODO - * @Date 2025/4/8 21:15 - */ -@Data -public class HeartbeatResponse { - @Schema(title = "主版本") - private String masterVersion; - @Schema(title = "从属版本") - private String slaveVersion; - @Schema(title = "构建机状态") - private String agentStatus; - @Schema(title = "通道数量") - private int parallelTaskCount; - @Schema(title = "环境变量") - private Map envs; - @Schema(title = "网关地址") - private String gateway; - @Schema(title = "文件网关路径") - private String fileGateway; - @Schema(title = "Agent的一些属性配置") - private Map props; - @Schema(title = "docker最大任务数量") - private int dockerParallelTaskCount; - @Schema(title = "用户国际化语言") - private String language; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/JDKInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/JDKInfo.java deleted file mode 100644 index 88b3bb5d..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/JDKInfo.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname JDKInfo - * @Description TODO - * @Date 2025/4/8 21:16 - */ -@Data -public class JDKInfo { - @Schema(title = "操作系统类型,MACOS/LINUX/WINDOWS") - private String os; - @Schema(title = "CPU架构,AMD64/ARM64/MIPS64") - private String archType; - @Schema(title = "java -version 版本信息最后一行") - private String jdkVersionString; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartAgentUpdateType.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartAgentUpdateType.java deleted file mode 100644 index 50db9182..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartAgentUpdateType.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -/** - * @author by mianbin - * @Classname ThirdPartAgentUpdateType - * @Description TODO - * @Date 2025/4/8 21:16 - */ -public enum ThirdPartAgentUpdateType { - ADD, - REMOVE, - UPDATE -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgent.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgent.java deleted file mode 100644 index f9cbe694..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgent.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import cd.casic.ci.common.pipeline.enums.AgentStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgent - * @Description TODO - * @Date 2025/4/8 21:16 - */ -@Data -public class ThirdPartyAgent { - @Schema(title = "Agent Hash ID", required = true) - private String agentId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "节点ID", required = false) - private String nodeId; - @Schema(title = "状态") - private AgentStatus status; - @Schema(title = "主机名", required = true) - private String hostname; - @Schema(title = "系统", required = true) - private String os; - @Schema(title = "IP地址", required = true) - private String ip; - @Schema(title = "Secret KEY", required = true) - private String secretKey; - @Schema(title = "创建用户", required = true) - private String createUser; - @Schema(title = "创建时间", required = true) - private Long createTime; - @Schema(title = "并行执行的个数", required = false) - private Integer parallelTaskCount; - @Schema(title = "Docker构建机并行执行的个数", required = false) - private Integer dockerParallelTaskCount; - @Schema(title = "agent版本") - private String masterVersion; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentAction.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentAction.java deleted file mode 100644 index e91f56b9..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentAction.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentAction - * @Description TODO - * @Date 2025/4/8 21:19 - */ -@Data -public class ThirdPartyAgentAction { - @Schema(title = "Agent Hash Id", required = true) - private String agentId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "活动", required = true) - private String action; - @Schema(title = "活动时间", required = true) - private Long actionTime; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentCreate.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentCreate.java deleted file mode 100644 index 98be140a..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentCreate.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentCreate - * @Description TODO - * @Date 2025/4/8 21:19 - */ -@Data -public class ThirdPartyAgentCreate { - @Schema(title = "名称", required = true) - private String name; - @Schema(title = "IP地址", required = true) - private String ip; - @Schema(title = "工作空间", required = true) - private String workspace; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentDetail.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentDetail.java deleted file mode 100644 index ffef2f35..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentDetail.java +++ /dev/null @@ -1,73 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import cd.casic.ci.common.pipeline.pojo.agent.NewHeartbeatInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentDetail - * @Description TODO - * @Date 2025/4/8 21:19 - */ -@Data -public class ThirdPartyAgentDetail { - @Schema(title = "Agent Hash ID", required = true) - private String agentId; - @Schema(title = "Node Hash ID", required = true) - private String nodeId; - @Schema(title = "节点名称", required = true) - private String displayName; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "状态", required = true) - private String status; - @Schema(title = "主机名", required = true) - private String hostname; - @Schema(title = "操作系统 | LINUX MACOS WINDOWS", required = true) - private String os; - @Schema(title = "操作系统", required = true) - private String osName; - @Schema(title = "IP地址", required = true) - private String ip; - @Schema(title = "导入人", required = true) - private String createdUser; - @Schema(title = "导入时间", required = true) - private String createdTime; - @Schema(title = "Agent版本", required = true) - private String agentVersion; - @Schema(title = "Worker版本", required = true) - private String slaveVersion; - @Schema(title = "agent安装路径", required = true) - private String agentInstallPath; - @Schema(title = "已废弃,使用 parallelTaskCount", required = true) - private String maxParallelTaskCount; - @Schema(title = "最大构建并发数", required = true) - private String parallelTaskCount; - @Schema(title = "docker构建机通道数量", required = true) - private String dockerParallelTaskCount; - @Schema(title = "启动用户", required = true) - private String startedUser; - @Schema(title = "agent链接", required = true) - private String agentUrl; - @Schema(title = "agent安装脚本", required = true) - private String agentScript; - @Schema(title = "最新心跳时间", required = true) - private String lastHeartbeatTime; - @Schema(title = "CPU 核数", required = true) - private String ncpus; - @Schema(title = "内存", required = true) - private String memTotal; - @Schema(title = "硬盘空间(最大盘)", required = true) - private String diskTotal; - @Schema(title = "是否可以编辑", required = false) - private Boolean canEdit; - @Schema(title = "当前Agent版本", required = false) - private String currentAgentVersion; - @Schema(title = "当前Worker版本", required = false) - private String currentWorkerVersion; - @Schema(title = "心跳信息", required = false) - private NewHeartbeatInfo heartbeatInfo; - @Schema(title = "错误退出信息", required = false) - private String exitErrorMsg; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentHeartbeatInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentHeartbeatInfo.java deleted file mode 100644 index d777a737..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentHeartbeatInfo.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentHeartbeatInfo - * @Description TODO - * @Date 2025/4/8 21:19 - */ -@Data -public class ThirdPartyAgentHeartbeatInfo { - private String masterVersion; - private String slaveVersion; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentInfo.java deleted file mode 100644 index 3323bd8a..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentInfo - * @Description TODO - * @Date 2025/4/8 21:20 - */ -@Data -public class ThirdPartyAgentInfo { - @Schema(title = "Agent Hash ID", required = true) - private String agentId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "状态") - private String status; - @Schema(title = "主机名", required = true) - private String hostname; - @Schema(title = "IP地址", required = true) - private String ip; - @Schema(title = "节点名", required = true) - private String displayName; - @Schema(title = "详细名称", required = false) - private String detailName; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentLink.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentLink.java deleted file mode 100644 index ca61b1b9..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentLink.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentLink - * @Description TODO - * @Date 2025/4/8 21:20 - */ -@Data -public class ThirdPartyAgentLink { - @Schema(title = "ID") - private String agentId; - @Schema(title = "链接") - private String link; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentPipeline.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentPipeline.java deleted file mode 100644 index d46db037..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentPipeline.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline.CommandPipeline; -import cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline.FilePipeline; -import cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline.PipelineType; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentPipeline - * @Description TODO - * @Date 2025/4/8 21:20 - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = CommandPipeline.class, name = "COMMAND"), - @JsonSubTypes.Type(value = FilePipeline.class, name = "FILE") -}) -@Data -@AllArgsConstructor -public class ThirdPartyAgentPipeline { - private PipelineType type; - private String seqId; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentStartInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentStartInfo.java deleted file mode 100644 index 31ea609f..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentStartInfo.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentStartInfo - * @Description TODO - * @Date 2025/4/8 21:20 - */ -@Data -public class ThirdPartyAgentStartInfo { - @Schema(title = "主机名称") - private String hostname; - @Schema(title = "主机IP") - private String hostIp; - @Schema(title = "操作系统") - private String detectOS; - @Schema(title = "版本号") - private String version; - @Schema(title = "主版本号") - private String masterVersion; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentStaticInfo.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentStaticInfo.java deleted file mode 100644 index 01930057..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/ThirdPartyAgentStaticInfo.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ThirdPartyAgentStaticInfo - * @Description TODO - * @Date 2025/4/8 21:20 - */ -@Data -public class ThirdPartyAgentStaticInfo { - @Schema(title = "Agent Hash ID", required = true) - private String agentId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "操作系统", required = true) - private String os; - @Schema(title = "密钥", required = true) - private String secretKey; - @Schema(title = "创建人", required = true) - private String createdUser; - @Schema(title = "gateway", required = false) - private String gateway; - @Schema(title = "link", required = true) - private String link; - @Schema(title = "script", required = true) - private String script; - @Schema(title = "ip", required = true) - private String ip; - @Schema(title = "hostName", required = false) - private String hostName; - @Schema(title = "状态") - private Integer status; - @Schema(title = "agent版本") - private String masterVersion; -} diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/CommandPipeline.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/CommandPipeline.java deleted file mode 100644 index c03c3099..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/CommandPipeline.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import cd.casic.pipeline.environment.pojo.thirdpartyagent.ThirdPartyAgentPipeline; -import lombok.Getter; - -@Getter -public class CommandPipeline extends ThirdPartyAgentPipeline { - private final String command; - - public CommandPipeline(String command, String seqId) { - super(PipelineType.COMMAND, seqId); - this.command = command; - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/CommandPipelineCreate.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/CommandPipelineCreate.java deleted file mode 100644 index 14b99ebb..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/CommandPipelineCreate.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -public class CommandPipelineCreate extends PipelineCreate { - private String command; - private String seqId; - - public CommandPipelineCreate(String command) { - super(PipelineType.COMMAND, null); - this.command = command; - } - - //TODO - public CommandPipelineCreate() { - super(null, null); - this.command = command; - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/FilePipeline.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/FilePipeline.java deleted file mode 100644 index b1c477b3..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/FilePipeline.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import cd.casic.pipeline.environment.pojo.thirdpartyagent.ThirdPartyAgentPipeline; -import lombok.Getter; - -@Getter -public class FilePipeline extends ThirdPartyAgentPipeline { - private final FilePipelineOperation operation; - private final String file; - - public FilePipeline(FilePipelineOperation operation, String file, String seqId) { - super(PipelineType.FILE, seqId); - this.operation = operation; - this.file = file; - } - - public enum FilePipelineOperation { - DOWNLOAD, - UPLOAD - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/FilePipelineCreate.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/FilePipelineCreate.java deleted file mode 100644 index d249d7c5..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/FilePipelineCreate.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -public class FilePipelineCreate extends PipelineCreate { - private final FilePipeline.FilePipelineOperation operation; - private final String file; - - public FilePipelineCreate( - @JsonProperty("operation") FilePipeline.FilePipelineOperation operation, - @JsonProperty("file") String file, - @JsonProperty("seqId") String seqId) { - super(PipelineType.FILE, seqId); - this.operation = operation; - this.file = file; - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineCreate.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineCreate.java deleted file mode 100644 index 2074480d..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineCreate.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@NoArgsConstructor -public abstract class PipelineCreate { - private PipelineType type; - private String seqId; - - public PipelineCreate( - @JsonProperty("type") PipelineType type, - @JsonProperty("seqId") String seqId - ) { - this.type = type; - this.seqId = seqId; - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineResponse.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineResponse.java deleted file mode 100644 index fc2cd16b..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -public class PipelineResponse { - private final PipelineStatus status; - private final String message; - private final String seqId; - - public PipelineResponse( - @JsonProperty("status") PipelineStatus status, - @JsonProperty("message") String message, - @JsonProperty("seqId") String seqId - ) { - this.status = status; - this.message = message; - this.seqId = seqId; - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineSeqId.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineSeqId.java deleted file mode 100644 index a0141dc3..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineSeqId.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class PipelineSeqId { - private String seqId; -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineStatus.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineStatus.java deleted file mode 100644 index d320b5f0..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineStatus.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import lombok.Getter; - -@Getter -public enum PipelineStatus { - PENDING(1), - EXECUTING(2), - TIMEOUT(3), - FAILURE(4), - SUCCESS(5); - - private final int status; - - PipelineStatus(int status) { - this.status = status; - } - - public static PipelineStatus from(int status) { - for (PipelineStatus pipelineStatus : values()) { - if (pipelineStatus.getStatus() == status) { - return pipelineStatus; - } - } - throw new RuntimeException("The pipeline status " + status + " is not exist"); - } -} \ No newline at end of file diff --git a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineType.java b/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineType.java deleted file mode 100644 index d131a31e..00000000 --- a/modules/module-ci-environment/src/main/java/cd/casic/pipeline/environment/pojo/thirdpartyagent/pipeline/PipelineType.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.pipeline.environment.pojo.thirdpartyagent.pipeline; - -import lombok.Getter; - -@Getter -public enum PipelineType { - COMMAND, - FILE -} \ No newline at end of file diff --git a/modules/module-ci-event/pom.xml b/modules/module-ci-event/pom.xml deleted file mode 100644 index 6b0cbd18..00000000 --- a/modules/module-ci-event/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-event - - ${revision} - jar - - - - cd.casic.boot - module-ci-common-pipeline - - - cd.casic.boot - spring-boot-starter-mq - - - - \ No newline at end of file diff --git a/modules/module-ci-event/src/main/java/cd/casic/ci/event/dispatcher/EventDispatcher.java b/modules/module-ci-event/src/main/java/cd/casic/ci/event/dispatcher/EventDispatcher.java deleted file mode 100644 index c6835ab2..00000000 --- a/modules/module-ci-event/src/main/java/cd/casic/ci/event/dispatcher/EventDispatcher.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.event.dispatcher; - -import cd.casic.ci.event.pojo.IEvent; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.event.dispatcher - * @Project:ops-pro - * @name:EventDispatcher - * @Date:2025/03/25 9:56 - * @Filename:EventDispatcher - * @description:事件下发接口 - */ -public interface EventDispatcher { -} diff --git a/modules/module-ci-event/src/main/java/cd/casic/ci/event/dispatcher/SampleEventDispatcher.java b/modules/module-ci-event/src/main/java/cd/casic/ci/event/dispatcher/SampleEventDispatcher.java deleted file mode 100644 index 30dcfea0..00000000 --- a/modules/module-ci-event/src/main/java/cd/casic/ci/event/dispatcher/SampleEventDispatcher.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.event.dispatcher; - -import cd.casic.ci.event.pojo.IEvent; -import lombok.extern.slf4j.Slf4j; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.event.dispatcher - * @Project:ops-pro - * @name:SampleEventDispatcher - * @Date:2025/03/25 9:57 - * @Filename:SampleEventDispatcher - * @description:Todo - */ -@Slf4j -public class SampleEventDispatcher implements EventDispatcher { - public void dispatch(IEvent... events) { - for (IEvent event : events) { - log.info("EventDispatcher: " + event); - } - } -} diff --git a/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/ActionType.java b/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/ActionType.java deleted file mode 100644 index f8d25cd3..00000000 --- a/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/ActionType.java +++ /dev/null @@ -1,67 +0,0 @@ -package cd.casic.ci.event.enums; - -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.event.enums - * @Project:ops-pro - * @name:ActionType - * @Date:2025/03/25 9:51 - * @Filename:ActionType - * @description:Todo - */ -@Getter -public enum ActionType { - RETRY, // 重试 - START, // 开始 - REFRESH, // 刷新ElementAdditionalOptions - END, // 强制结束当前节点,会导致当前构建容器结束 - SKIP, // 跳过-不执行 - TERMINATE, // 终止 - ARCHIVE; // 归档 - - public boolean isStartOrRefresh() { - return isStart() || this == REFRESH; - } - - public boolean isStart() { - return START == this || RETRY == this; - } - - public boolean isEnd() { - return END == this || isTerminate(); - } - - public boolean isTerminate() { - return TERMINATE == this; - } - - public boolean isRetry() { - return RETRY == this; - } - - /** - * @deprecated replace by isStart - */ - @Deprecated - public static boolean isStart(ActionType actionType) { - return actionType.isStart(); - } - - /** - * @deprecated replace by isEnd - */ - @Deprecated - public static boolean isEnd(ActionType actionType) { - return actionType.isEnd(); - } - - /** - * @deprecated replace by isTerminate - */ - @Deprecated - public static boolean isTerminate(ActionType actionType) { - return actionType.isTerminate(); - } -} diff --git a/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/PipelineBuildStatusBroadCastEventType.java b/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/PipelineBuildStatusBroadCastEventType.java deleted file mode 100644 index 24c01fb7..00000000 --- a/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/PipelineBuildStatusBroadCastEventType.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.event.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.event.enums - * @Project:ops-pro - * @name:PipelineBuildStatusBroadCastEventType - * @Date:2025/03/25 9:53 - * @Filename:PipelineBuildStatusBroadCastEventType - * @description:Todo - */ -public enum PipelineBuildStatusBroadCastEventType { - BUILD_QUEUE, // 构建排队,包含并发超限时排队、并发组排队。 - BUILD_START, // 构建开始,不包含并发超限时排队、并发组排队。 - BUILD_END, // 构建结束 - BUILD_STAGE_START, // stage开始 - BUILD_STAGE_END, // stage结束 - BUILD_JOB_QUEUE, // job排队,包含互斥组排队、构建机复用互斥排队、最大job并发排队。 - BUILD_JOB_START, // job开始,不包含BUILD_JOB_QUEUE。如果job SKIP或没有可执行的插件,就不会有该事件。 - BUILD_JOB_END, // job结束,job SKIP或没有可执行的插件时会有该事件。 - BUILD_AGENT_START, // 构建机启动,现在仅包含第三方构建机 - BUILD_TASK_START, // 插件开始 - BUILD_TASK_END, // 插件结束 - BUILD_TASK_PAUSE; // 插件前置暂停 -} diff --git a/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/PipelineLabelChangeTypeEnum.java b/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/PipelineLabelChangeTypeEnum.java deleted file mode 100644 index a35a20cc..00000000 --- a/modules/module-ci-event/src/main/java/cd/casic/ci/event/enums/PipelineLabelChangeTypeEnum.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.event.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.event.enums - * @Project:ops-pro - * @name:PipelineLabelChangeTypeEnum - * @Date:2025/03/25 9:55 - * @Filename:PipelineLabelChangeTypeEnum - * @description:Todo - */ -public enum PipelineLabelChangeTypeEnum { - CREATE, - DELETE, - UPDATE -} diff --git a/modules/module-ci-event/src/main/java/cd/casic/ci/event/pojo/IEvent.java b/modules/module-ci-event/src/main/java/cd/casic/ci/event/pojo/IEvent.java deleted file mode 100644 index ceffcaa0..00000000 --- a/modules/module-ci-event/src/main/java/cd/casic/ci/event/pojo/IEvent.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.event.pojo; - -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessage; -import com.mysql.cj.MessageBuilder; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.event.pojo - * @Project:ops-pro - * @name:IEvent - * @Date:2025/03/25 9:46 - * @Filename:IEvent - * @description:Todo - */ -@Data -@Slf4j -@NoArgsConstructor -@AllArgsConstructor -public class IEvent extends AbstractRedisStreamMessage { - - private int delayMills = 0; - private int retryTime = 1; - - public void sendTo(Object bridge, String destination) { - try { - log.info(bridge.toString() + destination); - } catch (Exception ignored) { - log.error("[STREAM MQ] Fail to dispatch the event(" + this + ")", ignored); - } - } -} diff --git a/modules/module-ci-event/src/main/java/cd/casic/ci/event/pojo/pipeline/IPipelineEvent.java b/modules/module-ci-event/src/main/java/cd/casic/ci/event/pojo/pipeline/IPipelineEvent.java deleted file mode 100644 index 1467d527..00000000 --- a/modules/module-ci-event/src/main/java/cd/casic/ci/event/pojo/pipeline/IPipelineEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.event.pojo.pipeline; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.IEvent; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import org.slf4j.MDC; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.event.pojo.pipeline - * @Project:ops-pro - * @name:IPipelineEvent - * @Date:2025/03/25 9:50 - * @Filename:IPipelineEvent - * @description:Todo - */ -@EqualsAndHashCode(callSuper = true) -@Data -@NoArgsConstructor -@AllArgsConstructor -public abstract class IPipelineEvent extends IEvent { - private ActionType actionType; - private String source; - private String projectId; - private String pipelineId; - private String userId; - private String traceId = MDC.get("bizid"); - private String routeKeySuffix; - - public IPipelineEvent( ActionType actionType, String source, String projectId, String pipelineId, String userId,int delayMills) { - super(delayMills, 1); - this.actionType = actionType; - this.source = source; - this.projectId = projectId; - this.pipelineId = pipelineId; - this.userId = userId; - } -} diff --git a/modules/module-ci-log/pom.xml b/modules/module-ci-log/pom.xml deleted file mode 100644 index 6c502468..00000000 --- a/modules/module-ci-log/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-log - - ${revision} - - - - cd.casic.boot - module-ci-common-pipeline - - - - cd.casic.boot - spring-boot-starter-redis - - - - cd.casic.boot - spring-boot-starter-mybatis - - - - cd.casic.boot - spring-boot-starter-web - - - - cd.casic.boot - spring-boot-starter-monitor - - - - \ No newline at end of file diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/AppLogResource.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/AppLogResource.java deleted file mode 100644 index 722b15ef..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/AppLogResource.java +++ /dev/null @@ -1,277 +0,0 @@ -package cd.casic.ci.log.api; - - -import cd.casic.ci.log.dal.pojo.EndPageQueryLogs; -import cd.casic.ci.log.dal.pojo.PageQueryLogs; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*;; - -@Tag(name = "用户-日志资源") -@RestController -@RequestMapping("/app/logs") -public interface AppLogResource { - - @Operation(summary = "根据构建ID获取初始化所有日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/") - CommonResult getInitLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "对应elementId", required = false) - @RequestParam(value = "tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam(value = "jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam(value = "executeCount") - int executeCount, - @Parameter(description = "第几页", required = false) - @RequestParam("page") - int page, - @Parameter(description = "每页条数", required = false) - @RequestParam("pageSize") - int pageSize - ); - - @Operation(summary = "获取更多日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/more") - CommonResult getMoreLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "日志行数", required = false) - @RequestParam(value = "num", defaultValue = "100") - int num, - @Parameter(description = "是否正序输出", required = false) - @RequestParam(value = "fromStart", defaultValue = "true") - boolean fromStart, - @Parameter(description = "起始行号", required = true) - @RequestParam(value = "start") - long start, - @Parameter(description = "结尾行号", required = true) - @RequestParam(value = "end") - long end, - @Parameter(description = "对应elementId", required = false) - @RequestParam(value = "tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam(value = "jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam(value = "executeCount") - int executeCount - ); - - @Operation(summary = "获取某行后的日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/after") - CommonResult getAfterLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "起始行号", required = true) - @RequestParam("start") - long start, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "对应elementId", required = false) - @RequestParam("tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); - - @Operation(summary = "获取某行前指定行数的日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/before") - CommonResult getBeforeLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "结束行号", required = true) - @RequestParam("end") - long end, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "返回日志条数", required = false) - @RequestParam("size") - int size, - @Parameter(description = "对应elementId", required = false) - @RequestParam("tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); - - @Operation(summary = "根据构建ID获取初始化最后日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/end") - CommonResult getEndLogsPage( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(value = AUTH_HEADER_USER_ID, defaultValue = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "返回日志条数", required = true) - @RequestParam("size") - int size, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "对应elementId", required = false) - @RequestParam("tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); - - @Operation(summary = "根据构建ID获取初始化底部指定行数的日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/bottom") - CommonResult getBottomLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(value = AUTH_HEADER_USER_ID, defaultValue = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "返回日志条数", required = false) - @RequestParam("size") - int size, - @Parameter(description = "对应elementId", required = false) - @RequestParam("tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); - - @Operation(summary = "测试接口") - @GetMapping("test") - CommonResult test( - @Parameter(description = "构建的buildId", required = true, example = "1") - @RequestParam("buildId") - String buildId, - @Parameter(description = "标签名称", required = true, example = "java") - @RequestParam("tagName") - String tagName, - @Parameter(description = "要添加子标签", required = true, example = "spring") - @RequestParam("subTag") - String subTag - ); -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/BuildLogPrintResource.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/BuildLogPrintResource.java deleted file mode 100644 index 08df5321..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/BuildLogPrintResource.java +++ /dev/null @@ -1,127 +0,0 @@ -package cd.casic.ci.log.api; - -import cd.casic.ci.log.dal.pojo.TaskBuildLogProperty; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.dal.pojo.message.LogMessage; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; - -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*;; - -/** - * @author by mianbin - * @Classname BuildLogPrintResource - * @Description - * @Date 2025/3/19 14:44 - */ -@Tag(name = "构建-日志资源", description = "BUILD_LOG_PRINT") -@RestController -@RequestMapping("/build/logs") -public interface BuildLogPrintResource { - - @Operation(description = "写入一条日志") - @PostMapping("/") - CommonResult addLogLine( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "一条日志", required = true) - LogMessage logMessage); - - @Operation(description = "写入一条红色高亮日志") - @PostMapping("/red") - CommonResult addRedLogLine( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "一条日志", required = true) - LogMessage logMessage); - - @Operation(description = "写入一条黄色高亮日志") - @PostMapping("/yellow") - CommonResult addYellowLogLine( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "一条日志", required = true) - LogMessage logMessage - ); - - @Operation(description = "写入多条日志") - @PostMapping("/multi") - CommonResult addMultiLine( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "多条日志列表", required = true) - List logMessages - ); - - @Operation(description = "写入日志状态") - @PostMapping("/status") - CommonResult addLogStatus( - @Parameter(description = "构建id", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "分辨插件的tag,默认填对应插件id") - @RequestParam("tag") - String tag, - @Parameter(description = "插件内的分类的子tag,默认为空") - @RequestParam("subTag") - String subTag, - @Parameter(description = "job id或者container的34位id", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount, - @Parameter(description = "日志存储模式", required = false) - @RequestParam("logMode") - String logMode - ); - - @Operation(description = "更新日志状态") - @PutMapping("/status") - CommonResult updateLogStatus( - @Parameter(description = "构建id", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "是否已构建完成", required = true) - @RequestParam("finished") - boolean finished, - @Parameter(description = "分辨插件的tag,默认填对应插件id") - @RequestParam("tag") - String tag, - @Parameter(description = "插件内的分类的子tag,默认为空") - @RequestParam("subTag") - String subTag, - @Parameter(description = "job id或者container的34位id", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount, - @Parameter(description = "日志存储模式", required = false) - @RequestParam("logMode") - String logMode - ); - - @Operation(description = "更新日志存储模式的流转状态") - @PostMapping("/mode") - CommonResult updateLogStorageMode( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "执行次数") - @RequestParam("executeCount") - int executeCount, - @Parameter(description = "所有插件的日志存储结果", required = true) - List propertyList - ); - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/OpLogResource.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/OpLogResource.java deleted file mode 100644 index cf28df13..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/OpLogResource.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.log.api; - - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "管理-日志资源") -@RestController -@RequestMapping("/op") -public interface OpLogResource { - @Operation(description = "执行搬冷任务") - @PutMapping("/es/index/cold") - CommonResult makeIndexCold(); -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/ServiceLogPrintResource.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/ServiceLogPrintResource.java deleted file mode 100644 index bde8c4a6..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/ServiceLogPrintResource.java +++ /dev/null @@ -1,86 +0,0 @@ -package cd.casic.ci.log.api; - - - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.dal.pojo.enums.LogStorageMode; -import cd.casic.ci.log.dal.pojo.message.LogMessage; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_DEVOPS_BUILD_ID; - - -@RestController -@Tag(name = "服务-日志打印资源") -@RequestMapping("/service/logs/print") -public interface ServiceLogPrintResource { - - @Operation(summary = "写入日志状态") - @PostMapping("/status") - @Parameters({ - @Parameter(name = "tag", description = "分辨插件的tag,默认填对应插件id"), - @Parameter(name = "subTag", description = "插件内的分类的子tag,默认为空"), - @Parameter(name = "jobId", description = "job id或者container的34位id"), - @Parameter(name = "executeCount", description = "执行次数"), - - }) - CommonResult addLogStatus(@RequestHeader(value = AUTH_HEADER_DEVOPS_BUILD_ID) - @Parameter(description = "构建ID", required = true) - String buildId, - @RequestParam(value = "tag", required = false) String tag, - @RequestParam(value = "subTag", required = false) String subTag, - @RequestParam(value = "jobId", required = false) String jobId, - @RequestParam(value = "executeCount", required = false, defaultValue = "1") int executeCount); - - @Operation(summary = "更新日志状态") - @PutMapping("/status") - CommonResult updateLogStatus( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "是否已构建完成", required = true) - @RequestParam("finished") - boolean finished, - @Parameter(description = "分辨插件的tag,默认填对应插件id") - @RequestParam(value = "tag", required = false) - String tag, - @Parameter(description = "插件内的分类的子tag,默认为空") - @RequestParam(value = "subTag", required = false) - String subTag, - @Parameter(description = "job id或者container的34位id") - @RequestParam(value = "jobId", required = false) - String jobId, - @Parameter(description = "执行次数") - @RequestParam(value = "executeCount", required = false, defaultValue = "1") - int executeCount, - @Parameter(description = "插件的存储模式") - @RequestParam(value = "logStorageMode", required = false) - LogStorageMode logStorageMode - ); - - @Operation(summary = "写入一条日志") - @PostMapping("/") - CommonResult addLogLine( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - @Parameter(description = "一条日志", required = true) - LogMessage logMessage); - - @Operation(summary = "写入多条日志") - @PostMapping("/multi") - CommonResult addLogMultiLine( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - String buildId, - - @Parameter(description = "多条日志列表", required = true) - List logMessages); - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/ServiceLogResource.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/ServiceLogResource.java deleted file mode 100644 index a2d4ea05..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/ServiceLogResource.java +++ /dev/null @@ -1,173 +0,0 @@ -package cd.casic.ci.log.api; - - -import cd.casic.ci.log.dal.pojo.QueryLogLineNum; -import cd.casic.ci.log.dal.pojo.QueryLogStatus; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*;; - - -@RestController -@Tag(name = "服务-日志资源") -@RequestMapping("/service/logs") -public interface ServiceLogResource { - - @Operation(summary = "根据构建ID获取初始化所有日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/") - CommonResult getInitLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "对应elementId", required = false) - @RequestParam(value = "tag") - String tag, - @Parameter(description = "对应jobId", required = false) - @RequestParam(value = "jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam(value = "executeCount") - int executeCount - ); - - @Operation(summary = "获取更多日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/more") - CommonResult getMoreLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "日志行数", required = false) - @RequestParam(value = "num", defaultValue = "100") - int num, - @Parameter(description = "是否正序输出", required = false) - @RequestParam(value = "fromStart", defaultValue = "true") - boolean fromStart, - @Parameter(description = "起始行号", required = true) - @RequestParam(value = "start") - long start, - @Parameter(description = "结尾行号", required = true) - @RequestParam(value = "end") - long end, - @Parameter(description = "对应elementId", required = false) - @RequestParam(value = "tag") - String tag, - @Parameter(description = "对应jobId", required = false) - @RequestParam(value = "jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam(value = "executeCount") - int executeCount - ); - - @Operation(summary = "获取某行前的日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/after") - CommonResult getAfterLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "起始行号", required = true) - @RequestParam("start") - long start, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug",defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType",defaultValue = "null") - LogType logType, - @Parameter(description = "对应elementId", required = false) - @RequestParam("tag") - String tag, - @Parameter(description = "对应jobId", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); - - @Operation(summary = "获取插件的的日志状态") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/mode") - CommonResult getLogMode( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "对应elementId", required = true) - @RequestParam("tag") - String tag, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); - - @Operation(summary = "获取当前构建的最大行号") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/last_line_num") - CommonResult getLogLastLineNum( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId - ); - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/UserLogResource.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/UserLogResource.java deleted file mode 100644 index b979d84f..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/UserLogResource.java +++ /dev/null @@ -1,195 +0,0 @@ -package cd.casic.ci.log.api; - - -import cd.casic.ci.log.dal.pojo.QueryLogStatus; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*;; - - -@RestController -@Tag(name = "用户-日志资源") -@RequestMapping("/user/logs") -public interface UserLogResource { - @Operation(summary = "根据构建ID获取初始化所有日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/") - CommonResult getInitLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "对应elementId", required = false) - @RequestParam(value = "tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam(value = "subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam(value = "jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam(value = "executeCount") - int executeCount - ); - - @Operation(summary = "获取更多日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/more") - CommonResult getMoreLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug", defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType", defaultValue = "null") - LogType logType, - @Parameter(description = "日志行数", required = false) - @RequestParam(value = "num", defaultValue = "100") - int num, - @Parameter(description = "是否正序输出", required = false) - @RequestParam(value = "fromStart", defaultValue = "true") - boolean fromStart, - @Parameter(description = "起始行号", required = true) - @RequestParam(value = "start") - long start, - @Parameter(description = "结尾行号", required = true) - @RequestParam(value = "end") - long end, - @Parameter(description = "对应elementId", required = false) - @RequestParam(value = "tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam(value = "subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam(value = "jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam(value = "executeCount") - int executeCount - ); - - @Operation(summary = "获取某行后的日志") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/after") - CommonResult getAfterLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "起始行号", required = true) - @RequestParam("start") - long start, - @Parameter(description = "是否包含调试日志", required = false) - @RequestParam(value = "debug",defaultValue = "false") - boolean debug, - @Parameter(description = "过滤日志级别", required = false) - @RequestParam(value = "logType",defaultValue = "null") - LogType logType, - @Parameter(description = "对应elementId", required = false) - @RequestParam("tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); - - @Operation(summary = "下载日志接口") - @GetMapping("{projectId}/{pipelineId}/{buildId}/download") - ResponseEntity downloadLogs( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "对应elementId", required = true) - @RequestParam("tag") - String tag, - @Parameter(description = "指定subTag", required = false) - @RequestParam("subTag") - String subTag, - @Parameter(description = "对应jobId", required = false) - @RequestParam("jobId") - String jobId, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount, - @Parameter(description = "文件名") - @RequestParam("fileName") - String fileName - ); - - @Operation(summary = "获取插件的的日志状态") - @GetMapping("/{projectId}/{pipelineId}/{buildId}/mode") - CommonResult getLogMode( - @Parameter(description = "用户ID", required = true, example = AUTH_HEADER_USER_ID_DEFAULT_VALUE) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目ID", required = true) - @PathVariable("projectId") - String projectId, - @Parameter(description = "流水线ID", required = true) - @PathVariable("pipelineId") - String pipelineId, - @Parameter(description = "构建ID", required = true) - @PathVariable("buildId") - String buildId, - @Parameter(description = "对应elementId", required = true) - @RequestParam("tag") - String tag, - @Parameter(description = "执行次数", required = false) - @RequestParam("executeCount") - int executeCount - ); -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/AppLogResourceImpl.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/AppLogResourceImpl.java deleted file mode 100644 index aac97f91..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/AppLogResourceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package cd.casic.ci.log.api.impl; - - -import cd.casic.ci.log.dal.pojo.EndPageQueryLogs; -import cd.casic.ci.log.dal.pojo.PageQueryLogs; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.api.AppLogResource; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.ci.log.service.BuildLogQueryService; -import cd.casic.ci.log.service.LogTagService; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -@Slf4j -public class AppLogResourceImpl implements AppLogResource { - - @Resource - private BuildLogQueryService buildLogQueryService; - @Resource - private LogTagService logTagService; - - @Override - public CommonResult getInitLogs(String userId, String projectId, String pipelineId, String buildId, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount, int page, int pageSize) { - return buildLogQueryService.getInitLogsPage(userId, projectId, pipelineId, buildId, debug, logType, tag, jobId, executeCount, page, pageSize, subTag); - } - - @Override - public CommonResult getMoreLogs(String userId, String projectId, String pipelineId, String buildId, boolean debug, LogType logType, int num, boolean fromStart, long start, long end, String tag, String subTag, String jobId, int executeCount) { - return buildLogQueryService.getMoreLogs(userId, projectId, pipelineId, buildId, debug, logType, num, fromStart, start, end, tag, jobId, executeCount, subTag); - } - - @Override - public CommonResult getAfterLogs(String userId, String projectId, String pipelineId, String buildId, long start, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - return buildLogQueryService.getAfterLogs(userId, projectId, pipelineId, buildId, start, debug, logType, tag, jobId, executeCount, subTag); - } - - @Override - public CommonResult getBeforeLogs(String userId, String projectId, String pipelineId, String buildId, long end, boolean debug, LogType logType, int size, String tag, String subTag, String jobId, int executeCount) { - return buildLogQueryService.getBeforeLogs(userId, projectId, pipelineId, buildId, end, debug, logType, size, tag, jobId, executeCount, subTag); - } - - @Override - public CommonResult getEndLogsPage(String userId, String projectId, String pipelineId, String buildId, int size, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - return buildLogQueryService.getEndLogsPage(userId, projectId, pipelineId, buildId, size, debug, logType, tag, jobId, executeCount, subTag); - } - - @Override - public CommonResult getBottomLogs(String userId, String projectId, String pipelineId, String buildId, boolean debug, LogType logType, int size, String tag, String subTag, String jobId, int executeCount) { - return buildLogQueryService.getBottomLogs(userId, projectId, pipelineId, buildId, size, debug, logType, tag, jobId, executeCount, subTag); - } - - @Override - public CommonResult test(String buildId, String tagName, String subTag) { - logTagService.saveSubTag(buildId, tagName, subTag); - return CommonResult.success("成功"); - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/BuildLogPrintResourceImpl.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/BuildLogPrintResourceImpl.java deleted file mode 100644 index dea3f97c..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/BuildLogPrintResourceImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -package cd.casic.ci.log.api.impl; - - -import cd.casic.ci.log.dal.pojo.TaskBuildLogProperty; -import cd.casic.ci.log.dal.pojo.meta.Ansi; -import cd.casic.framework.commons.exception.ErrorCode; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.api.BuildLogPrintResource; -import cd.casic.ci.log.dal.pojo.enums.LogStorageMode; -import cd.casic.ci.log.service.BuildLogPrintService; -import cd.casic.ci.log.service.IndexService; -import cd.casic.ci.log.service.LogStatusService; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.util.Strings; -import org.springframework.beans.factory.annotation.Value; -import cd.casic.ci.log.dal.pojo.message.LogMessage; -import org.springframework.web.bind.annotation.RestController; - -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@RestController -public class BuildLogPrintResourceImpl implements BuildLogPrintResource { - @Resource - private BuildLogPrintService buildLogPrintService; - @Resource - private LogStatusService logStatusService; - @Resource - private IndexService indexService; - - @Value("{$spring.application.name}") - private String applicationName; - - @Override - public CommonResult addLogLine(String buildId, LogMessage logMessage) { - if (Strings.isBlank(buildId)) { - log.warn("Invalid build ID[" + buildId + "]"); - return CommonResult.error(new ErrorCode(1000, "buildId为空")); - } - ArrayList list = new ArrayList<>(); - list.add(logMessage); - //buildLogPrintService.dispatchEvent(new LogOriginEvent(buildId, list)); - System.out.println("占位"); - return CommonResult.success(true); - } - - @Override - public CommonResult addRedLogLine(String buildId, LogMessage logMessage) { - if (Strings.isBlank(buildId)) { - log.warn("Invalid build ID[" + buildId + "]"); - return CommonResult.error(new ErrorCode(1000, "buildId为空")); - } - // 设置红色日志 - List list = new ArrayList<>(); - logMessage.setMessage(new Ansi().bold().fgRed().a(logMessage.getMessage()).reset().toString()); - list.add(logMessage); - //buildLogPrintService.dispatchEvent(new LogOriginEvent(buildId,list)); - System.out.println("占位"); - return CommonResult.success(true); - } - - @Override - public CommonResult addYellowLogLine(String buildId, LogMessage logMessage) { - if (Strings.isBlank(buildId)) { - log.warn("Invalid build ID[" + buildId + "]"); - return CommonResult.error(new ErrorCode(1000, "buildId为空")); - } - // 设置黄色日志 - List list = new ArrayList<>(); - logMessage.setMessage(new Ansi().bold().fgYellow().a(logMessage.getMessage()).reset().toString()); - list.add(logMessage); - //buildLogPrintService.dispatchEvent(new LogOriginEvent(buildId,list)); - System.out.println("占位" + buildId + list); - return CommonResult.success(true); - } - - @Override - public CommonResult addMultiLine(String buildId, List logMessages) { - if (Strings.isBlank(buildId)) { - log.warn("Invalid build ID[" + buildId + "]"); - return CommonResult.error(new ErrorCode(1000, "buildId为空")); - } - //buildLogPrintService.dispatchEvent(new LogOriginEvent(buildId,logMessages)); - System.out.println("占位" + buildId + logMessages); -// recordMultiLogCount(logMessages.size()); - return CommonResult.success(true); - } - - @Override - public CommonResult addLogStatus(String buildId, String tag, String subTag, String jobId, int executeCount, String logMode) { - if (Strings.isBlank(buildId)) { - log.warn("Invalid build ID[" + buildId + "]"); - return CommonResult.error(new ErrorCode(1000, "buildId为空")); - } - // #7168 通过一次获取创建记录以及缓存 - String index = indexService.getIndexName(buildId); - log.info("Start to print log to index[" + index + "]"); - //buildLogPrintService.dispatchEvent(new LogStatusEvent(buildId,false,tag,subTag,jobId,executeCount, LogStorageMode.parse(logMode))); - System.out.println("占位" + buildId + tag + subTag + jobId + executeCount + LogStorageMode.parse(logMode)); - return CommonResult.success(true); - } - - @Override - public CommonResult updateLogStatus(String buildId, boolean finished, String tag, String subTag, String jobId, int executeCount, String logMode) { - if (Strings.isBlank(buildId)) { - log.warn("Invalid build ID[" + buildId + "]"); - return CommonResult.error(new ErrorCode(1000, "buildId为空")); - } - //buildLogPrintService.dispatchEvent(new LogStatusEvent(buildId,finished,tag,subTag,jobId,executeCount,LogStorageMode.parse(logMode))); - System.out.println("占位" + buildId + finished + tag + subTag + jobId + executeCount + LogStorageMode.parse(logMode)); - return CommonResult.success(true); - } - - @Override - public CommonResult updateLogStorageMode(String buildId, int executeCount, List propertyList) { - if (Strings.isBlank(buildId)) { - log.warn("Invalid build ID[" + buildId + "]"); - return CommonResult.error(new ErrorCode(1000, "buildId为空")); - } - logStatusService.updateStorageMode(buildId, executeCount, propertyList); - return CommonResult.success(true); - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/OpLogResourceImpl.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/OpLogResourceImpl.java deleted file mode 100644 index 9cec8f22..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/OpLogResourceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.log.api.impl; - - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.api.OpLogResource; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -public class OpLogResourceImpl implements OpLogResource { - // todo 和ES数据库相关的冷处理 - @Override - public CommonResult makeIndexCold() { - return null; - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/ServiceLogPrintResourceImpl.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/ServiceLogPrintResourceImpl.java deleted file mode 100644 index d0a0ae25..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/ServiceLogPrintResourceImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -package cd.casic.ci.log.api.impl; - - -import cd.casic.ci.log.api.ServiceLogPrintResource; -import cd.casic.framework.commons.exception.ErrorCode; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.dal.pojo.enums.LogStorageMode; -import cd.casic.ci.log.log.LogOriginEvent; -import cd.casic.ci.log.dal.pojo.message.LogMessage; -import cd.casic.ci.log.service.BuildLogPrintService; -import cd.casic.ci.log.service.IndexService; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.util.Strings; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.RestController; -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@RestController -public class ServiceLogPrintResourceImpl implements ServiceLogPrintResource { - - @Resource - private IndexService indexService; - @Resource - private BuildLogPrintService buildLogPrintService; - - private static Logger logger = LoggerFactory.getLogger(ServiceLogPrintResourceImpl.class); - - @Override - public CommonResult addLogStatus(String buildId, String tag, String subTag, String jobId, int executeCount) { - // 判断 buildId 是否为空 - if (buildId.isEmpty()) { - logger.warn("Invalid build ID"); - return CommonResult.error(new ErrorCode(1000, "Invalid build ID")); - } - // 通过一次获取 创建记录以及缓存 - String index = indexService.getIndexName(buildId); - logger.info("Start to print log to index: " + index); -// buildLogPrintService.dispatchEvent( -// new LogStatusEvent(buildId, false, tag, subTag, jobId, executeCount) -// ); - return CommonResult.success(true); - } - - @Override - public CommonResult updateLogStatus(String buildId, boolean finished, String tag, - String subTag, String jobId, int executeCount, LogStorageMode logStorageMode) { - if (Strings.isBlank(buildId)) { - logger.warn("Invalid build ID:" + buildId); - return CommonResult.error(new ErrorCode(1000, "Invalid build ID")); - } -// buildLogPrintService.dispatchEvent( -// new LogStatusEvent(buildId,finished,tag,subTag,jobId,executeCount,logStorageMode) -// ); - return CommonResult.success(true); - } - - @Override - public CommonResult addLogLine(String buildId, LogMessage logMessage) { - if (Strings.isBlank(buildId)) { - logger.warn("Invalid build ID" + buildId); - return CommonResult.error(new ErrorCode(1000, "Invalid build ID")); - } - List messages = new ArrayList<>(); - messages.add(logMessage); - return buildLogPrintService.asyncDispatchEvent(new LogOriginEvent(buildId, messages)); - } - - @Override - public CommonResult addLogMultiLine(String buildId, List logMessages) { - if (Strings.isBlank(buildId)) { - logger.warn("Invalid build ID" + buildId); - return CommonResult.error(new ErrorCode(1000, "Invalid build ID")); - } - buildLogPrintService.asyncDispatchEvent(new LogOriginEvent(buildId, logMessages)); - return CommonResult.success(true); - } - - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/ServiceLogResourceImpl.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/ServiceLogResourceImpl.java deleted file mode 100644 index 44abdb39..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/ServiceLogResourceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.ci.log.api.impl; - - - -import cd.casic.ci.log.dal.pojo.QueryLogLineNum; -import cd.casic.ci.log.dal.pojo.QueryLogStatus; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.api.ServiceLogResource; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.ci.log.service.BuildLogQueryService; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -public class ServiceLogResourceImpl implements ServiceLogResource { - - @Resource - private BuildLogQueryService buildLogQueryService; - - private static int defaultNum = 100; - - @Override - public CommonResult getInitLogs(String userId, String projectId, String pipelineId, String buildId, - boolean debug, LogType logType, String tag, String jobId, int executeCount) { - return buildLogQueryService.getInitLogs(userId,projectId,pipelineId,buildId,debug,logType,tag,jobId,executeCount,null); - } - - @Override - public CommonResult getMoreLogs(String userId, String projectId, String pipelineId, String buildId, - boolean debug, LogType logType, int num, boolean fromStart, long start, long end, String tag, String jobId, int executeCount) { - return buildLogQueryService.getMoreLogs(userId,projectId,pipelineId,buildId,debug,logType,num,fromStart,start,end,tag,jobId,executeCount,null); - } - - @Override - public CommonResult getAfterLogs(String userId, String projectId, String pipelineId, String buildId,long start, - boolean debug, LogType logType,String tag,String jobId, int executeCount) { - return buildLogQueryService.getAfterLogs(userId,projectId,pipelineId,buildId,start,debug,logType,tag,jobId,executeCount,null); - } - - @Override - public CommonResult getLogMode(String userId, String projectId, String pipelineId, String buildId, String tag, int executeCount) { - return buildLogQueryService.getLogMode(userId, projectId, pipelineId, buildId,tag,executeCount); - } - - @Override - public CommonResult getLogLastLineNum(String userId, String projectId, String pipelineId, String buildId) { - return buildLogQueryService.getLastLineNum(userId, projectId, pipelineId, buildId); - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/UserLogResourceImpl.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/UserLogResourceImpl.java deleted file mode 100644 index 1aa34a59..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/api/impl/UserLogResourceImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -package cd.casic.ci.log.api.impl; - -import cd.casic.ci.log.dal.pojo.LogLine; -import cd.casic.ci.log.dal.pojo.QueryLogStatus; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import io.micrometer.core.instrument.Counter; -import io.micrometer.core.instrument.MeterRegistry; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.api.UserLogResource; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.ci.log.service.BuildLogQueryService; -import io.micrometer.core.annotation.Timed; -import jakarta.annotation.Resource; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - - -@RestController -public class UserLogResourceImpl implements UserLogResource { - @Resource - private BuildLogQueryService buildLogQueryService; - @Resource - private MeterRegistry meterRegistry; - - private static final int defaultNum = 100; - - @Value("${spring.application.name}") - private String applicationName = ""; - - @Override - @Timed - public CommonResult getInitLogs(String userId, String projectId, String pipelineId, - String buildId, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - CommonResult initLogs = buildLogQueryService.getInitLogs(userId, projectId, pipelineId, buildId, debug, logType, tag, jobId, executeCount, subTag); - List logs = initLogs.getData().getLogs(); - if (logs == null) { - recordListLogCount(0); - } else { - recordListLogCount(logs.size()); - } - return initLogs; - } - - @Override - public CommonResult getMoreLogs(String userId, String projectId, String pipelineId, - String buildId, boolean debug, LogType logType, int num, boolean fromStart, long start, long end, String tag, String subTag, String jobId, int executeCount) { - return buildLogQueryService.getMoreLogs(userId, projectId, pipelineId, buildId, debug, logType, num, fromStart, start, end, tag, jobId, executeCount, subTag); - } - - @Override - public CommonResult getAfterLogs(String userId, String projectId, String pipelineId, String buildId, long start, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - CommonResult afterLogs = buildLogQueryService.getAfterLogs(userId, projectId, - pipelineId, buildId, start, debug, logType, tag, jobId, executeCount, subTag); - List logs = afterLogs.getData().getLogs(); - if (logs == null) { - recordListLogCount(0); - } else { - recordListLogCount(logs.size()); - } - return afterLogs; - } - - @Override - public ResponseEntity downloadLogs(String userId, String projectId, String pipelineId, String buildId, String tag, String subTag, String jobId, int executeCount, String fileName) { - return buildLogQueryService.downloadLogs(userId, projectId, pipelineId, buildId, tag, jobId, executeCount, fileName, subTag); - } - - @Override - public CommonResult getLogMode(String userId, String projectId, String pipelineId, String buildId, String tag, int executeCount) { - return buildLogQueryService.getLogMode(userId, projectId, pipelineId, buildId, tag, executeCount); - } - - private void recordListLogCount(int count) { - Counter.builder("list_log_count") - .tag("application", applicationName) - .register(meterRegistry) - .increment(count); - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/config/LogPrinterConfiguration.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/config/LogPrinterConfiguration.java deleted file mode 100644 index ea7c0a58..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/config/LogPrinterConfiguration.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.log.config; - -import lombok.val; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; - -import java.time.Duration; - -/** - * @Author:mianbin - * @Package:cd.casic.pipeline.config - * @Project:ops-pro - * @name:LogPrinterConfiguration - * @Date:2025/03/24 10:45 - * @Filename:LogPrinterConfiguration - * @description:Todo暂时日志的先放着 - */ -@Configuration -@ConditionalOnWebApplication -@AutoConfigureOrder(Ordered.LOWEST_PRECEDENCE) -public class LogPrinterConfiguration { - - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/IndexMapper.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/IndexMapper.java deleted file mode 100644 index d0c2ab32..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/IndexMapper.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.log.dal.dao; - -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; -import cd.casic.ci.log.dal.dataobject.LogIndicesV2; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import org.apache.ibatis.annotations.Mapper; - -import java.util.Date; -import java.util.Objects; - -/** - * @author by mianbin - * @Classname IndexDao - * @Description LogIndicesV2 的mapper - * @Date 2025/3/20 10:07 - */ -@Mapper -public interface IndexMapper extends BaseMapperX { - default void create(String buildId, String indexName, boolean enable) { - Date now = new Date(); - LogIndicesV2 entity = new LogIndicesV2(buildId, indexName, 1, now, now, enable, true); - insert(entity); - } - - /** - * 通过 id 查找 LogIndicesV2 - * 该方法是可能返回 null 值的,所以调用该方法的时候都应该对 null 值进行判断 - * - * @param buildId - * @return - */ - default LogIndicesV2 getBuild(String buildId) { - return selectOne(Wrappers.lambdaQuery().eq(LogIndicesV2::getBuildId, buildId)); - } - - default String getIndexName(String buildId) { - LogIndicesV2 logIndices = getBuild(buildId); - if (logIndices == null) - return ""; - return logIndices.getIndexName(); - } - - default boolean updateLastLineNum(String buildId, long latestLineNum) { - LogIndicesV2 logIndicesV2 = selectOne(LogIndicesV2::getBuildId, buildId); - if (Objects.nonNull(logIndicesV2)) { - logIndicesV2.setLastLineNum(latestLineNum); - } - return insertOrUpdate(logIndicesV2); - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/LogStatusMapper.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/LogStatusMapper.java deleted file mode 100644 index 9482e501..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/LogStatusMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.log.dal.dao; - -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; -import cd.casic.ci.log.dal.dataobject.LogStatus; -import org.apache.ibatis.annotations.Mapper; - -/** - * @author by mianbin - * @Classname LogStatus - * @Description TODO - * @Date 2025/3/20 14:28 - */ -@Mapper -public interface LogStatusMapper extends BaseMapperX { -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/LogTahMapper.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/LogTahMapper.java deleted file mode 100644 index 8759a4cf..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dao/LogTahMapper.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.log.dal.dao; - -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; -import cd.casic.ci.log.dal.dataobject.LogSubTags; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * @author by mianbin - * @Classname LogTahMapper - * @Description TODO - * @Date 2025/3/20 10:13 - */ -@Mapper -public interface LogTahMapper extends BaseMapperX { - - default void save(String buildId, String tag, String subTags) { - LogSubTags logSubTags = new LogSubTags(buildId, tag, subTags); - insert(logSubTags); - // todo 如果存在的话就更新值 - } - - default String getSubTags(String buildId, String tag) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery() - .eq(LogSubTags::getBuildId, buildId) - .eq(LogSubTags::getTag, tag); - LogSubTags one = selectOne(wrapper); - if (one != null) { - return one.getSubTags(); - } - return null; - } - - /** - * 删除所有 deleteList 里面的 buildId 构造的日志 - */ - default void delete(List deleteList) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery().in(LogSubTags::getBuildId, deleteList); - delete(wrapper); - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogIndicesV2.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogIndicesV2.java deleted file mode 100644 index 5c349e9c..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogIndicesV2.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.ci.log.dal.dataobject; - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -/** - * @author by mianbin - * @Classname LogIndicesV2 - * @Description TODO - * @Date 2025/3/19 17:16 - */ -@Data -@Accessors(chain = true) -@AllArgsConstructor -@NoArgsConstructor -@TableName(value = "log_indices_v2", autoResultMap = true) -@EqualsAndHashCode(callSuper = true) -public class LogIndicesV2 extends BaseDO { - @TableId - private Long id; - - private String buildId; - - private String indexName; - - private long lastLineNum; - /** - * build is enable v2 or not - */ - private boolean enable; - /** - * multi es log cluster name - */ - private String logClusterName; - /** - * use multi es log cluster or not - */ - private boolean useCluster; - - public LogIndicesV2(String buildId, String indexName, long lastLineNum, Date createTime, Date updateTime, boolean enable, boolean useCluster) { - this.buildId = buildId; - this.indexName = indexName; - this.lastLineNum = lastLineNum; - this.enable = enable; - this.useCluster = useCluster; - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogStatus.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogStatus.java deleted file mode 100644 index 777c43c4..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogStatus.java +++ /dev/null @@ -1,49 +0,0 @@ -package cd.casic.ci.log.dal.dataobject; - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * @author by mianbin - * @Classname LogStatus - * @Description TODO - * @Date 2025/3/19 17:24 - */ -@Data -@Accessors(chain = true) -@AllArgsConstructor -@TableName(value = "log_status", autoResultMap = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public class LogStatus extends BaseDO { - @TableId - private Long id; - - private String buildId; - - private String tag; - - private String subTag; - - private String jobId; - - private String mode; - - private int executeCount; - - private Boolean finished; - - public LogStatus(String buildId, String tag, String subTag, String jobId, String mode, int executeCount, Boolean finished) { - this.buildId = buildId; - this.tag = tag; - this.subTag = subTag; - this.jobId = jobId; - this.mode = mode; - this.executeCount = executeCount; - this.finished = finished; - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogSubTags.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogSubTags.java deleted file mode 100644 index 84fc5413..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/dataobject/LogSubTags.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.log.dal.dataobject; - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.*; -import lombok.experimental.Accessors; - -/** - * @author by mianbin - * @Classname LogSubTags - * @Description TODO - * @Date 2025/3/19 17:31 - */ -@Data -@Accessors(chain = true) -@TableName(value = "log_sub_tags", autoResultMap = true) -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -public class LogSubTags extends BaseDO { - @TableId - private long id; - /** - * 构建ID - */ - private String buildId; - - /** - * 插件标签 - */ - private String tag; - - /** - * 插件子标签 - */ - private String subTags; - - public LogSubTags(String buildId, String tag, String subTags) { - this.buildId = buildId; - this.tag = tag; - this.subTags = subTags; - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/EndPageQueryLogs.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/EndPageQueryLogs.java deleted file mode 100644 index 8952824e..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/EndPageQueryLogs.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.log.dal.pojo; - -import cd.casic.ci.log.dal.pojo.enums.LogStatusEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import java.util.ArrayList; -import java.util.List; - -/** - * @author by mianbin - * @Classname EndPageQueryLogs - * @Date 2025/3/19 17:34 - */ -@Data -@Schema(title = "结尾的日志查询模型") -public class EndPageQueryLogs { - @Schema(description = "构建ID", required = true) - private String buildId; - @Schema(description = "开始行号", required = true) - private long startLineNo = 0L; - @Schema(description = "结束行号", required = true) - private long endLineNo = 0L; - @Schema(description = "日志列表", required = true) - private List logs = new ArrayList<>(); - @Schema(description = "所用时间", required = false) - private long timeUsed = 0; - @Schema(description = "日志查询状态", required = false) - private int status = LogStatusEnum.SUCCEED.status; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/LogLine.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/LogLine.java deleted file mode 100644 index 72b3a039..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/LogLine.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.log.dal.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; -import lombok.val; - -/** - * @author by mianbin - * @Classname LogLine - * @Date 2025/3/19 17:35 - */ -@Data -@Schema(title = "日志模型") -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = false) -public class LogLine { - - @Schema(description = "日志行号", required = true) - private long lineNo; - @Schema(description = "日志时间戳", required = true) - private long timestamp; - @Schema(description = "日志消息体", required = true) - private String message; - @Schema(description = "日志权重级", required = true) - private Byte priority = 0; - @Schema(description = "日志tag", required = true) - private String tag = ""; - @Schema(description = "日志子tag", required = true) - private String subTag = ""; - @Schema(description = "日志jobId", required = true) - private String jobId = ""; - @Schema(title = "日志containerHashId", required = true) - private String containerHashId; - @Schema(title = "日志stepId", required = true) - private String stepId; - @Schema(description = "日志执行次数", required = true) - private int executeCount = 1; - - @Override - public int hashCode() { - return (int) (lineNo ^ (lineNo >>> 32)); - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/PageQueryLogs.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/PageQueryLogs.java deleted file mode 100644 index 65b2953d..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/PageQueryLogs.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.log.dal.pojo; - -import cd.casic.framework.commons.pojo.PageResult; -import cd.casic.ci.log.dal.pojo.enums.LogStatusEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PageQueryLogs - * @Date 2025/3/19 17:39 - */ -@Data -@Schema(title = "日志查询模型") -public class PageQueryLogs { - @Schema(description = "构建ID", required = true) - String buildId; - @Schema(description = "是否结束", required = true) - boolean finished; - //todo Page分页类,分页数据包装模型 - @Schema(description = "日志列表", required = true) - PageResult logs; - @Schema(description = "所用时间", required = false) - long timeUsed = 0; - @Schema(description = "日志查询状态", required = false) - int status = LogStatusEnum.SUCCEED.status; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogLineNum.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogLineNum.java deleted file mode 100644 index 70e6648e..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogLineNum.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.log.dal.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname QueryLogLineNum - * @Date 2025/3/19 17:47 - */ -@Data -@Schema(title = "日志行号查询模型") -@AllArgsConstructor -@NoArgsConstructor -public class QueryLogLineNum { - @Schema(description = "构建ID", required = true) - String buildId; - @Schema(description = "是否结束", required = true) - boolean finished; - @Schema(description = "日志存储状态", required = false) - long lastLineNum; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogStatus.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogStatus.java deleted file mode 100644 index 8a04de5a..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogStatus.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.log.dal.pojo; - -import cd.casic.ci.log.dal.pojo.enums.LogStorageMode; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname QueryLogStatus - * @Date 2025/3/19 17:45 - */ -@Data -@AllArgsConstructor -@Schema(description = "日志状态查询模型") -public class QueryLogStatus { - @Schema(description = "构建ID", required = true) - private String buildId; - @Schema(description = "是否结束", required = true) - private boolean finished; - @Schema(description = "日志存储状态") - private LogStorageMode logMode; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogs.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogs.java deleted file mode 100644 index a0c8c8ad..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/QueryLogs.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.log.dal.pojo; - -import cd.casic.ci.log.dal.pojo.enums.LogStatusEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author by mianbin - * @Classname QueryLogs - * @Date 2025/3/19 17:48 - */ -@Data -@Schema(description = "日志查询模型") -public class QueryLogs { - @Schema(description = "构建ID", required = true) - private String buildId; - @Schema(description = "是否结束", required = true) - private boolean finished; - @Schema(description = "是否有后续日志") - private boolean hasMore = false; - @Schema(description = "日志列表", required = true) - // listOf() 不可变 ; mutableListOf 生成可变数组 - private List logs = new ArrayList<>(); - @Schema(description = "所用时间", required = false) - private long timeUsed = 0; - @Schema(description = "日志查询状态", required = false) - private int status = LogStatusEnum.SUCCEED.status; - @Schema(description = "日志子tag列表", required = false) - private List subTags = null; - @Schema(description = "错误信息", required = false) - private String message = null; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/TaskBuildLogProperty.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/TaskBuildLogProperty.java deleted file mode 100644 index 15581e53..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/TaskBuildLogProperty.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.log.dal.pojo; - -import cd.casic.ci.log.dal.pojo.enums.LogStorageMode; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.File; - -/** - * @author by mianbin - * @Classname TaskBuildLogProperty - * @Date 2025/3/19 17:48 - */ -@Data -@Schema(description = "任务构建日志属性") -public class TaskBuildLogProperty { - @Schema(description = "插件任务ID", required = true) - public String elementId; - @Schema(description = "日志文件子路径", required = true) - public String childPath; - @Schema(description = "日志zip文件子路径", required = true) - public String childZipPath; - @Schema(description = "日志文件句柄", required = true) - public File logFile; - @Schema(description = "日志的存储模式") - public LogStorageMode logStorageMode = LogStorageMode.UPLOAD; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogErrorCodeEnum.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogErrorCodeEnum.java deleted file mode 100644 index d7ea2699..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogErrorCodeEnum.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.log.dal.pojo.enums; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; - -/** - * @author by mianbin - * @Classname LogErrorCodeEnum - * @Description 日志错误状态码枚举 - * @Date 2025/3/19 17:06 - */ -@Schema(title = "日志错误状态码") -@AllArgsConstructor -public enum LogErrorCodeEnum { - PRINT_QUEUE_LIMIT(2108005, "log print queue exceeds the limit"), - PRINT_IS_DISABLED(2108006, "log print config is disabled"); - - public int errorCode; - public String formatErrorMessage; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogStatusEnum.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogStatusEnum.java deleted file mode 100644 index f87ff1ce..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogStatusEnum.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.log.dal.pojo.enums; - -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.RequiredArgsConstructor; - -/** - * @author by mianbin - * @Classname LogStatus - * @Description 日志状态 - * @Date 2025/3/19 17:07 - */ -@RequiredArgsConstructor() -@Schema(title = "日志状态") -public enum LogStatusEnum { - @Schema(description = "查询成功") - SUCCEED(0), - @Schema(description = "日志为空") - EMPTY(1), - @Schema(description = "日志已过期") - CLEAN(2), - @Schema(description = "日志已清理") - CLOSED(3), - @Schema(description = "查询异常") - FAIL(999); - - public int status; - - LogStatusEnum(int status){ - this.status = status; - } - - @JsonValue - public int jsonValue() { - return status; - } - - public static LogStatusEnum parse(int status){ - switch (status){ - case 0: - return SUCCEED; - case 1: - return EMPTY; - case 2: - return CLEAN; - case 3: - return CLOSED; - default: - return FAIL; - } - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogStorageMode.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogStorageMode.java deleted file mode 100644 index ee13b063..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogStorageMode.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.log.dal.pojo.enums; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @author by mianbin - * @Classname LogStorageMode - * @Description 日志保存模型 - * @Date 2025/3/19 17:10 - */ -@Schema(title = "日志保存模型") -public enum LogStorageMode { - @Schema(description = "上报服务") - UPLOAD, - @Schema(description = "本地保存") - LOCAL, - @Schema(description = "仓库已归档") - ARCHIVED; - - public static LogStorageMode parse(String modeName) { - if (modeName.equals(LOCAL.name())) { - return LOCAL; - } else if (modeName.equals(ARCHIVED.name())) { - return ARCHIVED; - } else { - return UPLOAD; - } - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogType.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogType.java deleted file mode 100644 index c5adc33a..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/enums/LogType.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.log.dal.pojo.enums; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @author by mianbin - * @Classname LogType - * @Description 日志的类型 - * @Date 2025/3/19 17:12 - */ -@Schema(title = "日志的类型") -public enum LogType { - @Schema(description = "提醒日志") - WARN, - @Schema(description = "错误日志") - ERROR, - @Schema(description = "调试日志") - DEBUG, - @Schema(description = "普通的日志") - LOG -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LegacyLogMessage.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LegacyLogMessage.java deleted file mode 100644 index ad8d38e0..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LegacyLogMessage.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.log.dal.pojo.message; - -import lombok.Data; -import lombok.val; - -/** - * @Author:mianbin - * @Package:cd.casic.pipeline.dal.pojo.message - * @Project:ops-pro - * @name:LegacyLogMessage - * @Date:2025/03/24 10:37 - * @Filename:LegacyLogMessage - * @description:Todo - */ -@Data -public class LegacyLogMessage { - String tag; - String buildId; - String message; - Long timestamp; - Long nanoTime; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogMessage.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogMessage.java deleted file mode 100644 index 5ea1b361..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogMessage.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.log.dal.pojo.message; - -import cd.casic.ci.log.dal.pojo.enums.LogType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname LogMessage - * @Description 日志模型 - * @Date 2025/3/19 17:13 - */ -@Data -@Schema(title = "日志模型") -@AllArgsConstructor -public class LogMessage { - - @Schema(description = "日志内容信息") - String message; - @Schema(description = "时间戳") - long timestamp; - @Schema(description = "标签") - String tag = ""; - @Schema(title = "step Id") - String stepId = ""; - @Schema(description = "job id") - String jobId = ""; - @Schema(title = "container Hash Id") - String containerHashId = ""; - @Schema(description = "日志类型") - LogType logType = LogType.LOG; - @Schema(description = "执行次数") - int executeCount; - @Schema(description = "子标签") - String subTag = null; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogMessageWithLineNo.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogMessageWithLineNo.java deleted file mode 100644 index 764a4d4d..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogMessageWithLineNo.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.log.dal.pojo.message; - -import cd.casic.ci.log.dal.pojo.enums.LogType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname LogMessageWithLineNo - * @Date 2025/3/19 17:14 - */ -@Data -@Schema(title = "带行号的日志消息") -@AllArgsConstructor -public class LogMessageWithLineNo { - String tag; - String containerHashId = ""; - String subTag; - String message; - Long timestamp = 0L; - LogType logType = LogType.LOG; - Long lineNo = 0L; - Integer executeCount = 1; - String jobId; - String stepId; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogStatus.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogStatus.java deleted file mode 100644 index 4a6709dc..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/message/LogStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.log.dal.pojo.message; - -import lombok.Data; -import lombok.val; - -/** - * @Author:mianbin - * @Package:cd.casic.pipeline.dal.pojo.message - * @Project:ops-pro - * @name:LogStatus - * @Date:2025/03/24 10:38 - * @Filename:LogStatus - * @description:Todo - */ -@Data -public class LogStatus { - String buildId; - Boolean finished; - Long updateTime; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/Ansi.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/Ansi.java deleted file mode 100644 index 60fbc170..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/Ansi.java +++ /dev/null @@ -1,133 +0,0 @@ -package cd.casic.ci.log.dal.pojo.meta; - -import org.apache.logging.log4j.util.Strings; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; - -public class Ansi { - private static char FIRST_ESC_CHAR = 27; - private static char SECOND_ESC_CHAR = '['; - private static String DISABLE = Ansi.class.getName() + ".disable"; - private static Callable detector; - private StringBuilder builder; - - private List attributeOptions = new ArrayList<>(5); - - public void newDetector(Callable detector) { - if (detector == null) { - throw new IllegalArgumentException("detector is null"); - } - this.detector = detector; - } - - public boolean isDetected() { - try { - return detector.call(); - } catch (Exception e) { - return true; - } - } - - private InheritableThreadLocal holder = new InheritableThreadLocal() { - @Override - public Boolean initialValue(){ - return isDetected(); - } - }; - - public Ansi bold() { - return a(AnsiAttribute.INTENSITY_BOLD); - } - - public Ansi a(AnsiAttribute attribute) { - attributeOptions.add(attribute.value); - return this; - } - - public Ansi fgYellow() { - return this.fg(AnsiColor.YELLOW); - } - - public Ansi fgGreen() { - return this.fg(AnsiColor.GREEN); - } - - public Ansi fgRed() { - return this.fg(AnsiColor.RED); - } - - public Ansi fg(AnsiColor color) { - attributeOptions.add(color.fg()); - return this; - } - - public Ansi a(String value) { - // 修复换行后ansi编码问题 - String strLF = innerAppendEscapeSequenceStr('m', attributeOptions); - // 清空属性??? - flushAttributes(); - // 对value进行正则替换 - String fixLF = ""; - // 对 value 的空安全判断 - if (!Strings.isBlank(value)) - fixLF = value.replace("\n", "\n$strLF"); - builder.append(fixLF); - return this; - } - - private void flushAttributes() { - if (attributeOptions.isEmpty()) { - return; - } - if (attributeOptions.size() == 1 && attributeOptions.get(0) == 0) { - builder.append(FIRST_ESC_CHAR); - builder.append(SECOND_ESC_CHAR); - builder.append('m'); - } else { - // 内部添加分号 - innerAppendEscapeSequence('m', attributeOptions); - } - attributeOptions.clear(); - } - - private Ansi innerAppendEscapeSequence(char command, List options) { - builder.append(FIRST_ESC_CHAR); - builder.append(SECOND_ESC_CHAR); - int size = options.size(); - for (int i = 0;i < size;i++) { - if (i != 0) { - builder.append(';'); - } - builder.append(options.get(i)); - } - builder.append(command); - return this; - } - - private String innerAppendEscapeSequenceStr(char command,List options) { - StringBuilder str = new StringBuilder(); - str.append(FIRST_ESC_CHAR); - str.append(SECOND_ESC_CHAR); - int size = options.size(); - for (int i = 0; i < size;i++) { - if (i != 0) { - str.append(';'); - } - str.append(options.get(i)); - } - str.append(command); - return str.toString(); - } - - public Ansi reset() { - return a(AnsiAttribute.RESET); - } - - @Override - public String toString() { - flushAttributes(); - return builder.toString(); - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiAttribute.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiAttribute.java deleted file mode 100644 index bf360960..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiAttribute.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.log.dal.pojo.meta; - -public enum AnsiAttribute { - RESET(0), - INTENSITY_BOLD(1), - INTENSITY_FAINT(2), - ITALIC(3), - UNDERLINE(4), - BLINK_SLOW(5), - BLINK_FAST(6), - NEGATIVE_ON(7), - CONCEAL_ON(8), - STRIKETHROUGH_ON(9), - UNDERLINE_DOUBLE(21), - INTENSITY_BOLD_OFF(22), - ITALIC_OFF(23), - UNDERLINE_OFF(24), - BLINK_OFF(25), - NEGATIVE_OFF(27), - CONCEAL_OFF(28), - STRIKETHROUGH_OFF(29); - - public int value; - - AnsiAttribute(int val) { - this.value = val; - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiColor.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiColor.java deleted file mode 100644 index 535152cd..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiColor.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.log.dal.pojo.meta; - -public enum AnsiColor { - BLACK(0), - RED(1), - GREEN(2), - YELLOW(3), - BLUE(4), - MAGENTA(5), - CYAN(6), - WHITE(7), - DEFAULT(9); - - public int value; - - AnsiColor(int val) { - value = val; - } - - public int fg() { - return value + 30; - } - - public int bg() { - return value + 40; - } - - public int fgBright() { - return value + 90; - } - - public int bgBright() { - return value + 100; - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiErase.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiErase.java deleted file mode 100644 index de2cb514..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/dal/pojo/meta/AnsiErase.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.log.dal.pojo.meta; - -/** - * @Author:mianbin - * @Package:cd.casic.pipeline.dal.pojo.meta - * @Project:ops-pro - * @name:AnsiErase - * @Date:2025/03/24 10:41 - * @Filename:AnsiErase - * @description:Todo - */ -public enum AnsiErase { - - FORWARD(0), - BACKWARD(1), - ALL(2); - private int value; - - AnsiErase(int value) { - this.value = value; - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/jmx/CreateIndexBean.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/jmx/CreateIndexBean.java deleted file mode 100644 index 5e1a4f4c..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/jmx/CreateIndexBean.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.ci.log.jmx; - -import lombok.Synchronized; -import org.springframework.jmx.export.annotation.ManagedAttribute; -import org.springframework.jmx.export.annotation.ManagedResource; -import org.springframework.stereotype.Component; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author by mianbin - * @Classname CreateIndexBean - * @Description TODO - * @Date 2025/3/20 10:25 - */ -@Component -@ManagedResource(objectName = "ops.ci.log.v2:type=index,operation=create", description = "log create index performance") -public class CreateIndexBean { - private AtomicLong executeCount = new AtomicLong(0); - private AtomicLong executeElapse = new AtomicLong(0); - private AtomicLong calculateCount = new AtomicLong(0); - private AtomicLong failureCount = new AtomicLong(0); - - @Synchronized - public void execute(long elapse, boolean success) { - executeCount.incrementAndGet(); - calculateCount.incrementAndGet(); - executeElapse.addAndGet(elapse); - if (!success) { - failureCount.incrementAndGet(); - } - } - - @Synchronized - @ManagedAttribute - public double getCreateIndexPerformance() { - long elapse = executeElapse.getAndSet(0); - long count = calculateCount.getAndSet(0); - if (count == 0L) { - return 0L; - } else { - return (double) elapse / count; - } - } - - @ManagedAttribute - public long getExecuteCount() { - return executeCount.get(); - } - - @ManagedAttribute - public long getFailureCount() { - return failureCount.get(); - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/jmx/LogStorageBean.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/jmx/LogStorageBean.java deleted file mode 100644 index 79207dd5..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/jmx/LogStorageBean.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.ci.log.jmx; - -import lombok.Synchronized; -import org.springframework.jmx.export.annotation.ManagedResource; -import org.springframework.stereotype.Component; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author by mianbin - * @Classname LogStorageBean - * @Description * 日志保存模块,主要是使用原子类和 synchronized 关键字来保证并发性,记录每个操作的次数。 - * @Date 2025/3/20 10:26 - */ -@Component -@ManagedResource(objectName = "ops.ci.log.v2:type=logs", description = "log performance") -public class LogStorageBean { - - private AtomicLong batchWriteCount = new AtomicLong(0); - private AtomicLong batchWriteElapse = new AtomicLong(0); - private AtomicLong calculateCount = new AtomicLong(0); - private AtomicLong failureCount = new AtomicLong(0); - private AtomicLong bulkRequestCount = new AtomicLong(0); - private AtomicLong bulkRequestElapse = new AtomicLong(0); - private AtomicLong bulkRequestFailureCount = new AtomicLong(0); - private AtomicLong queryLogCount = new AtomicLong(0); - private AtomicLong queryLogElapse = new AtomicLong(0); - private AtomicLong queryCalculateCount = new AtomicLong(0); - private AtomicLong queryFailureCount = new AtomicLong(0); - private AtomicLong downloadLogCount = new AtomicLong(0); - private AtomicLong downloadLogElapse = new AtomicLong(0); - private AtomicLong downloadCalculateCount = new AtomicLong(0); - private AtomicLong downloadFailureCount = new AtomicLong(0); - - @Synchronized - public void query(Long elapse, boolean success) { - queryLogCount.incrementAndGet(); - queryCalculateCount.incrementAndGet(); - queryLogElapse.addAndGet(elapse); - if (!success) { - queryFailureCount.incrementAndGet(); - } - } - - @Synchronized - public void batchWrite(long elapse, boolean success) { - batchWriteCount.incrementAndGet(); - calculateCount.incrementAndGet(); - batchWriteElapse.addAndGet(elapse); - if (!success) { - failureCount.incrementAndGet(); - } - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/IEvent.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/IEvent.java deleted file mode 100644 index 14318012..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/IEvent.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.ci.log.log; - -import org.springframework.context.ApplicationEvent; - -/** - * @author by mianbin - * @Classname IEvent - * @Description 日志事件,现在暂时使用这种方式 - * @Date 2025/3/20 10:38 - */ -public abstract class IEvent { -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/ILogEvent.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/ILogEvent.java deleted file mode 100644 index 54e2f434..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/ILogEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.log.log; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * @author by mianbin - * @Classname ILogEvent - * @Description TODO - * @Date 2025/3/20 10:45 - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class ILogEvent extends IEvent { - - protected String buildId; - protected int retryTime; - protected int delayMills; - protected static int DELAY_DURATION_MILLS = 3 * 1000; - - public int getNextDelayMills(int retryTime) { - return DELAY_DURATION_MILLS * (3 - retryTime); - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogOriginEvent.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogOriginEvent.java deleted file mode 100644 index ef1a80a5..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogOriginEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.log.log; - -import cd.casic.ci.log.dal.pojo.message.LogMessage; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; - - -import java.util.List; - -/** - * @author by mianbin - * @Classname LogOriginEvent - * @Description 目前不是广播事件,留着后面用mq时候会用到。 - * @Date 2025/3/20 10:47 - */ -@Data -@AllArgsConstructor -@EqualsAndHashCode(callSuper = true) -public class LogOriginEvent extends ILogEvent { - private String buildId; - private List logs; - private int retryTime = 2; - private int delayMills = 0; - - public LogOriginEvent(String buildId, List logs) { - this.buildId = buildId; - this.logs = logs; - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogStatusEvent.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogStatusEvent.java deleted file mode 100644 index bbeb0157..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogStatusEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.log.log; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname LogStatusEvent - * @Description 目前不是广播事件,留着后面用mq时候会用到。 - * @Date 2025/3/20 10:49 - */ -@Data -@AllArgsConstructor -public class LogStatusEvent extends ILogEvent{ - private String buildId; - private Boolean finished; - private String tag; - private String subTag; - private String jobId; - private int executeCount; - private int retryTime = 2; - private int delayMills = 0; -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogStorageEvent.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogStorageEvent.java deleted file mode 100644 index 26d764a2..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/log/LogStorageEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.log.log; - -import cd.casic.ci.log.dal.pojo.message.LogMessageWithLineNo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.List; - -/** - * @author by mianbin - * @Classname LogStorageEvent - * @Description 目前不是广播事件,留着后面用mq时候会用到。 - * @Date 2025/3/20 10:50 - */ -@Data -@AllArgsConstructor -@EqualsAndHashCode(callSuper = true) -public class LogStorageEvent extends ILogEvent { - - private String buildId; - private List logs; - private int retryTime = 2; - private int delayMills = 0; - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogListenerService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogListenerService.java deleted file mode 100644 index fd960ae7..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogListenerService.java +++ /dev/null @@ -1,99 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.log.LogStorageEvent; -import cd.casic.ci.log.log.LogOriginEvent; -import cd.casic.ci.log.log.LogStatusEvent; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.util.Strings; -import org.springframework.stereotype.Service; - -/** - * @author by mianbin - * @Classname BuildLogListenerService - * @Description TODO - * @Date 2025/3/20 15:30 - */ -@Slf4j -@Service -public class BuildLogListenerService { - @Resource - private LogService logService; - - @Resource - private IndexService indexService; - - @Resource - private BuildLogPrintService buildLogPrintService; - - public void handleEvent(LogOriginEvent event) { - boolean result = false; - try { - logService.addLogEvent(event); - result = true; - } catch (Throwable ignored) { - log.warn("Fail to add the log event" + event.getBuildId(), ignored); - } finally { - // 如果结果不对 - if (!result && event.getRetryTime() >= 0) { - log.warn("Retry to add the log event " + event.getBuildId() + "time left:" + event.getRetryTime()); -// buildLogPrintService.dispatchEvent( -// new LogOriginEvent( -// event.getBuildId(), -// event.getLogs(), -// // 获取下一次事件的间隔 -// event.getRetryTime() - 1, -// event.getNextDelayMills(event.getDelayMills()) -// ) -// ); - } - } - } - - // 处理日志储存事件 - public void handleEvent(LogStorageEvent event) { - boolean result = false; - try { - logService.addBatchLogEvent(event); - result = true; - } catch (Throwable ignored) { - log.warn("Fail to add the log batch event " + event.getBuildId(), ignored); - } finally { - // 如果结果不对,那就重试 - if (!result && event.getRetryTime() >= 0) { - log.warn("Retry to add the log batch event " + event.getBuildId() + "time left:" + event.getRetryTime()); -// buildLogPrintService.dispatchEvent( -// new LogStorageEvent( -// event.getBuildId(), -// event.getLogs(), -// // 获取下一次事件的间隔 -// event.getRetryTime() - 1, -// event.getNextDelayMills(event.getDelayMills()) -// ) -// ); - } - } - } - - // 处理日志状态事件 - public void handleEvent(LogStatusEvent event) { - boolean result = false; - try { - logService.updateLogStatus(event); - // #3089 当收到构建级别的状态刷新时,清理缓存并保存行数 - if (Strings.isBlank(event.getJobId()) && Strings.isBlank(event.getTag())) { - indexService.flushLineNum2DB(event.getBuildId()); - } - result = true; - } catch (Throwable ignored) { - log.warn("Fail to add the multi lines [" + event.getBuildId() + "|" + event.getRetryTime() + "]", ignored); - } finally { - // 如果结果不对,那就重试 - if (!result && event.getRetryTime() >= 0) { - log.warn("Retry to add the multi lines " + event.getBuildId() + "time left:" + event.getRetryTime()); - - } - } - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogPrintService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogPrintService.java deleted file mode 100644 index 380563bb..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogPrintService.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.log.ILogEvent; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.framework.commons.util.spring.SpringUtils; -import cd.casic.ci.log.dal.pojo.enums.LogErrorCodeEnum; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * @author by mianbin - * @Classname BuildLogPrintService - * @Description 日志打印 - * @Date 2025/3/20 14:57 - */ -@Slf4j -@Service -public class BuildLogPrintService { - // todo, 这里线程池都是使用的默认参数,之后可以载入 logServiceConfig 在配置文件里面对参数进行修改 - private ThreadPoolExecutor logExecutorService = new ThreadPoolExecutor( - 100, - 100, - 0L, - TimeUnit.MILLISECONDS, - new LinkedBlockingQueue(1000)); - - public void dispatchEvent(ILogEvent event) { - SpringUtils.publishEvent(event); - } - - // 异步打印日志 - public CommonResult asyncDispatchEvent(ILogEvent event) { - // todo 检测配置文件,如果没有开启日志保存,进行的一些处理 - try { - // 从线程池里面拿一个线程出来处理这个事件 - logExecutorService.execute(() -> { - System.out.println("BuildLogPrintService[ " + event.getBuildId() + "] " + event.toString()); -// dispatchEvent(event); - }); - return CommonResult.success(true); - } catch (RejectedExecutionException e) { - // 队列满时的处理逻辑 - log.error( - "BKSystemErrorMonitor | BuildLogPrintService[ " + event.getBuildId() + "] " + - "asyncDispatchEvent failed with queue tasks exceed the limit", e); - return CommonResult.error(509, LogErrorCodeEnum.PRINT_QUEUE_LIMIT.formatErrorMessage); - } - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogQueryService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogQueryService.java deleted file mode 100644 index 4239b539..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogQueryService.java +++ /dev/null @@ -1,178 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.dal.pojo.*; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.dal.pojo.enums.LogStatusEnum; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.ci.log.jmx.LogStorageBean; -import jakarta.annotation.Resource; -import org.springframework.http.ResponseEntity; - -/** - * @author by mianbin - * @Classname BuildLogQueryService - * @Description TODO - * @Date 2025/3/20 14:59 - */ -public class BuildLogQueryService { - - @Resource - private LogService logService; - @Resource - private LogStatusService logStatusService; - @Resource - private IndexService indexService; - @Resource - private LogStorageBean logStorageBean; - - public CommonResult getInitLogs(String userId, String projectId, String pipelineId, - String buildId, boolean debug, LogType logType, String tag, String jobId, int executeCount, String subTag) { - // todo 鉴权代码 - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW); - long startEpoch = System.currentTimeMillis(); - boolean success = false; - try { - QueryLogs result = logService.queryInitLogs(buildId, debug, logType, tag, subTag, jobId, executeCount); - // 设置查出来使用的时间 - result.setTimeUsed(System.currentTimeMillis() - startEpoch); - // 判断当前查出来的日志的状态 - success = logStatusSuccess(result.getStatus()); - QueryLogs queryLogs = result; - return CommonResult.success(queryLogs); - } finally { - logStorageBean.query(System.currentTimeMillis() - startEpoch, success); - } - } - - public CommonResult getInitLogsPage(String userId, String projectId, String pipelineId, - String buildId, boolean debug, LogType logType, String tag, String jobId, int executeCount, - int page, int pageSize, String subTag) { - // todo 鉴权代码 - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW); - long startEpoch = System.currentTimeMillis(); - boolean success = false; - try { - PageQueryLogs result = logService.queryInitLogsPage(buildId, debug, logType, tag, subTag, jobId, executeCount,page,pageSize); - // 设置查出来使用的时间 - result.setTimeUsed(System.currentTimeMillis() - startEpoch); - // 判断当前查出来的日志的状态 - success = logStatusSuccess(result.getStatus()); - return CommonResult.success(result); - } finally { - logStorageBean.query(System.currentTimeMillis() - startEpoch, success); - } - } - - public CommonResult getMoreLogs(String userId, String projectId, String pipelineId, String buildId, boolean debug, - LogType logType, int num, boolean fromStart, long start, long end, String tag, String jobId, int executeCount,String subTag) { - // todo 鉴权代码 -// validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW) - long startEpoch = System.currentTimeMillis(); - boolean success = false; - try { - QueryLogs result = logService.queryLogsBetweenLines(buildId,num,fromStart,start,end, debug, logType, tag, subTag, jobId, executeCount); - // 设置查出来使用的时间 - result.setTimeUsed(System.currentTimeMillis() - startEpoch); - // 判断当前查出来的日志的状态 - success = logStatusSuccess(result.getStatus()); - return CommonResult.success(result); - } finally { - logStorageBean.query(System.currentTimeMillis() - startEpoch, success); - } - } - - public CommonResult getAfterLogs(String userId, String projectId, String pipelineId, String buildId, - long start, boolean debug, LogType logType, String tag, String jobId, int executeCount,String subTag) { - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW) - long startEpoch = System.currentTimeMillis(); - boolean success = false; - try { - QueryLogs result = logService.queryLogsAfterLine(buildId,start,debug,logType,tag, subTag, jobId, executeCount); - // 设置查出来使用的时间 - result.setTimeUsed(System.currentTimeMillis() - startEpoch); - // 判断当前查出来的日志的状态 - success = logStatusSuccess(result.getStatus()); - return CommonResult.success(result); - } finally { - logStorageBean.query(System.currentTimeMillis() - startEpoch, success); - } - } - - public CommonResult getBeforeLogs(String userId, String projectId, String pipelineId, String buildId, - long end, boolean debug, LogType logType, int size, String tag, String jobId, int executeCount, String subTag) { - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW) - long startEpoch = System.currentTimeMillis(); - boolean success = false; - try { - QueryLogs result = logService.queryLogsBeforeLine(buildId,end,size,debug,logType,tag, subTag, jobId, executeCount); - // 设置查出来使用的时间 - result.setTimeUsed(System.currentTimeMillis() - startEpoch); - // 判断当前查出来的日志的状态 - success = logStatusSuccess(result.getStatus()); - return CommonResult.success(result); - } finally { - logStorageBean.query(System.currentTimeMillis() - startEpoch, success); - } - } - - public CommonResult getEndLogsPage(String userId, String projectId, String pipelineId, String buildId, - int size, boolean debug, LogType logType, String tag, String jobId, int executeCount, String subTag) { - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW) - long startEpoch = System.currentTimeMillis(); - boolean success = false; - try { - EndPageQueryLogs result = logService.getEndLogsPage(pipelineId,buildId,debug,logType,tag, subTag, jobId, executeCount,size); - // 设置查出来使用的时间 - result.setTimeUsed(System.currentTimeMillis() - startEpoch); - // 判断当前查出来的日志的状态 - success = logStatusSuccess(result.getStatus()); - return CommonResult.success(result); - } finally { - logStorageBean.query(System.currentTimeMillis() - startEpoch, success); - } - } - - public CommonResult getBottomLogs(String userId, String projectId, String pipelineId, String buildId, - int size, boolean debug, LogType logType, String tag, String jobId, int executeCount, String subTag) { - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW) - long startEpoch = System.currentTimeMillis(); - boolean success = false; - try { - QueryLogs result = logService.getBottomLogs(pipelineId,buildId,debug,logType,tag, subTag, jobId, executeCount,size); - // 设置查出来使用的时间 - result.setTimeUsed(System.currentTimeMillis() - startEpoch); - // 判断当前查出来的日志的状态 - success = logStatusSuccess(result.getStatus()); - return CommonResult.success(result); - } finally { - logStorageBean.query(System.currentTimeMillis() - startEpoch, success); - } - } - - public CommonResult getLogMode(String userId, String projectId, String pipelineId, String buildId, String tag, int executeCount) { - // 鉴权 - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW) - // 这里的 executeCount 默认为1 - return CommonResult.success(logStatusService.getStorageMode(buildId,tag,executeCount)); - } - - // 获取当前构建的最大行号 - public CommonResult getLastLineNum(String userId, String projectId, String pipelineId, String buildId) { - // validateAuth(userId, projectId, pipelineId, buildId, AuthPermission.VIEW) - long lastLineNum = indexService.getLastLineNum(buildId); - boolean finished = logStatusService.isFinish(buildId, null, null, null, 1); - QueryLogLineNum res = new QueryLogLineNum(buildId, finished, lastLineNum); - return CommonResult.success(res); - } - - private boolean logStatusSuccess(int logStatus) { - return LogStatusEnum.parse(logStatus) == LogStatusEnum.EMPTY || - LogStatusEnum.parse(logStatus) == LogStatusEnum.SUCCEED; - } - - public ResponseEntity downloadLogs(String userId, String projectId, String pipelineId, String buildId, - String tag, String jobId, int executeCount, String finaName, String subTag) { - return null; - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/IndexService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/IndexService.java deleted file mode 100644 index a3fc91b2..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/IndexService.java +++ /dev/null @@ -1,180 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.dal.dao.IndexMapper; -import cd.casic.framework.redis.core.RedisTemplateUtils; -import cd.casic.ci.log.dal.dataobject.LogIndicesV2; -import com.github.benmanes.caffeine.cache.Caffeine; -import com.github.benmanes.caffeine.cache.LoadingCache; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.util.Strings; -import org.redisson.RedissonRedLock; -import org.redisson.api.RLock; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import java.util.concurrent.TimeUnit; - -/** - * @author by mianbin - * @Classname IndexService - * @Description TODO - * @Date 2025/3/20 10:53 - */ -@Slf4j -@Service -public class IndexService { - - @Resource - private IndexMapper indexMapper; - - @Resource - private RedissonClient redissonClient; - - @Resource - private RedisTemplateUtils redisTemplateUtils; - - private static String LOG_INDEX_LOCK = "log:build:enable:lock:key"; - private static String LOG_LINE_NUM = "log:build:line:num:"; - private static String LOG_LINE_NUM_LOCK = "log:build:line:num:distribute:lock"; - private static Long INDEX_CACHE_MAX_SIZE = 100000L; - private static Long INDEX_CACHE_EXPIRE_MINUTES = 30L; - private static Long INDEX_LOCK_EXPIRE_SECONDS = 10L; - - // 返回 redis Key - public static String getLineNumRedisKey(String buildId) { - return LOG_LINE_NUM + buildId; - } - - // Caffeine 本地数据库,不存在数据时自动添加 - private LoadingCache indexCache = Caffeine.newBuilder() - .maximumSize(INDEX_CACHE_MAX_SIZE) - .expireAfterAccess(INDEX_CACHE_EXPIRE_MINUTES, TimeUnit.MINUTES) - .build(key -> initialIndex(key)); - - // 如果不存在初始化 index 方法 - private String initialIndex(String buildId) { - String indexName = indexMapper.getIndexName(buildId); - - // 如果数据库里面都不存在 indexName,就使用分布式锁在数据库里面新增 - if (Strings.isBlank(indexName)){ - String lockKey = LOG_INDEX_LOCK + ":" + buildId; - RLock lock = redissonClient.getLock(lockKey); - RedissonRedLock redLock = new RedissonRedLock(lock); - try{ - redLock.lock(); - // 二次验证,防止重复 - indexName = indexMapper.getIndexName(buildId); - if (Strings.isBlank(indexName)){ - log.info(buildId + " Add the build record"); - indexName = saveIndex(buildId); - } - } finally { - lock.unlock(); - } - } - return indexName; - } - - // 保存index到 数据库 和 Redis 里面去,最后返回值保存在 Caffeine 里面 - private String saveIndex(String buildId) { - String indexName = indexMapper.getIndexName(buildId); - // 保存到 mongo - indexMapper.create(buildId,indexName,true); - // 保存到 redis - redisTemplateUtils.set(getLineNumRedisKey(buildId),"1",TimeUnit.DAYS.toSeconds(2)); - - log.info("["+buildId+"|"+indexName+"] Create new index in db and cache"); - - return indexName; - } - - public String getIndexName(String buildId) { - // 这里的 get 如果不存在就会初始化调用 initialIndex 方法 - String index = indexCache.get(buildId); - if (Strings.isBlank(index)) { - log.error("Fail to get the index of build from caffeine cache:" + buildId); - index = "testId"; - } - return index; - } - - public long getAndAddLineNum(String buildId, int size) { - // 获得并发锁 - RLock lock = redissonClient.getLock("$LOG_LINE_NUM_LOCK:$buildId"); - RedissonRedLock redissonRedLock = new RedissonRedLock(lock); - try { - redissonRedLock.lock(); - Object lineNum = redisTemplateUtils.get(getLineNumRedisKey(buildId)); - // 缓存命中则直接进行自增,缓存未命中则从db中取值,自增后再刷新缓存 - if (lineNum == null) { - log.warn("[" + buildId + "|[" + size + "] Fail to get and add the line num, get from db"); - // 从 indexMapper 里面取出 - LogIndicesV2 build = indexMapper.getBuild(buildId); - if (build == null) { - log.warn("[" + buildId + "|[" + size + "] The build is not exist in db"); - return -1; - } - log.warn("[" + buildId + "|" + size + "] Got from db, lastLineNum: " + build.getLastLineNum()); - lineNum = build.getLastLineNum() + size; - redisTemplateUtils.set(getLineNumRedisKey(buildId), lineNum, TimeUnit.DAYS.toSeconds(2)); - return build.getLastLineNum(); - } else { - lineNum = redisTemplateUtils.incr(getLineNumRedisKey(buildId), size); - } - return (long) lineNum - size; - } finally { - redissonRedLock.unlock(); - } - } - - public String getBuildIndexName(String buildId){ - LogIndicesV2 logIndices = indexMapper.getBuild(buildId); - if (logIndices == null) { - return ""; - } - return logIndices.getIndexName(); - } - - public long getLastLineNum(String buildId) { - Object number = redisTemplateUtils.get(getLineNumRedisKey(buildId)); - if (number != null) { - return (long) number; - } - log.error("Redis can't find the lineNumber"); - - // 如果为空就从数据库里面去取 - LogIndicesV2 build = indexMapper.getBuild(buildId); - if (build != null) { - return build.getLastLineNum(); - } - - // 如果还为空就返回0 - return 0; - } - - // 清理缓存并保存行数 - public void flushLineNum2DB(String buildId) { - String lineNum = (String) redisTemplateUtils.get(getLineNumRedisKey(buildId)); - if (Strings.isBlank(lineNum)) { - log.warn("[$buildId] Fail to get lineNum from redis"); - return; - } - // 看数据是否合法 - long latestLineNum = 0; - try { - latestLineNum = Long.parseLong(lineNum); - } catch (Exception e) { - log.warn("[" + buildId + "|" + lineNum + "] Fail to convert line num to long", e); - return; - } - // 如果更新成功 - if (indexMapper.updateLastLineNum(buildId, latestLineNum)) { - redisTemplateUtils.del(getLineNumRedisKey(buildId)); - } else { - log.warn("[" + buildId + "|" + latestLineNum + "] Fail to update the build latest line num"); - } - } - - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogService.java deleted file mode 100644 index 58f1b67a..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogService.java +++ /dev/null @@ -1,109 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.dal.pojo.EndPageQueryLogs; -import cd.casic.ci.log.dal.pojo.PageQueryLogs; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import cd.casic.ci.log.log.LogStorageEvent; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.ci.log.log.LogOriginEvent; -import cd.casic.ci.log.log.LogStatusEvent; - -/** - * @author by mianbin - * @Classname LogService - * @Description TODO - * @Date 2025/3/20 10:31 - */ -public interface LogService { - - QueryLogs queryInitLogs( - String buildId, - boolean debug, - LogType logType, - String tag, - String subTag, - String jobId, - int executeCount - ); - - QueryLogs queryLogsBetweenLines( - String buildId, - int num, - boolean fromStart, - long start, - long end, - boolean debug, - LogType logType, - String tag, - String subTag, - String jobId, - int executeCount - ); - - QueryLogs queryLogsAfterLine( - String buildId, - long start, - boolean debug, - LogType logType, - String tag, - String subTag, - String jobId, - int executeCount - ); - - PageQueryLogs queryInitLogsPage( - String buildId, - boolean debug, - LogType logType, - String tag, - String subTag, - String jobId, - int executeCount, - int page, - int pageSize - ); - - QueryLogs queryLogsBeforeLine( - String buildId, - long end, - int size, - boolean debug, - LogType logType, - String tag, - String subTag, - String jobId, - int executeCount - ); - - EndPageQueryLogs getEndLogsPage( - String pipelineId, - String buildId, - boolean debug, - LogType logType, - String tag, - String subTag, - String jobId, - int executeCount, - int size - ); - - QueryLogs getBottomLogs( - String pipelineId, - String buildId, - boolean debug, - LogType logType, - String tag, - String subTag, - String jobId, - int executeCount, - int size - ); - - - void addLogEvent(LogOriginEvent event); - - void addBatchLogEvent(LogStorageEvent event); - - void updateLogStatus(LogStatusEvent event); - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogServiceImpl.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogServiceImpl.java deleted file mode 100644 index 325d38d8..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogServiceImpl.java +++ /dev/null @@ -1,238 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.dal.pojo.EndPageQueryLogs; -import cd.casic.ci.log.dal.pojo.PageQueryLogs; -import cd.casic.ci.log.dal.pojo.QueryLogs; -import cd.casic.ci.log.log.LogStorageEvent; -import cd.casic.ci.log.dal.pojo.enums.LogType; -import cd.casic.ci.log.log.LogOriginEvent; -import cd.casic.ci.log.log.LogStatusEvent; -import cd.casic.ci.log.jmx.CreateIndexBean; -import cd.casic.ci.log.jmx.LogStorageBean; -import cd.casic.ci.log.dal.pojo.message.LogMessage; -import cd.casic.ci.log.dal.pojo.message.LogMessageWithLineNo; -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.redisson.RedissonRedLock; -import org.redisson.api.RLock; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * @author by mianbin - * @Classname LogServiceImpl - * @Description TODO - * @Date 2025/3/20 10:52 - */ -@Slf4j -@Service -public class LogServiceImpl implements LogService { - @Resource - private IndexService indexService; - @Resource - private LogStatusService logStatusService; - @Resource - private LogTagService logTagService; - @Resource - private CreateIndexBean createIndexBean; - @Resource - private LogStorageBean logStorageBean; - @Resource - private BuildLogPrintService buildLogPrintService; - @Resource - private RedissonClient redissonClient; - - private static long LONG_SEARCH_TIME = 64000; - private static long SHORT_SEARCH_TIME = 32000; - private static long SEARCH_TIMEOUT_SECONDS = 60L; - private static long SEARCH_FRAGMENT_SIZE = 100000; - private static long INDEX_CACHE_MAX_SIZE = 100000L; - private static long INDEX_CACHE_EXPIRE_MINUTES = 30L; - private static long INDEX_LOCK_EXPIRE_SECONDS = 10L; - private static long INDEX_STORAGE_WARN_MILLIS = 1000; - private Cache indexCache = Caffeine.newBuilder() - .maximumSize(INDEX_CACHE_MAX_SIZE).expireAfterAccess(INDEX_CACHE_EXPIRE_MINUTES, TimeUnit.MINUTES) - .build(); - - @Override - public void addLogEvent(LogOriginEvent event) { -// List logMessage = addLineNo(event.getBuildId(),event.getLogs()); - -// if (!logMessage.isEmpty()) { -// buildLogPrintService.dispatchEvent(new LogStorageEvent(event.getBuildId(), logMessage)); -// } - } - - @Override - public void addBatchLogEvent(LogStorageEvent event) { - long currentEpoch = System.currentTimeMillis(); - boolean success = false; - try { - // todo 提前准备索引 - prepareIndex(event.getBuildId()); - List logMessages = event.getLogs(); - List buf = new ArrayList<>(); - // 遍历日志信息 - for (LogMessageWithLineNo logMessage : logMessages) { - buf.add(logMessage); -// if (buf.size() == Constants.BULK_BUFFER_SIZE){ -// // 添加多行日志 -// if (doAddMultiLines(buf,event.getBuildId()) == 0){ -// throw new Exception( -// "None of lines is inserted successfully to ES " + -// "["+event.getBuildId()+"|"+event.getRetryTime()+"}]" -// ); -// } else { -// buf.clear(); -// } -// } - } - if (!buf.isEmpty()) { - if (doAddMultiLines(buf, event.getBuildId()) == 0) { - throw new Exception("None of lines is inserted successfully to ES" + "[" + event.getBuildId() + "|" + event.getRetryTime() + "}]"); - } - } - success = true; - } catch (Exception e) { - e.printStackTrace(); - } finally { - long elapse = System.currentTimeMillis() - currentEpoch; - logStorageBean.batchWrite(elapse, success); - - // #4265 当日志消息处理时间过长时打印消息内容 - if (elapse >= INDEX_STORAGE_WARN_MILLIS && !event.getLogs().isEmpty()) { - log.warn("[" + event.getBuildId() + "] addBatchLogEvent spent too much time(" + elapse + ") with tag=" + event.getLogs().get(0).getTag() + "}"); - } - } - } - - private int doAddMultiLines(List buf, String buildId) { - return 0; - } - - // todo 在ES里面创建index - private void createIndex(String buildId, String index) { - - } - - // todo 给ES数据库存消息 - private boolean isExistIndex(String buildId, String index) { - return true; - } - - @Override - public QueryLogs queryInitLogs(String buildId, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - return doQueryInitLogs(buildId, debug, logType, tag, subTag, jobId, executeCount); - } - - private QueryLogs doQueryInitLogs(String buildId, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - // todo 从 ES 数据库里面取出数据 - return null; - } - - @Override - public QueryLogs queryLogsBetweenLines(String buildId, int num, boolean fromStart, long start, long end, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - return null; - } - - @Override - public QueryLogs queryLogsAfterLine(String buildId, long start, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - return null; - } - - @Override - public PageQueryLogs queryInitLogsPage(String buildId, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount, int page, int pageSize) { - return null; - } - - @Override - public QueryLogs queryLogsBeforeLine(String buildId, long end, int size, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount) { - return null; - } - - @Override - public EndPageQueryLogs getEndLogsPage(String pipelineId, String buildId, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount, int size) { - return null; - } - - @Override - public QueryLogs getBottomLogs(String pipelineId, String buildId, boolean debug, LogType logType, String tag, String subTag, String jobId, int executeCount, int size) { - return null; - } - - @Override - public void updateLogStatus(LogStatusEvent event) { -// logStatusService.finish(event.getBuildId(),event.getTag(),event.getSubTag(), -// event.getJobId(),event.getExecuteCount(),event.getLogStorageMode(),event.getFinished()); - } - - private List addLineNo(String buildId, List logMessages) { - long lineNum = indexService.getAndAddLineNum(buildId, logMessages.size()); - - if (lineNum == -1) { - log.error("Got null logIndex from indexService, buildId: " + buildId); - return new ArrayList<>(); - } - // 不为空的话 - long startLineNum = lineNum; - List res = new ArrayList<>(); - // 遍历 logMessages - for (LogMessage logMessage : logMessages) { - // 设置 timestamp - long timestamp = logMessage.getTimestamp(); - if (timestamp == 0L) { - timestamp = System.currentTimeMillis(); - } - // 如果 tag 不为空 - if (!StringUtils.isEmpty((logMessage.getSubTag()))) { - logTagService.saveSubTag(buildId, logMessage.getTag(), logMessage.getSubTag()); - } - //todo 这个传参先null,后面再弄 - res.add(new LogMessageWithLineNo(logMessage.getTag(), logMessage.getSubTag(), - logMessage.getJobId(), logMessage.getMessage(), - timestamp, logMessage.getLogType(), startLineNum++, logMessage.getExecuteCount(), null, null) - ); - } - return res; - } - - private boolean prepareIndex(String buildId) { - String index = indexService.getIndexName(buildId); - if (!checkIndexCreate(buildId, index)) { - createIndex(buildId, index); - indexCache.put(index, true); - return true; - } - return true; - } - - private boolean checkIndexCreate(String buildId, String index) { - if (indexCache.getIfPresent(index) == true) { - return true; - } - RLock lock = redissonClient.getLock("LOG:index:create:lock:key:$index"); - RedissonRedLock redissonRedLock = new RedissonRedLock(lock); - try { - redissonRedLock.lock(); - if (indexCache.getIfPresent(index) == true) { - return true; - } - // Check from ES - if (isExistIndex(buildId, index)) { - log.info("[" + buildId + "|" + index + "] the index is already created"); - indexCache.put(index, true); - return true; - } - return false; - } finally { - redissonRedLock.unlock(); - } - } -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogStatusService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogStatusService.java deleted file mode 100644 index be973568..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogStatusService.java +++ /dev/null @@ -1,90 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.dal.pojo.QueryLogStatus; -import cd.casic.ci.log.dal.pojo.TaskBuildLogProperty; -import cd.casic.ci.log.dal.dao.LogStatusMapper; -import cd.casic.ci.log.dal.pojo.enums.LogStorageMode; -import cd.casic.ci.log.dal.dataobject.LogStatus; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.util.Strings; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @author by mianbin - * @Classname LogStatusService - * @Date 2025/3/20 14:27 - */ -@Slf4j -@Service -public class LogStatusService { - - @Resource - private LogStatusMapper logStatusMapper; - - public void finish(String buildId, String tag, String subTag, String jobId, int executeCount, LogStorageMode logStorageMode, Boolean finished) { - // todo 当死锁的时候重试 - LogStatus logStatus = new LogStatus(buildId, tag, subTag, jobId, logStorageMode.name(), executeCount, finished); - logStatusMapper.insert(logStatus); - } - - public void updateStorageMode(String buildId, int executeCount, List propertyList) { - // 开始循环更新 - for (TaskBuildLogProperty property : propertyList) { - // 先弄出更新的mode - // 写出更新的后置 where 条件,buildId 和 elementId 和 executeCount 相等 - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery() - .eq(LogStatus::getBuildId, buildId) - .eq(LogStatus::getTag, property.getElementId()) - .eq(LogStatus::getExecuteCount, executeCount); - LogStatus logStatus = logStatusMapper.selectOne(wrapper); - logStatus.setMode(property.getLogStorageMode().name()); - logStatusMapper.update(logStatus, wrapper); - } - } - - public QueryLogStatus getStorageMode(String buildId, String tag, int executeCount) { - // 获取 record - LogStatus record = logStatusMapper.selectOne(Wrappers.lambdaQuery() - .eq(LogStatus::getBuildId, buildId) - .eq(LogStatus::getTag, tag) - .eq(LogStatus::getExecuteCount, executeCount)); - - if (record != null) { - return new QueryLogStatus(buildId, record.getFinished(), LogStorageMode.parse(record.getMode())); - } else { - return new QueryLogStatus(buildId, false, LogStorageMode.UPLOAD); - } - } - - public boolean isFinish(String buildId, String tag, String subTag, String jobId, int executeCount) { - // 判空 - if (tag == null) - tag = ""; - if (subTag == null) - subTag = ""; - // #8804 将db中保存字段兜底为空字符串,方便唯一键冲突判断,也就是 jobId - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() - .eq(LogStatus::getBuildId, buildId) - .eq(LogStatus::getExecuteCount, executeCount); - if (!Strings.isBlank(jobId)) { - queryWrapper.eq(LogStatus::getJobId, jobId) - .eq(LogStatus::getTag, "") - .eq(LogStatus::getSubTag, ""); - } else { - queryWrapper - .eq(LogStatus::getTag, tag) - .eq(LogStatus::getSubTag, subTag); - } - LogStatus res = logStatusMapper.selectOne(queryWrapper); - if (res != null) { - return res.getFinished(); - } - return false; - } - -} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogTagService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogTagService.java deleted file mode 100644 index 8c561d20..00000000 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/LogTagService.java +++ /dev/null @@ -1,102 +0,0 @@ -package cd.casic.ci.log.service; - -import cd.casic.ci.log.dal.dao.LogTahMapper; -import cd.casic.framework.commons.util.json.JsonUtils; -import cd.casic.framework.redis.core.RedisTemplateUtils; -import com.fasterxml.jackson.core.type.TypeReference; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.logging.log4j.util.Strings; -import org.redisson.RedissonRedLock; -import org.redisson.api.RLock; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * @author by mianbin - * @Classname LogTagService - * @Description TODO - * @Date 2025/3/20 14:49 - */ -@Slf4j -@Service -public class LogTagService { - - @Resource - private LogTahMapper logTahMapper; - @Resource - private RedisTemplateUtils redisTemplateUtils; - @Resource - private RedissonClient redissonClient; - - private static String LOG_SUBTAG = "log:build:tag:subTags:"; - private static String LOG_SUBTAG_LOCK = "log:build:tag:subTags:distribute:lock:"; - - public static String getSubTagsRedisKey(String buildId, String tagName) { - return LOG_SUBTAG + genBuildIdAndTagKey(buildId, tagName); - } - - private static String genBuildIdAndTagKey(String buildId, String tagName) { - return buildId + ":" + tagName; - } - - public void saveSubTag(String buildId, String tagName, String subTag) { - // 从 redis 和数据库里面 看是否已经保存 - List originSubTags = getSubTags(buildId, tagName); - // 如果已经保存了 - if (originSubTags != null && originSubTags.contains(subTag)) { - return; - } - - // 如果没有保存,也就是数据库里面没有 - List subTags = new ArrayList<>(); - subTags.add(subTag); - - if (originSubTags != null) { - subTags.addAll(originSubTags); - } - - // 存入数据库 - logTahMapper.save(buildId, tagName, JsonUtils.toJsonString(subTags)); - saveSubTagsToRedis(buildId, tagName, JsonUtils.toJsonString(subTags)); - - log.info("[" + buildId + "|" + tagName + "] Create new subTag in db and redis: " + subTag); - } - - private List getSubTags(String buildId, String tagName) { - // 看 redis 里面有没有 - String subTagsStr = (String) redisTemplateUtils.get(getSubTagsRedisKey(buildId, tagName)); - - if (Strings.isBlank(subTagsStr)) { - // redis 里面没有就看数据库里面有木有 - String subTags = logTahMapper.getSubTags(buildId, tagName); - if (subTags != null) { - // 如果有,就存入 redis 并且返回 - saveSubTagsToRedis(buildId, tagName, subTags); - return JsonUtils.parseObject(subTags, new TypeReference>() { - }); - } - // 没有返回 null - return null; - } else { - return JsonUtils.parseObject(subTagsStr, new TypeReference>() { - }); - } - } - - private void saveSubTagsToRedis(String buildId, String tagName, String subTags) { - RLock lock = redissonClient.getLock(LOG_SUBTAG_LOCK); - RedissonRedLock redisLock = new RedissonRedLock(lock); - try { - redisLock.lock(); - redisTemplateUtils.set(getSubTagsRedisKey(buildId, tagName), subTags, TimeUnit.DAYS.toSeconds(1)); - } finally { - redisLock.unlock(); - } - } - -} diff --git a/modules/module-ci-market/pom.xml b/modules/module-ci-market/pom.xml deleted file mode 100644 index 1f5f1749..00000000 --- a/modules/module-ci-market/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-market - - jar - ${revision} - - - - cd.casic.boot - module-ci-common-pipeline - - - - \ No newline at end of file diff --git a/modules/module-ci-market/src/main/java/cd/casic/ci/event/market/constant/StoreMessageCode.java b/modules/module-ci-market/src/main/java/cd/casic/ci/event/market/constant/StoreMessageCode.java deleted file mode 100644 index 6b7a7204..00000000 --- a/modules/module-ci-market/src/main/java/cd/casic/ci/event/market/constant/StoreMessageCode.java +++ /dev/null @@ -1,135 +0,0 @@ -package cd.casic.ci.event.market.constant; - -/** - * 流水线微服务模块请求返回状态码 - * 返回码制定规则(0代表成功,为了兼容历史接口的成功状态都是返回0): - * 1、返回码总长度为7位, - * 2、前2位数字代表系统名称(如21代表持续集成平台) - * 3、第3位和第4位数字代表微服务模块(00:common-公共模块 01:process-流水线 02:artifactory-版本仓库 03:dispatch-分发 04:dockerhost-docker机器 - * 05:environment-环境 06:experience-版本体验 07:image-镜像 08:log-日志 09:measure-度量 10:monitoring-监控 11:notify-通知 - * 12:openapi-开放api接口 13:plugin-插件 14:quality-质量红线 15:repository-代码库 16:scm-软件配置管理 17:support-支撑服务 - * 18:ticket-证书凭据 19:project-项目管理 20:store-商店 21: auth-权限 22:sign-签名服务 23:metrics-度量服务 24:external-外部 - * 25:prebuild-预建 26: dispatcher-kubernetes 27:buildless 28: lambda 29: stream 30: worker 31: dispatcher-docker - * 32: remotedev 35:misc-杂项) - * 4、最后3位数字代表具体微服务模块下返回给客户端的业务逻辑含义(如001代表系统服务繁忙,建议一个模块一类的返回码按照一定的规则制定) - * 5、系统公共的返回码写在CommonMessageCode这个类里面,具体微服务模块的返回码写在相应模块的常量类里面 - * - * @author by mianbin - * @Classname StoreMessageCode - */ -public class StoreMessageCode { - public static final String MSG_CODE_BUILD_TYPE_PREFIX = "buildType.";// 构建资源类型国际化前缀 - public static final String USER_QUERY_ATOM_PERMISSION_IS_INVALID = "2120001";// 研发商店:没有插件的查看权限 - public static final String USER_QUERY_PROJECT_PERMISSION_IS_INVALID = "2120002";// 研发商店:没有项目的查看权限 - public static final String USER_CREATE_REPOSITORY_FAIL = "2120003";// 研发商店:创建代码库失败,请稍后再试 - public static final String USER_INSTALL_ATOM_CODE_IS_INVALID = "2120004";// 研发商店:安装插件失败 - public static final String USER_REPOSITORY_PULL_TASK_JSON_FILE_FAIL = "2120005";// 研发商店:从[{0}]分支拉取插件配置文件[task.json]失败,请确认是否OAUTH授权、文件是否正确上传代码库等 - public static final String USER_REPOSITORY_TASK_JSON_FIELD_IS_NULL = "2120006";// 研发商店:插件配置文件[task.json]{0}字段不能为空 - public static final String USER_REPOSITORY_TASK_JSON_FIELD_IS_NOT_MATCH = "2120007";// 研发商店:插件配置文件[task.json]{0}字段与工作台录入的不一致 - public static final String USER_ATOM_RELEASE_STEPS_ERROR = "2120008";// 研发商店:插件发布流程状态变更顺序不正确 - public static final String USER_ATOM_VERSION_IS_NOT_FINISH = "2120009";// 研发商店:插件{0}的{1}版本发布未结束,请稍后再试 - public static final String USER_ATOM_VERSION_IS_INVALID = "2120010";// 研发商店:插件升级的版本号{0}错误,应为{1} - public static final String USER_LOGO_SIZE_IS_INVALID = "2120011";// logo的尺寸应为{0}x{1} - public static final String USER_LOGO_TYPE_IS_NOT_SUPPORT = "2120012";// logo不支持{0}类型,可以上传{1}类型 - public static final String UPLOAD_LOGO_IS_TOO_LARGE = "2120013";// 研发商店:上传的logo文件不能超过{0} - public static final String USER_ATOM_CONF_INVALID = "2120014";// 研发商店:插件配置文件{0}格式不正确,错误原因:{1} - public static final String USER_ATOM_VISIBLE_DEPT_IS_INVALID = "2120015";// 研发商店:你不在{0}插件的可见范围之内,请联系插件发布者 - public static final String USER_COMPONENT_ADMIN_COUNT_ERROR = "2120016";// 研发商店:管理员个数不能少于1个 - public static final String ADD_ATOM_PLATFORM_INFO_FAILED = "2120017";// 添加插件对接平台信息失败 - public static final String USER_ATOM_QUALITY_CONF_INVALID = "2120018";// 研发商店:插件配置文件[quality.json]{0}格式不正确,请检查 - public static final String USER_REPOSITORY_PULL_QUALITY_JSON_FILE_FAIL = "2120019";// 研发商店:从[{0}]分支拉取插件配置文件[quality.json]失败,请确认是否OAUTH授权、文件是否正确上传代码库等 - public static final String USER_ATOM_USED = "2120020";// 研发商店:插件{0}已被项目{1}下的流水线使用,不可以卸载 - public static final String USER_ATOM_UNINSTALL_REASON_USED = "2120021";// 研发商店:插件卸载原因{0}已被使用,不能删除。建议禁用 - public static final String USER_COMPONENT_RELEASED_IS_NOT_ALLOW_DELETE = "2120022";// 研发商店:组件{0}已发布到商店,请先下架再删除 - public static final String USER_ATOM_USED_IS_NOT_ALLOW_DELETE = "2120023";// 研发商店:插件{0}已安装到其他项目下使用,请勿移除 - public static final String USER_REPOSITORY_BK_FRONTEND_DIR_IS_NULL = "2120024";// 研发商店:插件代码库文件夹[{0}]未创建 - public static final String USER_ATOM_IS_NOT_ALLOW_USE_IN_PROJECT = "2120025";// 你的项目[{0}]不允许使用插件[{1}],请检查插件是否被正确安装 - public static final String USER_REPOSITORY_TASK_JSON_FIELD_IS_INVALID = "2120026";// 研发商店:插件配置文件[task.json]{0}格式不正确,请检查 - public static final String USER_ATOM_IS_NOT_ALLOW_REPLACE = "2120027";// 研发商店:插件[{0}]的[{1}]版本无法被插件[{2}]的[{3}]版本替换,插件[{2}]的{4}参数无法映射替换 - public static final String USER_TO_ATOM_IS_NOT_BE_HIS_ATOM = "2120028";// 研发商店:目标替换插件不能是历史内置老插件 - public static final String USER_ATOM_NOT_COMPATIBLE_INPUT_FIELD = "2120029";// 研发商店:插件当前版本新增了无默认值的必填入参[{0}],将导致存量流水线执行异常,请修改发布类型进行非兼容式升级 - public static final String USER_ATOM_COMPATIBLE_INPUT_FIELD_CONFIRM = "2120030";// 研发商店:插件当前版本新增了入参[{0}],请确认插件执行逻辑对这些参数不存在或值为空的情况做了兼容处理,否则有可能导致存量流水线执行异常 - public static final String USER_ATOM_COMPATIBLE_OUTPUT_FIELD_CONFIRM = "2120031";// 研发商店:插件当前版本减少了出参[{0}],请确认插件执行逻辑对这些参数不存在或值为空的情况做了兼容处理,否则有可能导致存量流水线执行异常 - public static final String USER_ATOM_INPUT_NUM_IS_TOO_MANY = "2120032";// 研发商店:插件入参数量太多,系统规定的数量最大为:{0} - public static final String USER_ATOM_OUTPUT_NUM_IS_TOO_MANY = "2120033";// 研发商店:插件出参数量太多,系统规定的数量最大为:{0} - public static final String USER_REPOSITORY_TASK_JSON_OS_DEFAULT_ENV_IS_INVALID = "2120034";// 研发商店:配置文件[{0}]{1}操作系统默认环境配置数量为{2}个,默认环境配置数量有且只能为1个 - public static final String USER_REPOSITORY_PULL_ERROR_JSON_FILE_FAIL = "2120035";// 研发商店:从[{0}]分支拉取插件配置文件[error.json]失败,请确认是否OAUTH授权、文件是否正确上传代码库等 - public static final String USER_REPOSITORY_ERROR_JSON_ERROR_CODE_EXIST_DUPLICATE = "2120036";// 研发商店:插件配置文件[error.json]errorCode字段数据重复,请检查{0} - public static final String USER_REPOSITORY_ERROR_JSON_FIELD_IS_INVALID = "2120037";// 研发商店:插件配置文件[error.json]errorCode格式不正确,请检查 - public static final String TASK_JSON_CONFIGURE_FORMAT_ERROR = "2120038";// 参数[{0}] 的{1} ,请检查task.json配置格式是否正确 \n - public static final String GET_ATOM_LANGUAGE_ENV_INFO_FAILED = "2120039";// 获取插件开发语言相关的环境变量信息失败 - ;// 研发商店:插件配置文件[task.json]config配置格式不正确,{0} - public static final String TASK_JSON_CONFIG_IS_INVALID = "2120040";// 研发商店: 拉取文件[{0}]失败,失败原因:{1} - public static final String USER_PULL_FILE_FAIL = "2120041";// 插件包文件[{0}]不存在,请检查文件所在路径是否正确 - public static final String ATOM_PACKAGE_FILE_NOT_FOUND = "2120042"; - public static final String USER_TEMPLATE_VERSION_IS_NOT_FINISH = "2120201";// 研发商店:模板{0}的{1}版本发布未结束,请稍后再试 - public static final String USER_TEMPLATE_RELEASE_STEPS_ERROR = "2120202";// 研发商店:模板发布流程状态变更顺序不正确 - public static final String USER_TEMPLATE_ATOM_VISIBLE_DEPT_IS_INVALID = "2120203";// 研发商店:模板的可见范围不在插件{0}的可见范围之内,如有需要请联系插件的发布者 - public static final String USER_TEMPLATE_ATOM_NOT_INSTALLED = "2120204";// 研发商店:模版下的插件{0}尚未安装,请先安装后再使用 - public static final String USER_TEMPLATE_RELEASED = "2120205";// 研发商店:模版{0}已发布到商店,请先下架再删除 - public static final String USER_TEMPLATE_USED = "2120206";// 研发商店:模版{0}已安装到其他项目下使用,请勿移除 - public static final String USER_TEMPLATE_ATOM_IS_INVALID = "2120207";// 研发商店:模版下的插件{0}不可用,请联系模板发布者 - public static final String USER_TEMPLATE_IMAGE_VISIBLE_DEPT_IS_INVALID = "2120208";// 研发商店:模板的可见范围不在镜像[{0}]的可见范围之内,如有需要请联系镜像的发布者 - public static final String USER_TEMPLATE_IMAGE_IS_INVALID = "2120209";// 研发商店:模版下的镜像{0}不可用,请联系模板发布者 - public static final String USER_INSTALL_TEMPLATE_CODE_IS_INVALID = "2120210";// 研发商店: 商店模板{0}安装到项目[{1}]失败,模板已安装或项目下存在与模板{0}同名的自定义模板,若有同名的自定义模板请修改模板名称后再安装商店模版。 - public static final String USER_IMAGE_VERSION_IS_NOT_FINISH = "2120301";// 研发商店:镜像{0}的{1}版本发布未结束,请稍后再试 - public static final String USER_IMAGE_VERSION_IS_INVALID = "2120302";// 研发商店:镜像升级的版本号{0}错误,应为{1} - public static final String USER_IMAGE_RELEASE_STEPS_ERROR = "2120303";// 研发商店:镜像发布流程中状态变更顺序不正确 - public static final String USER_IMAGE_RELEASED = "2120304";// 研发商店:镜像{0}已发布到商店,请先下架再删除 - public static final String USER_IMAGE_USED = "2120305";// 研发商店:镜像{0}已安装到其他项目下使用,请勿移除 - public static final String USER_IMAGE_NOT_INSTALLED = "2120306";// 研发商店:项目{0}未安装镜像{1},无法使用 - public static final String USER_IMAGE_UNKNOWN_SOURCE_TYPE = "2120307";// 研发商店:镜像原始来源类型未知:{0} - public static final String USER_IMAGE_UNKNOWN_IMAGE_CATEGORY = "2120308";// 镜像范畴未知:{0} - public static final String USER_IMAGE_NOT_EXIST = "2120309";// 镜像[{0}]不存在 - public static final String USER_IMAGE_VERSION_NOT_EXIST = "2120310";// 标识为{0}版本号为{1}的镜像不存在 - public static final String USER_IMAGE_PROJECT_IS_INVALID = "2120311";// 研发商店:容器镜像[{0}]在项目[{1}]下不可用,请联系镜像发布者调整可见范围,调整后手动安装镜像 - public static final String USER_SERVICE_RELEASED_IS_NOT_ALLOW_DELETE = "2120401";// 研发商店:扩展服务{0}已发布到商店,请先下架再删除 - public static final String USER_SERVICE_USED_IS_NOT_ALLOW_DELETE = "2120402";// 研发商店:扩展服务{0}已安装到其他项目下使用,请勿移除 - public static final String USER_SERVICE_VERSION_IS_INVALID = "2120403";// 研发商店:扩展服务升级的版本号{0}错误,应为{1} - public static final String USER_SERVICE_VERSION_IS_NOT_FINISH = "2120404";// 研发商店:扩展服务{0}的{1}版本发布未结束,请稍后再试 - public static final String USER_SERVICE_CODE_DIFF = "2120405";// 研发商店:扩展编码与extension.json文件内编码不一致 - public static final String USER_SERVICE_RELEASE_STEPS_ERROR = "2120406";// 研发商店:扩展服务发布流程状态变更顺序不正确 - public static final String USER_SERVICE_PROJECT_UNENABLE = "2120407";// 研发商店:选中调试项目已被禁用 - public static final String USER_SERVICE_PROJECT_NOT_PERMISSION = "2120408";// 研发商店:选中调试项目无创建流水线权限 - public static final String USER_SERVICE_NOT_EXIST = "2120409";// 研发商店:扩展服务不存在{0} - public static final String USER_ITEM_SERVICE_USED_IS_NOT_ALLOW_DELETE = "2120410";// 研发商店:扩展点下还有可用的扩展服务,不能删除 - public static final String USER_SERVICE_NOT_DEPLOY = "2120411";// 研发商店:用户扩展服务未部署 - public static final String USER_PRAISE_IS_INVALID = "2120901";// 研发商店:你已点赞过 - public static final String USER_PROJECT_IS_NOT_ALLOW_INSTALL = "2120902";// 研发商店:你没有权限将组件安装到项目:{0} - public static final String USER_COMMENT_IS_INVALID = "2120903";// 研发商店:你已评论过,无法继续添加评论。但可以修改原有评论 - public static final String USER_CLASSIFY_IS_NOT_ALLOW_DELETE = "2120904";// 研发商店:该分类下还有正在使用的组件,不允许直接删除 - public static final String USER_APPROVAL_IS_NOT_ALLOW_REPEAT_APPLY = "2120905";// 研发商店:你已有处于待审批或审批通过的申请单,请勿重复申请 - public static final String USER_UPLOAD_PACKAGE_INVALID = "2120906";// 研发商店:请确认上传的包是否正确 - public static final String USER_SENSITIVE_CONF_EXIST = "2120907";// 研发商店:字段名{0}已存在 - public static final String USER_START_CODECC_TASK_FAIL = "2120908";// 研发商店:启动代码扫描任务失败 - public static final String USER_CHANGE_TEST_PROJECT_FAIL = "2120909";// 研发商店:用户[{0}]没有项目[{1}]下的流水线新增/修改/执行权限,请先给用户赋权 - public static final String SENSITIVE_API_PASSED_IS_NOT_ALLOW_CANCEL = "2120910";// 研发商店:敏感API已经审批通过不能取消 - public static final String SENSITIVE_API_APPROVED_IS_NOT_ALLOW_PASS = "2120911";// 研发商店:敏感API已经取消不能审批 - public static final String SENSITIVE_API_NOT_EXIST = "2120912";// 研发商店:敏感API[{0}]不存在 - public static final String USER_HIS_VERSION_UPGRADE_INVALID = "2120913";// 研发商店:当前发布类型下仅能新增历史大版本下的小版本,请修改版本号或者发布类型 - public static final String USER_UPLOAD_FILE_PATH_ERROR = "2120914";// 研发商店:文件路径[{0}]错误 - public static final String USER_ERROR_CODE_INVALID = "2120915";// 研发商店:错误码{0}格式错误 - public static final String USER_LOCALE_FILE_NOT_EXIST = "2120916";// 研发商店:未提供系统[{0}]语言的配置文件 - public static final String NO_COMPONENT_ADMIN_PERMISSION = "2120917";// 无组件{0}管理员权限,请联系组件管理员。 - public static final String GET_INFO_NO_PERMISSION = "2120918";// 无权限访问组件{0}信息,请联系组件管理员获取权限 - public static final String PROJECT_NO_PERMISSION = "2120919";// 无权限,非项目{0}成员或非插件{1}安装人 - public static final String IMAGE_ADD_NO_PROJECT_MEMBER = "2120920";// 无权限新增镜像,不是项目{0}成员 - public static final String IMAGE_PUBLISH_REPO_NO_PERMISSION = "2120921";// 无权限操作公共镜像仓库 - public static final String COMMENT_UPDATE_NO_PERMISSION = "2120922";// 不是该评论的发表人,无权限更新该评论 - public static final String BUILD_VISIT_NO_PERMISSION = "2120923";// 接口请求中的插件【{0}】不是当前当前构建运行的插件 - public static final String VERSION_PUBLISHED = "2120924";// 组件{0}版本({1})已发布 - public static final String NO_COMPONENT_ADMIN_AND_CREATETOR_PERMISSION = "2120925";// 无组件{0}管理员或当前版本创建者权限,请联系组件管理员。 - public static final String USER_NOT_IS_STORE_MEMBER = "2120926";// 研发商店:用户{0}不是组件成员 - public static final String GET_BRANCH_COMMIT_INFO_ERROR = "2120927";// 获取分支提交信息异常 - public static final String STORE_BRANCH_NO_NEW_COMMIT = "2120928";// 代码未变更,分支测试版本生成失败 - public static final String STORE_VERSION_IS_NOT_FINISH = "2120929";// 研发商店:组件[{0}]的[{1}]版本发布未结束,请稍后再试 - public static final String STORE_RELEASE_STEPS_ERROR = "2120930";// 研发商店:组件发布流程中状态变更顺序不正确 - public static final String STORE_PROJECT_COMPONENT_NO_PERMISSION = "2120931";// 研发商店:项目[{0}]没有组件[{1}]的使用权限,请先安装组件 - public static final String STORE_VERSION_IS_INVALID = "2120932";// 研发商店:组件升级的版本号{0}错误,请参照版本号升级规范填入正确版本号 - public static final String STORE_INSTALL_VALIDATE_FAIL = "2120933";// 研发商店: 组件{0}安装校验失败,失败原因:{1} - public static final String STORE_COMPONENT_REPO_FILE_DELETE_FAIL = "2120934";// 研发商店:组件仓库文件删除失败 - ;// 当 queryProjectComponentFlag、installed 或 updateFlag 参数不为空时, projectCode 参数必须非空 - public static final String STORE_QUERY_PARAM_CHECK_FAIL = "2120935"; - public static final String STORE_COMPONENT_IS_NOT_ALLOW_OFFLINE = "2120936";// 研发商店:非发布状态的版本不允许下架 - public static final String STORE_COMPONENT_CODE_REPOSITORY_DELETE_FAIL = "2120937";// 研发商店:代码库删除失败,失败原因:{0} -} diff --git a/modules/module-ci-process-api/pom.xml b/modules/module-ci-process-api/pom.xml deleted file mode 100644 index bcbe5085..00000000 --- a/modules/module-ci-process-api/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-process-api - - ${project.artifactId} - - ${revision} - - jar - - - - cd.casic.boot - module-ci-common-pipeline - - - cd.casic.boot - module-ci-event - - - cd.casic.boot - module-ci-repository - - - cd.casic.boot - module-ci-ticket - - - cd.casic.boot - module-ci-project - - - cd.casic.boot - module-ci-log - - - \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/BuildJobResource.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/BuildJobResource.java deleted file mode 100644 index 73d0fa6a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/BuildJobResource.java +++ /dev/null @@ -1,153 +0,0 @@ -package cd.casic.ci.process.api.engine; - -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.common.pipeline.pojo.JobHeartbeatRequest; -import cd.casic.ci.process.api.engine.pojo.HeartBeatInfo; -import cd.casic.ci.process.api.process.pojo.BuildJobResult; -import cd.casic.ci.process.api.process.pojo.BuildTask; -import cd.casic.ci.process.api.process.pojo.BuildTaskResult; -import cd.casic.ci.process.api.process.pojo.BuildVariables; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import kotlin.Result; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*; - -/** - * @author by mianbin - * @Classname BuildJobResource - * @Description TODO - * @Date 2025/3/31 15:20 - */ -@Tag(name = "ENGINE_BUILD_JOB", description = "引擎-构建机请求|此接口不接受服务间Feign,只接受构建机处请求") -@RestController -@RequestMapping("/build/worker") -public interface BuildJobResource { - - @Operation(summary = "构建机器启动成功") - @PutMapping("/started") - Result jobStarted( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "构建机名称", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_NAME) String vmName, - @Parameter(description = "网络问题导致的重试次数", required = false) - @RequestParam(value = "retryCount", required = false) String retryCount - ); - - @Operation(summary = "构建机请求获取任务") - @GetMapping("/claim") - Result claimTask( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "构建机名称", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_NAME) String vmName - ); - - @Operation(summary = "构建机Job完成任务") - @PostMapping("/complete") - Result completeTask( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "构建机名称", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_NAME) String vmName, - @Parameter(description = "执行结果", required = true) - @RequestBody BuildTaskResult result - ); - - @Operation(summary = "结束构建机Job") - @PostMapping("/end") - Result jobEnd( - @Parameter(description = "项目ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "构建机名称", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_NAME) String vmName, - @Parameter(description = "执行结果", required = false) - @RequestBody(required = false) BuildJobResult result - ); - - @Operation(summary = "Job超时触发") - @PostMapping("/timeout") - Result jobTimeout( - @Parameter(description = "projectId", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "pipelineId", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PIPELINE_ID) String pipelineId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId - ); - - @Operation(summary = "Job心跳请求") - @PostMapping("/heartbeat") - Result jobHeartbeat( - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "构建机名称", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_NAME) String vmName - ); - - @Operation(summary = "Job心跳请求V1版") - @PostMapping("/heartbeat/v1") - Result jobHeartbeatV1( - @Parameter(description = "projectId", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "构建机名称", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_NAME) String vmName, - @Parameter(description = "执行次数", required = false) - @RequestParam(value = "executeCount", required = false) Integer executeCount, - @Parameter(description = "心跳请求报文体", required = false) - @RequestBody(required = false) JobHeartbeatRequest jobHeartbeatRequest - ); - - @Operation(summary = "job异常上报并停止构建") // #5046 增加启动时异常上报,并停止构建,如果网络通的话 - @PostMapping("/submit_error") - Result submitError( - @Parameter(description = "projectId", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "pipelineId", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PIPELINE_ID) String pipelineId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId, - @Parameter(description = "构建环境ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) String vmSeqId, - @Parameter(description = "执行结果", required = true) - @RequestBody ErrorInfo errorInfo - ); - - @Operation(summary = "获取当前构建的构建详情页") - @GetMapping("/detail_url") - Result getBuildDetailUrl( - @Parameter(description = "projectId", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PROJECT_ID) String projectId, - @Parameter(description = "pipelineId", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_PIPELINE_ID) String pipelineId, - @Parameter(description = "构建ID", required = true) - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) String buildId - ); -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/atom/IAtomTask.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/atom/IAtomTask.java deleted file mode 100644 index 38b55b76..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/atom/IAtomTask.java +++ /dev/null @@ -1,191 +0,0 @@ -package cd.casic.ci.process.api.engine.atom; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.ErrorCode; -import cd.casic.ci.common.pipeline.pojo.ErrorType; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.process.api.engine.common.Timeout; -import cd.casic.ci.process.api.engine.common.VMUtils; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildTask; -import cn.hutool.core.date.DateUtil; -import lombok.Getter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import static cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions.RunCondition; - -/** - * @author by mianbin - * @Classname IAtomTask - * @Description TODO - * @Date 2025/3/31 16:01 - */ -public interface IAtomTask { - - Logger logger = LoggerFactory.getLogger(IAtomTask.class); - /** - * 开始执行原子逻辑,一般原子的业务逻辑都在这里处理. - * 请注意: 如果有需要线程大量的循环sleep等待其他处理结果来判断是否成功的逻辑,请拆开到 tryFinish 去做判断 - * 并且在 tryFinish 函数确认返回false,则引擎后续会继续调度 tryFinish 函数来处理. - * 该设计用来处理那些需要大量循环查询原子任务是否结束的,拆分为单独的 tryFinish 进行尝试查询状态以终止,减少线程被独占做无用的sleep - * 应用场景: - * 1.同步原子,需要轮循等待接口返回数据以决定原子是否完成整个业务, eg: CodeCC/apk加固/子流水线调用 - * - * 例外: 当前原子执行失败则不会等待,直接标识为当前原子执行结束 status.isFinish() - * - * @param task 执行任务 - * @param param 参数 - * @param runVariables 当前流水线运行中产生的变量 - * @return BuildStatus 返回标志位是否要等待其他任务结束才结束 - */ - AtomResponse execute(PipelineBuildTask task, T param, Map runVariables); - - /** - * 读取参数Element - */ - T getParamElement(PipelineBuildTask task); - - default AtomResponse execute(PipelineBuildTask task, Map runVariables) { - return execute(task, getParamElement(task), runVariables); - } - - /** - * 是否结束当前原子结束,如果不是,则后续引擎会不断地去调用该方法来判断原子是否结束了。 - * 子类通过复写该方法来实现,目前默认用查任务状态的方式保证大部分原子都是这类的操作 - * - * - * @param task 执行任务 - * @param runVariables 运行时变量 - * @param actionType 事件动作 - * @return BuildStatus - * 返回标志位是否要等待其他任务结束才结束,如果返回 status.isFinish() - * true: 可以结束当前原子 - * false: 需要等待其在他任务执行完。后续会不断的去调用该函数去查直到false,或者超时 - * 例外: 当前原子执行失败则不会等待,直接标识为当前原子执行结束 - */ - default AtomResponse tryFinish(PipelineBuildTask task, Map runVariables, ActionType actionType) { - T param = getParamElement(task); - AtomResponse atomResponse = tryFinishImpl(task, param, runVariables, actionType); - // 未结束?检查是否超时 - if (!atomResponse.getBuildStatus().isFinish()) { - long startTime = task.getStartTime() != null ? DateUtil.toInstant(task.getStartTime()).toEpochMilli() : 0L; - Long timeout = task.getAdditionalOptions() != null ? task.getAdditionalOptions().getTimeout() : null; - if (timeout == null && VMUtils.isVMTask(task.getTaskId())) { - // 如果timeout为空且task为开关机插件任务,则给timeout赋默认值 - timeout = Timeout.DEFAULT_PREPARE_MINUTES; - } - long timeoutMills = Timeout.transMinuteTimeoutToMills(timeout); - RunCondition runCondition = task.getAdditionalOptions() != null ? task.getAdditionalOptions().getRunCondition() : null; - if (timeoutMills > 0 && System.currentTimeMillis() - startTime >= timeoutMills) { - logger.info( - "[{}]|TIME_OUT|startTime={}|timeoutMills={}|current={}", - task.getBuildId(), startTime, timeoutMills, System.currentTimeMillis() - ); - atomResponse = new AtomResponse( - BuildStatus.EXEC_TIMEOUT, - null, - ErrorType.USER, - ErrorCode.USER_TASK_OUTTIME_LIMIT, - "Task time out " + TimeUnit.MILLISECONDS.toMinutes(timeoutMills) + " minutes" - ); - } else if (actionType.isTerminate()) { // 强制终止的设置为失败 - logger.info("[{}]|FORCE_TERMINATE|job={}|task={}", task.getBuildId(), task.getContainerId(), task.getTaskId()); - atomResponse = defaultFailAtomResponse; - } else if (actionType == ActionType.END && runCondition != RunCondition.PRE_TASK_FAILED_EVEN_CANCEL) { - logger.info("[{}]|CANCEL|job={}|task={}", task.getBuildId(), task.getContainerId(), task.getTaskId()); - atomResponse = new AtomResponse(BuildStatus.CANCELED, null, null, null, null); - } - } - return atomResponse; - } - - private AtomResponse tryFinishImpl( - PipelineBuildTask task, - T param, - Map runVariables, - ActionType actionType - ) { - AtomResponse atomResponse = tryFinish(task, param, runVariables, actionType.isTerminate()); - RunCondition runCondition = task.getAdditionalOptions() != null ? task.getAdditionalOptions().getRunCondition() : null; - return !atomResponse.getBuildStatus().isFinish() - ? actionType.isTerminate() - ? new AtomResponse( - BuildStatus.FAILED, - null, - ErrorType.PLUGIN, - ErrorCode.PLUGIN_DEFAULT_ERROR, - "Force Terminate!" - ) - : actionType == ActionType.END && runCondition != RunCondition.PRE_TASK_FAILED_EVEN_CANCEL - ? new AtomResponse(BuildStatus.CANCELED, null, null, null, null) - : atomResponse - : atomResponse; - } - - default AtomResponse tryFinish( - PipelineBuildTask task, - T param, - Map runVariables, - boolean force - ) { - return force - ? task.getStatus().isFinish() - ? new AtomResponse( - task.getStatus(), - null, - task.getErrorType(), - task.getErrorCode(), - task.getErrorMsg() - ) - : defaultFailAtomResponse - : new AtomResponse( - task.getStatus(), - null, - task.getErrorType(), - task.getErrorCode(), - task.getErrorMsg() - ); - } - - default String parseVariable(String value, Map runVariables) { - if (value == null || value.isEmpty()) { - return ""; - } - return EnvUtils.parseEnv(value, runVariables); - } - - /** - * 原子执行结果 - * @version 1.0 - */ - @Getter - class AtomResponse { - private final BuildStatus buildStatus; - private final Map outputVars; - private ErrorType errorType; - private Integer errorCode; - private String errorMsg; - - public AtomResponse(BuildStatus buildStatus, Map outputVars, ErrorType errorType, Integer errorCode, String errorMsg) { - this.buildStatus = buildStatus; - this.outputVars = outputVars; - this.errorType = errorType; - this.errorCode = errorCode; - this.errorMsg = errorMsg; - } - } - - AtomResponse defaultSuccessAtomResponse = new AtomResponse(BuildStatus.SUCCEED, null, null, null, null); - - AtomResponse defaultFailAtomResponse = new AtomResponse( - BuildStatus.FAILED, - null, - ErrorType.USER, - ErrorCode.PLUGIN_DEFAULT_ERROR, - "not definded error" - ); -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/BuildTimeCostUtils.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/BuildTimeCostUtils.java deleted file mode 100644 index 5c04aded..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/BuildTimeCostUtils.java +++ /dev/null @@ -1,303 +0,0 @@ -package cd.casic.ci.process.api.engine.common; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeLine; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordContainer; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordModel; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordStage; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordTask; -import cn.hutool.core.lang.Pair; -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; - -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; - -/** - * @author by mianbin - * @Classname BuildTimeCostUtils - * @Description TODO - * @Date 2025/3/31 16:07 - */ -@Slf4j -public class BuildTimeCostUtils { - - public static BuildRecordTimeCost generateBuildTimeCost(BuildRecordModel buildRecordModel, List stageRecords) { - LocalDateTime startTime = buildRecordModel.getStartTime(); - if (startTime == null) { - return new BuildRecordTimeCost(); - } - LocalDateTime endTime = buildRecordModel.getEndTime() != null ? buildRecordModel.getEndTime() : LocalDateTime.now(); - long totalCost = Duration.between(buildRecordModel.getQueueTime(), endTime).toMillis(); - long executeCost = 0L; - long waitCost = 0L; - long queueCost = 0L; - for (BuildRecordStage record : stageRecords) { - //这里转换需要注意,要根据实际发来的进行获取, 这里获取的应该是stage里面的BuildRecordTimeCost,要调试 - String stageVar = (String) record.getStageVar().get(BuildRecordTimeCost.class.getSimpleName()); - if (stageVar == null) { - continue; - } - BuildRecordTimeCost stageCost = JSONUtil.toBean(stageVar, BuildRecordTimeCost.class, false); - executeCost += stageCost.getExecuteCost(); - waitCost += stageCost.getWaitCost(); - queueCost += stageCost.getQueueCost(); - if (stageCost == null) { - continue; - } - executeCost += stageCost.getExecuteCost(); - waitCost += stageCost.getWaitCost(); - queueCost += stageCost.getQueueCost(); - } - long systemCost = totalCost - executeCost - queueCost - waitCost; - return new BuildRecordTimeCost( - totalCost, - executeCost, - waitCost, - Duration.between(buildRecordModel.getQueueTime(), startTime).toMillis(), - notNegative(systemCost) - ); - } - - public static BuildRecordTimeCost generateStageTimeCost(BuildRecordStage buildRecordStage, List containerRecords) { - LocalDateTime startTime = buildRecordStage.getStartTime(); - if (startTime == null) { - return null; - } - LocalDateTime endTime = buildRecordStage.getEndTime() != null ? buildRecordStage.getEndTime() : LocalDateTime.now(); - long totalCost = Duration.between(startTime, endTime).toMillis(); - List containerExecuteCost = new ArrayList<>(); - List containerWaitCost = List.of( - new BuildRecordTimeLine.Moment(startTime, endTime) - ); - List containerQueueCost = List.of( - new BuildRecordTimeLine.Moment(startTime, endTime) - ); - for (BuildRecordContainer record : containerRecords) { - BuildRecordTimeLine containerTimeLine = JSONUtil.toBean( record.getContainerVar().get(BuildRecordTimeLine.class.getSimpleName()).toString(), BuildRecordTimeLine.class, false); - if (containerTimeLine == null) { - continue; - } - if (record.getEndTime() != null) { - BuildRecordTimeLine.Moment fixedMoment = new BuildRecordTimeLine.Moment(record.getEndTime(), endTime); - containerTimeLine.getWaitCostMoments().add(fixedMoment); - containerTimeLine.getQueueCostMoments().add(fixedMoment); - } - containerExecuteCost = mergeTimeLine(containerExecuteCost, containerTimeLine.getExecuteCostMoments()); - List mergedWaitCost = mergeTimeLine(containerTimeLine.getWaitCostMoments(), containerTimeLine.getQueueCostMoments()); - containerWaitCost = intersectionTimeLine(containerWaitCost, mergedWaitCost); - containerQueueCost = intersectionTimeLine(containerQueueCost, containerTimeLine.getQueueCostMoments()); - } - long executeCost = containerExecuteCost.stream().mapToLong(moment -> moment.getEndTime() - moment.getStartTime()).sum(); - long queueCost = containerQueueCost.stream().mapToLong(moment -> moment.getEndTime() - moment.getStartTime()).sum(); - long waitCost = buildRecordStage.getTimestamps().entrySet().stream() - .filter(entry -> entry.getKey().stageCheckWait()) - .mapToLong(entry -> { - BuildRecordTimeStamp time = entry.getValue(); - logWhenNull(time, buildRecordStage.getBuildId() + "|STAGE|" + buildRecordStage.getStageId() + "|" + entry.getKey().name()); - return time.between(); - }) - .sum() + containerWaitCost.stream().mapToLong(moment -> moment.getEndTime() - moment.getStartTime()).sum(); - long systemCost = totalCost - executeCost - waitCost; - return new BuildRecordTimeCost( - totalCost, - executeCost, - waitCost, - queueCost, - notNegative(systemCost) - ); - } - - public static BuildRecordTimeCost generateMatrixTimeCost(BuildRecordContainer buildRecordContainer, List containerRecords) { - LocalDateTime startTime = buildRecordContainer.getStartTime(); - if (startTime == null) { - return null; - } - LocalDateTime endTime = buildRecordContainer.getEndTime() != null ? buildRecordContainer.getEndTime() : LocalDateTime.now(); - long totalCost = Duration.between(startTime, endTime).toMillis(); - List containerExecuteCost = new ArrayList<>(); - List containerWaitCost = List.of( - new BuildRecordTimeLine.Moment(startTime, endTime) - ); - List containerQueueCost = List.of( - new BuildRecordTimeLine.Moment(startTime, endTime) - ); - for (BuildRecordContainer record : containerRecords) { - BuildRecordTimeLine containerTimeLine = JSONUtil.toBean( record.getContainerVar().get(BuildRecordTimeLine.class.getSimpleName()).toString(), BuildRecordTimeLine.class, false); - if (containerTimeLine == null) { - continue; - } - containerExecuteCost = mergeTimeLine(containerExecuteCost, containerTimeLine.getExecuteCostMoments()); - containerWaitCost = intersectionTimeLine(containerWaitCost, containerTimeLine.getWaitCostMoments()); - containerQueueCost = intersectionTimeLine(containerQueueCost, containerTimeLine.getQueueCostMoments()); - } - long executeCost = containerExecuteCost.stream().mapToLong(moment -> moment.getEndTime() - moment.getStartTime()).sum(); - long queueCost = containerQueueCost.stream().mapToLong(moment -> moment.getEndTime() - moment.getStartTime()).sum(); - long waitCost = containerWaitCost.stream().mapToLong(moment -> moment.getEndTime() - moment.getStartTime()).sum(); - long systemCost = totalCost - executeCost - queueCost - waitCost; - return new BuildRecordTimeCost( - totalCost, - executeCost, - waitCost, - queueCost, - notNegative(systemCost) - ); - } - - public static Pair generateContainerTimeCost(BuildRecordContainer buildRecordContainer, List taskRecords) { - BuildRecordTimeLine containerTimeLine = new BuildRecordTimeLine(); - LocalDateTime startTime = buildRecordContainer.getStartTime(); - if (startTime == null) { - startTime = taskRecords.isEmpty() ? null : taskRecords.get(0).getStartTime(); - if (startTime == null) { - return Pair.of(null, containerTimeLine); - } - } - LocalDateTime endTime = buildRecordContainer.getEndTime() != null ? buildRecordContainer.getEndTime() : LocalDateTime.now(); - long totalCost = Duration.between(startTime, endTime).toMillis(); - long executeCost = 0L; - long waitCost = 0L; - long queueCost = buildRecordContainer.getTimestamps().entrySet().stream() - .filter(entry -> entry.getKey().containerCheckQueue()) - .mapToLong(entry -> { - BuildRecordTimeStamp time = entry.getValue(); - logWhenNull(time, buildRecordContainer.getBuildId() + "|CONTAINER|" + buildRecordContainer.getContainerId() + "|" + entry.getKey().name()); - time.insert2TimeLine(containerTimeLine.getQueueCostMoments()); - return time.between(); - }) - .sum(); - for (BuildRecordTask record : taskRecords) { - BuildRecordTimeLine taskTimeLine = new BuildRecordTimeLine(); - BuildRecordTimeCost cost = generateTaskTimeCost(record, taskTimeLine); - if (cost != null) { - containerTimeLine.getQueueCostMoments().addAll(taskTimeLine.getQueueCostMoments()); - containerTimeLine.getWaitCostMoments().addAll(taskTimeLine.getWaitCostMoments()); - containerTimeLine.getExecuteCostMoments().addAll(taskTimeLine.getExecuteCostMoments()); - executeCost += cost.getExecuteCost(); - waitCost += cost.getWaitCost(); - } - } - long systemCost = totalCost - executeCost - waitCost - queueCost; - return Pair.of( - new BuildRecordTimeCost( - totalCost, - executeCost, - waitCost, - queueCost, - notNegative(systemCost) - ), - containerTimeLine - ); - } - - public static BuildRecordTimeCost generateTaskTimeCost(BuildRecordTask buildRecordTask, BuildRecordTimeLine timeLine) { - LocalDateTime startTime = buildRecordTask.getStartTime(); - if (startTime == null) { - return null; - } - LocalDateTime endTime = buildRecordTask.getEndTime() != null ? buildRecordTask.getEndTime() : LocalDateTime.now(); - long totalCost = Duration.between(startTime, endTime).toMillis(); - long waitCost = buildRecordTask.getTimestamps().entrySet().stream() - .filter(entry -> entry.getKey().taskCheckWait()) - .mapToLong(entry -> { - BuildRecordTimeStamp time = entry.getValue(); - logWhenNull(time, buildRecordTask.getBuildId() + "|TASK|" + buildRecordTask.getTaskId() + "|" + entry.getKey().name()); - if (timeLine != null) { - time.insert2TimeLine(timeLine.getWaitCostMoments()); - } - return time.between(); - }) - .sum(); - long executeCost = totalCost - waitCost; - if (timeLine != null) { - List executeMoments = differenceTimeLine( - List.of(new BuildRecordTimeLine.Moment(startTime, endTime)), - timeLine.getWaitCostMoments() - ); - timeLine.getExecuteCostMoments().addAll(executeMoments); - } - return new BuildRecordTimeCost( - totalCost, - waitCost, - notNegative(executeCost) - ); - } - - public static List differenceTimeLine(List left, List right) { - List> line = new ArrayList<>(); - List ans = new ArrayList<>(); - for (BuildRecordTimeLine.Moment moment : left) { - - line.add(Pair.of(moment.getStartTime(), 'L')); - line.add(Pair.of(moment.getEndTime(), 'L')); - } - for (BuildRecordTimeLine.Moment moment : right) { - line.add(Pair.of(moment.getStartTime(), 'R')); - line.add(Pair.of(moment.getEndTime(), 'R')); - } - line.sort(java.util.Comparator.comparingLong(Pair::getKey)); - boolean cnt = true; - int index = 0; - while (index < line.size()) { - if (line.get(index).getValue() == 'R') { - cnt = !cnt; - } - if (cnt && index < line.size() - 1) { - ans.add(new BuildRecordTimeLine.Moment(line.get(index).getKey(), line.get(index + 1).getKey())); - } - index++; - } - return ans; - } - - public static List intersectionTimeLine(List left, List right) { - List ans = new ArrayList<>(); - int i = 0; - int j = 0; - while (i < left.size() && j < right.size()) { - long lo = Math.max(left.get(i).getStartTime(), right.get(j).getStartTime()); - long hi = Math.min(left.get(i).getEndTime(), right.get(j).getEndTime()); - if (lo <= hi) { - ans.add(new BuildRecordTimeLine.Moment(lo, hi)); - } - if (left.get(i).getEndTime() < right.get(j).getEndTime()) { - i++; - } else { - j++; - } - } - return ans; - } - - public static List mergeTimeLine(List left, List right) { - List intervals = new ArrayList<>(left); - intervals.addAll(right); - intervals.sort(java.util.Comparator.comparingLong(BuildRecordTimeLine.Moment::getStartTime)); - List res = new ArrayList<>(); - for (BuildRecordTimeLine.Moment interval : intervals) { - if (res.isEmpty() || res.get(res.size() - 1).getEndTime() < interval.getStartTime()) { - res.add(interval); - } else { - BuildRecordTimeLine.Moment m = res.remove(res.size() - 1); - res.add(new BuildRecordTimeLine.Moment(m.getStartTime(), Math.max(m.getEndTime(), interval.getEndTime()))); - } - } - return res; - } - - private static void logWhenNull(BuildRecordTimeStamp time, String logInfo) { - if (time.getStartTime() == null) { - log.warn(logInfo + "|warning! start time is null."); - } - if (time.getEndTime() == null) { - log.warn(logInfo + "|warning! end time is null."); - } - } - - private static long notNegative(long value) { - return Math.max(value, 0); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/EngineConstants.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/EngineConstants.java deleted file mode 100644 index 76404644..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/EngineConstants.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.engine.common; - -/** - * @author by mianbin - * @Classname EngineConstants - * @Description TODO - * @Date 2025/3/31 16:10 - */ -public class EngineConstants { - public static final String BS_ATOM_STATUS_REFRESH_DELAY_MILLS = "_bsDelayMills_"; - public static final String BS_ATOM_START_TIME_MILLS = "_bsAtomStartTimeMills_"; - public static final String BS_ATOM_LOOP_TIMES = "_bsAtomLoopTimes_"; - public static final String BS_QUALITY_RESULT = "_bsQualityResult_"; - public static final String BS_MANUAL_ACTION = "_bsManualAction_"; - public static final String BS_MANUAL_ACTION_USERID = "_bsManualActionUserId_"; - public static final String BS_MANUAL_ACTION_SUGGEST = "_bsManualActionSuggest_"; - public static final String BS_MANUAL_ACTION_PARAMS = "_bsManualActionParams_"; - public static final String BS_MANUAL_ACTION_DESC = "_bsManualActionDesc_"; - public static final String BS_MANUAL_START_STAGE = "manual_start_stage"; - public static final String BS_QUALITY_PASS_STAGE = "quality_start_stage"; - public static final String BS_QUALITY_ABORT_STAGE = "quality_abort_stage"; - public static final String BS_CONTAINER_END_SOURCE_PREFIX = "CONTAINER_END_"; - public static final String BS_MANUAL_STOP_PAUSE_ATOM = "taskCancel_"; - public static final String BS_STAGE_CANCELED_END_SOURCE = "STAGE_CANCELED_END"; - public static final String BS_CANCEL_BUILD_SOURCE = "cancel_build"; - public static final String BS_PAUSE_TASK = "_bkTaskPauseTag_"; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/Loop.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/Loop.java deleted file mode 100644 index 334cbf61..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/Loop.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.process.api.engine.common; - -/** - * @author by mianbin - * @Classname Loop - * @Description TODO - * @Date 2025/3/31 16:12 - */ -public class Loop { - public static final int DEFAULT_INTERVAL_MILLS = 3000; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/Timeout.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/Timeout.java deleted file mode 100644 index d79a3ca9..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/Timeout.java +++ /dev/null @@ -1,99 +0,0 @@ -package cd.casic.ci.process.api.engine.common; - -import cd.casic.ci.process.api.process.utils.PipelineVarUtil; - -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * @author by mianbin - * @Classname Timeout - * @Description TODO - * @Date 2025/3/31 16:13 - */ -public class Timeout { - public static final long DEFAULT_TIMEOUT_MIN = 900L; - public static final long DEFAULT_PREPARE_MINUTES = 10L; - public static final long DEFAULT_STAGE_TIMEOUT_HOURS = 24L; - private static final long MAX_STAGE_REVIEW_DAYS = 30L; - public static final long MAX_JOB_RUN_DAYS = 7L; - - public static final long MAX_HOURS = TimeUnit.DAYS.toHours(MAX_STAGE_REVIEW_DAYS); - public static final long STAGE_MAX_MILLS = TimeUnit.HOURS.toMillis(MAX_HOURS) + 1; - public static final int MAX_MINUTES = (int) TimeUnit.DAYS.toMinutes(MAX_JOB_RUN_DAYS); - public static final long CONTAINER_MAX_MILLS = TimeUnit.MINUTES.toMillis(MAX_MINUTES) + 1; - - private static TimeoutObj transTimeoutObj(String timeoutStr) { - boolean change = false; - long minute; - try { - if (timeoutStr != null && !timeoutStr.isEmpty()) { - minute = Integer.parseInt(timeoutStr); - } else { - change = true; - minute = DEFAULT_TIMEOUT_MIN; - } - } catch (Exception badConfig) { - change = true; - minute = DEFAULT_TIMEOUT_MIN; - } - if (minute <= 0 || minute > MAX_MINUTES) { - change = true; - minute = MAX_MINUTES; - } - return new TimeoutObj( - timeoutStr, - minute, - transMinuteTimeoutToMills(minute), - change - ); - } - - public static long transMinuteTimeoutToSec(Long timeoutMinutes) { - long minute = timeoutMinutes != null ? timeoutMinutes : DEFAULT_TIMEOUT_MIN; - if (minute <= 0 || minute > MAX_MINUTES) { - minute = MAX_MINUTES; - } - return TimeUnit.MINUTES.toSeconds(minute) + 1; - } - - public static long transMinuteTimeoutToMills(Long timeoutMinutes) { - long minute = timeoutMinutes != null ? timeoutMinutes : DEFAULT_TIMEOUT_MIN; - if (minute <= 0 || minute > MAX_MINUTES) { - minute = MAX_MINUTES; - } - return TimeUnit.MINUTES.toMillis(minute) + 1; - } - - public static TimeoutObj decTimeout(String timeoutVar, Map contextMap) { - TimeoutObj obj; - String timeoutStr = timeoutVar != null ? timeoutVar.trim() : null; - if (PipelineVarUtil.isVar(timeoutStr)) { -// String tTimeout = EnvReplacementParser.parse(timeoutStr, contextMap); - String tTimeout = ""; - obj = transTimeoutObj(tTimeout); - if (!tTimeout.equals(timeoutStr)) { - obj.replaceByVar = true; - } - } else { - obj = transTimeoutObj(timeoutStr); - } - return obj; - } - - public static class TimeoutObj { - public String beforeChangeStr; - public long minutes; - public long millis; - public boolean change; - public boolean replaceByVar; - - public TimeoutObj(String beforeChangeStr, long minutes, long millis, boolean change) { - this.beforeChangeStr = beforeChangeStr; - this.minutes = minutes; - this.millis = millis; - this.change = change; - this.replaceByVar = false; - } - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/VMUtils.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/VMUtils.java deleted file mode 100644 index 14b6c098..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/common/VMUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -package cd.casic.ci.process.api.engine.common; - -import cn.hutool.core.date.DateUtil; - -import java.util.Random; -import java.util.Set; - -/** - * @author by mianbin - * @Classname VMUtils - * @Description TODO - * @Date 2025/3/31 16:22 - */ -public class VMUtils { - - /** - * 生成阶段ID - * - * @param seq 序号 - * @return 生成的阶段ID - */ - public static String genStageId(int seq) { - return "stage-" + seq; - } - - /** - * 为用户生成阶段ID - * - * @param seq 序号 - * @return 生成的用户阶段ID - */ - public static String genStageIdForUser(int seq) { - return "stage_" + seq; - } - - /** - * 生成停止虚拟机任务ID - * - * @param seq 序号 - * @return 生成的停止虚拟机任务ID - */ - public static String genStopVMTaskId(int seq) { - return getStopVmLabel() + seq; - } - - /** - * 生成结束点任务ID - * - * @param seq 序号 - * @return 生成的结束点任务ID - */ - public static String genEndPointTaskId(int seq) { - return getEndLabel() + seq; - } - - /** - * 生成虚拟机任务序号 - * - * @param containerSeq 容器序号 - * @param taskSeq 任务序号 - * @return 生成的虚拟机任务序号 - */ - public static int genVMTaskSeq(int containerSeq, int taskSeq) { - return containerSeq * 1000 + taskSeq; - } - - /** - * 生成矩阵容器序号 - * - * @param matrixGroupId 矩阵组ID - * @param innerIndex 内部索引 - * @return 生成的矩阵容器序号 - */ - public static int genMatrixContainerSeq(int matrixGroupId, int innerIndex) { - return matrixGroupId * 1000 + innerIndex; - } - - /** - * 生成矩阵作业ID - * - * @param groupJobId 组作业ID - * @param innerSeq 内部序号 - * @return 生成的矩阵作业ID - */ - public static String genMatrixJobId(String groupJobId, int innerSeq) { - return groupJobId + "." + innerSeq; - } - - /** - * 生成启动虚拟机任务ID - * - * @param containerSeq 容器序号 - * @return 生成的启动虚拟机任务ID - */ - public static String genStartVMTaskId(String containerSeq) { - return getStartVmLabel() + containerSeq; - } - - /** - * 获取停止虚拟机标签 - * - * @return 停止虚拟机标签 - */ - public static String getStopVmLabel() { - return "stopVM-"; - } - - /** - * 获取清理虚拟机标签 - * - * @return 清理虚拟机标签 - */ - public static String getCleanVmLabel() { - return "Clean_Job#"; - } - - /** - * 获取启动虚拟机标签 - * - * @return 启动虚拟机标签 - */ - public static String getStartVmLabel() { - return "startVM-"; - } - - /** - * 获取准备虚拟机标签 - * - * @return 准备虚拟机标签 - */ - public static String getPrepareVmLabel() { - return "Prepare_Job#"; - } - - /** - * 获取等待标签 - * - * @return 等待标签 - */ - public static String getWaitLabel() { - return "Wait_Finish_Job#"; - } - - /** - * 获取结束标签 - * - * @return 结束标签 - */ - public static String getEndLabel() { - return "end-"; - } - - /** - * 获取容器作业ID - * - * @param randomSeed 随机种子 - * @param jobIdSet 已存在的作业ID集合 - * @return 生成的容器作业ID - */ - public static String getContainerJobId(int randomSeed, Set jobIdSet) { - Random random = new Random(randomSeed); - StringBuilder sequence = new StringBuilder(); - for (int i = 0; i < 3; i++) { - sequence.append((char) (random.nextInt('z' - 'A' + 1) + 'A')); - } - String jobId = "job_" + sequence; - return jobIdSet.contains(jobId) ? jobId + "_" + DateUtil.current() : jobId; - } - - /** - * 判断是否为虚拟机任务 - * - * @param taskId 任务ID - * @return 如果是虚拟机任务返回 true,否则返回 false - */ - public static boolean isVMTask(String taskId) { - return taskId.startsWith(getStartVmLabel()) || - taskId.startsWith(getStopVmLabel()) || - taskId.startsWith(getEndLabel()); - } - - /** - * 判断是否为矩阵容器ID - * - * @param containerId 容器ID - * @return 如果是矩阵容器ID返回 true,否则返回 false - */ - public static boolean isMatrixContainerId(String containerId) { - try { - return Integer.parseInt(containerId) > 1000; - } catch (NumberFormatException ignore) { - return false; - } - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/BuildTaskException.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/BuildTaskException.java deleted file mode 100644 index 63073034..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/BuildTaskException.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.api.engine.exception; - -import lombok.Getter; - -import javax.lang.model.type.ErrorType; - -/** - * @author by mianbin - * @Classname BuildTaskException - * @Description TODO - * @Date 2025/3/31 16:31 - */ -@Getter -public class BuildTaskException extends Exception { - private final ErrorType errorType; - private final int errorCode; - private final String pipelineId; - private final String buildId; - private final String taskId; - - public BuildTaskException(ErrorType errorType, int errorCode, String errorMsg, String pipelineId, String buildId, String taskId) { - super(errorMsg); - this.errorType = errorType; - this.errorCode = errorCode; - this.pipelineId = pipelineId; - this.buildId = buildId; - this.taskId = taskId; - } - - public BuildTaskException(ErrorType errorType, int errorCode, String errorMsg) { - this(errorType, errorCode, errorMsg, null, null, null); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/InvalidTimerException.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/InvalidTimerException.java deleted file mode 100644 index f3de3e3b..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/InvalidTimerException.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.process.api.engine.exception; - -/** - * @author by mianbin - * @Classname InvalidTimerException - * @Description TODO - * @Date 2025/3/31 16:32 - */ -public class InvalidTimerException extends Exception { - public InvalidTimerException() { - super(); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/PipelineNotExistException.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/PipelineNotExistException.java deleted file mode 100644 index ac8fd7fc..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/exception/PipelineNotExistException.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.process.api.engine.exception; - -/** - * @author by mianbin - * @Classname PipelineNotExistException - * @Description TODO - * @Date 2025/3/31 16:32 - */ -public class PipelineNotExistException extends Exception { - public PipelineNotExistException(String msg) { - super(msg); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/BuildInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/BuildInfo.java deleted file mode 100644 index 82466beb..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/BuildInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.process.api.process.pojo.BuildStageStatus; -import cd.casic.ci.process.api.process.pojo.PipelineBuildMaterial; -import cd.casic.ci.process.api.process.pojo.code.WebhookInfo; -import lombok.Data; -import org.apache.tomcat.jni.FileInfo; - -import java.util.List; - -/** - * @author by mianbin - * @Classname BuildInfo - * @Description TODO - * @Date 2025/3/31 16:36 - */ -@Data -public class BuildInfo { - private final String projectId; - private final String pipelineId; - private final String buildId; - private final int version; - private final String versionName; - private final String yamlVersion; - private final int buildNum; - private final String trigger; - private BuildStatus status; - private long queueTime; - private final long executeTime; - // 真正用来执行构建的人的身份(一般像Git触发,有可能]与触发人不一样,因为Git平台账号不一定是人) - private final String startUser; - // 真正的触发人(不一定是人,也可能是机器账号,比如git平台账号) - private final String triggerUser; - private Long startTime; - private Long endTime; - private final int taskCount; - private final String firstTaskId; - private final String parentBuildId; - private final String parentTaskId; - private final ChannelCode channelCode; - private List buildParameters; - private List errorInfoList; - private List stageStatus; - private final boolean debug; - //只用executeCount做判断 - @Deprecated - private final Boolean retryFlag; - private final int executeCount; - private String concurrencyGroup; - private final String webhookType; - private final WebhookInfo webhookInfo; - private final String buildMsg; - private final List material; - private final List artifactList; - private final String remark; - private final String recommendVersion; - private final String buildNumAlias; - private final Long updateTime; - private final Integer errorType; - private final Integer errorCode; - private final String errorMsg; - - public boolean isFinish() { - if (status.name().equals(BuildStatus.STAGE_SUCCESS.name()) && - endTime != null && - endTime > 0 && - startTime != null && - endTime > startTime) { - return true; - } - return status.isFinish(); - } - - public boolean isSuccess() { - if (status.name().equals(BuildStatus.STAGE_SUCCESS.name()) && - endTime != null && - endTime > 0 && - startTime != null && - endTime > startTime) { - return true; - } - return status.isSuccess(); - } - - public boolean isFailure() { - return status.isFailure(); - } - - public boolean isCancel() { - return status.isCancel(); - } - - public boolean isStageSuccess() { - return status == BuildStatus.STAGE_SUCCESS; - } - - public boolean isTriggerReviewing() { - return status == BuildStatus.TRIGGER_REVIEWING; - } - - public boolean isReadyToRun() { - return status.isReadyToRun(); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/BuildRetryInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/BuildRetryInfo.java deleted file mode 100644 index 2b94f75c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/BuildRetryInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * @author by mianbin - * @Classname BuildRetryInfo - * @Description TODO - * @Date 2025/3/31 16:39 - */ -@Data -public class BuildRetryInfo { - /** - * 是否重新构建 - */ - private boolean rebuild; - /** - * 当前时间 - */ - private LocalDateTime nowTime; - /** - * 构建状态 - */ - private BuildStatus status; - /** - * 构建参数列表 - */ - private List buildParameters; - /** - * 并发组 - */ - private String concurrencyGroup; - /** - * 执行次数 - */ - private final int executeCount; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/ContainerStartInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/ContainerStartInfo.java deleted file mode 100644 index 7ebabb86..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/ContainerStartInfo.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ContainerStartInfo - * @Description TODO - * @Date 2025/3/31 16:40 - */ -@Data -@Schema(title = "构建机启动信息模型") -public class ContainerStartInfo { - /** - * 主机名称 - */ - @Schema(title = "主机名称") - private PipelineBuildContainer buildContainer; - - /** - * 主机IP - */ - @Schema(title = "主机IP") - private PipelineBuildTask startBuildTask; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/HeartBeatInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/HeartBeatInfo.java deleted file mode 100644 index ba9b0f26..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/HeartBeatInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Set; - -/** - * @author by mianbin - * @Classname HeartBeatInfo - * @Description TODO - * @Date 2025/3/31 15:22 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "心跳信息") -public class HeartBeatInfo { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "构建ID") - private String buildId; - @Schema(title = "项目ID") - private String vmSeqId; - @Schema(title = "取消的task任务的id集合") - private Set cancelTaskIds = null; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildContainer.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildContainer.java deleted file mode 100644 index ff58eb61..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildContainer.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @author by mianbin - * @Classname PipelineBuildContainer - * @Description TODO - * @Date 2025/3/31 16:56 - */ -@Data -@AllArgsConstructor -public class PipelineBuildContainer { - private final String projectId; - private final String pipelineId; - private final String buildId; - private final String stageId; - private final String containerId; // 与seq id同值 - private final String containerHashId; // 与model中的container.containerHashId同值 - private final String jobId; - private final Boolean matrixGroupFlag; - private final String matrixGroupId; - private final String containerType; - private final int seq; - private BuildStatus status; - private LocalDateTime startTime; - private LocalDateTime endTime; - private int cost = 0; - private int executeCount = 1; - private PipelineBuildContainerControlOption controlOption; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildContainerControlOption.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildContainerControlOption.java deleted file mode 100644 index 1405ba1e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildContainerControlOption.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.container.AgentReuseMutex; -import cd.casic.ci.common.pipeline.container.MutexGroup; -import cd.casic.ci.common.pipeline.option.JobControlOption; -import cd.casic.ci.common.pipeline.option.MatrixControlOption; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineBuildContainerControlOption - * @Description TODO - * @Date 2025/3/31 16:57 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class PipelineBuildContainerControlOption { - private JobControlOption jobControlOption; - private MatrixControlOption matrixControlOption; - private boolean inFinallyStage; - private MutexGroup mutexGroup; - private Boolean containPostTaskFlag; // 是否包含post任务 - private AgentReuseMutex agentReuseMutex; // 是否包含构建机复用互斥 -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildStage.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildStage.java deleted file mode 100644 index d80c20f3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildStage.java +++ /dev/null @@ -1,73 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.StagePauseCheck; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @author by mianbin - * @Classname PipelineBuildStage - * @Description TODO - * @Date 2025/3/31 16:57 - */ -@Data -public class PipelineBuildStage { - /** - * 项目 ID - */ - private String projectId; - /** - * 管道 ID - */ - private String pipelineId; - /** - * 构建 ID - */ - private String buildId; - /** - * 阶段 ID - */ - private String stageId; - /** - * 阶段序号 - */ - private int seq; - /** - * 阶段状态 - */ - private BuildStatus status; - /** - * 开始时间 - */ - private LocalDateTime startTime; - /** - * 结束时间 - */ - private LocalDateTime endTime; - /** - * 耗时 - */ - private int cost = 0; - /** - * 执行次数 - */ - private int executeCount = 1; - /** - * 控制选项 - */ - private PipelineBuildStageControlOption controlOption; - /** - * 进入检查 - */ - private StagePauseCheck checkIn; - /** - * 离开检查 - */ - private StagePauseCheck checkOut; - /** - * 用户可见的阶段 ID - */ - private String stageIdForUser; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildStageControlOption.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildStageControlOption.java deleted file mode 100644 index 02a4cb4a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildStageControlOption.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.option.StageControlOption; -import lombok.Data; - -import java.io.Serializable; - -/** - * @author by mianbin - * @Classname PipelineBuildStageControlOption - * @Description 管道构建阶段控制选项类,用于封装管道构建阶段的控制相关信息 - * @Date 2025/3/31 16:58 - */ -@Data -public class PipelineBuildStageControlOption implements Serializable { - - /** - * 阶段控制选项 - */ - private final StageControlOption stageControlOption; - - /** - * 是否为最终阶段,默认为 false - */ - private final boolean finallyStage; - - /** - * 是否快速终止,默认为 false - */ - private final Boolean fastKill; - - /** - * 全参构造函数 - * - * @param stageControlOption 阶段控制选项 - * @param finallyStage 是否为最终阶段 - * @param fastKill 是否快速终止 - */ - public PipelineBuildStageControlOption(StageControlOption stageControlOption, boolean finallyStage, Boolean fastKill) { - this.stageControlOption = stageControlOption; - this.finallyStage = finallyStage; - this.fastKill = fastKill == null ? false : fastKill; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildTask.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildTask.java deleted file mode 100644 index 0d66d857..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineBuildTask.java +++ /dev/null @@ -1,57 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import cd.casic.ci.common.pipeline.pojo.ErrorType; -import lombok.AllArgsConstructor; -import lombok.Data; -import java.time.LocalDateTime; -import java.util.Map; - -/** - * @author by mianbin - * @Classname PipelineBuildTask - * @Description TODO - * @Date 2025/3/31 16:59 - */ -@Data -@AllArgsConstructor -public class PipelineBuildTask { - private final String projectId; - private final String pipelineId; - private final String templateId; - private final String buildId; - private final String stageId; - private final String containerId; - private final String containerHashId; - private final String containerType; - private final int taskSeq; - private final String taskId; - private final String taskName; - private final String taskType; - private final String taskAtom; - private BuildStatus status; - private Map taskParams; - private final ElementAdditionalOptions additionalOptions; - private Integer executeCount; - private String starter; - private final String approver; - private String subProjectId; - private String subBuildId; - private LocalDateTime startTime; - private LocalDateTime endTime; - private ErrorType errorType; - private Integer errorCode; - private String errorMsg; - private final String atomCode; - private final String stepId; - private Long totalTime; - private final String jobId; - - public String getTaskParam(String paramName) { - if (taskParams.get(paramName) != null) { - return taskParams.get(paramName).toString().trim(); - } - return ""; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineInfo.java deleted file mode 100644 index b67941f2..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.common.pipeline.pojo.transfer.TemplateInfo; -import cd.casic.ci.process.api.process.pojo.PipelinePermissions; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname PipelineInfo - * @Description TODO - * @Date 2025/3/31 17:00 - */ -@Data -@Schema(title = "流水线信息") -public class PipelineInfo { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "流水线DI") - private String pipelineId; - @Schema(title = "模板ID") - private String templateId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "流水线描述") - private String pipelineDesc; - @Schema(title = "版本") - private int version = 1; - @Schema(title = "创建时间") - private long createTime = 0; - @Schema(title = "更新时间") - private long updateTime = 0; - @Schema(title = "创建者") - private String creator; - @Schema(title = "上一次的更新者") - private String lastModifyUser; - @Schema(title = "渠道号") - private ChannelCode channelCode; - @Schema(title = "是否能够手动启动") - private boolean canManualStartup; - @Schema(title = "是否可以跳过") - private boolean canElementSkip; - @Schema(title = "任务数") - private int taskCount; - @Schema(title = "版本名称") - private String versionName = ""; - @Schema(title = "ID") - private Long id; - @Schema(title = "流水线组名称列表", required = false) - private List viewNames; - @Schema(title = "最后构建启动时间", required = false) - private Long latestBuildStartTime; - @Schema(title = "最后构建结束时间", required = false) - private Long latestBuildEndTime; - @Schema(title = "最后构建状态", required = false) - private BuildStatus latestBuildStatus; - @Schema(title = "最后构建版本号", required = false) - private Integer latestBuildNum; - @Schema(title = "最后构建ID", required = false) - private String latestBuildId; - @Schema(title = "触发方式", required = false) - private String trigger; - @Schema(title = "约束模式下的模板信息", required = false) - private TemplateInfo templateInfo; - @Schema(title = "最新流水线版本状态(如有任何发布版本则为发布版本)", required = false) - private VersionStatus latestVersionStatus = VersionStatus.RELEASED; - @Schema(title = "流水线权限", required = false) - private PipelinePermissions permissions; - @Schema(title = "流水线被锁定,即禁用", required = false) - private Boolean locked = false; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineModelTask.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineModelTask.java deleted file mode 100644 index 5ce65a86..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineModelTask.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author by mianbin - * @Classname PipelineModelTask - * @Description 流水线模型插件任务 - * @Date 2025/3/31 17:00 - */ -@Data -@AllArgsConstructor -public class PipelineModelTask { - private final String projectId; - private final String pipelineId; - private final String stageId; - private final String containerId; - private final String taskId; - private final int taskSeq; - private final String taskName; - private final String atomCode; - private String atomVersion; - private final String classType; - private final String taskAtom; - private final Map taskParams = new ConcurrentHashMap<>(); - private ElementAdditionalOptions additionalOptions; - private String os = "linux"; - private String taskPosition = ""; // 插件在model中的位置,eg: stageSeq-jobSeq-taskSeq - private boolean stageEnable = true; - private boolean containerEnable = true; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelinePauseValue.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelinePauseValue.java deleted file mode 100644 index 62fa7c66..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelinePauseValue.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import lombok.Data; - -/** - * @author by mianbin - * @Classname PipelinePauseValue - * @Description TODO - * @Date 2025/3/31 17:01 - */ -@Data -public class PipelinePauseValue { - private String projectId; - private String buildId; - private String taskId; - private String defaultValue; - private String newValue; - private Integer executeCount; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineTimer.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineTimer.java deleted file mode 100644 index f6b76531..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineTimer.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname PipelineTimer - * @Description TODO - * @Date 2025/3/31 17:01 - */ -@Data -@AllArgsConstructor -public class PipelineTimer { - private String projectId; - private String pipelineId; - private String startUser; - private List crontabExpressions; - private ChannelCode channelCode; - private String repoHashId; - private List branchs; - private Boolean noScm; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineVersionWithInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineVersionWithInfo.java deleted file mode 100644 index e46c058a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/PipelineVersionWithInfo.java +++ /dev/null @@ -1,101 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineVersionWithInfo - * @Description TODO - * @Date 2025/3/31 17:02 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "流水线信息") -public class PipelineVersionWithInfo { - @Schema(title = "项目ID") - private String projectId; - - @Schema(title = "流水线DI") - private String pipelineId; - - @Schema(title = "模板ID") - private String templateId; - - @Schema(title = "流水线名称") - private String pipelineName; - - @Schema(title = "流水线描述") - private String pipelineDesc; - - @Schema(title = "版本") - private int version = 1; - - @Schema(title = "创建时间") - private long createTime; - - @Schema(title = "更新时间") - private Long updateTime; - - @Schema(title = "版本创建者") - private String creator; - - @Schema(title = "上一次的更新者") - private String lastModifyUser; - - @Schema(title = "渠道号") - private ChannelCode channelCode; - - @Schema(title = "是否能够手动启动") - private boolean canManualStartup; - - @Schema(title = "是否可以跳过") - private boolean canElementSkip; - - @Schema(title = "任务数") - private int taskCount; - - @Schema(title = "版本名称") - private String versionName = ""; - - @Schema(title = "ID") - private Long id; - - @Schema(title = "流水线组名称列表", required = false) - private java.util.List viewNames; - - @Schema(title = "关联构建记录总数", required = false) - private Integer referCount; - - @Schema(title = "发布版本号", required = false) - private Integer versionNum; - - @Schema(title = "编排版本号", required = false) - private Integer pipelineVersion; - - @Schema(title = "触发器版本号", required = false) - private Integer triggerVersion; - - @Schema(title = "配置版本号", required = false) - private Integer settingVersion; - - @Schema(title = "草稿版本状态标识", required = false) - private VersionStatus status = VersionStatus.RELEASED; - - @Schema(title = "版本变更说明", required = false) - private String description; - - @Schema(title = "该版本的来源版本(空时一定为主路径)", required = false) - private Integer baseVersion; - - @Schema(title = "草稿的来源版本名称(只在草稿版本有值)", required = false) - private String baseVersionName; - - @Schema(title = "调试构建ID", required = false) - private String debugBuildId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/event/PipelineStreamEnabledEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/event/PipelineStreamEnabledEvent.java deleted file mode 100644 index 561fbe5f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/engine/pojo/event/PipelineStreamEnabledEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.process.api.engine.pojo.event; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * @author by mianbin - * @Classname PipelineStreamEnabledEvent - * @Description TODO - * @Date 2025/3/31 16:33 - */ -@EqualsAndHashCode(callSuper = true) -@Data -public class PipelineStreamEnabledEvent extends IPipelineEvent { - private final String source; - private final String projectId; - private final String pipelineId; - private final String userId; - private ActionType actionType; - private int delayMills; - private final long gitProjectId; - private final String gitProjectUrl; - private final boolean enable; - - public PipelineStreamEnabledEvent(String source, String projectId, String pipelineId, String userId, - ActionType actionType, int delayMills, long gitProjectId, String gitProjectUrl, boolean enable) { - this.source = source; - this.projectId = projectId; - this.pipelineId = pipelineId; - this.userId = userId; - this.actionType = actionType != null ? actionType : ActionType.START; - this.delayMills = delayMills; - this.gitProjectId = gitProjectId; - this.gitProjectUrl = gitProjectUrl; - this.enable = enable; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/PipelineBuildParamKey.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/PipelineBuildParamKey.java deleted file mode 100644 index f0b31a37..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/PipelineBuildParamKey.java +++ /dev/null @@ -1,91 +0,0 @@ -package cd.casic.ci.process.api.process.constant; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.constant - * @Project:ops-pro - * @name:PipelineBuildParamKey - * @Date:2025/03/24 14:32 - * @Filename:PipelineBuildParamKey - * @description:流水线上下文变量Key - */ -public class PipelineBuildParamKey { - // GIT 触发公共参数 - public static final String CI_REPO_TYPE = "ci.repo_type"; - public static final String CI_REPO_URL = "ci.repo_url"; - public static final String CI_REPO = "ci.repo"; - public static final String CI_REPO_ID = "ci.repo_id"; - public static final String CI_REPO_GROUP = "ci.repo_group"; - public static final String CI_REPO_NAME = "ci.repo_name"; - public static final String CI_REPO_ALIAS_NAME = "ci.repo_alias_name"; - public static final String CI_EVENT = "ci.event"; - public static final String CI_EVENT_URL = "ci.event_url"; - public static final String CI_BRANCH = "ci.branch"; - public static final String CI_BUILD_MSG = "ci.build_msg"; - public static final String CI_COMMIT_MESSAGE = "ci.commit_message"; - public static final String CI_ACTION = "ci.action"; - public static final String CI_ACTOR = "ci.actor"; - // GIT PUSH参数 - public static final String CI_BEFORE_SHA = "ci.before_sha"; - public static final String CI_BEFORE_SHA_SHORT = "ci.before_sha_short"; - public static final String CI_SHA = "ci.sha"; - public static final String CI_SHA_SHORT = "ci.sha_short"; - public static final String CI_OPERATION_KIND = "ci.operation_kind"; - // GIT MR参数 - public static final String CI_MR_PROPOSER = "ci.mr_proposer"; - public static final String CI_HEAD_REPO_URL = "ci.head_repo_url"; - public static final String CI_BASE_REPO_URL = "ci.base_repo_url"; - public static final String CI_HEAD_REF = "ci.head_ref"; - public static final String CI_BASE_REF = "ci.base_ref"; - public static final String CI_MR_ID = "ci.mr_id"; - public static final String CI_MR_IID = "ci.mr_iid"; - public static final String CI_MR_DESC = "ci.mr_desc"; - public static final String CI_MR_TITLE = "ci.mr_title"; - public static final String CI_MR_URL = "ci.mr_url"; - public static final String CI_MR_REVIEWERS = "ci.mr_reviewers"; - public static final String CI_MILESTONE_NAME = "ci.milestone_name"; - public static final String CI_MILESTONE_ID = "ci.milestone_id"; - // GIT TAG参数 - public static final String CI_COMMIT_AUTHOR = "ci.commit_author"; - public static final String CI_TAG_FROM = "ci.tag_from"; - // GIT TAG参数 - public static final String CI_ISSUE_TITLE = "ci.issue_title"; - public static final String CI_ISSUE_ID = "ci.issue_id"; - public static final String CI_ISSUE_IID = "ci.issue_iid"; - public static final String CI_ISSUE_DESCRIPTION = "ci.issue_description"; - public static final String CI_ISSUE_STATE = "ci.issue_state"; - public static final String CI_ISSUE_OWNER = "ci.issue_owner"; - public static final String CI_ISSUE_MILESTONE_ID = "ci.issue_milestone_id"; - // GIT NOTE参数 - public static final String CI_NOTE_COMMENT = "ci.note_comment"; - public static final String CI_NOTE_ID = "ci.note_id"; - public static final String CI_NOTE_TYPE = "ci.note_type"; - public static final String CI_NOTE_AUTHOR = "ci.note_author"; - public static final String CI_CREATE_TIME = "ci.create_time"; - public static final String CI_MODIFY_TIME = "ci.modify_time"; - public static final String CI_REVIEW_ID = "ci.review_id"; - public static final String CI_REVIEW_IID = "ci.review_iid"; - public static final String CI_REVIEW_TYPE = "ci.review_type"; - public static final String CI_REVIEW_REVIEWERS = "ci.review_reviewers"; - public static final String CI_REVIEW_STATE = "ci.review_state"; - public static final String CI_REVIEW_OWNER = "ci.review_owner"; - // GIT REVIEW参数 - public static final String CI_CREATE_REF = "ci.create_ref"; - public static final String CI_CREATE_REF_TYPE = "ci.create_type"; - // 流水线基础变量 - public static final String CI_BUILD_NO = "ci.build-no"; - public static final String CI_BUILD_NUM = "ci.build_num"; - public static final String CI_PIPELINE_CREATOR = "ci.pipeline_creator"; - public static final String CI_PIPELINE_MODIFIER = "ci.pipeline_modifier"; - public static final String CI_PIPELINE_VERSION = "ci.pipeline_version"; - public static final String CI_PROJECT_ID = "ci.project_id"; - public static final String CI_PROJECT_NAME = "ci.project_name"; - public static final String CI_BUILD_START_TYPE = "ci.build_start_type"; - public static final String CI_PIPELINE_ID = "ci.pipeline_id"; - public static final String CI_BUILD_ID = "ci.build_id"; - public static final String CI_PIPELINE_NAME = "ci.pipeline_name"; - public static final String CI_WORKSPACE = "ci.workspace"; - public static final String CI_FAILED_TASKNAMES = "ci.failed_tasknames"; - public static final String CI_FAILED_TASKS = "ci.failed_tasks"; - public static final String CI_REMARK = "ci.remark"; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/PipelineViewType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/PipelineViewType.java deleted file mode 100644 index d6909de3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/PipelineViewType.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.api.process.constant; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.constant - * @Project:ops-pro - * @name:PipelineViewType - * @Date:2025/03/24 14:38 - * @Filename:PipelineViewType - * @description:Todo - */ -public class PipelineViewType { - public static final int UNCLASSIFIED = -1; - public static final int DYNAMIC = 1; - public static final int STATIC = 2; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/ProcessMessageCode.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/ProcessMessageCode.java deleted file mode 100644 index 03d7fa3a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/constant/ProcessMessageCode.java +++ /dev/null @@ -1,560 +0,0 @@ -package cd.casic.ci.process.api.process.constant; - -import lombok.val; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.constant - * @Project:ops-pro - * @name:ProcessMessageCode - * @Date:2025/03/24 14:36 - * @Filename:ProcessMessageCode - * @description: - * 流水线微服务模块请求返回状态码 - * 返回码制定规则(0代表成功,为了兼容历史接口的成功状态都是返回0): - * 1、返回码总长度为7位, - * 2、前2位数字代表系统名称(如21代表平台) - * 3、第3位和第4位数字代表微服务模块(00:common-公共模块 01:process-流水线 02:artifactory-版本仓库 03:dispatch-分发 04:dockerhost-docker机器 - * 05:environment-环境 06:experience-版本体验 07:image-镜像 08:log-日志 09:measure-度量 10:monitoring-监控 11:notify-通知 - * 12:openapi-开放api接口 13:plugin-插件 14:quality-质量红线 15:repository-代码库 16:scm-软件配置管理 17:support-支撑服务 - * 18:ticket-证书凭据 19:project-项目管理 20:store-商店 21: auth-权限 22:sign-签名服务 23:metrics-度量服务 24:external-外部 - * 25:prebuild-预建 26: dispatcher-kubernetes 27:buildless 28: lambda 29: stream 30: worker 31: dispatcher-docker - * 32: remotedev 35:misc-杂项) - * 4、最后3位数字代表具体微服务模块下返回给客户端的业务逻辑含义(如001代表系统服务繁忙,建议一个模块一类的返回码按照一定的规则制定) - * 5、系统公共的返回码写在CommonMessageCode这个类里面,具体微服务模块的返回码写在相应模块的常量类里面 - */ -public class ProcessMessageCode { - - // 常量标志 对应code - public static final String SYSTEM_VIEW_LABEL = "CONST_PROCESS_VIEW_LABEL_SYSTEM"; // "系统视图" - public static final String PROJECT_VIEW_LABEL = "CONST_PROCESS_VIEW_LABEL_PROJECT"; // "项目视图" - public static final String PERSON_VIEW_LABEL = "CONST_PROCESS_VIEW_LABEL_PRIVATE"; // "个人视图" - public static final String FAVORITE_PIPELINES_LABEL = "CONST_PROCESS_VIEW_LABEL_FAVORITE"; // "我的收藏" - public static final String MY_PIPELINES_LABEL = "CONST_PROCESS_VIEW_LABEL_MY"; // "我的流水线" - public static final String ALL_PIPELINES_LABEL = "CONST_PROCESS_VIEW_LABEL_ALL"; // "全部流水线" - - public static final String BK_NON_TIMED_TRIGGER_SKIP = "bkNonTimedTriggerSkip"; // 非定时触发,直接跳过 - public static final String BK_RETRY_TIMED_TRIGGER_SKIP = "bkRetryTimedTriggerSkip"; // 重试定时触发的构建,直接跳过 - public static final String BK_FIRST_STAGE_ENV_NOT_EMPTY = "bkFirstStageEnvNotEmpty"; // 第一阶段的环境不能为空 - public static final String BK_QUALITY_CHECK_SUCCEED = "bkQualityCheckSucceed"; // 质量红线({0})检测已通过 - public static final String BK_QUALITY_CHECK_INTERCEPTED = "bkQualityCheckIntercepted"; // 质量红线({0})检测被拦截 - public static final String BK_QUALITY_TO_BE_REVIEW = "bkQualityToBeReview"; // 质量红线({0})待审核!审核人:{1} - public static final String BK_POLLING_WAIT_FOR_QUALITY_RESULT = "bkPollingWaitForQualityResult"; // 第 {0} 次轮询等待红线结果 - public static final String BK_QUALITY_CHECK_RESULT = "bkQualityCheckResult"; // 检测红线结果 - public static final String BK_AUDIT_TIMEOUT = "bkAuditTimeout"; // 审核超时 - public static final String BK_AUDIT_RESULT = "bkAuditResult"; // 步骤审核结束,审核结果:[{0}],审核人:{1} - - // 正在处理当前上报的任务, 请稍等。。。 - public static final String BK_PROCESSING_CURRENT_REPORTED_TASK_PLEASE_WAIT = "bkProcessingCurrentReportedTaskPleaseWait"; - - // 不能同时为空, 填时需同时填写参数 - public static final String BK_VIEW_ID_AND_NAME_CANNOT_BE_EMPTY_TOGETHER = "bkViewIdAndNameCannotBeEmptyTogether"; - - // 因【Git事件触发】插件中,MR Request Hook勾选了【MR为同源同目标分支时,等待队列只保留最新触发的任务】配置,该次构建已被新触发的构建 - public static final String BK_TRIGGERED_BY_GIT_EVENT_PLUGIN = "bkTriggeredByGitEventPlugin"; - public static final String BK_BUILD_IN_REVIEW_STATUS = "bkBuildInReviewStatus";// 项目【{0}】下的流水线【{1}】#{2} 构建处于待审核状态 - - // 用户({0}) 没有流水线({1})的执行权限 - public static final String BK_USER_NO_PIPELINE_EXECUTE_PERMISSIONS = "bkUserNoPipelineExecutePermissions"; - public static final String BK_REMOTE_CALL_SOURCE_IP = "bkRemoteCallSourceIp"; // 本次远程调用的来源IP是[$sourceIp] - public static final String BK_PIPELINE_NAME = "bkPipelineName"; // 流水线名称 - public static final String BK_CREATOR = "bkCreator"; // 创建人 - public static final String BK_TCLS_ENVIRONMENT_MESSAGE = "bkTclsEnvironmentMessage"; // 获取 TCLS 环境失败,请检查用户名密码是否正确,错误信息: - public static final String BK_TCLS_ENVIRONMENT = "bkTclsEnvironment"; // 获取 TCLS 环境失败,请检查用户名密码是否正确 - public static final String BK_CONTINUE = "bkContinue"; // 继续 - public static final String BK_OVERRULE = "bkOverrule"; // 驳回 - public static final String BK_TRIGGER = "bkTrigger"; // 触发 - - public static final Integer OK = 0; - - public static final String ERROR_BUILD_TASK_SUBPIPELINEID_NULL = "2101001"; // 子流水线id不存在 - public static final String ERROR_BUILD_TASK_SUBPIPELINEID_NOT_EXISTS = "2101002";// 子流水线不存在 - public static final String ERROR_PIPELINE_VIEW_MAX_LIMIT = "2101003";// 最多允许同时保存30个视图 - public static final String ERROR_PIPELINE_VIEW_NOT_FOUND = "2101004";// 视图({0})不存在 - public static final String ERROR_PIPELINE_VIEW_HAD_EXISTS = "2101005";// 视图({0})已存在 - public static final String ERROR_DEL_PIPELINE_VIEW_NO_PERM = "2101006";// 用户({0})无权限删除视图({1}) - public static final String PIPELINE_LIST_LENGTH_LIMIT = "2101007";// 流水线列表长度不能超过100 - public static final String USER_NEED_PIPELINE_X_PERMISSION = "2101008";// 流水线: 用户无{0}权限 - public static final String ERROR_PIPELINE_CHANNEL_CODE = "2101009";// 流水线:流水线渠道来源不符合({0}) - public static final String ERROR_ATOM_NOT_FOUND = "2101010";// 插件不存在 - public static final String ILLEGAL_PIPELINE_MODEL_JSON = "2101011";// 流水线: 流水线Model不合法 - public static final String OPERATE_PIPELINE_FAIL = "2101012";// 流水线: 流水线出现异常:{0} - public static final String ERROR_PIPELINE_NAME_EXISTS = "2101013";// 流水线: 流水线名称已被使用 - public static final String ERROR_PIPELINE_TEMPLATE_CAN_NOT_EDIT = "2101014";// 流水线: 模板流水线不支持编辑 - public static final String ERROR_PIPELINE_NAME_TOO_LONG = "2101015";// 流水线名称过长 - public static final String ERROR_PIPELINE_IS_EXISTS = "2101016";// 流水线: 流水线已存在 - public static final String ERROR_QUALITY_TASK_NOT_FOUND = "2101017";// 流水线: 质量红线拦截的任务[{0}]不存在 - public static final String ERROR_QUALITY_REVIEWER_NOT_MATCH = "2101018";// 流水线: 用户({0})不在审核人员名单中 - public static final String CANCEL_BUILD_BY_OTHER_USER = "2101019";// 流水线已经被{0}取消构建,请过{1}秒后再试 - public static final String ERROR_START_BUILD_FREQUENT_LIMIT = "2101020";// 流水线: 不能太频繁启动构建 - public static final String DENY_START_BY_MANUAL = "2101021";// 流水线: 该流水线不能手动启动 - public static final String DENY_START_BY_REMOTE = "2101022";// 流水线: 该流水线不能远程触发 - public static final String ERROR_PARAM_WEBHOOK_ID_NAME_ALL_NULL = "2101023";// Webhook 的ID和名称同时为空 - public static final String ERROR_RESTORE_PIPELINE_NOT_FOUND = "2101024";// 要还原的流水线不存在,可能已经被删除或还原了 - public static final String ERROR_PIPELINE_MODEL_NEED_JOB = "2101025";// Stage缺少Job{0} - public static final String ONLY_MANAGE_CAN_OPERATE_TEMPLATE = "2101026";// 只有管理员才能操作模板 - public static final String PIPELINE_SETTING_NOT_EXISTS = "2101027";// 流水线设置不存在 - public static final String TEMPLATE_NAME_CAN_NOT_NULL = "2101028";// 模板名不能为空字符串 - public static final String PIPELINE_PARAM_CONSTANTS_DUPLICATE = "2101029";// 流水线变量参数和常量重名 - public static final String ERROR_TEMPLATE_NAME_IS_EXISTS = "2101030";// 模板名已经存在 - public static final String TEMPLATE_CAN_NOT_DELETE_WHEN_HAVE_INSTANCE = "2101031";// 模板还存在实例,不允许删除 - public static final String TEMPLATE_CAN_NOT_DELETE_WHEN_PUBLISH = "2101032";// 已关联到研发商店,请先下架再删除 - public static final String TEMPLATE_CAN_NOT_DELETE_WHEN_INSTALL = "2101033";// 已安装到其他项目下使用,不能删除 - public static final String ERROR_TEMPLATE_NOT_EXISTS = "2101034";// 模板不存在 - public static final String ERROR_SOURCE_TEMPLATE_NOT_EXISTS = "2101035";// 源模板不存在 - public static final String FAIL_TO_LIST_TEMPLATE_PARAMS = "2101036";// 列举流水线模板参数失败 - public static final String ONLY_ONE_TRIGGER_JOB_IN_PIPELINE = "2101037";// 流水线只能有一个触发Stage - public static final String ERROR_PIPELINE_NOT_EXISTS = "2101038";// 流水线{0}不存在 - public static final String ERROR_PIPELINE_MODEL_NOT_EXISTS = "2101039";// 流水线的模型不存在 - public static final String ERROR_PIPELINE_NODEL_CONTAINER_NOT_EXISTS = "2101040";// 流水线的模型中指定构建容器{0}不存在 - public static final String ERROR_SAVE_PIPELINE_TIMER = "2101041";// 流水线的定时触发器保存失败 - public static final String ERROR_PIPELINE_JOB_NEED_TASK = "2101042";// Job需要至少有一个任务插件 - public static final String ERROR_DEL_PIPELINE_TIMER = "2101043";// 流水线{0}的定时触发器删除失败 - public static final String SVN_NOT_SUPPORT_TAG = "2101044";// SVN do not support tag - public static final String ERROR_PIPELINE_REPO_ID_NULL = "2101045";// 仓库ID为空 - public static final String ERROR_PIPELINE_REPO_NAME_NULL = "2101046";// 仓库名为空 - public static final String ERROR_PIPELINE_LOCK = "2101047";// 流水线锁定 - public static final String ILLEGAL_TIMER_CRONTAB = "2101048";// 定时触发器的定时参数[{0}]不合法 - public static final String ERROR_PIPELINE_QUEUE_FULL = "2101049";// 流水线队列满 - public static final String USER_NO_PIPELINE_PERMISSION_UNDER_PROJECT = "2101050";// 用户({0})在工程({1})下没有流水线{2}权限 - public static final String ERROR_PIPELINE_DISPATCH_STORE_IMAGE_CODE_BLANK = "2101051";// 模型中使用了商店镜像,但code为空 - public static final String ERROR_PIPELINE_DISPATCH_STORE_IMAGE_VERSION_BLANK = "2101052";// 模型中使用了商店镜像,但version为空 - public static final String ERROR_PIPELINE_DISPATCH_VALUE_BLANK = "2101053";// 模型中非商店蓝盾源/第三方源的镜像value为空 - public static final String ERROR_PIPELINE_PARAMS_NAME_ERROR = "2101054";// 请使用英文命名流水线变量 - public static final String ERROR_PIPELINE_STAGE_NO_REVIEW_GROUP = "2101055";// Stage[{0}]准入配置不正确 - public static final String ERROR_PIPELINE_DESC_TOO_LONG = "2101056";// 流水线描述过长 - public static final String ILLEGAL_TIMER_INTERVAL_CRONTAB = "2101057";// 定时触发器的定时参数[{0}]不能秒级触发 - public static final String ERROR_PIPLEINE_INPUT = "2101058";// 流水线: 入参buildId与pipelineId不匹配 - public static final String MODEL_ATOMCODE_NOT_EXSIT = "2101059";// 流水线内包含插件市场不存在的插件 - public static final String QUERY_USER_INFO_FAIL = "2101060";// 获取用户信息失败 - public static final String PROJECT_NOT_EXIST = "2101061";// 项目不存在 - public static final String ERROR_ATOM_RUN_BUILD_ENV_INVALID = "2101062";// 流水线: 插件[{0}]不能在该环境下运行 - public static final String ERROR_TEMPLATE_PIPELINE_IS_INSTANCING = "2101063";// 流水线: 模板下的流水线实例{0}正在更新中,请稍后再试 - public static final String ERROR_FINALLY_STAGE = "2101064";// 流水线: 每个Model只能包含一个FinallyStage,并且处于最后位置 - public static final String ERROR_FINALLY_STAGE_JOB_CONDITION = "2101065";// 流水线: finally stage下的[{0}]Job运行条件配置错误: {1} - public static final String ERROR_NORMAL_STAGE_JOB_CONDITION = "2101066";// 流水线: 普通stage下的[{0}]Job运行条件配置错误: {0} - public static final String ERROR_EMPTY_JOB = "2101067";// 流水线: Model信息不完整,Stage[{0}] Job[{1}]下没有插件 - public static final String ERROR_PIPELINE_MODEL_TOO_LARGE = "2101068";// 流水线: 流水线模型超限,阈值为[{0}]个字符,请联系发布者 - - // 流水线: 流水线下[{0}]的[{1}]数量超限,阈值为[{2}]个,请联系发布者 - public static final String ERROR_PIPELINE_MODEL_COMPONENT_NUM_TOO_LARGE = "2101069"; - public static final String ERROR_ATOM_PARAM_VALUE_TOO_LARGE = "2101070";// 流水线: 插件[{0}]的参数[{1}]值超限,阈值为[{2}]个字符,请联系发布者 - public static final String ERROR_PIPELINE_STAGE_REVIEW_GROUP_NO_USER = "2101072";// Stage[{0}]的审核组[{1}]没有未配置可执行人 - public static final String ERROR_PIPELINE_STAGE_REVIEW_GROUP_NOT_FOUND = "2101073";// Stage[{0}]的审核组ID[{1}]不存在 - public static final String ERROR_PIPELINE_STAGE_POSITION_NOT_FOUND = "2101074";// Stage[{0}]的准入准出标识[{1}]不正确 - public static final String ERROR_PIPELINE_START_WITH_ERROR = "2101075";// 流水线启动准备失败{0} - public static final String ERROR_TEMPLATE_NOT_UPDATE = "2101076";// 该模板无法更新 - public static final String REPOSITORY_ID_AND_NAME_ARE_EMPTY = "2101077";// 仓库ID和仓库名都为空 - public static final String ERROR_TEMPLATE_VERSION_COUNT_EXCEEDS_LIMIT = "2101078";// 模板的版本数量不能超过{0}个 - public static final String FAIL_TEMPLATE_UPDATE_NUM_TOO_BIG = "2101079";// 模板实例更新数量[{0}]超过系统规定的最大值{1},请调整参数或咨询助手 - public static final String ERROR_START_BUILD_PROJECT_UNENABLE = "2101080";// 项目[{0}]已禁用,不能启动 - public static final String ERROR_BUILD_EXPIRED_CANT_RETRY = "2101081";// 构建数据已过期,请使用rebuild进行重试/Please use rebuild - public static final String ERROR_PIPELINE_STAGE_REVIEW_VARIABLES_OUT_OF_LENGTH = "2101082";// Stage审核参数{0}超出4000长度限制 - public static final String ERROR_PIPELINE_CAN_NOT_DELETE_WHEN_HAVE_BUILD_RECORD = "2101083";// 流水线版本还存在构建记录,不允许删除 - public static final String ERROR_JOB_TIME_OUT_PARAM_VAR = "2101084";// Job[{0}]的超时配置的流水线变量[{1}]值[{2}]超出合理范围[{3}](分钟) - - // Job[{0}]的Task[{1}]的超时配置的流水线变量[{2}]值[{3}]超出合理范围[{4}](分钟) - public static final String ERROR_TASK_TIME_OUT_PARAM_VAR = "2101085"; - - // Job[{0}]的互斥组[{1}]超时配置的流水线变量[{2}]值[{3}]超出合理范围[{4}](分钟) - public static final String ERROR_JOB_MUTEX_TIME_OUT_PARAM_VAR = "2101086"; - public static final String GIT_INVALID = "2101087";// 无效的GIT仓库 - public static final String TGIT_INVALID = "2101088";// 无效的TGIT仓库 - public static final String SVN_INVALID = "2101089";// 无效的SVN仓库 - public static final String GITHUB_INVALID = "2101090";// 无效的GITHUB仓库 - public static final String P4_INVALID = "2101091";// 无效的p4仓库 - public static final String GIT_NOT_FOUND = "2101092";// 代码库{0}不存在 - public static final String NOT_SVN_CODE_BASE = "2101093";// 代码库({0})不是svn代码库 - public static final String FAIL_TO_GET_SVN_DIRECTORY = "2101094";// 获取Svn目录失败, msg:{0} - public static final String ADD_PIPELINE_TIMER_TRIGGER_SAVE_FAIL = "2101095";// 添加流水线的定时触发器保存失败!可能是定时器参数过长! - public static final String BUILD_QUEUE_FOR_SINGLE = "2101096";// 排队中: 当前构建正在排队中 - public static final String ERROR_JOB_MATRIX_YAML_CONFIG_ERROR = "2101097";// Job[{0]的矩阵YAML配置错误: - public static final String ERROR_PIPELINE_ID_NOT_PROJECT_PIPELINE = "2101098";// {0} 非 {1} 流水线 - public static final String ERROR_NO_MATCHING_PIPELINE = "2101099";// 没有找到对应的流水线 - - // 子流水线不允许循环调用,循环流水线:projectId:{0},pipelineId:{1} - public static final String ERROR_SUB_PIPELINE_NOT_ALLOWED_CIRCULAR_CALL = "2101100"; - public static final String ERROR_MAX_PIPELINE_COUNT_PER_PROJECT = "2101101";// 该项目最多只能创建{0}条流水线 - public static final String ERROR_RETRY_3_FAILED = "2101102";// 重试3次失败 - public static final String ERROR_UPDATE_FAILED = "2101103";// 更新失败: {0} - public static final String ERROR_PERMISSION_NOT_PROJECT_MANAGER = "2101104";// {0}非项目{1}管理员 - public static final String BUILD_QUEUE_FOR_CONCURRENCY = "2101105";// 排队中: 当前构建正在并发组({0})排队中 - public static final String USER_INSTALL_ATOM_CODE_IS_INVALID = "2101106";// 安装插件失败 - - public static final String ERROR_PAUSE_PIPELINE_IS_RUNNING = "2101107";// 暂停的流水线已开始运行 - public static final String ERROR_ELEMENT_TOO_LONG = "2101109";// {0} element大小越界 - public static final String ERROR_JOB_RUNNING = "2101110";// job非完成态,不能进行重试 - public static final String ERROR_TIMEOUT_IN_BUILD_QUEUE = "2101111";// 排队超时,取消运行! [{0}] - public static final String ERROR_BUILD_TASK_QUALITY_OUT = "2101112";// 质量红线(准出)检测失败 - public static final String ERROR_TIMEOUT_IN_RUNNING = "2101113";// {0}运行达到({1})分钟,超时结束运行! - public static final String ERROR_RETRY_STAGE_NOT_FAILED = "2101114";// stage非失败状态,不能进行重试 - public static final String ERROR_NO_PARAM_IN_JOB_CONDITION = "2101115";// 请设置Job运行的自定义变量 - public static final String ERROR_BACKGROUND_SERVICE_TASK_EXECUTION = "2101116";// 后台服务任务执行出错 - public static final String ERROR_BACKGROUND_SERVICE_RUNNING_ERROR = "2101117";// 后台服务运行出错 - public static final String ERROR_VIEW_NOT_FOUND_IN_PROJECT = "2101118";// 在项目 {0} 下未找到{1}视图{2} - - public static final String ERROR_BUILD_TASK_ENV_NAME_IS_NULL = "2101119";// 环境名未初始化 - public static final String ERROR_BUILD_TASK_ENV_ID_IS_NULL = "2101120";// 环境ID未初始化 - public static final String ERROR_BUILD_TASK_ENV_NAME_NOT_EXISTS = "2101121";// 以下这些环境名称不存在,请重新修改流水线!$noExistsEnvNames - public static final String ERROR_BUILD_TASK_USER_ENV_NO_OP_PRI = "2101122";// 用户没有操作这些环境的权限!环境:$noExistsEnvNames - - // "以下这些环境id不存在,请重新修改流水线!id: - public static final String ERROR_BUILD_TASK_USER_ENV_ID_NOT_EXISTS = "2101123"; - public static final String ERROR_BUILD_TASK_TARGETENV_TYPE_IS_NULL = "2101124";// 支持 目标环境类型: {0} - - public static final String ERROR_VIEW_GROUP_IS_PROJECT_NO_SAME = "2101125";// 流水线组的视图范围不一致 - public static final String ERROR_VIEW_EXCEED_THE_LIMIT = "2101126";// 流水线组创建太多了 - public static final String ERROR_VIEW_DUPLICATE_NAME = "2101127";// 流水线组名称重复 - public static final String ERROR_VIEW_NAME_ILLEGAL = "2101128";// 流水线组名称不合法 - public static final String ERROR_DUPLICATE_BUILD_RETRY_ACT = "2101129";// 当前构建正在运行中,请勿重复提交重试请求 - - public static final String ERROR_BUILD_TASK_QUALITY_IN = "2101130";// 质量红线(准入)检测失败 - public static final String INCORRECT_EXCEL_FORMAT = "2101131";// Excel格式错误,或文件不存在 - public static final String ERROR_CALLBACK_URL_INVALID = "2101132";// 回调的url非法 - public static final String USER_NEED_PROJECT_X_PERMISSION = "2101133";// 用户({0})无({1})项目权限 - public static final String ERROR_CALLBACK_HISTORY_NOT_FOUND = "2101134";// 回调历史记录({0})不存在 - public static final String ERROR_CALLBACK_REPLY_FAIL = "2101135";// 回调重试失败 - public static final String ERROR_CALLBACK_NOT_FOUND = "2101136";// 回调记录({0})不存在 - public static final String ERROR_CALLBACK_SAVE_FAIL = "2101137";// 创建callback失败,失败原因:{0} - - public static final String ERROR_PIPELINE_TIMER_SCM_NO_CHANGE = "2101138";// 流水线定时触发时代码没有变更 - public static final String ERROR_PIPELINE_SUMMARY_NOT_FOUND = "2101139";// 异常:流水线的基础构建数据Summary不存在,请联系管理员 - public static final String ERROR_PIPELINE_IS_NOT_THE_LATEST = "2101140";// 异常:保存已拒绝,因为保存流水线时已不是最新版本 - public static final String ERROR_RESTART_EXSIT = "2101141";// 流水线: 待restart构建{0}已在restart中 - public static final String MAXIMUM_NUMBER_QUEUES_ILLEGAL = "2101142";// 最大排队数量非法 - public static final String ERROR_VIEW_GROUP_NO_PERMISSION = "2101143";// 没有修改流水线组权限 - public static final String ERROR_EXPORT_OUTPUT_CONFLICT = "2101144";// 变量名[{0}]来源不唯一,请修改变量名称或增加插件输出命名空间:{1} - public static final String ERROR_PIPELINE_DEPENDON_CYCLE = "2101145";// ({0})与({1})的jobId循环依赖 - public static final String ERROR_PIPELINE_JOBID_EXIST = "2101146";// ({0})的jobId({1})已存在 - public static final String MAXIMUM_QUEUE_LENGTH_ILLEGAL = "2101147";// 最大排队时长非法 - public static final String BUILD_MSG_LABEL = "2101148";// 构建信息 - public static final String BUILD_MSG_MANUAL = "2101149";// 手动触发 - public static final String BUILD_MSG_TIME = "2101150";// 定时触发 - public static final String BUILD_MSG_REMOTE = "2101151";// 远程触发 - public static final String BUILD_MSG_WEBHOOK = "2101152";// webhook触发 - public static final String BUILD_MSG_SERVICE = "2101153";// 服务触发 - public static final String BUILD_MSG_PIPELINE = "2101154";// 流水线触发 - public static final String BUILD_MSG_DESC = "2101155";// 构建信息描述 - public static final String BUILD_WORKER_DEAD_ERROR = "2101156";// 其他构建进程挂掉的参考信息,自由添加方便打印到日志里 - public static final String BUILD_AGENT_DETAIL_LINK_ERROR = "2101157";// 构建机Agent详情链接 - public static final String BUILD_MSG_TRIGGERS = "2101158";// 构建触发 - - // 构建进程心跳超时{0}秒 - // \n 可能原因: - // \n 1. 构建机网络不通,检查构建机网络代理、或所在企业安全鉴权会话是否过期。 - // \n 2. 业务构建进程进程被操作系统或其他程序杀掉,需自查并降低负载后重试。 - // \n 3. 其他参考链接[Link] 其他构建进程挂掉的参考信息,自由添加方便打印卫通日志里 - // \n 4. 平台级故障导致大面积超时。 - public static final String BK_TIP_MESSAGE = "2101159"; - public static final String ERROR_GROUP_COUNT_EXCEEDS_LIMIT = "2101160";// 一个项目标签组不能超过10个 - public static final String ERROR_LABEL_COUNT_EXCEEDS_LIMIT = "2101161";// 同一分组下最多可添加12个标签 - public static final String ERROR_LABEL_NAME_TOO_LONG = "2101162";// 一个标签最多输入20个字符 - public static final String ERROR_NO_BUILD_EXISTS_BY_ID = "2101163";// 流水线构建[{0}]不存在 - public static final String ERROR_NO_PIPELINE_EXISTS_BY_ID = "2101164";// 流水线[{0}]不存在 - public static final String ERROR_SUBPIPELINE_CYCLE_CALL = "2101165";// 子流水线循环调用 - public static final String ERROR_NO_STAGE_EXISTS_BY_ID = "2101166";// 构建中Stage[{0}]不存在 - public static final String ERROR_STAGE_IS_NOT_PAUSED = "2101167";// 构建中Stage[{0}]未处于等待把关状态 - public static final String ERROR_CONDITION_EXPRESSION_PARSE = "2101168";// 执行条件表达式解析失败 - public static final String ERROR_TRIGGER_REVIEW_ABORT = "2101169";// 触发审核未通过 - public static final String ERROR_TRIGGER_NOT_UNDER_REVIEW = "2101170";// 触发不在审核状态中 - public static final String ERROR_GENERATE_REMOTE_TRIGGER_TOKEN_FAILED = "2101171";// 生成远程触发token失败 - public static final String ERROR_NO_BUILD_RECORD_FOR_CORRESPONDING_SUB_PIPELINE = "2101172";// 找不到对应子流水线的构建记录 - public static final String ERROR_NO_CORRESPONDING_SUB_PIPELINE = "2101173";// "找不到对应子流水线" - public static final String ERROR_USER_NO_PERMISSION_GET_PIPELINE_INFO = "2101174";// 用户({0}) 无权限获取流水线({1})信息({2}) - public static final String ERROR_SUB_PIPELINE_PARAM_FILTER_FAILED = "2101175";// 子流水线参数过滤失败 - public static final String ERROR_NO_PERMISSION_PLUGIN_IN_TEMPLATE = "2101176";// 模版下存在无权限的插件 - public static final String PIPELINE_ORCHESTRATIONS_NUMBER_ILLEGAL = "2101177";// 流水线编排数量非法 - public static final String MAXIMUM_NUMBER_CONCURRENCY_ILLEGAL = "2101178";// 最大并发数量非法 - public static final String GET_PIPELINE_ATOM_INFO_NO_PERMISSION = "2101179";// 无权访问插件{0}的流水线信息,请联系组件管理员 - public static final String GROUP_IS_EXIST = "2101180";// 分组({0})已存在/group ({0}) is already exist - public static final String GROUP_LABEL_IS_EXIST = "2101181";// 分组标签({0})已存在/group label ({0}) is already exist - public static final String PIPELINE_BUILD_HAS_ENDED_CANNOT_BE_OPERATE = "2101182";// 流水线: 流水线构建已结束,不能操作 - public static final String ERROR_NO_PERMISSION_OPERATION_TEMPLATE = "2101183";// 用户没有操作模板的权限 - public static final String ERROR_NO_PIPELINE_VERSION_EXISTS_BY_ID = "2101184";// 流水线版本[{0}]不存在 - public static final String ERROR_NO_PIPELINE_DRAFT_EXISTS = "2101185";// 该流水不存在草稿版本 - public static final String ERROR_OCCURRED_IN_TRANSFER = "2101186";// 转换时出现报错 - public static final String ERROR_PIPELINE_CONSTANTS_BLANK_ERROR = "2101187";// 常量({0})的取值为空 - public static final String ERROR_PIPELINE_YAML_FILENAME = "2101188";// 流水线YAML文件后缀{0}不正确 - public static final String ERROR_PIPELINE_WITH_EMPTY_STAGE = "2101189";// 编辑保存stage不能为空 - public static final String ERROR_NO_RELEASE_PIPELINE_VERSION = "2101190";// 无发布版本的流水线无法执行 - public static final String ERROR_TRIGGER_DETAIL_NOT_FOUND = "2101191";// 触发详情{0}不存在 - public static final String ERROR_TRIGGER_EVENT_NOT_FOUND = "2101192";// 触发事件{0}不存在 - public static final String ERROR_TRIGGER_TYPE_REPLAY_NOT_SUPPORT = "2101193";// 触发类型{0}不支持重放 - public static final String ERROR_TRIGGER_REPLAY_PIPELINE_NOT_EMPTY = "2101194";// 重放流水线ID不能为空 - public static final String ERROR_WEBHOOK_REQUEST_NOT_FOUND = "2101195";// webhook {0} 不存在 - public static final String ERROR_GET_GIT_PROJECT_INFO = "2101196";// 获取git项目信息失败 - public static final String ERROR_GET_GIT_MERGE_INFO = "2101197";// 获取mr信息失败 - public static final String ERROR_GET_GIT_MERGE_REVIEW = "2101198";// 获取mr view信息失败 - public static final String ERROR_GET_GIT_MERGE_CHANGE = "2101199";// 获取mr change信息失败 - public static final String ERROR_GET_GIT_FILE_TREE = "2101200";// 获取git文件树失败 - public static final String ERROR_GET_YAML_CONTENT = "2101201";// 获取yaml文件内容失败 - public static final String ERROR_GET_GIT_FILE_INFO = "2101202";// 获取文件信息失败 - public static final String ERROR_CI_YAML_NEED_MERGE_OR_REBASE = "2101203";// - public static final String ERROR_DEVNET_TIMEOUT = "2101204"; // - public static final String UNKNOWN_ERROR = "2101205"; - public static final String YAML_VIEW_CANNOT_DELETE = "2101206";// 由开启 PAC 模式自动创建,不支持手动修改和删除 - public static final String YAML_VIEW_CANNOT_UPDATE = "2101207";// 由开启 PAC 模式自动创建,不支持手动添加/移除流水线 - public static final String YAML_VIEW_CANNOT_BULK_REMOVE = "2101208";// 由开启 PAC 模式自动创建,删除流水线请前往代码库操作 - public static final String ERROR_GET_COMMIT_INFO = "2101209";// 获取commit信息失败 - public static final String ERROR_DELETE_YAML_PIPELINE_IN_DEFAULT_BRANCH = "2101210";// 已开启PAC模式,不能删除默认分支yaml关联的流水线 - public static final String ERROR_YAML_CONTENT_IS_EMPTY = "2101211";// yaml文件内容不能为空 - public static final String ERROR_YAML_FILE_NAME_FORMAT = "2101212";// yaml文件名格式错误,仅支持yaml、yml后缀和一级子目录 - public static final String ERROR_PIPELINE_BOUND_YAML = "2101213";// 流水线已绑定文件{0},不能修改 - public static final String ERROR_PIPELINE_BOUND_REPO = "2101214";// 流水线已绑定代码库{0},不能修改 - public static final String ERROR_YAML_BOUND_PIPELINE = "2101215";// 文件{0}已绑定流水线{1} - public static final String ERROR_YAML_PUSH_NO_REPO_PERMISSION = "2101216";// 发布必须仓库developer以上权限 - public static final String ERROR_REPO_NO_INIT = "2101217";// 默认分支不存在,请先初始化代码库 - public static final String ERROR_REPOSITORY_NOT_OAUTH = "2101218";// 当前代码库关联人({0})未进行OAUTH授权,请尝试切换代码库凭证类型 - public static final String ERROR_VERSION_IS_NOT_UPDATED = "2101219";// 当前代码库关联人({0})未进行OAUTH授权,请尝试切换代码库凭证类型 - public static final String ERROR_TASK_NOT_ALLOWED_TO_BE_SKIPPED = "2101221";// task不允许被跳过 - public static final String ERROR_INCORRECT_NOTIFICATION_TYPE = "2101230";// 通知类型配置不正确,请检查 - public static final String ERROR_INCORRECT_NOTIFICATION_MESSAGE_CONTENT = "2101231";// 通知内容为空,请检查 - public static final String ERROR_AGENT_REUSE_MUTEX_JOB_NULL = "2101232";// {0}使用流水线构建机复用互斥组需要声明具体的JobId,不能为空 - // 流水线构建机复用互斥组节点 {0} 复用的 {1} 不存在,或非第三方构建机节点 - public static final String ERROR_AGENT_REUSE_MUTEX_DEP_NULL_NODE = "2101233"; - // 在 {0} 下,构建机复用互斥组节点 {1} 与被复用的 {2} 节点调度类型不同,AgentId和AgentEnv不能互相复用 - public static final String ERROR_AGENT_REUSE_MUTEX_DEP_ERROR = "2101234"; - public static final String ERROR_YAML_PUSH_CREATE_BRANCH = "2101235";// 创建分支失败: {0} - public static final String ERROR_YAML_PUSH_CREATE_BRANCH_NO_PERMISSION = "2101236";// 用户{0}没有代码库{1}的创建分支权限 - public static final String ERROR_YAML_PUSH_CREATE_FILE = "2101237";// 创建文件失败: {0} - public static final String ERROR_YAML_PUSH_CREATE_FILE_NO_PERMISSION = "2101238";// 用户{0}没有工蜂仓库{1}的创建文件权限 - public static final String ERROR_YAML_PUSH_CREATE_MERGE_REQUEST = "2101239";// 创建mr失败: {0} - public static final String ERROR_YAML_PUSH_CREATE_MERGE_REQUEST_NO_PERMISSION = "2101240";// 用户{0}没有工蜂仓库{1}的创建mr权限 - public static final String ERROR_GIT_PROJECT_NOT_FOUND_OR_NOT_PERMISSION = "2101241";// 工蜂仓库({0})不存在或没有权限访问 - public static final String ERROR_TGIT_SERVER_EXCEPTION = "2101242";// 工蜂服务异常 - - public static final String ERROR_TIMER_TRIGGER_SVN_BRANCH_NOT_EMPTY = "2101243";// 定时触发SVN分支不能为空 - public static final String ERROR_PIPELINE_ELEMENT_CHECK_FAILED = "2101244";// 流水线有效性校验失败 - public static final String ERROR_TIMER_TRIGGER_REPO_NOT_FOUND = "2101245";// 定时触发代码库不存在 - public static final String ERROR_TIMER_TRIGGER_NEED_ENABLE_PAC = "2101246";// 定时触发需要流水线开启PAC - public static final String ERROR_PIPELINE_TIMER_BRANCH_IS_EMPTY = "2101247";// 流水线定时触发分支为空 - public static final String ERROR_PIPELINE_TIMER_BRANCH_NO_CHANGE = "2101248";// 定时触发分支{0}代码没有变更 - public static final String ERROR_PIPELINE_TIMER_BRANCH_NOT_FOUND = "2101249";// 定时触发分支{0}不存在 - public static final String ERROR_PIPELINE_JOB_ID_FORMAT = "2101250";// 流水线Job:{0}的jobId为空或长度超过{1}位 - public static final String ERROR_PIPELINE_JOB_CONTROL_NODECURR = "2101251";// 流水线Job:{0}的单节点或总结点并发配置需要为小于1000的正整数 - public static final String ERROR_PIPELINE_TIMER_BRANCH_UNKNOWN = "2101252";// 定时触发分支{0}未知错误 - public static final String ERROR_PIPELINE_CONDITION_EXPRESSION_TOO_LONG = "2101253";// 自定义条件表达式{0}的长度超过{1}位 - public static final String ERROR_PIPELINE_BUILD_START_PARAM_NO_EMPTY = "2101254";// 构建启动参数如果必填,不能为空 - public static final String ERROR_REPEATEDLY_START_VM = "2101255";// 重复启动构建机,当前构建机的状态为:{0} - public static final String ERROR_PIPELINE_VARIABLES_OUT_OF_LENGTH = "2101256";// 流水线启动参数{0}超出4000长度限制 - - // 在 {0} 下,构建机复用互斥组节点 {1} 与被复用的 {2} 节点前后顺序不明,使用变量需明确前后顺序 - public static final String ERROR_AGENT_REUSE_MUTEX_VAR_ERROR = "2101257"; - public static final String ERROR_PIPELINE_RETRY_TIME_INVALID = "2101258";// 构建数据已过期,重试时间不能晚于构建开始时间{0}天以上 - public static final String ERROR_COMMIT_BRANCH_IS_NOT_EMPTY = "2101259";// 指定分支不能为空 - public static final String ERROR_NON_LATEST_RELEASE_VERSION = "2101266";// 当前构建版本已不是最新版本,请重新选择版本 - public static final String ERROR_REPO_HASH_ID_IS_NOT_EMPTY = "2101267";// 代码库信息不能为空 - - public static final String BK_SUCCESSFULLY_DISTRIBUTED = "bkSuccessfullyDistributed";// 跨项目构件分发成功,共分发了{0}个文件 - public static final String BK_SUCCESSFULLY_FAILED = "bkSuccessfullyFailed";// 跨项目构件分发失败, - public static final String BK_NO_MATCH_FILE_DISTRIBUTE = "bkNoMatchFileDistribute";// 匹配不到待分发的文件: {0} - - // 开始对文件({0})执行Gcloud相关操作,详情请去gcloud官方地址查看: - public static final String BK_START_PERFORMING_GCLOUD_OPERATION = "bkStartPerformingGcloudOperation"; - public static final String BK_START_UPLOAD_OPERATION = "bkStartUploadOperation";// 开始执行 \"上传动态资源版本\" 操作 - public static final String BK_OPERATION_PARAMETERS = "bkOperationParameters";// \"上传动态资源版本\" 操作参数: - public static final String BK_QUERY_VERSION_UPLOAD = "bkQueryVersionUpload";// 开始执行 \"查询版本上传 CDN 任务状态\" 操作\n - public static final String BK_WAIT_QUERY_VERSION = "bkWaitQueryVersion";// \"等待查询版本上传 CDN 任务状态\" 操作执行完毕: \n - - // \"查询版本上传 CDN 任务状态\" 操作 成功执行完毕\n - public static final String BK_OPERATION_COMPLETED_SUCCESSFULLY = "bkOperationCompletedSuccessfully"; - public static final String BK_FAILED_UPLOAD_FILE = "bkFailedUploadFile";// 上传文件失败: - public static final String BK_CREATE_RESOURCE_OPERATION = "bkCreateResourceOperation";// 开始执行 \"创建资源\" 操作\n - public static final String BK_CREATE_RESOURCES_OPERATION_PARAMETERS = "bkCreateResourcesOperationParameters";// \"创建资源\" 操作参数: - public static final String BK_START_RELEASE_OPERATION = "bkStartReleaseOperation";// 开始执行 \"预发布\" 操作\n - public static final String BK_RESPONSE_RESULT = "bkResponseResult";// 预发布单个或多个渠道响应结果: - public static final String BK_RECIPIENT_EMPTY = "bkRecipientEmpty";// 收件人为空 - public static final String BK_EMAIL_NOTIFICATION_CONTENT_EMPTY = "bkEmailNotificationContentEmpty";// 邮件通知内容为空 - public static final String BK_MESSAGE_SUBJECT_EMPTY = "bkMessageSubjectEmpty";// 邮件主题为空 - public static final String BK_EXPERIENCE_PATH_EMPTY = "bkExperiencePathEmpty";// 体验路径为空 - public static final String BK_INCORRECT_NOTIFICATION_METHOD = "bkIncorrectNotificationMethod";// 通知方式不正确 - - // 版本体验({0})创建成功 - public static final String BK_VERSION_EXPERIENCE_CREATED_SUCCESSFULLY = "bkVersionExperienceCreatedSuccessfully"; - public static final String BK_VIEW_RESULT = "bkViewResult";// 查看结果: - public static final String BK_RECEIVER_EMPTY = "bkReceiverEmpty";// Message Receivers is empty(接收人为空) - public static final String BK_MESSAGE_CONTENT_EMPTY = "bkMessageContentEmpty";// Message Body is empty(消息内容为空) - public static final String BK_EMPTY_TITLE = "bkEmptyTitle";// Message Title is empty(标题为空) - public static final String BK_COMPUTER_VIEW_DETAILS = "bkComputerViewDetails";// {0}\n\n电脑查看详情:{1}\n手机查看详情:{2} - - // send enterprise wechat message(发送企业微信消息):\n{0}\nto\n{1} - public static final String BK_SEND_WECOM_MESSAGE = "bkSendWecomMessage"; - public static final String BK_INVALID_NOTIFICATION_RECIPIENT = "bkInvalidNotificationRecipient";// 通知接收者不合法: - public static final String BK_WECOM_NOTICE = "bkWecomNotice";// 企业微信通知内容: - public static final String BK_SEND_WECOM_CONTENT = "bkSendWecomContent";// 发送企业微信内容: ({0}) 到 {1} - public static final String BK_SEND_WECOM_CONTENT_SUCCESSFULLY = "bkSendWecomContentSuccessfully";// 发送企业微信内容: ({0}) 到 {1}成功 - public static final String BK_SEND_WECOM_CONTENT_FAILED = "bkSendWecomContentFailed";// 发送企业微信内容: ({0}) 到 {1}失败: - public static final String BK_PULL_GIT_WAREHOUSE_CODE = "bkPullGitWarehouseCode";// 拉取Git仓库代码 - public static final String BK_AUTOMATIC_EXPORT_NOT_SUPPORTED = "bkAutomaticExportNotSupported"; - - // ### 可以通过 runs-on: macos-10.15 使用macOS公共构建集群。 - public static final String BK_BUILD_CLUSTERS_THROUGH = "bkBuildClustersThrough"; - - // 注意默认的Xcode版本为12.2,若需自定义,请在JOB下自行执行 xcode-select 命令切换 ### - public static final String BK_NOTE_DEFAULT_XCODE_VERSION = "bkNoteDefaultXcodeVersion"; - public static final String BK_PLEASE_USE_STAGE_AUDIT = "bkPleaseUseStageAudit";// 人工审核插件请改用Stage审核 ### - public static final String BK_PLUG_NOT_SUPPORTED = "bkPlugNotSupported";// # 注意:不支持插件【{0}({1})】的导出 - public static final String BK_FIND_RECOMMENDED_REPLACEMENT_PLUG = "bkFindRecommendedReplacementPlug";// 请在蓝盾研发商店查找推荐的替换插件! - public static final String BK_OLD_PLUG_NOT_SUPPORT = "bkOldPlugNotSupport";// 内置老插件不支持导出,请使用市场插件 ### - public static final String BK_NO_RIGHT_EXPORT_PIPELINE = "bkNoRightExportPipeline";// 用户({0})无权限在工程({1})下导出流水线 - public static final String BK_PIPELINED_ID = "bkPipelinedId";// # 流水线ID: - public static final String BK_EXPORT_TIME = "bkExportTime";// # 导出时间: - public static final String BK_EXPORT_SYSTEM_CREDENTIALS = "bkExportSystemCredentials"; - - // # 注意:[插件]输入参数可能存在敏感信息,请仔细检查,谨慎分享!!! \n - public static final String BK_SENSITIVE_INFORMATION_IN_PARAMETERS = "bkSensitiveInformationInParameters"; - - // # 注意:[插件]Stream不支持蓝盾老版本的插件,请在研发商店搜索新插件替换 \n - public static final String BK_STREAM_NOT_SUPPORT = "bkStreamNotSupport"; - - // # \n# tips:部分参数导出会存在\[该字段限制导出,请手动填写]\,需要手动指定。原因有:\n - public static final String BK_PARAMETERS_BE_EXPORTED = "bkParametersBeExported"; - public static final String BK_IDENTIFIED_SENSITIVE_INFORMATION = "bkIdentifiedSensitiveInformation";// # ①识别出为敏感信息,不支持导出\n - public static final String BK_UNKNOWN_CONTEXT_EXISTS = "bkUnknownContextExists";// # ②部分字段校验格式时存在未知上下文,不支持导出\n - public static final String BK_AUTOMATIC_EXPORT_NOT_SUPPORTED_IMAGE = "bkAutomaticExportNotSupportedImage"; - - // ###请直接填入镜像(TLinux2.2公共镜像)的URL地址,若存在鉴权请增加 credentials 字段### - public static final String BK_ENTER_URL_ADDRESS_IMAGE = "bkEnterUrlAddressImage"; - public static final String BK_ADMINISTRATOR = "bkAdministrator";// 管理员 - public static final String BK_QUICK_APPROVAL_MOA = "bkQuickApprovalMoa";// 【通过MOA快速审批】 - public static final String BK_QUICK_APPROVAL_PC = "bkQuickApprovalPc";// 【通过PC快速审批】 - public static final String BK_NOT_CONFIRMED_CAN_EXECUTED = "bkNotConfirmedCanExecuted";// 插件 {0} 尚未确认是否可以在工蜂CI执行 - public static final String BK_CONTACT_PLUG_DEVELOPER = "bkContactPlugDeveloper";// ,请联系插件开发者 - public static final String BK_CHECK_INTEGRITY_YAML = "bkCheckIntegrityYaml";// 请检查YAML的完整性,或切换为研发商店推荐的插件后再导出 - public static final String BK_BEE_CI_NOT_SUPPORT = "bkBeeCiNotSupport";// 工蜂CI不支持蓝盾老版本插件 - public static final String BK_SEARCH_STORE = "bkSearchStore";// 请在研发商店搜索新插件替换 - - // # 注意:工蜂CI暂不支持当前类型的构建机 - public static final String BK_NOT_SUPPORT_CURRENT_CONSTRUCTION_MACHINE = "bkNotSupportCurrentConstructionMachine"; - public static final String BK_EXPORT = "bkExport";// 的导出, - public static final String BK_CHECK_POOL_FIELD = "bkCheckPoolField";// 需检查JOB({0})的Pool字段 - public static final String BK_CONSTRUCTION_MACHINE_NOT_SUPPORTED = "bkConstructionMachineNotSupported";// # 注意:暂不支持当前类型的构建机 - - // # 注意:【{0}】的环境【{1}】在新业务下可能不存在, - public static final String BK_NOT_EXIST_UNDER_NEW_BUSINESS = "bkNotExistUnderNewBusiness"; - - // 请手动修改成存在的环境,并检查操作系统是否正确 - public static final String BK_CHECK_OPERATING_SYSTEM_CORRECT = "bkCheckOperatingSystemCorrect"; - - // # 注意:【{0}】的节点【{1}】在新业务下可能不存在, - public static final String BK_NODE_NOT_EXIST_UNDER_NEW_BUSINESS = "bkNodeNotExistUnderNewBusiness"; - public static final String BK_PLEASE_MANUALLY_MODIFY = "bkPleaseManuallyModify";// 请手动修改成存在的节点 - - // # 注意:【{0}】仅对PCG业务可见,请检查当前业务是否属于PCG! \n - public static final String BK_ONLY_VISIBLE_PCG_BUSINESS = "bkOnlyVisiblePcgBusiness"; - - // # 注意:[插件]工蜂CI不支持依赖蓝盾项目的服务(如凭证、节点等), - public static final String BK_WORKER_BEE_CI_NOT_SUPPORT = "bkWorkerBeeCiNotSupport"; - public static final String BK_MODIFICATION_GUIDELINES = "bkModificationGuidelines"; - public static final String BK_BUILD_INFO = "bkBuildInfo";// 构建信息 - public static final String BK_DETAIL = "bkDetail";// 详情 - public static final String BK_BUILD_STATUS = "bkBuildStatus";// 构建状态 - public static final String BK_BUILD_VARIABLES = "bkBuildVariables";// 构建变量 - public static final String BK_BUILD_VARIABLES_VALUE = "bkBuildVariablesValue";// 构建变量的值 - public static final String BK_BUILD_HISTORY = "bkBuildHistory";// 构建历史 - public static final String BK_PENDING_APPROVAL = "bkPendingApproval";// 步骤等待审核(Pending approval) - public static final String BK_REVIEWERS = "bkReviewers";// 待审核人(Reviewers) - public static final String BK_REVIEWER = "bkReviewer";// 审核人(Reviewer) - public static final String BK_DESCRIPTION = "bkDescription";// 审核说明(Description) - public static final String BK_PARAMS = "bkParams";// 审核参数(Params) - public static final String BK_AUDIT_RESULTS_APPROVE = "bkAuditResultsApprove";// 审核结果(result):继续(Approve) - public static final String BK_AUDIT_RESULTS_REJECT = "bkAuditResultsReject";// 审核结果(result):驳回(Reject) - public static final String BK_FINAL_APPROVAL = "bkFinalApproval";// 步骤审核结束(Final approval) - public static final String BK_REVIEW_COMMENTS = "bkReviewComments";// 审核意见(Review comments) - public static final String BK_QUEUE_TIMEOUT = "bkQueueTimeout";// 排队超时(Queue timeout) - public static final String BK_JOB_QUEUE_TIMEOUT = "bkJobQueueTimeout";// Job排队超时,请检查并发配置/Queue timeout - public static final String BK_TRIGGER_USER = "bkTriggerUser";// 触发人(trigger user) - public static final String BK_START_USER = "bkStartUser";// 执行人(start user) - - // [自定义变量全部满足时不运行](Don‘t run it when all the custom variables are matched) - public static final String BK_WHEN_THE_CUSTOM_VARIABLES_ARE_ALL_SATISFIED = "bkWhenTheCustomVariablesAreAllSatisfied"; - - // [自定义变量全部满足时运行](Run it when all the custom variables are matched) - public static final String BK_CUSTOM_VARIABLES_ARE_ALL_SATISFIED = "bkCustomVariablesAreAllSatisfied"; - public static final String BK_CHECK_TASK_RUN_CONDITION = "bkCheckTaskRunCondition";// 检查插件运行条件/Check Task Run Condition: - public static final String BK_TASK_DISABLED = "bkTaskDisabled";// [插件被禁用](Task disabled) = true - - // [只有前面有任务失败时才运行](Only when a previous task has failed) - public static final String BK_ONLY_WHEN_PREVIOUS_TASK_HAS_FAILED = "bkOnlyWhenPreviousTaskHasFailed"; - - // [即使前面有插件运行失败也运行,除非被取消才不运行] (Even if a previous task has failed, unless the build was canceled) - public static final String BK_IT_DOES_NOT_RUN_UNLESS_IT_IS_CANCELED = "bkItDoesNotRunUnlessItIsCanceled"; - - // [即使前面有插件运行失败也运行,即使被取消也运行](Run even if a previous plugin failed, and run even if it was cancelled) - public static final String BK_RUNS_EVEN_IF_CANCELED = "bkRunsEvenIfCanceled"; - public static final String BK_JOB_FAILURE_OR_CANCEL = "bkJobFailureOrCancel";// Job失败或被取消(Job failure or cancel) skip=true - public static final String BK_CHECK_JOB_RUN_CONDITION = "bkCheckJobRunCondition";// 检查Job运行条件/Check Job Run Condition: - public static final String BK_RELEASE_LOCK = "bkReleaseLock";// 释放互斥组锁(Release Lock) - public static final String BK_GET_LOCKED = "bkGetLocked";// 获得锁定(Matched) 锁定期(Exp): - public static final String BK_QUEUE_DISABLED = "bkQueueDisabled";// 未开启排队(Queue disabled) - - // 当前排队数(Queuing)[{0}], 已等待(Waiting)[{1}} seconds] - public static final String BK_CURRENT_NUMBER_OF_QUEUES = "bkCurrentNumberOfQueues"; - public static final String BK_QUEUE_FULL = "bkQueueFull";// 队列满(Queue full) - public static final String BK_ENQUEUE = "bkEnqueue";// 当前排队数(Queuing)[{0}]. 入队等待(Enqueue) - - // Job#{0}|互斥组Mutex[{1}]| - public static final String BK_MUTUALLY_EXCLUSIVE_GROUPS = "bkMutuallyExclusiveGroups"; - public static final String BK_LOCKED = "bkLocked";// 锁定中(Running) - public static final String BK_CLICK = "bkClick";// 查看 - public static final String BK_CURRENT = "bkCurrent";// 当前(Current) - public static final String BK_PREVIOUS_STAGE_CANCEL = "bkPreviousStageCancel";// [上游 Stage 取消时](Previous Stage Cancel): - public static final String BK_PREVIOUS_STAGE_FAILED = "bkPreviousStageFailed";// [上游 Stage 失败时](Previous Stage Failed): - public static final String BK_PREVIOUS_STAGE_SUCCESS = "bkPreviousStageSuccess";// [上游 Stage 成功时](Previous Stage Success): - public static final String BK_UNEXECUTE_TASK = "bkUnexecuteTask";// 终止构建,跳过(UnExecute Task) - public static final String BK_CONDITION_INVALID = "bkConditionInvalid";// 执行条件判断失败(Condition Invalid) - public static final String BK_STAGE_REVIEW_EMPTY_REVIEWER = "bkStageReviewEmptyViewer";// 由于无审核人,被系统自动驳回 - - // [SystemLog]收到终止指令(UnExecute PostAction Task) - public static final String BK_UNEXECUTE_POSTACTION_TASK = "bkUnexecutePostactionTask"; - public static final String BK_MAX_PARALLEL = "bkMaxParallel";// 并行上限/Max parallel: - public static final String BK_MANUALLY_SKIPPED = "bkManuallySkipped";// 被手动跳过 Manually skipped - public static final String BK_EVENT = "bkEvent";// {0}事件 - public static final String BK_WAREHOUSE_EVENTS = "bkWarehouseEvents";// 仓库事件 - public static final String BK_VM_START_ALREADY = "bkVmStartAlready";// 重复启动构建机/VM Start already: - public static final String BK_CONTINUE_WHEN_ERROR = "bkContinueWhenError";// 失败自动跳过/continue when error - public static final String BK_MUTEX_WAITING = "bkMutexWaiting";// 互斥中(Mutex waiting) - public static final String BK_QUEUING = "bkQueuing";// 排队中(Queuing) - public static final String BK_PENDING = "bkPending";// 审核中(Pending) - public static final String BK_QUALITY_IN = "bkQualityIn";// 质量红线(准入) - public static final String BK_QUALITY_OUT = "bkQualityOut";// 质量红线(准出) - public static final String BK_BUILD_FINISHED_AND_DENY_PAUSE = "bkBuildFinishedAndDenyPause";// 构建已结束,禁止暂停请求 - public static final String BK_PIPELINE_RUN_CONDITION_RESULT = "bkPipelineRunConditionResult";// 执行条件计算结果 - public static final String BK_PIPELINE_RUN_CONDITION_NOT_MATCH = "bkPipelineRunConditionNotMatch";// 执行条件为满足,将跳过 - public static final String BK_PIPELINE_RUN_CONDITION_WITH_ERROR = "bkPipelineRunConditionWithError";// 执行条件计算报错 - - public static final String BK_AGENT_REUSE_MUTEX = "bkAgentReuseMutex"; - public static final String BK_AGENT_REUSE_MUTEX_AGENT_ID_NULL = "bkAgentReuseMutexAgentIdNull"; - public static final String BK_MERGE_YAML_CREATE_FILE_TITLE = "bkMergeYamlCreateFileTitle";// 新增流水线发布mr标题 - public static final String BK_MERGE_YAML_UPDATE_FILE_TITLE = "bkMergeYamlUpdateFileTitle";// 修改流水线发布mr标题 - public static final String BK_BUILD_QUEUE_WAIT_FOR_CONCURRENCY = "bkBuildQueueWaitingForConcurrency";// 并发组配置的排队 - public static final String BK_BUILD_QUEUE_WAIT = "bkBuildQueueWaiting";// 并发配置的排队 - public static final String BK_BUILD_CANCEL_BY_CONCURRENCY = "bkBuildCancelByConcurrency";// 并发组配置的取消 - - public static final String BK_PIPELINE_ELEMENT_CHECK_FAILED_MESSAGE = "bkPipelineElementCheckFailedMessage"; - // 没有子流水线执行权限错误标题 - public static final String BK_NOT_SUB_PIPELINE_EXECUTE_PERMISSION_ERROR_TITLE = "bkNotSubPipelineExecutePermissionErrorTitle"; - // 没有子流水线执行权限错误消息 - public static final String BK_NOT_SUB_PIPELINE_EXECUTE_PERMISSION_ERROR_MESSAGE = "bkNotSubPipelineExecutePermissionErrorMessage"; - - // 用户[xxx] 没有如下子流水线的执行权限,重置授权失败 - public static final String BK_NOT_SUB_PIPELINE_EXECUTE_PERMISSION_RESET_ERROR_TITLE = - "bkNotSubPipelineExecutePermissionResetErrorTitle"; - - // 权限代持人[xxx]已无当前流水线执行权限,可能是权限已过期或不再负责此流水线,请联系流水线拥有者处理 - public static final String BK_AUTHOR_NOT_PIPELINE_EXECUTE_PERMISSION = "bkAuthorNotPipelineExecutePermission"; - // 子流水线循环依赖错误标题 - public static final String BK_SUB_PIPELINE_CIRCULAR_DEPENDENCY_ERROR_TITLE = "bkSubPipelineCircularDependencyErrorTitle"; - - // 当前流水线存在循环依赖 - public static final String BK_CURRENT_SUB_PIPELINE_CIRCULAR_DEPENDENCY_ERROR_MESSAGE = - "bkCurrentSubPipelineCircularDependencyErrorMessage"; - - // 子流水线[xxx]调用了当前流水线,形成循环依赖 - public static final String BK_SUB_PIPELINE_CIRCULAR_DEPENDENCY_ERROR_MESSAGE = - "bkSubPipelineCircularDependencyErrorMessage"; - - // [xxx]流水线循环调用[xxx]流水线,形成循环依赖 - public static final String BK_OTHER_SUB_PIPELINE_CIRCULAR_DEPENDENCY_ERROR_MESSAGE = - "bkOtherSubPipelineCircularDependencyErrorMessage"; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/HistorySearchType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/HistorySearchType.java deleted file mode 100644 index 2b0d980d..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/HistorySearchType.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.api.process.enums; - -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.enums - * @Project:ops-pro - * @name:HistorySearchType - * @Date:2025/03/25 10:09 - * @Filename:HistorySearchType - * @description:Todo - */ -@Getter -public enum HistorySearchType { - TRIGGER, // 触发器 - MATERIAL // 源材料 -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/OperationLogType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/OperationLogType.java deleted file mode 100644 index aae52e0e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/OperationLogType.java +++ /dev/null @@ -1,57 +0,0 @@ -package cd.casic.ci.process.api.process.enums; - -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.enums - * @Project:ops-pro - * @name:OperationLogType - * @Date:2025/03/25 10:10 - * @Filename:OperationLogType - * @description:Todo - */ -@Getter -@AllArgsConstructor -public enum OperationLogType { - CREATE_PIPELINE_AND_DRAFT("创建流水线首次保存草稿:「创建了草稿」"), - CREATE_DRAFT_VERSION("编辑流水线生成草稿:「从 P1.T2.0 创建了草稿」"), - UPDATE_DRAFT_VERSION("修改草稿保存后:「修改了草稿」"), - CREATE_BRANCH_VERSION("新增分支版本:「新增版本 P1.T2.0」"), - UPDATE_BRANCH_VERSION("修改分支版本:「修改版本 P1.T2.0」"), - RELEASE_MASTER_VERSION("正式版本完成时:「发布版本 P1.T2.0」"), - DISABLE_PIPELINE("禁用流水线时:「禁用了流水线」"), - ENABLE_PIPELINE("启用流水线时:「启用了流水线」"), - ADD_PIPELINE_OWNER("添加流水线成员时:「添加 xxx,yyy 为执行者」"), - ADD_PIPELINE_TO_GROUP("将流水线添加到流水线组时:「添加到流水线组 a」"), - MOVE_PIPELINE_OUT_OF_GROUP("将流水线移出流水线组时:「从流水线组 a 中移出」"), - UPDATE_PIPELINE_SETTING("修改流水线设置:「修改配置新增版本 P2.T1.2」"), - RESET_RECOMMENDED_VERSION_BUILD_NO("重置流水线推荐版本号:「重置流水线推荐版本号为 xxx」"), - NORMAL_SAVE_OPERATION("普通保存操作"); - - private final String description; - public static OperationLogType parseType(String type) { - if (type == null || type.isBlank()) return NORMAL_SAVE_OPERATION; - try { - return OperationLogType.valueOf(type); - } catch (Exception ignore) { - return NORMAL_SAVE_OPERATION; - } - } - - public static OperationLogType fetchType(VersionStatus versionStatus) { - if (versionStatus == null) return NORMAL_SAVE_OPERATION; - switch (versionStatus) { - case COMMITTING: - return CREATE_PIPELINE_AND_DRAFT; - case BRANCH: - return CREATE_BRANCH_VERSION; - case RELEASED: - return RELEASE_MASTER_VERSION; - default: - return NORMAL_SAVE_OPERATION; - } - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/VariableType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/VariableType.java deleted file mode 100644 index 3170b064..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/enums/VariableType.java +++ /dev/null @@ -1,168 +0,0 @@ -package cd.casic.ci.process.api.process.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.enums - * @Project:ops-pro - * @name:VariableType - * @Date:2025/03/25 10:13 - * @Filename:VariableType - * @description:Todo - */ -@Getter -public enum VariableType { - BK_CI_PIPELINE_ID, - BK_CI_START_TYPE, - BK_CI_PROJECT_NAME, - BK_CI_PIPELINE_NAME, - BK_CI_BUILD_URL, - BK_CI_BUILD_ID, - BK_CI_BUILD_NUM, - BK_CI_BUILD_NUM_ALIAS, - BK_CI_BUILD_JOB_ID("job.id"), - BK_CI_BUILD_MSG, - BK_CI_BUILD_TASK_ID("step.id"), - BK_CI_BUILD_REMARK, - BK_CI_BUILD_FAIL_TASKS, - BK_CI_BUILD_FAIL_TASKNAMES, - BK_CI_TURBO_ID, - BK_CI_MAJOR_VERSION, - BK_CI_MINOR_VERSION, - BK_CI_FIX_VERSION, - BK_CI_BUILD_NO, - BK_CI_PIPELINE_UPDATE_USER, - BK_CI_PIPELINE_VERSION, - BK_CI_PROJECT_NAME_CN, - BK_CI_START_CHANNEL, - BK_CI_START_USER_ID, - BK_CI_START_USER_NAME, - BK_CI_PARENT_PROJECT_ID, - BK_CI_PARENT_PIPELINE_ID, - BK_CI_PARENT_BUILD_ID, - BK_CI_START_PIPELINE_USER_ID, - BK_CI_START_WEBHOOK_USER_ID, - BK_CI_RETRY_COUNT, - BK_CI_ATOM_VERSION("step.atom_version"), - BK_CI_ATOM_CODE("step.atom_code"), - BK_CI_TASK_NAME("step.name"), - BK_CI_ATOM_NAME("step.atom_name"), - BK_CI_GIT_REPO_URL, - BK_CI_GIT_REPO_NAME, - BK_CI_GIT_REPO_ALIAS_NAME, - BK_CI_GIT_REPO_BRANCH, - BK_CI_GIT_REPO_TAG, - BK_CI_GIT_REPO_CODE_PATH, - BK_CI_GIT_REPO_LAST_COMMIT_ID, - BK_CI_GIT_REPO_HEAD_COMMIT_ID, - BK_CI_GIT_REPO_HEAD_COMMIT_COMMENT, - BK_CI_GIT_REPO_HEAD_COMMIT_AUTHOR, - BK_CI_GIT_REPO_HEAD_COMMIT_COMMITTER, - BK_CI_REPO_WEBHOOK_REPO_TYPE, - BK_CI_REPO_WEBHOOK_REPO_URL, - BK_CI_REPO_WEBHOOK_NAME, - BK_CI_REPO_WEBHOOK_ALIAS_NAME, - BK_CI_REPO_WEBHOOK_HASH_ID, - BK_CI_REPO_GIT_WEBHOOK_COMMITID, - BK_CI_REPO_GIT_WEBHOOK_EVENT_TYPE, - BK_CI_REPO_GIT_WEBHOOK_INCLUDE_BRANCH, - BK_CI_REPO_GIT_WEBHOOK_EXCLUDE_BRANCH, - BK_CI_REPO_GIT_WEBHOOK_INCLUDE_PATHS, - BK_CI_REPO_GIT_WEBHOOK_EXCLUDE_PATHS, - BK_CI_REPO_GIT_WEBHOOK_EXCLUDE_USERS, - BK_CI_GIT_WEBHOOK_FINAL_INCLUDE_BRANCH, - BK_CI_GIT_WEBHOOK_FINAL_INCLUDE_PATH, - BK_REPO_GIT_WEBHOOK_PUSH_COMMIT_MSG_(true), // 尾部可以通配n - BK_CI_HOOK_MESSAGE, - BK_CI_REPO_GIT_WEBHOOK_PUSH_USERNAME, - BK_CI_REPO_GIT_WEBHOOK_BRANCH, - BK_REPO_GIT_WEBHOOK_PUSH_BEFORE_COMMIT, - BK_REPO_GIT_WEBHOOK_PUSH_AFTER_COMMIT, - BK_REPO_GIT_WEBHOOK_PUSH_ADD_FILE_(true), // 尾部可以通配n1和n2 - BK_REPO_GIT_WEBHOOK_PUSH_MODIFY_FILE_(true), // 尾部可以通配n1和n2 - BK_REPO_GIT_WEBHOOK_PUSH_DELETE_FILE_(true), // 尾部可以通配n1和n2 - BK_REPO_GIT_WEBHOOK_PUSH_ADD_FILE_COUNT, - BK_REPO_GIT_WEBHOOK_PUSH_MODIFY_FILE_COUNT, - BK_REPO_GIT_WEBHOOK_PUSH_DELETE_FILE_COUNT, - BK_REPO_GIT_WEBHOOK_PUSH_OPERATION_KIND, - BK_REPO_GIT_WEBHOOK_PUSH_ACTION_KIND, - BK_CI_REPO_GIT_WEBHOOK_MR_AUTHOR, - BK_CI_REPO_GIT_WEBHOOK_TARGET_URL, - BK_CI_REPO_GIT_WEBHOOK_SOURCE_URL, - BK_CI_REPO_GIT_WEBHOOK_TARGET_BRANCH, - BK_CI_REPO_GIT_WEBHOOK_SOURCE_BRANCH, - BK_CI_REPO_GIT_WEBHOOK_MR_CREATE_TIME, - BK_CI_REPO_GIT_WEBHOOK_MR_UPDATE_TIME, - BK_CI_REPO_GIT_WEBHOOK_MR_CREATE_TIMESTAMP, - BK_CI_REPO_GIT_WEBHOOK_MR_UPDATE_TIMESTAMP, - BK_CI_REPO_GIT_WEBHOOK_MR_ID, - BK_CI_REPO_GIT_WEBHOOK_MR_NUMBER, - BK_CI_REPO_GIT_WEBHOOK_MR_DESC, - BK_CI_REPO_GIT_WEBHOOK_MR_TITLE, - BK_CI_REPO_GIT_WEBHOOK_MR_ASSIGNEE, - BK_CI_REPO_GIT_WEBHOOK_MR_URL, - BK_CI_REPO_GIT_WEBHOOK_MR_REVIEWERS, - BK_CI_REPO_GIT_WEBHOOK_MR_MILESTONE, - BK_CI_REPO_GIT_WEBHOOK_MR_MILESTONE_DUE_DATE, - BK_CI_REPO_GIT_WEBHOOK_MR_LABELS, - BK_REPO_GIT_WEBHOOK_MR_LAST_COMMIT, - BK_REPO_GIT_WEBHOOK_MR_LAST_COMMIT_MSG, - BK_CI_REPO_GIT_WEBHOOK_TAG_NAME, - BK_CI_REPO_GIT_WEBHOOK_TAG_OPERATION, - BK_CI_REPO_GIT_WEBHOOK_TAG_USERNAME, - BK_CI_REPO_GIT_WEBHOOK_TAG_CREATE_FROM, - BK_CI_REPO_GIT_WEBHOOK_REVIEW_REVIEWABLE_TYPE, - BK_CI_REPO_GIT_WEBHOOK_REVIEW_REVIEWABLE_ID, - BK_CI_REPO_GIT_WEBHOOK_REVIEW_RESTRICT_TYPE, - BK_CI_REPO_GIT_WEBHOOK_REVIEW_APPROVING_REVIEWERS, - BK_CI_REPO_GIT_WEBHOOK_REVIEW_APPROVED_REVIEWERS, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_TITLE, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_ID, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_IID, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_DESCRIPTION, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_STATE, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_OWNER, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_URL, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_MILESTONE_ID, - BK_CI_REPO_GIT_WEBHOOK_ISSUE_ACTION, - BK_CI_REPO_GIT_WEBHOOK_NOTE_COMMENT, - BK_CI_REPO_GIT_WEBHOOK_NOTE_ID, - BK_CI_REPO_GIT_WEBHOOK_NOTE_PROJECT_ID, - BK_CI_REPO_GIT_WEBHOOK_NOTE_NOTEABLE_TYPE, - BK_CI_REPO_GIT_WEBHOOK_NOTE_AUTHOR_ID, - BK_CI_REPO_GIT_WEBHOOK_NOTE_CREATED_AT, - BK_CI_REPO_GIT_WEBHOOK_NOTE_UPDATED_AT, - BK_CI_REPO_GIT_WEBHOOK_NOTE_URL, - BK_CI_REPO_SVN_WEBHOOK_REVERSION, - BK_CI_REPO_SVN_WEBHOOK_USERNAME, - BK_CI_REPO_SVN_WEBHOOK_COMMIT_TIME, - BK_CI_REPO_SVN_WEBHOOK_INCLUDE_PATHS, - BK_CI_REPO_SVN_WEBHOOK_EXCLUDE_PATHS, - BK_CI_REPO_SVN_WEBHOOK_INCLUDE_USERS, - BK_CI_REPO_SVN_WEBHOOK_EXCLUDE_USERS, - BK_CI_REPO_GIT_WEBHOOK_INCLUDE_BRANCHS, - BK_CI_REPO_GIT_WEBHOOK_EXCLUDE_BRANCHS, - BK_CI_REPO_GITHUB_WEBHOOK_CREATE_REF_NAME, - BK_CI_REPO_GITHUB_WEBHOOK_CREATE_REF_TYPE, - BK_CI_REPO_GITHUB_WEBHOOK_CREATE_USERNAME; - - private final boolean hasPrefix; - private final String aliasName; - - VariableType() { - this.hasPrefix = false; - this.aliasName = ""; - } - - VariableType(String aliasName) { - this.hasPrefix = false; - this.aliasName = aliasName; - } - - VariableType(boolean hasPrefix) { - this.hasPrefix = hasPrefix; - this.aliasName = ""; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/AccessRepository.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/AccessRepository.java deleted file mode 100644 index 8a6582ca..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/AccessRepository.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:AccessRepository - * @Date:2025/03/24 14:54 - * @Filename:AccessRepository - * @description:Todo - */ -@Data -@Schema(title = "快速接入-代码库") -public class AccessRepository { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "项目名称", required = true) - private String projectName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildBasicInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildBasicInfo.java deleted file mode 100644 index 08b5c820..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildBasicInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildBasicInfo - * @Date:2025/03/24 14:55 - * @Filename:BuildBasicInfo - * @description:Todo - */ -@Schema(title = "构建模型-基础信息") -public class BuildBasicInfo { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线版本", required = true) - private int pipelineVersion; - @Schema(title = "构建状态", required = false) - private BuildStatus status; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildFormRepositoryValue.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildFormRepositoryValue.java deleted file mode 100644 index a89c761a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildFormRepositoryValue.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildFormRepositoryValue - * @Date:2025/03/24 14:56 - * @Filename:BuildFormRepositoryValue - * @description:Todo - */ -@Data -public class BuildFormRepositoryValue { - private String id; - private String name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistory.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistory.java deleted file mode 100644 index bad8c78c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistory.java +++ /dev/null @@ -1,84 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.process.api.process.pojo.code.WebhookInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import org.apache.tomcat.jni.FileInfo; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildHistory - * @Date:2025/03/24 14:56 - * @Filename:BuildHistory - * @description:Todo - */ -@Data -@Schema(title = "历史构建模型") -public class BuildHistory { - @Schema(title = "构建ID", required = true) - private String id; - @Schema(title = "启动用户", required = true) - private String userId; - @Schema(title = "触发条件", required = true) - private String trigger; - @Schema(title = "构建号", required = true) - private Integer buildNum; - @Schema(title = "编排版本号", required = true) - private int pipelineVersion; - @Schema(title = "编排版本名称", required = true) - private String pipelineVersionName; - @Schema(title = "流水线的执行开始时间", required = true) - private long startTime; - @Schema(title = "流水线的执行结束时间", required = true) - private Long endTime; - @Schema(title = "状态", required = true) - private String status; - @Schema(title = "各阶段状态", required = true) - private List stageStatus; - @Schema(title = "服务器当前时间戳", required = true) - private long currentTimestamp; - @Schema(title = "是否是手机启动", required = false) - private boolean isMobileStart = false; - @Schema(title = "原材料", required = false) - private List material; - @Schema(title = "排队于(毫秒时间戳)", required = false) - private Long queueTime; - @Schema(title = "构件列表", required = false) - private List artifactList; - @Schema(title = "备注", required = false) - private String remark; - @Schema(title = "总耗时(毫秒)", required = false) - private Long totalTime; - @Schema(title = "运行耗时(毫秒,不包括人工审核时间)", required = false) - private Long executeTime; - @Schema(title = "启动参数", required = false) - private List buildParameters; - @Schema(title = "WebHookType", required = false) - private String webHookType; - @Schema(title = "webhookInfo", required = false) - private WebhookInfo webhookInfo; - @Schema(title = "启动类型(新)", required = false) - private String startType; - @Schema(title = "推荐版本号", required = false) - private String recommendVersion; - @Schema(title = "是否重试", required = false) - private boolean retry = false; - @Schema(title = "流水线任务执行错误", required = false) - private List errorInfoList; - @Schema(title = "构建信息", required = false) - private String buildMsg; - @Schema(title = "自定义构建版本号", required = false) - private String buildNumAlias; - @Schema(title = "流水线编排的最后更新时间", required = false) - private Long updateTime; - @Schema(title = "并发时,设定的group", required = false) - private String concurrencyGroup; - @Schema(title = "构建执行次数(重试次数-1)", required = false) - private Integer executeCount; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryRemark.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryRemark.java deleted file mode 100644 index ef7c464e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryRemark.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildHistoryRemark - * @Date:2025/03/24 14:58 - * @Filename:BuildHistoryRemark - * @description:Todo - */ -@Data -@Schema(title = "历史构建备注") -public class BuildHistoryRemark { - @Schema(title = "备注", required = true) - private String remark; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryVariables.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryVariables.java deleted file mode 100644 index fb5b1250..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryVariables.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildHistoryVariables - * @Date:2025/03/24 15:01 - * @Filename:BuildHistoryVariables - * @description:Todo - */ -@Data -@Schema(title = "历史构建变量") -public class BuildHistoryVariables { - @Schema(title = "构建ID", required = true) - private String id; - @Schema(title = "启动用户", required = true) - private String userId; - @Schema(title = "触发条件", required = true) - private String trigger; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "构建号", required = true) - private int buildNum; - @Schema(title = "编排文件版本号", required = true) - private int pipelineVersion; - @Schema(title = "开始时间", required = true) - private long startTime; - @Schema(title = "结束时间", required = true) - private Long endTime; - @Schema(title = "状态", required = true) - private String status; - @Schema(title = "构建变量集合", required = true) - private Map variables; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryWithPipelineVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryWithPipelineVersion.java deleted file mode 100644 index e4c093eb..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryWithPipelineVersion.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.framework.commons.pojo.PageResult; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildHistoryWithPipelineVersion - * @Date:2025/03/24 15:01 - * @Filename:BuildHistoryWithPipelineVersion - * @description:Todo - */ -@Data -@Schema(title = "历史构建模型-最新版本号-下载权限") -public class BuildHistoryWithPipelineVersion { - @Schema(title = "构建历史", required = true) - // 这里随便用了一个分页 - private PageResult history; - @Schema(title = "是否拥有下载构建的权限", required = true) - private boolean hasDownloadPermission; - @Schema(title = "最新的编排版本号", required = true) - private int pipelineVersion; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryWithVars.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryWithVars.java deleted file mode 100644 index ec4b9d3e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildHistoryWithVars.java +++ /dev/null @@ -1,81 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.process.api.process.pojo.code.WebhookInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import org.apache.tomcat.jni.FileInfo; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildHistoryWithVars - * @Date:2025/03/24 15:02 - * @Filename:BuildHistoryWithVars - * @description:Todo - */ -@Data -@Schema(title = "带构建变量的历史构建模型") -public class BuildHistoryWithVars { - @Schema(title = "构建ID", required = true) - private String id; - @Schema(title = "启动用户", required = true) - private String userId; - @Schema(title = "触发条件", required = true) - private String trigger; - @Schema(title = "构建号", required = true) - private Integer buildNum; - @Schema(title = "编排文件版本号", required = true) - private int pipelineVersion; - @Schema(title = "开始时间", required = true) - private long startTime; - @Schema(title = "结束时间", required = true) - private Long endTime; - @Schema(title = "状态", required = true) - private String status; - @Schema(title = "各阶段状态", required = true) - private List stageStatus; - @Schema(title = "服务器当前时间戳", required = true) - private long currentTimestamp; - @Schema(title = "是否是手机启动", required = false) - private boolean isMobileStart = false; - @Schema(title = "原材料", required = false) - private List material; - @Schema(title = "排队于", required = false) - private Long queueTime; - @Schema(title = "排队位置", required = false) - private int currentQueuePosition = 0; - @Schema(title = "构件列表", required = false) - private List artifactList; - @Schema(title = "备注", required = false) - private String remark; - @Schema(title = "总耗时(毫秒)", required = false) - private Long totalTime; - @Schema(title = "运行耗时(毫秒,不包括人工审核时间)", required = false) - private Long executeTime; - @Schema(title = "启动参数", required = false) - private List buildParameters; - @Schema(title = "WebHook类型", required = false) - private String webHookType; - @Schema(title = "webhook信息", required = false) - private WebhookInfo webhookInfo; - @Schema(title = "启动类型(新)", required = false) - private String startType; - @Schema(title = "推荐版本号", required = false) - private String recommendVersion; - @Schema(title = "是否重试", required = false) - private boolean retry = false; - @Schema(title = "流水线任务执行错误", required = false) - private List errorInfoList; - @Schema(title = "构建信息", required = false) - private String buildMsg; - @Schema(title = "自定义构建版本号", required = false) - private String buildNumAlias; - @Schema(title = "构建变量集合(30天左右过期删除)", required = true) - private Map variables; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildId.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildId.java deleted file mode 100644 index d26d28f1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildId.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildId - * @Date:2025/03/24 15:07 - * @Filename:BuildId - * @description:Todo - */ -@Data -@Schema(title = "构建模型-ID") -public class BuildId { - @Schema(title = "构建ID", required = true) - private String id; - @Schema(title = "当前执行次数") - private int executeCount = 1; - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "流水线ID") - private String pipelineId; - @Schema(title = "构建编号") - private Integer num; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildJobResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildJobResult.java deleted file mode 100644 index 51ded489..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildJobResult.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildJobResult - * @Date:2025/03/24 15:08 - * @Filename:BuildJobResult - * @description:Todo - */ -@Schema(title = "流水线模型-job执行结果") -public class BuildJobResult { - @Schema(title = "错误原因", required = false) - private String message; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildManualStartupInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildManualStartupInfo.java deleted file mode 100644 index 265a14a4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildManualStartupInfo.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import io.swagger.v3.oas.annotations.media.Schema; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildManualStartupInfo - * @Date:2025/03/24 15:08 - * @Filename:BuildManualStartupInfo - * @description:Todo - */ -@Schema(title = "构建模型-流水线手动启动信息") -public class BuildManualStartupInfo { - @Schema(title = "是否可手工启动", required = true) - private boolean canManualStartup; - @Schema(title = "是否可跳过插件", required = true) - private boolean canElementSkip; - @Schema(title = "启动表单元素列表", required = true) - private List properties; - @Schema(title = "指定的构建号", required = true) - private BuildNo buildNo; - @Schema(title = "是否使用最近一次的参数进行构建", required = false) - private Boolean useLatestParameters; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildStageProgressInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildStageProgressInfo.java deleted file mode 100644 index 309b26cd..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildStageProgressInfo.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildStageProgressInfo - * @Date:2025/03/24 15:08 - * @Filename:BuildStageProgressInfo - * @description:Todo - */ -@Schema(title = "阶段进度") -public class BuildStageProgressInfo { - @Schema(title = "阶段进度", required = true) - private Double stageProgressRete; - @Schema(title = "task进度", required = true) - private List taskProgressList; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildStageStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildStageStatus.java deleted file mode 100644 index c1715606..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildStageStatus.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildStageStatus - * @Date:2025/03/24 15:09 - * @Filename:BuildStageStatus - * @description:Todo - */ -@Data -@Schema(title = "历史构建阶段状态") -@AllArgsConstructor -public class BuildStageStatus { - @Schema(title = "阶段ID", required = true) - private String stageId; - @Schema(title = "阶段名称", required = true) - private String name; - @Schema(title = "阶段状态", required = false, readOnly = true) - private String status; - @Schema(title = "阶段标签", required = false, readOnly = true) - private List tag; - @Schema(title = "阶段启动时间", required = false, readOnly = true) - private Long startEpoch; - @Schema(title = "容器运行时间", required = false, readOnly = true) - private Long elapsed; - @Schema(title = "各项耗时", required = true) - private BuildRecordTimeCost timeCost; - @Schema(title = "前端", required = false, readOnly = true) - private String showMsg; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTask.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTask.java deleted file mode 100644 index e333fbb8..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTask.java +++ /dev/null @@ -1,57 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildTaskStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildTask - * @Date:2025/03/24 15:10 - * @Filename:BuildTask - * @description:Todo - */ -@Data -@Schema(title = "流水线模型-构建任务") -public class BuildTask { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "构建环境ID", required = true) - private String vmSeqId; - @Schema(title = "任务状态", required = true) - private BuildTaskStatus status; - @Schema(title = "插件执行次数", required = false) - private Integer executeCount; - @Schema(title = "任务ID", required = true) - private String taskId; - @Schema(title = "插件ID", required = true) - private String elementId; - @Schema(title = "标识上下文的插件ID", required = true) - private String stepId; - @Schema(title = "插件名字", required = true) - private String elementName; - @Schema(title = "插件版本号", required = false) - private String elementVersion; - @Schema(title = "任务类型", required = false) - private String type; - @Schema(title = "任务参数", required = false) - private Map params; - @Schema(title = "环境参数", required = false) - private Map buildVariable; - @Schema(title = "容器类型", required = false) - private String containerType; - @Schema(title = "签名token", required = false) - private String signToken; - - @Override - public String toString() { - return "buildId=" + buildId + "|vmSeqId=" + vmSeqId + "|status=" + status + "|taskId=" + taskId + - "|name=" + elementName + "|stepId=" + stepId + "|type=" + type + - "|paramSize=" + (params != null ? params.size() : 0) + - "|buildVarSize=" + (buildVariable != null ? buildVariable.size() : 0); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskPauseInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskPauseInfo.java deleted file mode 100644 index 80930d59..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskPauseInfo.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildTaskPauseInfo - * @Date:2025/03/24 15:12 - * @Filename:BuildTaskPauseInfo - * @description:Todo - */ -@Data -@Schema(title = "流水线暂停操作实体类") -public class BuildTaskPauseInfo { - @Schema(title = "任务ID") - private String taskId; - @Schema(title = "插件ID") - private String stepId; - @Schema(title = "element信息,若插件内有变量变更需给出变更后的element") - private Element element; - @Schema(title = "是否继续 true:继续构建 false:停止构建") - private boolean isContinue; - @Schema(title = "当前stageId") - private String stageId; - @Schema(title = "当前containerId") - private String containerId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskProgressInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskProgressInfo.java deleted file mode 100644 index d72fc3a0..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskProgressInfo.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildTaskProgressInfo - * @Date:2025/03/24 15:12 - * @Filename:BuildTaskProgressInfo - * @description:Todo - */ -@Data -@Schema(title = "task进度") -public class BuildTaskProgressInfo { - @Schema(title = "task进度", required = true) - private Double taskProgressRete; - @Schema(title = "task名称", required = true) - private String taskName; - @Schema(title = "Job执行顺序", required = true) - private String jobExecutionOrder; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskResult.java deleted file mode 100644 index 9a2feddf..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTaskResult.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildTaskResult - * @Date:2025/03/24 15:13 - * @Filename:BuildTaskResult - * @description:Todo - */ -@Data -@Schema(title = "流水线模型-构建任务结果") -public class BuildTaskResult { - @Schema(title = "任务ID", required = true) - private String taskId; - @Schema(title = "插件ID", required = true) - private String elementId; - @Schema(title = "插件版本号", required = false) - private String elementVersion; - @Schema(title = "容器Hash ID", required = true) - private String containerId; - @Schema(title = "是否执行成功", required = true) - private boolean success; - @Schema(title = "插件执行次数", required = true) - private Integer executeCount; - @Schema(title = "构建结果", required = true) - private Map buildResult; - @Schema(title = "错误原因", required = false) - private String message; - @Schema(title = "任务类型", required = false) - private String type; - @Schema(title = "错误类型", required = false) - private String errorType; - @Schema(title = "错误码标识", required = false) - private Integer errorCode; - @Schema(title = "对接平台代码", required = false) - private String platformCode; - @Schema(title = "对接平台错误码", required = false) - private Integer platformErrorCode; - @Schema(title = "插件监控数据", required = false) - private Map monitorData; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTemplateAcrossInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTemplateAcrossInfo.java deleted file mode 100644 index 22c60307..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildTemplateAcrossInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:BuildTemplateAcrossInfo - * @Date:2025/03/24 15:15 - * @Filename:BuildTemplateAcrossInfo - * @description:Todo - */ -@Data -@Schema(title = "构建中跨项目引用模板信息") -public class BuildTemplateAcrossInfo { - @Schema(title = "模板ID") - private String templateId; - @Schema(title = "模板类型") - private TemplateAcrossInfoType templateType; - @Schema(title = "模板实例ID列表") - private List templateInstancesIds; - @Schema(title = "目标项目ID") - private String targetProjectId; - - public enum TemplateAcrossInfoType { - JOB, - STEP - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildVariables.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildVariables.java deleted file mode 100644 index 8113aeaf..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/BuildVariables.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.BuildEnv; -import cd.casic.ci.project.dal.pojo.PipelineAsCodeSettings; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process - * @Project:ops-pro - * @name:BuildVariables - * @Date:2025/03/24 15:34 - * @Filename:BuildVariables - * @description:Todo - */ -@Data -@Schema(title = "流水线模型-构建参数变量") -public class BuildVariables { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "构建环境ID", required = true) - private String vmSeqId; - @Schema(title = "构建机名称", required = true) - private String vmName; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "pipeline id", required = true) - private String pipelineId; - @Schema(title = "参数集合(已完成上下文转换)", required = true) - private Map variables; - @Schema(title = "系统环境变量", required = false) - private List buildEnvs; - @Schema(title = "container的编排ID(同seq)", required = false) - private String containerId; - @Schema(title = "container的全局ID", required = false) - private String containerHashId; - @Schema(title = "container用户自定义ID", required = false) - private String jobId; - @Schema(title = "参数类型集合(用于打印时区分敏感信息,建议不要作为传参使用)", required = false) - private List variablesWithType; - @Schema(title = "Job超时时间(毫秒)", required = true) - private long timeoutMills; - @Schema(title = "容器类型", required = false) - private String containerType; - @Schema(title = "YAML流水线特殊配置", required = false) - private PipelineAsCodeSettings pipelineAsCodeSettings; - @Schema(title = "构建日志归档阈值(单位:万)") - private Integer loggingLineLimit; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/CreateCallBackResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/CreateCallBackResult.java deleted file mode 100644 index d30848d7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/CreateCallBackResult.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:CreateCallBackResult - * @Date:2025/03/24 15:35 - * @Filename:CreateCallBackResult - * @description:Todo - */ -@Data -@Schema(title = "项目的流水线回调创建结果") -public class CreateCallBackResult { - @Schema(title = "成功事件列表", required = false) - private List successEvents; - @Schema(title = "失败事件列表", required = false) - private Map failureEvents; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/DockerEnableProject.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/DockerEnableProject.java deleted file mode 100644 index 8ef25ba7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/DockerEnableProject.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:DockerEnableProject - * @Date:2025/03/24 15:36 - * @Filename:DockerEnableProject - * @description:Todo - */ -@Data -@Schema(title = "") -public class DockerEnableProject { - @Schema(title = "是否启用", required = false) - private boolean enable; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "创建时间", required = false) - private long createTime; - @Schema(title = "更新时间", required = false) - private long updateTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/JobMutexGroup.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/JobMutexGroup.java deleted file mode 100644 index 4a098539..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/JobMutexGroup.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:JobMutexGroup - * @Date:2025/03/24 15:37 - * @Filename:JobMutexGroup - * @description:Todo - */ -@Data -@Schema(title = "Job互斥组模型-列表信息") -public class JobMutexGroup { - @Schema(title = "Job互斥组名字", required = true) - private String jobMutexGroupName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PTemplateOrderByType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PTemplateOrderByType.java deleted file mode 100644 index 2c5b9058..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PTemplateOrderByType.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PTemplateOrderByType - * @Date:2025/03/24 17:01 - * @Filename:PTemplateOrderByType - * @description:Todo - */ -public enum PTemplateOrderByType { - NAME, - CREATOR, - CREATE_TIME, -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PTemplateSortType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PTemplateSortType.java deleted file mode 100644 index 0f838374..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PTemplateSortType.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PTemplateSortType - * @Date:2025/03/24 17:01 - * @Filename:PTemplateSortType - * @description:Todo - */ -public enum PTemplateSortType { - ASC, - DESC; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Permission.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Permission.java deleted file mode 100644 index 5ec77cd6..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Permission.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:Permission - * @Date:2025/03/24 15:37 - * @Filename:Permission - * @description:Todo - */ -public enum Permission { - DEPLOY, - DOWNLOAD, - EDIT, - EXECUTE, - DELETE, - VIEW, - CREATE, - LIST -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Pipeline.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Pipeline.java deleted file mode 100644 index 72755f37..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Pipeline.java +++ /dev/null @@ -1,123 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.process.api.process.pojo.classify.PipelineGroupLabels; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:Pipeline - * @Date:2025/03/24 15:38 - * @Filename:Pipeline - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线模型-列表信息") -public class Pipeline { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "流水线描述", required = false) - private String pipelineDesc; - @Schema(title = "流水线任务数量", required = true) - private int taskCount; - @Schema(title = "构建次数", required = true) - private long buildCount; - @Schema(title = "运行锁定", required = false) - private boolean lock; - @Schema(title = "是否可手工启动", required = true) - private boolean canManualStartup; - @Schema(title = "最后构建启动时间", required = false) - private Long latestBuildStartTime; - @Schema(title = "最后构建结束时间", required = false) - private Long latestBuildEndTime; - @Schema(title = "最后构建状态", required = false) - private BuildStatus latestBuildStatus; - @Schema(title = "最后构建版本号", required = false) - private Integer latestBuildNum; - @Schema(title = "最后构建任务名称", required = false) - @Deprecated - private String latestBuildTaskName; - @Schema(title = "最后任务预计执行时间(毫秒)", required = false) - private Long latestBuildEstimatedExecutionSeconds; - @Schema(title = "最后构建实例ID", required = false) - private String latestBuildId; - @Schema(title = "部署时间", required = true) - private long deploymentTime; - @Schema(title = "流水线创建时间", required = true) - private long createTime; - @Schema(title = "更新时间", required = true) - private long updateTime; - @Schema(title = "编排文件版本号", required = true) - private int pipelineVersion; - @Schema(title = "服务器当前时间戳", required = true) - private long currentTimestamp; - @Schema(title = "当前运行的构建的个数", required = true) - private int runningBuildCount; - @Schema(title = "是否有list权限", required = true) - private boolean hasPermission; - @Schema(title = "是否被收藏", required = true) - private boolean hasCollect; - @Schema(title = "最后执行人id", required = false) - private String latestBuildUserId; - @Schema(title = "是否从模板中实例化出来的", required = false) - private Boolean instanceFromTemplate; - @Schema(title = "模板ID", required = false) - private String templateId; - @Schema(title = "版本名称", required = false) - private String versionName; - @Schema(title = "版本", required = false) - private Long version; - @Schema(title = "流水线更新人", required = false) - private String updater; - @Schema(title = "流水线创建人", required = false) - private String creator; - @Schema(title = "流水线分组和标签", required = false) - private List groupLabel; - @Schema(title = "最后自定义构建版本号", required = false) - private String latestBuildNumAlias; - @Schema(title = "自定义构建号规则", required = false) - private String buildNumRule; - @Schema(title = "编排详情", required = false) - private Model model; - @Schema(title = "流水线组名称列表", required = false) - private List viewNames; - @Schema(title = "最后一次构建的构建信息", required = false) - private String lastBuildMsg; - @Schema(title = "最后一次构建所有的任务个数", required = false) - private Integer lastBuildTotalCount; - @Schema(title = "最后一次构建已完成的任务个数", required = false) - private Integer lastBuildFinishCount; - @Schema(title = "启动类型(新)", required = false) - private String startType; - @Schema(title = "触发方式", required = false) - private String trigger; - @Schema(title = "webhook仓库别名", required = false) - private String webhookAliasName; - @Schema(title = "webhook提交信息", required = false) - private String webhookMessage; - @Schema(title = "webhook仓库地址", required = false) - private String webhookRepoUrl; - @Schema(title = "webhook类型", required = false) - private String webhookType; - @Schema(title = "是否已删除", required = false) - private Boolean delete; - @Schema(title = "最新流水线版本状态(如有任何发布版本则为发布版本)", required = false) - private VersionStatus latestVersionStatus; - @Schema(title = "流水线权限", required = false) - private PipelinePermissions permissions; - @Schema(title = "yaml在默认分支是否存在", required = false) - private Boolean yamlExist; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineAtomRel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineAtomRel.java deleted file mode 100644 index 517df498..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineAtomRel.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineAtomRel - * @Date:2025/03/24 15:42 - * @Filename:PipelineAtomRel - * @description:Todo - */ -@Data -@Schema(title = "流水线插件相关信息") -public class PipelineAtomRel { - @Schema(title = "流水线链接", required = true) - private String pipelineUrl; - @Schema(title = "插件版本", required = true) - private String atomVersion; - @Schema(title = "修改人", required = true) - private String modifier; - @Schema(title = "修改时间", required = true) - private String updateTime; - @Schema(title = "执行人", required = false) - private String executor; - @Schema(title = "执行时间", required = false) - private String executeTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineAtomReplaceHistory.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineAtomReplaceHistory.java deleted file mode 100644 index 15b3eec9..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineAtomReplaceHistory.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineAtomReplaceHistory - * @Date:2025/03/24 15:43 - * @Filename:PipelineAtomReplaceHistory - * @description:Todo - */ -@Data -@Schema(title = "流水线插件替换历史") -public class PipelineAtomReplaceHistory { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "业务ID", required = true) - private String busId; - @Schema(title = "业务类型", required = true) - private String busType; - @Schema(title = "源版本号", required = true) - private int sourceVersion; - @Schema(title = "目标版本号", required = false) - private Integer targetVersion; - @Schema(title = "状态", required = true) - private String status; - @Schema(title = "插件替换基本信息ID", required = true) - private String baseId; - @Schema(title = "插件替换项信息ID", required = true) - private String itemId; - @Schema(title = "用户ID", required = true) - private String userId; - @Schema(title = "日志", required = false) - private String log; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineBuildMaterial.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineBuildMaterial.java deleted file mode 100644 index 4e241d21..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineBuildMaterial.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.log.scm.enums.ScmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineBuildMaterial - * @Date:2025/03/24 15:53 - * @Filename:PipelineBuildMaterial - * @description:Todo - */ -@Data -@Schema(title = "") -public class PipelineBuildMaterial { - @Schema(title = "代码库类型", required = false) - private String scmType = ScmType.CODE_TGIT.name(); - @Schema(title = "别名", required = false) - private String aliasName; - @Schema(title = "url 地址", required = false) - private String url; - @Schema(title = "分支名称", required = false) - private String branchName; - @Schema(title = "当前最新提交id", required = false) - private String newCommitId; - @Schema(title = "当前提交备注信息", required = false) - private String newCommitComment; - @Schema(title = "提交次数", required = false) - private Integer commitTimes; - @Schema(title = "是否为源材料主仓库", required = false) - private Boolean mainRepo = false; - @Schema(title = "提交时间", required = false) - private Long createTime = System.currentTimeMillis() / 1000; - @Schema(title = "插件ID", required = false) - private String taskId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCallBackInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCallBackInfo.java deleted file mode 100644 index 54ab16a7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCallBackInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.CallBackEvent; -import cd.casic.ci.common.pipeline.pojo.event.CallBackNetWorkRegionType; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineCallBackInfo - * @Date:2025/03/24 15:56 - * @Filename:PipelineCallBackInfo - * @description:Todo - */ -@Data -@NoArgsConstructor -public class PipelineCallBackInfo { - private CallBackEvent callbackEvent; - private String callbackUrl; - private String secretToken; - private String callbackName; - private CallBackNetWorkRegionType region; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCollation.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCollation.java deleted file mode 100644 index c5aef516..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCollation.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineCollation - * @Date:2025/03/24 15:57 - * @Filename:PipelineCollation - * @description:Todo - */ -public enum PipelineCollation { - DEFAULT, - ASC, - DESC -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineContainerMonitor.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineContainerMonitor.java deleted file mode 100644 index 6a18810d..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineContainerMonitor.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.VMBaseOS; -import cd.casic.ci.common.pipeline.type.BuildType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineContainerMonitor - * @Date:2025/03/24 15:57 - * @Filename:PipelineContainerMonitor - * @description:Todo - */ -@Data -@Schema(title = "流水线模型-容器监控信息") -public class PipelineContainerMonitor { - @Schema(title = "操作系统类型", required = false) - private VMBaseOS osType; - @Schema(title = "创建类型", required = false) - private BuildType buildType; - @Schema(title = "最长启动时间", required = false) - private long maxStartupTime; - @Schema(title = "最长执行时间", required = false) - private long maxExecuteTime; - @Schema(title = "用户列表", required = false) - private List users; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCopy.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCopy.java deleted file mode 100644 index 50d619e1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineCopy.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineCopy - * @Date:2025/03/24 16:10 - * @Filename:PipelineCopy - * @description:Todo - */ -@Data -@Schema(title = "流水线-COPY创建信息") -public class PipelineCopy { - @Schema(title = "名称", required = true) - private String name; - @Schema(title = "描述", required = false) - private String desc; - @Schema(title = "流水线基础设置-基本信息中的标签", required = false) - private List labels; - @Schema(title = "配置静态流水线组,需要填写视图ID", required = false) - private List staticViews; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineDetail.java deleted file mode 100644 index 2fc049a9..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineDetail.java +++ /dev/null @@ -1,84 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineRunLockType; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineYamlVo; -import cd.casic.ci.project.dal.pojo.PipelineAsCodeSettings; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineDetail - * @Date:2025/03/24 16:10 - * @Filename:PipelineDetail - * @description:Todo - */ -@Data -@Schema(title = "流水线预览页完整信息") -public class PipelineDetail { - - @Schema(title = "流水线Id") - private String pipelineId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "是否收藏") - private boolean hasCollect; - @Schema(title = "是否可以手动触发") - private boolean canManualStartup; - @Schema(title = "是否可以调试") - private boolean canDebug; - @Schema(title = "是否可以发布") - private boolean canRelease; - @Schema(title = "是否从模板实例化") - private boolean instanceFromTemplate; - @Schema(title = "当前模板的ID", required = false) - private String templateId; - @Schema(title = "关联模板版本", required = false) - private Long templateVersion; - @Schema(title = "草稿或最新的发布版本") - private int version; - @Schema(title = "草稿或最新的发布版本名称") - private String versionName; - @Schema(title = "草稿的基准版本(存在草稿才有值)", required = false) - private Integer baseVersion; - @Schema(title = "草稿的基准版本的状态(存在草稿才有值)", required = false) - private VersionStatus baseVersionStatus; - @Schema(title = "基准版本的版本名称") - private String baseVersionName; - @Schema(title = "最新的发布版本,如果为空则说明没有过发布版本") - private Integer releaseVersion; - @Schema(title = "最新的发布版本名称,如果为空则说明没有过发布版本") - private String releaseVersionName; - @Schema(title = "是否有编辑权限") - private boolean hasPermission; - @Schema(title = "流水线描述") - private String pipelineDesc; - @Schema(title = "创建者") - private String creator; - @Schema(title = "创建时间") - private long createTime; - @Schema(title = "更新时间") - private long updateTime; - @Schema(title = "流水线组名称列表", required = false) - private List viewNames; - @Schema(title = "流水线权限", required = false) - private PipelinePermissions permissions; - @Schema(title = "Lock 类型", required = false) - private PipelineRunLockType runLockType; - @Schema(title = "最新流水线版本状态(如有任何发布版本则为发布版本)", required = false) - private VersionStatus latestVersionStatus; - @Schema(title = "PAC配置", required = false) - private PipelineAsCodeSettings pipelineAsCodeSettings; - @Schema(title = "流水线YAML信息", required = false) - private PipelineYamlVo yamlInfo; - @Schema(title = "yaml文件在默认分支是否存在", required = false) - private Boolean yamlExist; - @Schema(title = "运行锁定", required = false) - private boolean locked; - -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineDetailInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineDetailInfo.java deleted file mode 100644 index 3b5e8be1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineDetailInfo.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineDetailInfo - * @Date:2025/03/24 16:12 - * @Filename:PipelineDetailInfo - * @description:Todo - */ -@Data -@Schema(title = "流水线名称与Id") -public class PipelineDetailInfo { - @Schema(title = "流水线Id") - private String pipelineId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "是否收藏") - private boolean hasCollect; - @Schema(title = "canManualStartup") - private boolean canManualStartup; - @Schema(title = "是否关联模板") - private boolean instanceFromTemplate; - @Schema(title = "流水线版本") - private int pipelineVersion; - @Schema(title = "发布时间-时间戳") - private long deploymentTime; - @Schema(title = "是否有编辑权限") - private boolean hasPermission; - @Schema(title = "关联模板ID", required = false) - private String templateId; - @Schema(title = "关联模板版本", required = false) - private Long templateVersion; - @Schema(title = "流水线描述") - private String pipelineDesc; - @Schema(title = "创建者") - private String creator; - @Schema(title = "创建时间") - private long createTime; - @Schema(title = "更新时间") - private long updateTime; - @Schema(title = "最新流水线版本状态(如有任何发布版本则为发布版本)", required = false) - private VersionStatus latestVersionStatus; - @Schema(title = "流水线组名称列表", required = false) - private List viewNames; - @Schema(title = "运行锁定", required = false) - private boolean locked; - -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineId.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineId.java deleted file mode 100644 index 7cddc6b1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineId.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineId - * @Date:2025/03/24 16:13 - * @Filename:PipelineId - * @description:Todo - */ -@Data -@Schema(title = "流水线模型-ID") -public class PipelineId { - @Schema(title = "流水线ID", required = true) - private String id; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineIdAndName.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineIdAndName.java deleted file mode 100644 index 3e3ed9be..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineIdAndName.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineIdAndName - * @Date:2025/03/24 16:21 - * @Filename:PipelineIdAndName - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "流水线名称与Id") -public class PipelineIdAndName { - @Schema(title = "流水线Id") - private String pipelineId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "流水线的来源渠道") - private ChannelCode channelCode; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineIdInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineIdInfo.java deleted file mode 100644 index 45133087..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineIdInfo.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineIdInfo - * @Date:2025/03/24 16:22 - * @Filename:PipelineIdInfo - * @description:Todo - */ -@Data -@Schema(title = "流水线id模型") -@AllArgsConstructor -public class PipelineIdInfo { - @Schema(title = "流水线id,全局唯一", required = false) - private String pipelineId; - @Schema(title = "流水线自增ID,主要用于权限中心的资源ID,保证项目下唯一", required = false) - private Long id; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineListRequest.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineListRequest.java deleted file mode 100644 index 161488b6..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineListRequest.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.Collection; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineListRequest - * @Date:2025/03/24 16:23 - * @Filename:PipelineListRequest - * @description:Todo - */ -@Data -@AllArgsConstructor -public class PipelineListRequest { - private Collection pipelineId; - private Collection templateId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineName.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineName.java deleted file mode 100644 index c9b1411a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineName.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineName - * @Date:2025/03/24 16:23 - * @Filename:PipelineName - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "流水线模型-修改NAME") -public class PipelineName { - @Schema(title = "流水线修改后的名称", required = true) - private String name; - @Schema(title = "流水线修改前的名称", required = false) - private String oldName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineNotifyTemplateEnum.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineNotifyTemplateEnum.java deleted file mode 100644 index 515e0cd4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineNotifyTemplateEnum.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineNotifyTemplateEnum - * @Date:2025/03/24 16:24 - * @Filename:PipelineNotifyTemplateEnum - * @description:Todo - */ -public enum PipelineNotifyTemplateEnum { - PIPELINE_STARTUP_NOTIFY_TEMPLATE("PIPELINE_STARTUP_NOTIFY_TEMPLATE"), - - PIPELINE_STARTUP_NOTIFY_TEMPLATE_DETAIL("PIPELINE_STARTUP_NOTIFY_TEMPLATE_DETAIL"), - - PIPELINE_SHUTDOWN_SUCCESS_NOTIFY_TEMPLATE("PIPELINE_SHUTDOWN_SUCCESS_NOTIFY_TEMPLATE"), - - PIPELINE_SHUTDOWN_SUCCESS_NOTIFY_TEMPLATE_DETAIL("PIPELINE_SHUTDOWN_SUCCESS_NOTIFY_TEMPLATE_DETAIL"), - - PIPELINE_SHUTDOWN_FAILURE_NOTIFY_TEMPLATE("PIPELINE_SHUTDOWN_FAILURE_NOTIFY_TEMPLATE"), - - PIPELINE_SHUTDOWN_FAILURE_NOTIFY_TEMPLATE_DETAIL("PIPELINE_SHUTDOWN_FAILURE_NOTIFY_TEMPLATE_DETAIL"), - - PIPELINE_SHUTDOWN_CANCEL_NOTIFY_TEMPLATE("PIPELINE_SHUTDOWN_CANCEL_NOTIFY_TEMPLATE"), - - PIPELINE_SHUTDOWN_CANCEL_NOTIFY_TEMPLATE_DETAIL("PIPELINE_SHUTDOWN_CANCEL_NOTIFY_TEMPLATE_DETAIL"), - - PIPELINE_TRIGGER_REVIEW_NOTIFY_TEMPLATE("PIPELINE_TRIGGER_REVIEW_NOTIFY_TEMPLATE"), - - PIPELINE_MANUAL_REVIEW_ATOM_NOTIFY_TEMPLATE("MANUAL_REVIEW_ATOM_NOTIFY_TEMPLATE"), - - PIPELINE_MANUAL_REVIEW_ATOM_REMINDER_NOTIFY_TEMPLATE("MANUAL_REVIEW_ATOM_REMINDER_NOTIFY_TEMPLATE"), - - PIPELINE_MANUAL_REVIEW_STAGE_NOTIFY_TO_TRIGGER_TEMPLATE("MANUAL_REVIEW_STAGE_NOTIFY_TO_TRIGGER_TEMPLATE"), - - PIPELINE_MANUAL_REVIEW_STAGE_REJECT_TO_TRIGGER_TEMPLATE("MANUAL_REVIEW_STAGE_REJECT_TO_TRIGGER_TEMPLATE"), - - PIPELINE_MANUAL_REVIEW_STAGE_NOTIFY_TEMPLATE("MANUAL_REVIEW_STAGE_NOTIFY_TEMPLATE"), - - PIPELINE_UPDATE_TEMPLATE_INSTANCE_NOTIFY_TEMPLATE("UPDATE_TEMPLATE_INSTANCE_NOTIFY_TEMPLATE"), - - PIPELINE_WEBHOOK_REGISTER_FAILURE_NOTIFY_TEMPLATE("PIPELINE_WEBHOOK_REGISTER_FAILURE_NOTIFY_TEMPLATE"), - - PIPELINE_CALLBACK_DISABLE_NOTIFY_TEMPLATE("PIPELINE_CALLBACK_DISABLE_NOTIFY_TEMPLATE"), - - UNKNOWN("NULL"); - - private final String templateCode; - - PipelineNotifyTemplateEnum(String templateCode) { - this.templateCode = templateCode; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineOperationDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineOperationDetail.java deleted file mode 100644 index 9bfd3ddf..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineOperationDetail.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.process.api.process.enums.OperationLogType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineOperationDetail - * @Date:2025/03/24 16:25 - * @Filename:PipelineOperationDetail - * @description:Todo - */ -@Data -@Schema(title = "流水线操作日志") -public class PipelineOperationDetail { - @Schema(title = "唯一标识ID", required = false) - private Long id; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "版本ID", required = true) - private Integer version; - @Schema(title = "操作用户", required = true) - private String operator; - @Schema(title = "操作类型", required = true) - private OperationLogType operationLogType; - @Schema(title = "操作类型文字(国际化后)", required = true) - private String operationLogStr; - @Schema(title = "操作参数", required = true) - private String params; - @Schema(title = "操作时间", required = false) - private Long operateTime; - @Schema(title = "操作内容", required = false) - private String description; - @Schema(title = "版本名称", required = false) - private String versionName; - @Schema(title = "版本创建时间", required = false) - private Long versionCreateTime; - @Schema(title = "草稿版本标识", required = false) - private VersionStatus status; - @Schema(title = "来源代码库标识(分支名)", required = false) - private String pacRefs; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineOperationLog.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineOperationLog.java deleted file mode 100644 index bd0f0f1d..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineOperationLog.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.process.api.process.enums.OperationLogType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineOperationLog - * @Date:2025/03/24 16:27 - * @Filename:PipelineOperationLog - * @description:Todo - */ -@Data -@Schema(title = "流水线操作日志") -public class PipelineOperationLog { - @Schema(title = "唯一标识ID", required = false) - private Long id; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "版本ID", required = true) - private Integer version; - @Schema(title = "操作用户", required = true) - private String operator; - @Schema(title = "操作类型", required = true) - private OperationLogType operationLogType; - @Schema(title = "操作参数", required = true) - private String params; - @Schema(title = "操作时间", required = false) - private Long operateTime; - @Schema(title = "操作内容", required = false) - private String description; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelinePermissions.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelinePermissions.java deleted file mode 100644 index 2674d011..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelinePermissions.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelinePermissions - * @Date:2025/03/24 16:28 - * @Filename:PipelinePermissions - * @description:Todo - */ -@Data -@Schema(title = "流水线-流水线权限") -public class PipelinePermissions { - @Schema(title = "管理员权限", required = true) - private Boolean canManage; - @Schema(title = "删除权限", required = true) - private Boolean canDelete; - @Schema(title = "查看权限", required = true) - private Boolean canView; - @Schema(title = "编辑权限", required = true) - private Boolean canEdit; - @Schema(title = "执行权限", required = true) - private Boolean canExecute; - @Schema(title = "下载权限", required = true) - private Boolean canDownload; - @Schema(title = "分享权限", required = true) - private Boolean canShare; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineProjectRel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineProjectRel.java deleted file mode 100644 index 29581151..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineProjectRel.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineProjectRel - * @Date:2025/03/24 16:45 - * @Filename:PipelineProjectRel - * @description:Todo - */ -@Data -@Schema(title = "流水线信息") -public class PipelineProjectRel { - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "项目标识", required = true) - private String projectCode; - @Schema(title = "插件版本", required = true) - private String atomVersion; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineRemoteToken.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineRemoteToken.java deleted file mode 100644 index dfdd0162..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineRemoteToken.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineRemoteToken - * @Date:2025/03/24 16:45 - * @Filename:PipelineRemoteToken - * @description:Todo - */ -@Data -@Schema(title = "远程执行token") -public class PipelineRemoteToken { - @Schema(title = "token字符串", required = false) - private String token; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineSortType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineSortType.java deleted file mode 100644 index 19a9746c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineSortType.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineSortType - * @Date:2025/03/24 16:45 - * @Filename:PipelineSortType - * @description:Todo - */ -public enum PipelineSortType { - NAME, - CREATE_TIME, - UPDATE_TIME, - LAST_EXEC_TIME -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineStageTag.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineStageTag.java deleted file mode 100644 index 38050572..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineStageTag.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineStageTag - * @Date:2025/03/24 16:46 - * @Filename:PipelineStageTag - * @description:Todo - */ -@Data -@Schema(title = "流水线-阶段标签信息") -@AllArgsConstructor -public class PipelineStageTag { - @Schema(title = "阶段标签ID", required = true) - private String id; - @Schema(title = "阶段标签名称", required = true) - private String stageTagName; - @Schema(title = "阶段标签权重", required = true) - private Integer weight; - @Schema(title = "是否为默认标签", required = true) - private Boolean defaultFlag; - @Schema(title = "创建日期") - private Long createTime; - @Schema(title = "更新日期") - private Long updateTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineStatus.java deleted file mode 100644 index 1c345f59..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineStatus.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineStatus - * @Date:2025/03/24 16:46 - * @Filename:PipelineStatus - * @description:Todo - */ -@Data -@Schema(title = "流水线模型-列表-状态信息") -public class PipelineStatus { - @Schema(title = "流水线任务数量", required = true) - private Integer taskCount; - @Schema(title = "构建次数", required = true) - private Long buildCount; - @Schema(title = "运行锁定", required = false) - private Boolean lock; - @Schema(title = "是否可手工启动", required = true) - private Boolean canManualStartup; - @Schema(title = "最后构建时间", required = false) - private Long latestBuildStartTime; - @Schema(title = "最后构建结束时间", required = false) - private Long latestBuildEndTime; - @Schema(title = "最后构建状态", required = false) - private BuildStatus latestBuildStatus; - @Schema(title = "最后构建版本号", required = false) - private Integer latestBuildNum; - @Schema(title = "最后构建任务名称", required = false) - @Deprecated() - //"无用.不再提供任何信息" - private String latestBuildTaskName; - @Schema(title = "最后任务预计执行时间(毫秒)", required = false) - private Long latestBuildEstimatedExecutionSeconds; - @Schema(title = "最后构建实例ID", required = false) - private String latestBuildId; - @Schema(title = "服务器当前时间戳", required = true) - private Long currentTimestamp; - @Schema(title = "当前运行的构建的个数", required = true) - private Integer runningBuildCount; - @Schema(title = "是否被收藏", required = true) - private Boolean hasCollect; - @Schema(title = "最后一次构建所有的任务个数", required = false) - private Integer lastBuildTotalCount; - @Schema(title = "最后一次构建已完成的任务个数", required = false) - private Integer lastBuildFinishCount; - @Schema(title = "触发方式", required = false) - private String trigger; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineTemplate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineTemplate.java deleted file mode 100644 index f4446b65..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineTemplate.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.container.Stage; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineTemplate - * @Date:2025/03/24 16:49 - * @Filename:PipelineTemplate - * @description:Todo - */ -@Data -@Schema(title = "流水线-模板信息") -public class PipelineTemplate { - @Schema(title = "模板名称", required = true) - private String name; - @Schema(title = "模板描述", required = false) - private String desc; - @Schema(title = "应用范畴", required = true) - private List category; - @Schema(title = "模板图标", required = false) - private String icon; - @Schema(title = "模板LOGO路径", required = false) - private String logoUrl; - @Schema(title = "模板作者", required = true) - private String author; - @Schema(title = "插件数量", required = true) - private Integer atomNum; - @Schema(title = "当前模板对应的被复制的模板或安装的研发商店的模板对应的ID", required = true) - private String srcTemplateId; - @Schema(title = "是否为公共模版", required = true) - private Boolean publicFlag; - @Schema(title = "阶段集合", required = true) - private List stages; - -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineTemplateInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineTemplateInfo.java deleted file mode 100644 index bbd2c290..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineTemplateInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.container.Stage; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineTemplateInfo - * @Date:2025/03/24 16:50 - * @Filename:PipelineTemplateInfo - * @description:Todo - */ -@Data -public class PipelineTemplateInfo { - @Schema(title = "模版名称", required = true) - private String name; - @Schema(title = "模版ID", required = true) - private String templateId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "当前模板版本ID", required = true) - private Long version; - @Schema(title = "父模板版本ID", required = true) - private Long srcTemplateVersion; - @Schema(title = "最新版本号", required = true) - private String versionName; - @Schema(title = "模板类型", required = true) - private String templateType; - @Schema(title = "模板类型描述", required = true) - private String templateTypeDesc; - @Schema(title = "应用范畴", required = true) - private List category; - @Schema(title = "模版logo", required = true) - private String logoUrl; - @Schema(title = "阶段集合", required = true) - private List stages; - @Schema(title = "模版名称,兼容老代码", required = true) - private String templateName; - @Schema(title = "父模板ID", required = true) - private String srcTemplateId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineUser.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineUser.java deleted file mode 100644 index c31f577c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineUser.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineUser - * @Date:2025/03/24 16:51 - * @Filename:PipelineUser - * @description:Todo - */ -@Data -@Schema(title = "流水线-用户信息") -public class PipelineUser { - @Schema(title = "主键ID", required = true) - private Long id; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "创建时间", required = true) - private Long createTime; - @Schema(title = "更新时间", required = true) - private Long updateTime; - @Schema(title = "创建人", required = true) - private String creator; - @Schema(title = "修改人", required = true) - private String modifier; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineVersionReleaseRequest.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineVersionReleaseRequest.java deleted file mode 100644 index 46a56361..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/PipelineVersionReleaseRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.CodeTargetAction; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineYamlVo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:PipelineVersionReleaseRequest - * @Date:2025/03/24 16:52 - * @Filename:PipelineVersionReleaseRequest - * @description:Todo - */ -@Data -@Schema(title = "流水线-版本发布请求") -public class PipelineVersionReleaseRequest { - @Schema(title = "是否本次开启PAC", required = true) - private Boolean enablePac; - @Schema(title = "版本描述", required = false) - private String description; - @Schema(title = "模板版本号(为空时默认最新)", required = false) - private CodeTargetAction targetAction; - @Schema(title = "静态流水线组", required = false) - private List staticViews; - @Schema(title = "流水线YAML信息", required = false) - private PipelineYamlVo yamlInfo; - @Schema(title = "提交到指定的分支", required = false) - private String targetBranch; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ProcessConstants.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ProcessConstants.java deleted file mode 100644 index 6d8935aa..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ProcessConstants.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:ProcessConstants - * @Date:2025/03/24 16:59 - * @Filename:ProcessConstants - * @description:Todo - */ -public class ProcessConstants { - public static final String KEY_STAGE_ID = "stageId"; - public static final String KEY_CONTAINER_ID = "containerId"; - public static final String KEY_TASK_ID = "taskId"; - public static final String KEY_EXECUTE_COUNT = "executeCount"; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ProjectPipelineCallBackHistory.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ProjectPipelineCallBackHistory.java deleted file mode 100644 index 60daa59f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ProjectPipelineCallBackHistory.java +++ /dev/null @@ -1,58 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:ProjectPipelineCallBackHistory - * @Date:2025/03/24 17:00 - * @Filename:ProjectPipelineCallBackHistory - * @description:Todo - */ -@Data -@Schema(title = "项目的流水线回调历史") -@AllArgsConstructor -public class ProjectPipelineCallBackHistory { - @Schema(title = "流水线id", required = false) - private Long id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "回调url地址", required = false) - private String callBackUrl; - @Schema(title = "事件", required = false) - private String events; - @Schema(title = "状态", required = false) - private String status; - @Schema(title = "请求header", required = false) - private List requestHeaders; - @Schema(title = "请求body", required = false) - private String requestBody; - @Schema(title = "响应状态码", required = false) - private Integer responseCode; - @Schema(title = "响应body", required = false) - private String responseBody; - @Schema(title = "错误信息", required = false) - private String errorMsg; - @Schema(title = "创建时间", required = false) - private Long createdTime; - @Schema(title = "开始时间", required = false) - private Long startTime; - @Schema(title = "结束时间", required = false) - private Long endTime; - - @Data - @Schema(title = "回调header 模型") - @AllArgsConstructor - public static class CallBackHeader { - @Schema(title = "名字", required = false) - private String name; - @Schema(title = "值", required = false) - private String value; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Property.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Property.java deleted file mode 100644 index 29cb56bc..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Property.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:Property - * @Date:2025/03/24 17:00 - * @Filename:Property - * @description:Todo - */ -@Data -@Schema(title = "属性") -public class Property { - @Schema(title = "健", required = false) - private String key; - @Schema(title = "值", required = false) - private String value; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Report.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Report.java deleted file mode 100644 index 7e01128f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/Report.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:Report - * @Date:2025/03/24 17:01 - * @Filename:Report - * @description:Todo - */ -@Data -@Schema(title = "自定义报告-报告信息") -public class Report { - @Schema(title = "名称", required = true) - private String name; - @Schema(title = "首页地址", required = true) - private String indexFileUrl; - @Schema(title = "报告类型", required = true) - private String type; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ReviewParam.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ReviewParam.java deleted file mode 100644 index 416d25fe..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/ReviewParam.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.enums.ManualReviewAction; -import cd.casic.ci.common.pipeline.pojo.element.atom.ManualReviewParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:ReviewParam - * @Date:2025/03/24 17:02 - * @Filename:ReviewParam - * @description:Todo - */ -@Data -@Schema(title = "人工审核插件-审核信息") -public class ReviewParam { - @Schema(title = "项目Id", required = true) - private String projectId; - @Schema(title = "流水线Id", required = true) - private String pipelineId; - @Schema(title = "构建Id", required = true) - private String buildId; - @Schema(title = "审核人", required = true) - private List reviewUsers; - @Schema(title = "审核结果", required = false) - private ManualReviewAction status; - @Schema(title = "描述", required = false) - private String desc; - @Schema(title = "审核意见", required = false) - private String suggest; - @Schema(title = "参数列表", required = false) - private List params; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SetContextVarData.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SetContextVarData.java deleted file mode 100644 index b655a431..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SetContextVarData.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:SetContextVarData - * @Date:2025/03/24 17:02 - * @Filename:SetContextVarData - * @description:Todo - */ -@Data -public class SetContextVarData { - private String projectId; - private String pipelineId; - private String buildId; - private String contextName; - private String contextVal; - private Boolean readOnly; - private Boolean rewriteReadOnly; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/StageQualityRequest.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/StageQualityRequest.java deleted file mode 100644 index 44daaf99..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/StageQualityRequest.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:StageQualityRequest - * @Date:2025/03/24 17:02 - * @Filename:StageQualityRequest - * @description:Todo - */ -@Data -@Schema(title = "stage准入准出-质量红线触发") -public class StageQualityRequest { - @Schema(title = "准入准出标识", required = true) - private String position; - @Schema(title = "把关是否通过", required = true) - private Boolean pass; - @Schema(title = "第几次检查", required = true) - private Integer checkTimes; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/StageTagRequest.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/StageTagRequest.java deleted file mode 100644 index cac5661a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/StageTagRequest.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:StageTagRequest - * @Date:2025/03/24 17:03 - * @Filename:StageTagRequest - * @description:Todo - */ -@Data -@Schema(title = "流水线-阶段标签信息请求体") -public class StageTagRequest { - @Schema(title = "阶段标签名称", required = true) - private String stageTagName; - @Schema(title = "阶段标签权重", required = true) - private Integer weight; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SubPipeline.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SubPipeline.java deleted file mode 100644 index 4fc9fc42..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SubPipeline.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:SubPipeline - * @Date:2025/03/24 17:03 - * @Filename:SubPipeline - * @description:Todo - */ -@Data -@Schema(title = "子流水线基本信息") -public class SubPipeline { - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "流水线ID", required = true) - private String pipelineId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SubscriptionType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SubscriptionType.java deleted file mode 100644 index e9fab093..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/SubscriptionType.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.framework.commons.exception.ServiceException; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:SubscriptionType - * @Date:2025/03/24 17:03 - * @Filename:SubscriptionType - * @description:Todo - */ -public enum SubscriptionType { - ALL(0), - ONLY_SUCCESS(1), - ONLY_FAILURE(2); - - private final Integer type; - - SubscriptionType(Integer type) { - this.type = type; - } - - public Integer getType() { - return type; - } - - public static SubscriptionType toType(Integer type) { - for (SubscriptionType subscriptionType : SubscriptionType.values()) { - if (subscriptionType.getType().equals(type)) { - return subscriptionType; - } - } - throw new ServiceException(-1000, "Unknown subscript type - " + type); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/TransferResponseResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/TransferResponseResult.java deleted file mode 100644 index d18657e2..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/TransferResponseResult.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import cd.casic.ci.common.pipeline.pojo.PipelineModelAndSetting; -import cd.casic.ci.common.pipeline.pojo.transfer.TransferMark; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:TransferResponseResult - * @Date:2025/03/24 17:04 - * @Filename:TransferResponseResult - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "流水线互转-Response-result") -public class TransferResponseResult { - @Schema(title = "modelAndSetting") - private PipelineModelAndSetting modelAndSetting; - @Schema(title = "当前yaml内容") - private String newYaml; - @Schema(title = "定位") - private TransferMark mark; - @Schema(title = "互转报错信息") - private String error; - @Schema(title = "是否支持YAML解析", required = true) - private Boolean yamlSupported; - @Schema(title = "YAML解析异常信息") - private String yamlInvalidMsg; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/VmInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/VmInfo.java deleted file mode 100644 index 5717b3fc..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/VmInfo.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo - * @Project:ops-pro - * @name:VmInfo - * @Date:2025/03/24 17:05 - * @Filename:VmInfo - * @description:Todo - */ -@Data -@Schema(title = "Vm信息") -public class VmInfo { - @Schema(title = "IP", required = false) - private String ip; - @Schema(title = "名称", required = true) - private String name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/app/PipelinePage.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/app/PipelinePage.java deleted file mode 100644 index 08f41c07..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/app/PipelinePage.java +++ /dev/null @@ -1,47 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.app; - -import cd.casic.ci.process.api.process.pojo.classify.PipelineView; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PipelinePage - * @Description TODO - * @Date 2025/4/1 16:18 - */ -@Data -@AllArgsConstructor -@Schema(title = "Pipeline分页数据包装模型") -public class PipelinePage { - @Schema(title = "总记录行数", required = true) - private Long count; - - @Schema(title = "第几页", required = true) - private Integer page; - - @Schema(title = "每页多少条", required = true) - private Integer pageSize; - - @Schema(title = "总共多少页", required = true) - private Integer totalPages; - - @Schema(title = "数据", required = true) - private java.util.List records; - - @Schema(title = "是否拥有创建权限", required = true) - private Boolean hasCreatePermission; - - @Schema(title = "总pipeline是否为空(不管有没有权限的)", required = true) - private Boolean hasPipelines; - - @Schema(title = "是否有收藏的流水线", required = true) - private Boolean hasFavorPipelines; - - @Schema(title = "是否有用户权限的流水线", required = true) - private Boolean hasPermissionPipelines; - - @Schema(title = "用户当前视图", required = false) - private PipelineView currentView; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/app/StartBuildContext.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/app/StartBuildContext.java deleted file mode 100644 index 3752e382..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/app/StartBuildContext.java +++ /dev/null @@ -1,458 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.app; - -import cd.casic.ci.common.pipeline.constant.StringConstant; -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeType; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineRunLockType; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.common.pipeline.utils.CascadePropertyUtils; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.process.api.process.pojo.code.WebhookInfo; -import cd.casic.ci.process.api.process.utils.DependOnUtils; -import cd.casic.ci.process.api.process.utils.PipelineVarUtil; -import cd.casic.framework.commons.util.watcher.Watcher; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; - -import java.time.LocalDateTime; -import java.util.*; - -import static cd.casic.ci.common.pipeline.constant.PipelineConstants.PIPELINE_GIT_EVENT_URL; -import static cd.casic.ci.common.pipeline.constant.WebhookConstant.*; -import static cd.casic.ci.process.api.process.utils.Constants.*; -import static cd.casic.ci.process.api.process.utils.PipelineVarUtil.CONTEXT_PREFIX; - -/** - * @author by mianbin - * @Classname StartBuildContext - * @Description TODO - * @Date 2025/4/1 16:23 - */ -@Data -@Slf4j -@AllArgsConstructor -public class StartBuildContext { - private static final int MAX_LENGTH = 255; - private static final int DELTA = 16; - - private final LocalDateTime now; - private final String projectId; - private final String pipelineId; - private final String buildId; - private final int resourceVersion; - private final String versionName; - private final String yamlVersion; - private final ActionType actionType; - private final int executeCount; - private final boolean stageRetry; - private final String retryStartTaskId; - private String firstTaskId; - private int containerSeq; - private int taskCount; - private final String userId; - private final String triggerUser; - private final StartType startType; - private final String parentBuildId; - private final String parentTaskId; - private final ChannelCode channelCode; - private final boolean retryFailedContainer; - private boolean needUpdateStage; - private final boolean skipFailedTask; - private final Map variables; - private final BuildStatus startBuildStatus; - private final WebhookInfo webhookInfo; - private final String buildMsg; - private final List triggerReviewers; - private final Map pipelineParamMap; - private final List buildParameters; - private final String concurrencyGroup; - private final PipelineSetting pipelineSetting; - private String buildNumAlias; - private int buildNum; - private BuildNo.BuildNoType buildNoType; - private Integer currentBuildNo; - private final boolean debug; - private final String debugModelStr; - private final Watcher watcher; - - public StartBuildContext(LocalDateTime now, String projectId, String pipelineId, String buildId, int resourceVersion, String versionName, String yamlVersion, ActionType actionType, int executeCount, boolean stageRetry, String retryStartTaskId, String firstTaskId, int containerSeq, int taskCount, String userId, String triggerUser, StartType startType, String parentBuildId, String parentTaskId, ChannelCode channelCode, boolean retryFailedContainer, boolean needUpdateStage, boolean skipFailedTask, Map variables, BuildStatus startBuildStatus, WebhookInfo webhookInfo, String buildMsg, List triggerReviewers, Map pipelineParamMap, List buildParameters, String concurrencyGroup, PipelineSetting pipelineSetting, String buildNumAlias, int buildNum, BuildNo.BuildNoType buildNoType, Integer currentBuildNo, boolean debug, String debugModelStr) { - this.now = now != null ? now : LocalDateTime.now(); - this.projectId = projectId; - this.pipelineId = pipelineId; - this.buildId = buildId; - this.resourceVersion = resourceVersion; - this.versionName = versionName; - this.yamlVersion = yamlVersion; - this.actionType = actionType; - this.executeCount = executeCount; - this.stageRetry = stageRetry; - this.retryStartTaskId = retryStartTaskId; - this.firstTaskId = firstTaskId; - this.containerSeq = containerSeq; - this.taskCount = taskCount; - this.userId = userId; - this.triggerUser = triggerUser; - this.startType = startType; - this.parentBuildId = parentBuildId; - this.parentTaskId = parentTaskId; - this.channelCode = channelCode; - this.retryFailedContainer = retryFailedContainer; - this.needUpdateStage = needUpdateStage; - this.skipFailedTask = skipFailedTask; - this.variables = variables; - this.startBuildStatus = startBuildStatus; - this.webhookInfo = webhookInfo; - this.buildMsg = buildMsg; - this.triggerReviewers = triggerReviewers; - this.pipelineParamMap = pipelineParamMap; - this.buildParameters = buildParameters; - this.concurrencyGroup = concurrencyGroup; - this.pipelineSetting = pipelineSetting; - this.buildNumAlias = buildNumAlias; - this.buildNum = buildNum; - this.buildNoType = buildNoType; - this.currentBuildNo = currentBuildNo; - this.debug = debug; - this.debugModelStr = debugModelStr; - this.watcher = new Watcher("startBuild-" + buildId); - } - - /** - * 检查Stage是否属于失败重试[stageRetry]时,当前[stage]是否需要跳过 - */ - public boolean needSkipWhenStageFailRetry(Stage stage) { - if (needRerunStage(stage)) { - return false; - } else if (!stageRetry) { - return false; - } else { - return BuildStatus.parse(stage.getStatus()).isFinish(); - } - } - - public boolean needSkipContainerWhenFailRetry(Stage stage, Container container) { - BuildStatus containerStatus = BuildStatus.parse(container.getStatus()); - if (needRerunStage(stage)) { - return false; - } else if (!containerStatus.isFailure() && !containerStatus.isCancel()) { - return false; - } else { - return !retryStartTaskId.isEmpty(); - } - } - - public boolean needSkipTaskWhenRetry(Stage stage, Container container, String taskId) { - if (stage.isFinally()) { - return false; - } else if (stage.getId().equals(retryStartTaskId)) { - return false; - } else if (retryStartTaskId.isEmpty()) { - return false; - } else if (isRetryDependOnContainer(container)) { - return false; - } else { - return !retryStartTaskId.equals(taskId); - } - } - - public boolean inSkipStage(Stage stage, Element atom) { - if (skipFailedTask && retryStartTaskId.equals(atom.getId())) { - return true; - } else { - return skipFailedTask && (stage.getId().equals(retryStartTaskId) && BuildStatus.parse(atom.getStatus()).isFailure()); - } - } - - /** - * 是否是要重试的失败容器 - */ - public boolean isRetryFailedContainer(Stage stage, Container container) { - if (stage.isFinally()) { - if (stage.getId().equals(retryStartTaskId)) { - return retryFailedContainer && BuildStatus.parse(container.getStatus()).isSuccess(); - } else { - return false; - } - } else if (isRetryDependOnContainer(container)) { - return false; - } else { - return retryFailedContainer && BuildStatus.parse(container.getStatus()).isSuccess(); - } - } - - // 失败重试,跳过的dependOn容器也应该被执行 - private boolean isRetryDependOnContainer(Container container) { - return DependOnUtils.enableDependOn(container) && BuildStatus.parse(container.getStatus()) == BuildStatus.SKIP; - } - - public boolean needRerunStage(Stage stage) { - return stage.isFinally() || retryStartTaskId == null || stage.getId().equals(retryStartTaskId); - } - - public boolean needRerunTask(Stage stage, Container container) { - return needRerunStage(stage) || isRetryDependOnContainer(container); - } - - public static StartBuildContext init(String projectId, String pipelineId, String buildId, int resourceVersion, String versionName, String yamlVersion, String modelStr, boolean debug, PipelineSetting pipelineSetting, List realStartParamKeys, Map pipelineParamMap, Map webHookStartParam, List triggerReviewers, Integer currentBuildNo) { - List buildParam = genOriginStartParamsList(realStartParamKeys, pipelineParamMap); - Map params = new HashMap<>(); - for (BuildParameters param : pipelineParamMap.values()) { - params.put(param.getKey(), param.getValue().toString()); - } - String retryStartTaskId = params.get(PIPELINE_RETRY_START_TASK_ID); - - ActionType actionType; - int executeCount; - boolean isStageRetry; - if (params.get(PIPELINE_RETRY_COUNT) != null) { - int count; - try { - count = Integer.parseInt(params.get(PIPELINE_RETRY_COUNT).trim()); - count = Math.max(count, 0); - } catch (NumberFormatException ignored) { - count = 0; - } - actionType = ActionType.RETRY; - executeCount = count + 1; - isStageRetry = retryStartTaskId != null && retryStartTaskId.startsWith("stage-"); - } else { - actionType = ActionType.START; - executeCount = 1; - isStageRetry = false; - } - ChannelCode channelCode = params.get(PIPELINE_START_CHANNEL) != null ? ChannelCode.valueOf(params.get(PIPELINE_START_CHANNEL)) : ChannelCode.BS; - boolean retryFailedContainer = params.get(PIPELINE_RETRY_ALL_FAILED_CONTAINER) != null ? Boolean.parseBoolean(params.get(PIPELINE_RETRY_ALL_FAILED_CONTAINER)) : false; - boolean skipFailedTask = params.get(PIPELINE_SKIP_FAILED_TASK) != null ? Boolean.parseBoolean(params.get(PIPELINE_SKIP_FAILED_TASK)) : false; - String buildMsg = params.get(PIPELINE_BUILD_MSG) != null ? StringConstant.coerceAtMaxLength(params.get(PIPELINE_BUILD_MSG), MAX_LENGTH) : null; - - String concurrencyGroup = null; - if (pipelineSetting != null && pipelineSetting.getRunLockType() == PipelineRunLockType.GROUP_LOCK && pipelineSetting.getConcurrencyGroup() != null) { - Map webhookParam = new HashMap<>(); - for (BuildParameters param : webHookStartParam.values()) { - webhookParam.put(param.getKey(), param.getValue().toString()); - } - concurrencyGroup = EnvUtils.parseEnv(pipelineSetting.getConcurrencyGroup(), PipelineVarUtil.fillContextVarMap(webhookParam)); - log.info("[$pipelineId]|[$buildId]|ConcurrencyGroup=$concurrencyGroup"); - } - - BuildStatus startBuildStatus = triggerReviewers == null || triggerReviewers.isEmpty() ? BuildStatus.QUEUE : BuildStatus.TRIGGER_REVIEWING; - - return new StartBuildContext( - LocalDateTime.now(), - projectId, - pipelineId, - buildId, - resourceVersion, - versionName, - yamlVersion, - actionType, - executeCount, - isStageRetry, - retryStartTaskId, - params.getOrDefault(PIPELINE_START_TASK_ID, ""), - 0, - 0, - params.get(PIPELINE_START_USER_ID), - params.get(PIPELINE_START_USER_NAME), - StartType.valueOf(params.get(PIPELINE_START_TYPE)), - params.get(PIPELINE_START_PARENT_BUILD_ID), - params.get(PIPELINE_START_PARENT_BUILD_TASK_ID), - channelCode, - retryFailedContainer, - false, - skipFailedTask, - params, - startBuildStatus, - getWebhookInfo(params), - buildMsg, - triggerReviewers, - pipelineParamMap, - buildParam, - concurrencyGroup, - pipelineSetting, - null, - 1, - null, - currentBuildNo, - debug, - modelStr - ); - } - - - private static WebhookInfo getWebhookInfo(Map params) { - List startTypes = Arrays.asList(StartType.WEB_HOOK.name(), StartType.PIPELINE.name(), StartType.SERVICE.name(), StartType.REMOTE.name()); - String startType = params.get(PIPELINE_START_TYPE); - if (!startTypes.contains(startType)) { - return null; - } - return new WebhookInfo( - supportCustomMaterials(startType) ? startType : params.get(REPO_WEBHOOK_REPO_TYPE), - params.get(REPO_WEBHOOK_REPO_NAME), - params.get(PIPELINE_WEBHOOK_COMMIT_MESSAGE), - params.get(REPO_WEBHOOK_REPO_URL), - params.get(PIPELINE_WEBHOOK_TYPE), - params.get(PIPELINE_WEBHOOK_BRANCH), - params.get(REPO_WEBHOOK_REPO_ALIAS_NAME), - params.get(PIPELINE_WEBHOOK_TYPE).equals(CodeType.GIT.name()) ? params.get(REPO_GIT_WEBHOOK_EVENT_TYPE) : params.get(PIPELINE_WEBHOOK_EVENT_TYPE), - params.get(PIPELINE_WEBHOOK_REVISION), - params.get(PIPELINE_WEBHOOK_REVISION), - params.get(REPO_GIT_WEBHOOK_MR_MERGE_COMMIT_SHA), - params.get(REPO_GIT_WEBHOOK_MR_SOURCE_BRANCH), - params.get(REPO_GIT_WEBHOOK_MR_ID), - params.get(REPO_GIT_WEBHOOK_MR_NUMBER), - params.get(REPO_GIT_WEBHOOK_MR_URL), - params.get(REPO_WEBHOOK_REPO_AUTH_USER), - params.get(REPO_GIT_WEBHOOK_TAG_NAME), - params.get(REPO_GIT_WEBHOOK_ISSUE_IID), - params.get(REPO_GIT_WEBHOOK_NOTE_ID), - params.get(REPO_GIT_WEBHOOK_REVIEW_ID), - params.get(PIPELINE_START_PARENT_PROJECT_ID), - params.get(PIPELINE_START_PARENT_PIPELINE_ID), - params.get(PIPELINE_START_PARENT_PIPELINE_NAME), - params.get(PIPELINE_START_PARENT_BUILD_ID), - params.get(PIPELINE_START_PARENT_BUILD_NUM), - supportCustomMaterials(startType) ? params.get(BK_CI_MATERIAL_URL) : params.get(PIPELINE_GIT_EVENT_URL), - params.get(BK_CI_MATERIAL_ID), - params.get(BK_CI_MATERIAL_NAME) - ); - } - - /** - * 是否支持自定义触发材料 - */ - private static boolean supportCustomMaterials(String startType) { - return startType != null && (startType.equals(StartType.REMOTE.name()) || startType.equals(StartType.SERVICE.name())); - } - - public static StartBuildContext init4SendBuildStartEvent(String userId, String projectId, String pipelineId, String buildId, int resourceVersion, String versionName, ActionType actionType, int executeCount, String firstTaskId, StartType startType, BuildStatus startBuildStatus, boolean debug) { - return new StartBuildContext( - LocalDateTime.now(), - projectId, - pipelineId, - buildId, - resourceVersion, - versionName, - null, - actionType, - executeCount, - false, - null, - firstTaskId, - 0, - 0, - userId, - "", - startType, - "", - "", - ChannelCode.BS, - false, - false, - false, - Collections.emptyMap(), - startBuildStatus, - null, - null, - null, - new HashMap<>(), - new ArrayList<>(), - null, - null, - null, - 1, - null, - null, - debug, - null - ); - } - - /** - * 根据[realStartParamKeys]启动参数Key列表读取[pipelineParamMap]参数值来生成流水线启动变量列表,不包含其他 - */ - private static ArrayList genOriginStartParamsList(List realStartParamKeys, Map pipelineParamMap) { - ArrayList originStartParams = new ArrayList<>(realStartParamKeys.size() + DELTA); - HashMap originStartContexts = new HashMap<>(realStartParamKeys.size()); - for (String key : realStartParamKeys) { - BuildParameters param = pipelineParamMap.get(key); - if (param != null) { - if (CascadePropertyUtils.supportCascadeParam(param.getValueType())) { - originStartParams.addAll(fillCascadeParam(param, originStartContexts)); - } else { - originStartParams.add(param); - fillContextPrefix(param, originStartContexts); - } - } - } - pipelineParamMap.putAll(originStartContexts); - - if (pipelineParamMap.containsKey(BUILD_NO)) { - originStartParams.add(pipelineParamMap.get(BUILD_NO)); - } - if (pipelineParamMap.containsKey(PIPELINE_BUILD_MSG)) { - originStartParams.add(pipelineParamMap.get(PIPELINE_BUILD_MSG)); - } - if (pipelineParamMap.containsKey(PIPELINE_RETRY_COUNT)) { - originStartParams.add(pipelineParamMap.get(PIPELINE_RETRY_COUNT)); - } - - return originStartParams; - } - - private static void fillContextPrefix(BuildParameters param, HashMap originStartContexts) { - String key = param.getKey(); - if (key.startsWith(CONTEXT_PREFIX)) { - originStartContexts.put(key, param); - } else { - String ctxKey = CONTEXT_PREFIX + key; - originStartContexts.put(ctxKey, param); - } - } - - /** - * 根据原始值,填充级联参数 - * xxx = {"repo-name": "xxx/xxx","branch":"master"} - * xxx.repo-name = xxx/xxx - * xxx.branch = master - */ - private static List fillCascadeParam(BuildParameters param, HashMap originStartContexts) { - List originStartParams = new ArrayList<>(); - String key = param.getKey(); - Object paramValue = CascadePropertyUtils.parseDefaultValue(key, param.getValue(), param.getValueType()); - BuildParameters cascadeParam = new BuildParameters( - param.getKey(), - paramValue, - param.getValueType(), - param.getDesc(), - param.getDefaultValue() - ); - originStartParams.add(cascadeParam); - // 填充下级参数的[variables.] - fillContextPrefix(cascadeParam, originStartContexts); - Map cascadeVariableKeyMap = CascadePropertyUtils.getCascadeVariableKeyMap(key, param.getValueType()); - for (Map.Entry entry : cascadeVariableKeyMap.entrySet()) { - String subKey = entry.getKey(); - String paramKey = entry.getValue(); - BuildParameters subParam = new BuildParameters( - paramKey, - paramValue != null && ((Map) paramValue).containsKey(subKey) ? ((Map) paramValue).get(subKey) : "", - param.getValueType(), - param.getDesc(), - param.getDefaultValue() - ); - // 填充下级参数的[variables.] - fillContextPrefix(subParam, originStartContexts); - } - return originStartParams; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/Audit.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/Audit.java deleted file mode 100644 index ea4a09ed..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/Audit.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.audit; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.audit - * @Project:ops-pro - * @name:Audit - * @Date:2025/03/24 19:41 - * @Filename:Audit - * @description:Todo - */ -@Data -@Schema(title = "审计模型-Audit") -public class Audit { - @Schema(title = "资源类型", required = true) - private String resourceType; - @Schema(title = "资源ID", required = true) - private String resourceId; - @Schema(title = "资源名称", required = true) - private String resourceName; - @Schema(title = "操作人", required = true) - private String userId; - @Schema(title = "操作", required = true) - private String action; - @Schema(title = "操作内容", required = true) - private String actionContent; - @Schema(title = "项目id", required = true) - private String projectId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/AuditInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/AuditInfo.java deleted file mode 100644 index 3b73e860..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/AuditInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.audit; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.audit - * @Project:ops-pro - * @name:AuditInfo - * @Date:2025/03/24 19:41 - * @Filename:AuditInfo - * @description:Todo - */ -@Data -@Schema(title = "审计模型-Audit") -@AllArgsConstructor -public class AuditInfo { - @Schema(title = "状态", required = true) - private String status; - @Schema(title = "资源类型", required = true) - private String resourceType; - @Schema(title = "资源ID", required = true) - private String resourceId; - @Schema(title = "资源名称", required = true) - private String resourceName; - @Schema(title = "操作人", required = true) - private String userId; - @Schema(title = "操作时间", required = true) - private Long updatedTime; - @Schema(title = "操作", required = true) - private String action; - @Schema(title = "操作内容", required = true) - private String actionContent; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/AuditPage.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/AuditPage.java deleted file mode 100644 index 05fa6e03..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/AuditPage.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.audit; - -import io.swagger.v3.oas.annotations.media.Schema; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.audit - * @Project:ops-pro - * @name:AuditPage - * @Date:2025/03/24 19:42 - * @Filename:AuditPage - * @description:Todo - */ -@Schema(title = "Audit分页数据包装模型") -public class AuditPage { - @Schema(title = "总记录行数", required = true) - private Long count; - @Schema(title = "第几页", required = true) - private Integer page; - @Schema(title = "每页多少条", required = true) - private Integer pageSize; - @Schema(title = "总共多少页", required = true) - private Integer totalPages; - @Schema(title = "数据", required = true) - private List records; - @Schema(title = "是否拥有创建权限", required = true) - private Boolean hasCreatePermission; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/QueryAudit.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/QueryAudit.java deleted file mode 100644 index c923f57e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/audit/QueryAudit.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.audit; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.audit - * @Project:ops-pro - * @name:QueryAudit - * @Date:2025/03/24 19:43 - * @Filename:QueryAudit - * @description:Todo - */ -@Schema(title = "审计模型-Audit-查询") -public class QueryAudit { - @Schema(title = "项目id", required = true) - private String projectId; - @Schema(title = "资源类型", required = true) - private String resourceType; - @Schema(title = "资源ID") - private String resourceId; - @Schema(title = "资源名称") - private String resourceName; - @Schema(title = "操作人") - private String userId; - @Schema(title = "开始时间") - private String startTime; - @Schema(title = "结束时间") - private String endTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroup.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroup.java deleted file mode 100644 index f1240685..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroup.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineGroup - * @Date:2025/03/24 19:50 - * @Filename:PipelineGroup - * @description:Todo - */ -@Data -@Schema(title = "流水线标签组模型") -public class PipelineGroup { - @Schema(title = "id", required = false) - private String id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "名称", required = false) - private String name; - @Schema(title = "创建时间", required = false) - private Long createTime; - @Schema(title = "更新时间", required = false) - private Long updateTime; - @Schema(title = "创建者", required = false) - private String createUser; - @Schema(title = "更新者", required = false) - private String updateUser; - @Schema(title = "流水线标签", required = false) - private List labels; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupCreate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupCreate.java deleted file mode 100644 index 3b388b1b..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupCreate.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineGroupCreate - * @Date:2025/03/24 19:50 - * @Filename:PipelineGroupCreate - * @description:Todo - */ -@Data -@Schema(title = "流水线创建模型") -public class PipelineGroupCreate { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "名称", required = false) - private String name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupLabels.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupLabels.java deleted file mode 100644 index b5afd973..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupLabels.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineGroupLabels - * @Date:2025/03/24 19:51 - * @Filename:PipelineGroupLabels - * @description:Todo - */ -@Data -@Schema(title = "流水线标签模型") -public class PipelineGroupLabels { - @Schema(title = "流水线名字", required = false) - private String groupName; - @Schema(title = "标签名字", required = false) - private List labelName; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupUpdate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupUpdate.java deleted file mode 100644 index 03c31fc3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupUpdate.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineGroupUpdate - * @Date:2025/03/24 19:51 - * @Filename:PipelineGroupUpdate - * @description:Todo - */ -@Data -@Schema(title = "流水线更新模型") -public class PipelineGroupUpdate { - @Schema(title = "流水线id", required = false) - private String id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线名字", required = false) - private String name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupWithLabels.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupWithLabels.java deleted file mode 100644 index 1ef2f0fa..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineGroupWithLabels.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineGroupWithLabels - * @Date:2025/03/24 19:51 - * @Filename:PipelineGroupWithLabels - * @description:Todo - */ -@Data -public class PipelineGroupWithLabels { - private String id; - private List labels; - private List labelNames; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabel.java deleted file mode 100644 index 9594ff3a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabel.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineLabel - * @Date:2025/03/24 19:51 - * @Filename:PipelineLabel - * @description:Todo - */ -@Data -@Schema(title = "流水线标签") -public class PipelineLabel { - @Schema(title = "标签id", required = false) - private String id; - @Schema(title = "流水线id", required = false) - private String groupId; - @Schema(title = "标签名称", required = false) - private String name; - @Schema(title = "创建时间", required = false) - private Long createTime; - @Schema(title = "更新时间", required = false) - private Long uptimeTime; - @Schema(title = "创建者", required = false) - private String createUser; - @Schema(title = "更新者", required = false) - private String updateUser; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelCreate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelCreate.java deleted file mode 100644 index 21675639..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelCreate.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineLabelCreate - * @Date:2025/03/24 19:52 - * @Filename:PipelineLabelCreate - * @description:Todo - */ -@Data -public class PipelineLabelCreate { - private String groupId; - private String name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelDetail.java deleted file mode 100644 index a0dc62cb..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelDetail.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineLabelDetail - * @Date:2025/03/24 19:52 - * @Filename:PipelineLabelDetail - * @description:Todo - */ -@Data -public class PipelineLabelDetail { - @Schema(title = "流水线标签信息", required = false) - private List pipelineLabelInfo; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelId.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelId.java deleted file mode 100644 index f86c87ac..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelId.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineLabelId - * @Date:2025/03/24 19:52 - * @Filename:PipelineLabelId - * @description:Todo - */ -@Data -public class PipelineLabelId { - private String id; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelUpdate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelUpdate.java deleted file mode 100644 index fd349843..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineLabelUpdate.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineLabelUpdate - * @Date:2025/03/24 19:52 - * @Filename:PipelineLabelUpdate - * @description:Todo - */ -@Data -public class PipelineLabelUpdate { - private String id; - private String groupId; - private String name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineNewView.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineNewView.java deleted file mode 100644 index 38ada3b7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineNewView.java +++ /dev/null @@ -1,43 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import cd.casic.ci.process.api.process.pojo.classify.enums.Logic; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineNewView - * @Date:2025/03/24 19:52 - * @Filename:PipelineNewView - * @description:Todo - */ -@Data -@Schema(title = "流水线视图") -public class PipelineNewView { - @Schema(title = "流水线id", required = false) - private String id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "名称", required = false) - private String name; - @Schema(title = "是否项目", required = false) - private Boolean projected; - @Schema(title = "创建时间", required = false) - private Long createTime; - @Schema(title = "更新时间", required = false) - private Long updateTime; - @Schema(title = "创建者", required = false) - private String creator; - @Schema(title = "逻辑符", required = false) - private Logic logic; - @Schema(title = "流水线视图过滤器列表", required = false) - private List filters; - @Schema(title = "视图类型", required = true) - private Integer viewType; - @Schema(title = "流水线ID列表", required = true) - private List pipelineIds; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineNewViewSummary.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineNewViewSummary.java deleted file mode 100644 index 0b0d3353..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineNewViewSummary.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineNewViewSummary - * @Date:2025/03/24 19:53 - * @Filename:PipelineNewViewSummary - * @description:Todo - */ -@Data -@Schema(title = "") -public class PipelineNewViewSummary { - @Schema(title = "视图id", required = false) - private String id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "视图名称", required = false) - private String name; - @Schema(title = "是否项目", required = false) - private Boolean projected; - @Schema(title = "创建时间", required = false) - private Long createTime; - @Schema(title = "更新时间", required = false) - private Long updateTime; - @Schema(title = "创建者", required = false) - private String creator; - @Schema(title = "是否置顶", required = false) - private Boolean top = false; - @Schema(title = "流水线组类型,1--动态,2--静态", required = true) - private Integer viewType; - @Schema(title = "流水线个数", required = true) - private Integer pipelineCount; - @Schema(title = "是否是PAC流水线组", required = true) - private Boolean pac = false; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineView.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineView.java deleted file mode 100644 index 75599baa..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineView.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineView - * @Date:2025/03/24 19:53 - * @Filename:PipelineView - * @description:Todo - */ -@Data -@Schema(title = "用户当前视图") -public class PipelineView { - @Schema(title = "视图id", required = false) - private String id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "视图名称", required = false) - private String name; - @Schema(title = "是否项目", required = false) - private Boolean projected; - @Schema(title = "创建时间", required = false) - private Long createTime; - @Schema(title = "更新时间", required = false) - private Long updateTime; - @Schema(title = "按流水线名过滤", required = false) - private String filterByPipelineName; - @Schema(title = "按创建人过滤", required = false) - private List filterByCreator; - @Schema(title = "流水线分组列表", required = false) - private List groups; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewAndPipelines.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewAndPipelines.java deleted file mode 100644 index 841c70a0..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewAndPipelines.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import cd.casic.ci.process.api.process.pojo.Pipeline; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewAndPipelines - * @Date:2025/03/24 19:53 - * @Filename:PipelineViewAndPipelines - * @description:Todo - */ - -@Data -@Schema(title = "") -public class PipelineViewAndPipelines { - @Schema(title = "当前视图id", required = false) - private String currentViewId; - @Schema(title = "视图列表", required = false) - private List viewList; - @Schema(title = "流水线页面", required = false) - private PipelineViewPipelinePage pipelinePage; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewBulkAdd.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewBulkAdd.java deleted file mode 100644 index a6831273..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewBulkAdd.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewBulkAdd - * @Date:2025/03/24 19:54 - * @Filename:PipelineViewBulkAdd - * @description:Todo - */ -@Data -@Schema(title = "流水线组批量添加") -public class PipelineViewBulkAdd { - @Schema(title = "流水线ID列表") - private List pipelineIds; - @Schema(title = "视图ID列表") - private List viewIds; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewBulkRemove.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewBulkRemove.java deleted file mode 100644 index 689e190f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewBulkRemove.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewBulkRemove - * @Date:2025/03/24 20:00 - * @Filename:PipelineViewBulkRemove - * @description:Todo - */ -@Data -@Schema(title = "流水线组批量移除") -public class PipelineViewBulkRemove { - @Schema(title = "流水线ID列表") - private List pipelineIds; - @Schema(title = "视图ID") - private String viewId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewClassify.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewClassify.java deleted file mode 100644 index d7159118..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewClassify.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewClassify - * @Date:2025/03/24 20:00 - * @Filename:PipelineViewClassify - * @description:Todo - */ -@Data -public class PipelineViewClassify { - private String label; - private List viewList; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewCreate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewCreate.java deleted file mode 100644 index b1a7d6a1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewCreate.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewCreate - * @Date:2025/03/24 20:01 - * @Filename:PipelineViewCreate - * @description:Todo - */ -@Data -@Schema(title = "流水线视图创建模型") -public class PipelineViewCreate { - private String projectId; - private String name; - private Boolean projected = false; - private String filterByPipelineName; - private List filterByCreator; - private List labels; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewDict.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewDict.java deleted file mode 100644 index 41f39f7f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewDict.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewDict - * @Date:2025/03/24 20:01 - * @Filename:PipelineViewDict - * @description:Todo - */ -@Data -@Schema(title = "流水线组与流水线的对应关系") -public class PipelineViewDict { - @Schema(title = "个人流水线组列表") - private List personalViewList; - @Schema(title = "项目流水线列表") - private List projectViewList; - @Data - @Schema(title = "流水线组信息") - public static class ViewInfo { - @Schema(title = "流水线组ID") - private String viewId; - @Schema(title = "流水线组名") - private String viewName; - @Schema(title = "流水线列表") - private List pipelineList; - @Data - @Schema(title = "流水线信息") - public static class PipelineInfo { - @Schema(title = "流水线ID") - private String pipelineId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "流水线组ID") - private String viewId; - @Schema(title = "是否删除") - private Boolean delete; - } - } - - public static final PipelineViewDict EMPTY = new PipelineViewDict(); -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilter.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilter.java deleted file mode 100644 index ab02de38..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilter.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewFilter - * @Date:2025/03/24 20:01 - * @Filename:PipelineViewFilter - * @description:Todo - */ -@Data -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = PipelineViewFilterByName.class, name = PipelineViewFilterByName.CLASS_TYPE), - @JsonSubTypes.Type(value = PipelineViewFilterByCreator.class, name = PipelineViewFilterByCreator.CLASS_TYPE), - @JsonSubTypes.Type(value = PipelineViewFilterByLabel.class, name = PipelineViewFilterByLabel.CLASS_TYPE), - @JsonSubTypes.Type(value = PipelineViewFilterByPacRepo.class, name = PipelineViewFilterByPacRepo.CLASS_TYPE) -}) -public abstract class PipelineViewFilter { -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByCreator.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByCreator.java deleted file mode 100644 index eb2794ee..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByCreator.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import cd.casic.ci.process.api.process.pojo.classify.enums.Condition; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewFilterByCreator - * @Date:2025/03/24 20:02 - * @Filename:PipelineViewFilterByCreator - * @description:Todo - */ - -@Data -@Schema(title = "流水线视图-通过创建者过滤", description = PipelineViewFilterByCreator.CLASS_TYPE) -public class PipelineViewFilterByCreator extends PipelineViewFilter { - public static final String CLASS_TYPE = "filterByCreator"; - @Schema(title = "条件", required = false) - private Condition condition; - @Schema(title = "用户id 列表", required = false) - private List userIds; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByLabel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByLabel.java deleted file mode 100644 index 2f767d8d..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByLabel.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import cd.casic.ci.process.api.process.pojo.classify.enums.Condition; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewFilterByLabel - * @Date:2025/03/24 20:02 - * @Filename:PipelineViewFilterByLabel - * @description:Todo - */ -@Data -@Schema(title = "流水线视图-通过label过滤", description = PipelineViewFilterByLabel.CLASS_TYPE) -public class PipelineViewFilterByLabel extends PipelineViewFilter { - public static final String CLASS_TYPE = "filterByLabel"; - @Schema(title = "条件", required = false) - private Condition condition; - @Schema(title = "流水线id", required = false) - private String groupId; - @Schema(title = "标签id列表", required = false) - private List labelIds; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByName.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByName.java deleted file mode 100644 index f3806ef6..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByName.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import cd.casic.ci.process.api.process.pojo.classify.enums.Condition; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewFilterByName - * @Date:2025/03/24 20:02 - * @Filename:PipelineViewFilterByName - * @description:Todo - */ -@Data -@Schema(title = "流水线视图-通过名字过滤", description = PipelineViewFilterByName.CLASS_TYPE) -public class PipelineViewFilterByName extends PipelineViewFilter { - public static final String CLASS_TYPE = "filterByName"; - @Schema(title = "条件", required = false) - private Condition condition; - @Schema(title = "流水线名字", required = false) - private String pipelineName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByPacRepo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByPacRepo.java deleted file mode 100644 index b1dcc222..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewFilterByPacRepo.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import cd.casic.ci.process.api.process.pojo.classify.enums.Condition; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewFilterByPacRepo - * @Date:2025/03/24 20:05 - * @Filename:PipelineViewFilterByPacRepo - * @description:Todo - */ -@Data -@Schema(title = "流水线视图-通过PAC仓库过滤", description = "filterByPacRepo") -public class PipelineViewFilterByPacRepo extends PipelineViewFilter { - - public static final String CLASS_TYPE = "filterByPacRepo"; - @Schema(title = "条件", required = false) - private Condition condition; - @Schema(title = "代码库HashId", required = false) - private String repoHashId; - @Schema(title = "文件夹名称", required = false) - private String directory; - public static final String classType = "filterByPacRepo"; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewForm.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewForm.java deleted file mode 100644 index b01c4eee..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewForm.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import cd.casic.ci.process.api.process.constant.PipelineViewType; -import cd.casic.ci.process.api.process.pojo.classify.enums.Logic; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Collections; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewForm - * @Date:2025/03/24 20:05 - * @Filename:PipelineViewForm - * @description:Todo - */ -@Data -@Schema(title = "流水线视图表单") -public class PipelineViewForm { - @Schema(title = "ID", required = false) - private String id; - @Schema(title = "视图名称", required = false) - private String name; - @Schema(title = "是否项目", required = false) - private boolean projected; - @Schema(title = "流水线组类型,1--动态,2--静态") - private int viewType = PipelineViewType.UNCLASSIFIED; - @Schema(title = "逻辑符", required = false) - private Logic logic = Logic.AND; - @Schema(title = "流水线视图过滤器列表", required = false) - private List filters = Collections.emptyList(); - @Schema(title = "流水线列表", required = false) - private List pipelineIds = Collections.emptyList(); -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewHitFilters.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewHitFilters.java deleted file mode 100644 index 1206c2a1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewHitFilters.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewHitFilters - * @Date:2025/03/24 20:05 - * @Filename:PipelineViewHitFilters - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线组命中情况") -public class PipelineViewHitFilters { - @Schema(title = "条件列表") - private List filters = new ArrayList<>(); - @Schema(title = "条件关系") - private String logic; - - @Data - public static class FilterInfo { - @Schema(title = "关键字") - private String key; - @Schema(title = "命中列表") - private List hits = new ArrayList<>(); - - @Data - public static class Hit { - @Schema(title = "是否命中") - private boolean hit; - @Schema(title = "对应的值") - private String value; - } - } - - public static final PipelineViewHitFilters EMPTY = new PipelineViewHitFilters(); -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewId.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewId.java deleted file mode 100644 index c66b1032..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewId.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewId - * @Date:2025/03/24 20:06 - * @Filename:PipelineViewId - * @description:Todo - */ -@Data -@Schema(title = "流水线视图ID") -public class PipelineViewId { - @Schema(title = "ID") - private String id; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewIdAndName.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewIdAndName.java deleted file mode 100644 index 2067869e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewIdAndName.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewIdAndName - * @Date:2025/03/24 20:06 - * @Filename:PipelineViewIdAndName - * @description:Todo - */ -@Data -@Schema(title = "流水线视图ID和名称") -public class PipelineViewIdAndName { - @Schema(title = "ID") - private String id; - @Schema(title = "名称") - private String name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewMatchDynamic.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewMatchDynamic.java deleted file mode 100644 index a5b822a0..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewMatchDynamic.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewMatchDynamic - * @Date:2025/03/24 20:06 - * @Filename:PipelineViewMatchDynamic - * @description:Todo - */ -@Data -@Schema(title = "命中动态组情况") -public class PipelineViewMatchDynamic { - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "标签列表") - private List labels; - - @Data - @Schema(title = "标签信息") - public static class LabelInfo { - @Schema(title = "标签分组id", required = false) - private String groupId; - @Schema(title = "标签id列表", required = false) - private List labelIds; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPipelineCount.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPipelineCount.java deleted file mode 100644 index b0d68b2c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPipelineCount.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewPipelineCount - * @Date:2025/03/24 20:07 - * @Filename:PipelineViewPipelineCount - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "流水线组--详细数目") -public class PipelineViewPipelineCount { - @Schema(title = "可查看流水线数目") - private int normalCount; - @Schema(title = "已删除流水线数目") - private int deleteCount; - - public static final PipelineViewPipelineCount DEFAULT = new PipelineViewPipelineCount(0, 0); - -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPipelinePage.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPipelinePage.java deleted file mode 100644 index 9d15188d..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPipelinePage.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewPipelinePage - * @Date:2025/03/24 20:07 - * @Filename:PipelineViewPipelinePage - * @description:Todo - */ -@Data -@AllArgsConstructor -@Schema(title = "Pipeline分页数据包装模型") -public class PipelineViewPipelinePage { - @Schema(title = "总记录行数", required = true) - private long count; - @Schema(title = "第几页", required = true) - private int page; - @Schema(title = "每页多少条", required = true) - private int pageSize; - @Schema(title = "总共多少页", required = true) - private int totalPages; - @Schema(title = "数据", required = true) - private List records; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPreview.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPreview.java deleted file mode 100644 index 64efb488..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewPreview.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Collections; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewPreview - * @Date:2025/03/24 20:08 - * @Filename:PipelineViewPreview - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "Pipeline视图预览") -public class PipelineViewPreview { - @Schema(title = "新增的流水线ID列表", required = true) - private List addedPipelineInfos = Collections.emptyList(); - @Schema(title = "删除的流水线ID列表", required = true) - private List removedPipelineInfos = Collections.emptyList(); - @Schema(title = "保留的流水线ID列表", required = true) - private List reservePipelineInfos = Collections.emptyList(); - - @Data - public static class PipelineInfo { - @Schema(title = "名称", required = true) - private String pipelineName; - @Schema(title = "ID", required = true) - private String pipelineId; - @Schema(title = "是否删除", required = true) - private boolean delete; - } - - public static final PipelineViewPreview EMPTY = new PipelineViewPreview(); -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewSettings.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewSettings.java deleted file mode 100644 index e0933ba2..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewSettings.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewSettings - * @Date:2025/03/24 20:08 - * @Filename:PipelineViewSettings - * @description:Todo - */ - -@Data -@Schema(title = "流水线视图设置模型") -public class PipelineViewSettings { - @Schema(title = "当前视图id", required = false) - private String currentViewId; - @Schema(title = "当前视图列表", required = false) - private List currentViews; - @Schema(title = "视图分类列表:项目视图,系统视图,个人视图等分类。分类下包含下面的视图", required = false) - private List viewClassifies; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewTopForm.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewTopForm.java deleted file mode 100644 index 6eea2040..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewTopForm.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewTopForm - * @Date:2025/03/24 20:08 - * @Filename:PipelineViewTopForm - * @description:Todo - */ - -@Data -@Schema(title = "流水线视图表单") -public class PipelineViewTopForm { - @Schema(title = "是否生效", required = true) - private boolean enabled; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewUpdate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewUpdate.java deleted file mode 100644 index 3ebab624..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/PipelineViewUpdate.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify - * @Project:ops-pro - * @name:PipelineViewUpdate - * @Date:2025/03/24 20:08 - * @Filename:PipelineViewUpdate - * @description:Todo - */ - -@Data -@Schema(title = "流水线视图更新模型") -public class PipelineViewUpdate { - @Schema(title = "视图id", required = false) - private String id; - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "视图名称", required = false) - private String name; - @Schema(title = "是否项目", required = false) - private boolean projected = false; - @Schema(title = "按流水线名过滤", required = false) - private String filterByPipelineName; - @Schema(title = "按创建人过滤", required = false) - private List filterByCreator; - @Schema(title = "标签列表", required = false) - private List labels; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/enums/Condition.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/enums/Condition.java deleted file mode 100644 index fd2ae78f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/enums/Condition.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify.enums - * @Project:ops-pro - * @name:Condition - * @Date:2025/03/24 19:49 - * @Filename:Condition - * @description:Todo - */ -public enum Condition { - LIKE, - NOT_LIKE, - EQUAL, - NOT_EQUAL, - INCLUDE, - NOT_INCLUDE; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/enums/Logic.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/enums/Logic.java deleted file mode 100644 index 7f72c0be..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/classify/enums/Logic.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.classify.enums; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.classify.enums - * @Project:ops-pro - * @name:Logic - * @Date:2025/03/24 19:48 - * @Filename:Logic - * @description:Todo - */ -public enum Logic { - AND, - OR; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/PipelineBuildCommit.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/PipelineBuildCommit.java deleted file mode 100644 index 3be45844..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/PipelineBuildCommit.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.code; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.code - * @Project:ops-pro - * @name:PipelineBuildCommit - * @Date:2025/03/24 20:15 - * @Filename:PipelineBuildCommit - * @description:Todo - */ -@Data -@Schema(title = "构建提交信息") -public class PipelineBuildCommit { - private String projectId; - private String pipelineId; - private String buildId; - private String commitId; - private String authorName; - private String message; - private String repoType; - private LocalDateTime commitTime; - private String url; - private String eventType; - private String mrId; - private String channel; - private String action; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookBuildResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookBuildResult.java deleted file mode 100644 index 373099f4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookBuildResult.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.code; - -import cd.casic.ci.process.api.process.pojo.BuildId; -import cd.casic.ci.process.api.process.pojo.classify.PipelineViewPreview; -import cd.casic.ci.process.api.process.pojo.trigger.PipelineTriggerReasonDetail; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.code - * @Project:ops-pro - * @name:WebhookBuildResult - * @Date:2025/03/24 20:16 - * @Filename:WebhookBuildResult - * @description:Todo - */ -@Data -@Schema(title = "webhook触发结果") -public class WebhookBuildResult { - @Schema(title = "触发结果") - private boolean result; - @Schema(title = "流水线信息") - private PipelineViewPreview.PipelineInfo pipelineInfo; - @Schema(title = "触发buildId") - private BuildId buildId; - @Schema(title = "触发失败原因") - private PipelineTriggerReasonDetail reasonDetail; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookCommit.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookCommit.java deleted file mode 100644 index 0b873035..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookCommit.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.code; - -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeEventType; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeType; -import cd.casic.ci.log.scm.enums.RepositoryConfig; -import lombok.Data; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.code - * @Project:ops-pro - * @name:WebhookCommit - * @Date:2025/03/24 20:16 - * @Filename:WebhookCommit - * @description:Todo - */ -@Data -public class WebhookCommit { - private String userId; - private String pipelineId; - private Integer version; - private Map params; - private RepositoryConfig repositoryConfig; - private String repoName; - private String commitId; - private boolean block; - private CodeEventType eventType; - private CodeType codeType; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookInfo.java deleted file mode 100644 index 35d37a1c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/code/WebhookInfo.java +++ /dev/null @@ -1,75 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.code; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.code - * @Project:ops-pro - * @name:WebhookInfo - * @Date:2025/03/24 20:16 - * @Filename:WebhookInfo - * @description:Todo - */ -@Data -@AllArgsConstructor -public class WebhookInfo { - @Schema(title = "代码库类型", required = true) - private String codeType; // CodeType.name - @Schema(title = "代码库完整名称", required = true) - private String nameWithNamespace; - @Schema(title = "仓库url链接", required = false) - private String webhookRepoUrl; - @Schema(title = "分支名(目标分支)", required = false) - private String webhookBranch; - @Schema(title = "别名", required = false) - private String webhookAliasName; - @Schema(title = "webhook类型", required = false) - private String webhookType; - @Schema(title = "事件类型", required = false) - private String webhookEventType; - @Schema(title = "提交信息", required = false) - private String webhookMessage; - @Schema(title = "提交信息id", required = false) - private String webhookCommitId; - @Schema(title = "参考信息(commit_id,mr_id,tag,issue_id,review_id,note_id等)", required = true) - private String refId; - @Schema(title = "合并后commitId", required = false) - private String webhookMergeCommitSha; - @Schema(title = "源分支", required = false) - private String webhookSourceBranch; - @Schema(title = "mr id", required = false) - private String mrId; - @Schema(title = "mr iid", required = false) - private String mrIid; - @Schema(title = "mr url", required = false) - private String mrUrl; - @Schema(title = "webhook仓库授权用户", required = false) - private String repoAuthUser; - @Schema(title = "tag 名称", required = false) - private String tagName; - @Schema(title = "issue iid", required = false) - private String issueIid; - @Schema(title = "note id", required = false) - private String noteId; - @Schema(title = "review id", required = false) - private String reviewId; - @Schema(title = "父流水线项目ID", required = false) - private String parentProjectId; - @Schema(title = "父流水线流水线ID", required = false) - private String parentPipelineId; - @Schema(title = "父流水线名称", required = false) - private String parentPipelineName; - @Schema(title = "父流水线buildId", required = false) - private String parentBuildId; - @Schema(title = "父流水线构建号", required = false) - private String parentBuildNum; - @Schema(title = "触发材料url", required = false) - private String linkUrl; - @Schema(title = "自定义触发材料ID", required = false) - private String materialId; - @Schema(title = "自定义触发材料名", required = false) - private String materialName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/IDispatchEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/IDispatchEvent.java deleted file mode 100644 index 0dfcb850..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/IDispatchEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.mq; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.log.log.IEvent; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.mq - * @Project:ops-pro - * @name:IDispatchEvent - * @Date:2025/03/25 9:34 - * @Filename:IDispatchEvent - * @description:Todo - */ -public class IDispatchEvent extends IEvent { - private ActionType actionType; - private String source; - private String projectId; - private String pipelineId; - private String userId; - private String routeKeySuffix; - private int delayMills; - private int retryTime = 1; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentShutdownDemoteEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentShutdownDemoteEvent.java deleted file mode 100644 index 01bfccbf..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentShutdownDemoteEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.mq; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import org.apache.tomcat.util.net.DispatchType; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.mq - * @Project:ops-pro - * @name:PipelineAgentShutdownDemoteEvent - * @Date:2025/03/25 9:35 - * @Filename:PipelineAgentShutdownDemoteEvent - * @description:Todo - */ -public class PipelineAgentShutdownDemoteEvent extends IPipelineEvent { - private String source; - private String projectId; - private String pipelineId; - private String userId; - private String buildId; - private String vmSeqId; - private boolean buildResult; - private Integer executeCount; - private String dockerRoutingType = "VM"; - private DispatchType dispatchType; - private String routeKeySuffix; - private ActionType actionType = ActionType.REFRESH; - private int delayMills = 0; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentShutdownEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentShutdownEvent.java deleted file mode 100644 index 2342a00f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentShutdownEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.mq; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import org.apache.tomcat.util.net.DispatchType; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.mq - * @Project:ops-pro - * @name:PipelineAgentShutdownEvent - * @Date:2025/03/25 9:35 - * @Filename:PipelineAgentShutdownEvent - * @description:Todo - */ -public class PipelineAgentShutdownEvent extends IPipelineEvent { - private String source; - private String projectId; - private String pipelineId; - private String userId; - private String buildId; - private String vmSeqId; - private boolean buildResult; - private Integer executeCount; - private String dockerRoutingType = "VM"; - private DispatchType dispatchType; - private String routeKeySuffix; - private ActionType actionType = ActionType.REFRESH; - private int delayMills = 0; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentStartupDemoteEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentStartupDemoteEvent.java deleted file mode 100644 index 2f640a88..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentStartupDemoteEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.mq; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import org.apache.tomcat.util.net.DispatchType; - -import java.util.Map; -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.mq - * @Project:ops-pro - * @name:PipelineAgentStartupDemoteEvent - * @Date:2025/03/25 9:36 - * @Filename:PipelineAgentStartupDemoteEvent - * @description:Todo - */ -public class PipelineAgentStartupDemoteEvent extends IPipelineEvent { - private String source; - private String projectId; - private String pipelineId; - private String pipelineName; - private String userId; - private String buildId; - private int buildNo; - private String vmSeqId; - private String taskName; - private String os; - private String vmNames; - private String channelCode; - private DispatchType dispatchType; - private String containerId; - private String containerHashId; - private Integer queueTimeoutMinutes; - private Map atoms = Map.of(); - private Integer executeCount; - private Map customBuildEnv; - private String dockerRoutingType = "VM"; - private String routeKeySuffix; - private String jobId; - private Set ignoreEnvAgentIds; - private Integer singleNodeConcurrency; - private Integer allNodeConcurrency; - private Long dispatchQueueStartTimeMilliSecond; - private ActionType actionType = ActionType.REFRESH; - private int delayMills = 0; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentStartupEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentStartupEvent.java deleted file mode 100644 index fc5f1588..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineAgentStartupEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.mq; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import org.apache.tomcat.util.net.DispatchType; - -import java.util.Map; -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.mq - * @Project:ops-pro - * @name:PipelineAgentStartupEvent - * @Date:2025/03/25 9:36 - * @Filename:PipelineAgentStartupEvent - * @description:Todo - */ -public class PipelineAgentStartupEvent extends IPipelineEvent { - private String source; - private String projectId; - private String pipelineId; - private String pipelineName; - private String userId; - private String buildId; - private int buildNo; - private String vmSeqId; - private String taskName; - private String os; - private String vmNames; - private String channelCode; - private DispatchType dispatchType; - private String containerId; - private String containerHashId; - private Integer queueTimeoutMinutes; - private Map atoms = Map.of(); - private Integer executeCount; - private Map customBuildEnv; - private String dockerRoutingType = "VM"; - private String routeKeySuffix; - private String jobId; - private Set ignoreEnvAgentIds; - private Integer singleNodeConcurrency; - private Integer allNodeConcurrency; - private Long dispatchQueueStartTimeMilliSecond; - private Integer jobTimeoutMinutes; - private ActionType actionType = ActionType.REFRESH; - private int delayMills = 0; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineBuildLessShutdownEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineBuildLessShutdownEvent.java deleted file mode 100644 index f0741962..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineBuildLessShutdownEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.mq; - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.mq - * @Project:ops-pro - * @name:PipelineBuildLessShutdownEvent - * @Date:2025/03/25 9:36 - * @Filename:PipelineBuildLessShutdownEvent - * @description:Todo - */ -public class PipelineBuildLessShutdownEvent extends IPipelineEvent { - private String source; - private String projectId; - private String pipelineId; - private String userId; - private String buildId; - private String vmSeqId; - private boolean buildResult; - private Integer executeCount; - private ActionType actionType = ActionType.REFRESH; - private int delayMills = 0; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineBuildLessStartupEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineBuildLessStartupEvent.java deleted file mode 100644 index 2e90a2b5..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/mq/PipelineBuildLessStartupEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.mq; - -import cd.casic.ci.common.pipeline.pojo.Zone; -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; - -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.mq - * @Project:ops-pro - * @name:PipelineBuildLessStartupEvent - * @Date:2025/03/25 9:37 - * @Filename:PipelineBuildLessStartupEvent - * @description:Todo - */ -public class PipelineBuildLessStartupEvent extends IPipelineEvent { - private String source; - private String projectId; - private String pipelineId; - private String userId; - private String buildId; - private String vmSeqId; - private String containerId; - private String containerHashId; - private String os; - private long startTime; - private String channelCode; - private Zone zone; - private Map atoms = Map.of(); - private Integer executeCount; - private Map customBuildEnv; - private Integer queueTimeoutMinutes; - private ActionType actionType = ActionType.REFRESH; - private int delayMills = 0; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/open/BuildStatusInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/open/BuildStatusInfo.java deleted file mode 100644 index 263333f7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/open/BuildStatusInfo.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.open; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import lombok.Data; - -/** - * @author by mianbin - * @Classname BuildStatusInfo - * @Description open接口返回的构建状态封装 - * @Date 2025/3/31 17:05 - */ -@Data -public class BuildStatusInfo { - private final String startUser; - private final boolean debug; - private final BuildStatus status; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/AppModelDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/AppModelDetail.java deleted file mode 100644 index 9abb083e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/AppModelDetail.java +++ /dev/null @@ -1,81 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.process.api.process.pojo.PipelineBuildMaterial; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname AppModelDetail - * @Description TODO - * @Date 2025/3/31 17:09 - */ -@Data -@Schema(title = "APP-构建详情-构建信息") -public class AppModelDetail { - @Schema(title = "ID", required = true) - private String buildId; - - @Schema(title = "启动用户", required = true) - private String userId; - - @Schema(title = "触发条件", required = true) - private String trigger; - - @Schema(title = "Start time", required = true) - private Long startTime; - - @Schema(title = "End time", required = false) - private Long endTime; - - @Schema(title = "Build status", required = true) - private String status; - - @Schema(title = "服务器当前时间戳", required = true) - private Long currentTimestamp; - - @Schema(title = "构建号", required = true) - private Integer buildNum; - - @Schema(title = "取消构建的用户", required = false) - private String cancelUserId; - - @Schema(title = "归档文件个数", required = false) - private Integer fileCount; - - @Schema(title = "包的版本(多个分号分隔)", required = false) - private String packageVersion; - - @Schema(title = "流水线Id", required = false) - private String pipelineId; - - @Schema(title = "流水线版本", required = false) - private Integer pipelineVersion; - - @Schema(title = "流水线名字", required = false) - private String pipelineName; - - @Schema(title = "项目Id", required = false) - private String projectId; - - @Schema(title = "是否收藏", required = false) - private Boolean hasCollect; - - @Schema(title = "编排文件", required = true) - private Model model; - - @Schema(title = "原材料", required = false) - private List material; - - @Schema(title = "备注", required = false) - private String remark; - - @Schema(title = "运行耗时(毫秒,不包括人工审核时间)", required = false) - private Long executeTime; - - @Schema(title = "构建信息", required = false) - private String buildMsg; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/BatchDeletePipeline.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/BatchDeletePipeline.java deleted file mode 100644 index a86ccaa8..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/BatchDeletePipeline.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname BatchDeletePipeline - * @Description TODO - * @Date 2025/3/31 17:21 - */ -@Data -@AllArgsConstructor -@Schema(title = "批量删除流水线") -public class BatchDeletePipeline { - @Schema(title = "项目ID") - private String projectId; - - @Schema(title = "流水线ID列表") - private java.util.List pipelineIds; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/BuildRecordInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/BuildRecordInfo.java deleted file mode 100644 index 6ba816d4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/BuildRecordInfo.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname BuildRecordInfo - * @Description TODO - * @Date 2025/3/31 17:22 - */ -@Data -@AllArgsConstructor -@Schema(title = "执行次数记录") -public class BuildRecordInfo { - @Schema(title = "触发人", required = true) - private String startUser; - @Schema(title = "耗时详情", required = true) - private BuildRecordTimeCost timeCost; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DeletePipelineResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DeletePipelineResult.java deleted file mode 100644 index 94045e5f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DeletePipelineResult.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname DeletePipelineResult - * @Description TODO - * @Date 2025/3/31 17:28 - */ -@Data -@AllArgsConstructor -@Schema(title = "删除流水线结果") -public class DeletePipelineResult { - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "流水线版本号", required = true) - private int version; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DeployPipelineResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DeployPipelineResult.java deleted file mode 100644 index 17afdb64..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DeployPipelineResult.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname DeployPipelineResult - * @Description TODO - * @Date 2025/3/31 17:28 - */ -@Data -@Schema(title = "配置流水线结果") -public class DeployPipelineResult { - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "流水线版本号", required = true) - private int version; - @Schema(title = "发布版本号", required = false) - private Integer versionNum; - @Schema(title = "生成版本名称", required = false) - private String versionName; - @Schema(title = "目标链接", required = false) - private String targetUrl; - @Schema(title = "yaml信息", required = false) - private PipelineYamlVo yamlInfo; - @Schema(title = "是否更新了推荐版本号基准值", required = false) - private Boolean updateBuildNo; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DynamicParameterInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DynamicParameterInfo.java deleted file mode 100644 index 14797144..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/DynamicParameterInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @author by mianbin - * @Classname DynamicParameterInfo - * @Description TODO - * @Date 2025/3/31 17:30 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "DynamicParameter模型-ID") -public class DynamicParameterInfo { - @JsonProperty("id") - private String id; // 该行的唯一标识,必填 - - @JsonProperty("paramModels") - private List paramModels; -} - -@Data -@NoArgsConstructor -@AllArgsConstructor -class DynamicParameterInfoParam { - @JsonProperty("value") - private String value = null; // 值,可做为初始化的默认值 - - @JsonProperty("disabled") - private boolean disabled; // 控制是否可编辑 - - @JsonProperty("id") - private String id; // 该模型的唯一标识,必填 - - @JsonProperty("isMultiple") - private Boolean isMultiple = null; // select是否多选 - - @JsonProperty("label") - private String label = null; // testLabel - - @JsonProperty("list") - private List list = null; // type是select起作用,需要有id和name字段 - - @JsonProperty("listType") - private String listType = null; // 获取列表方式,可以是url或者list - - @JsonProperty("type") - private String type; // 可以是input或者select - - @JsonProperty("url") - private String url = null; // type是select且listType是url起作用 - - @JsonProperty("dataPath") - private String dataPath = null; // 接口返回值,取数的路径,默认为 data.records -} - diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ModelDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ModelDetail.java deleted file mode 100644 index 3db43062..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ModelDetail.java +++ /dev/null @@ -1,59 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - - -import cd.casic.ci.common.pipeline.Model; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname ModelDetail - * @Description TODO - * @Date 2025/3/31 17:31 - */ -@Data -@AllArgsConstructor -@Schema(title = "构建详情-构建信息") -public class ModelDetail { - @Schema(title = "构建ID", required = true) - private String id; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "启动用户", required = true) - private String userId; - @Schema(title = "触发用户", required = true) - private String triggerUser; - @Schema(title = "触发条件", required = true) - private String trigger; - @Schema(title = "Start time", required = true) - private Long startTime; - @Schema(title = "End time", required = false) - private Long endTime; - @Schema(title = "Build status", required = true) - private String status; - @Schema(title = "Build Model", required = true) - private Model model; - @Schema(title = "服务器当前时间戳", required = true) - private Long currentTimestamp; - @Schema(title = "构建号", required = true) - private Integer buildNum; - @Schema(title = "取消构建的用户", required = false) - private String cancelUserId; - @Schema(title = "本次执行的编排版本号", required = true) - private Integer curVersion; - @Schema(title = "流水线当前最新版本号", required = true) - private Integer latestVersion; - @Schema(title = "最新一次的构建buildNo", required = true) - private Integer latestBuildNum; - @Schema(title = "最近修改人", required = true) - private String lastModifyUser; - @Schema(title = "执行耗时(排除系统耗时)流水线执行结束时才赋值", required = true) - private Long executeTime = 0L; - @Schema(title = "触发审核人列表", required = false) - private java.util.List triggerReviewers; - @Schema(title = "是否为调试构建", required = false) - private Boolean debug = false; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ModelRecord.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ModelRecord.java deleted file mode 100644 index 42b977c4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ModelRecord.java +++ /dev/null @@ -1,95 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.pojo.transfer.TemplateInfo; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.process.api.process.pojo.BuildStageStatus; -import cd.casic.ci.process.api.process.pojo.PipelineBuildMaterial; -import cd.casic.ci.process.api.process.pojo.code.WebhookInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @author by mianbin - * @Classname ModelRecord - * @Description TODO - * @Date 2025/3/31 17:37 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "构建详情-构建信息") -public class ModelRecord { - @Schema(title = "构建ID", required = true) - private String id; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "启动用户", required = true) - private String userId; - @Schema(title = "触发用户", required = true) - private String triggerUser; - @Schema(title = "触发条件", required = true) - private String trigger; - @Schema(title = "触发时间(进队列时间)", required = true) - private Long queueTime; - @Schema(title = "执行开始时间", required = true) - private Long startTime; - @Schema(title = "排队耗时(进队列到开始执行)", required = true) - private Long queueTimeCost; - @Schema(title = "执行结束时间", required = false) - private Long endTime; - @Schema(title = "Build status", required = true) - private String status; - @Schema(title = "Build Model", required = true) - private Model model; - @Schema(title = "服务器当前时间戳", required = true) - private Long currentTimestamp; - @Schema(title = "构建号", required = true) - private Integer buildNum; - @Schema(title = "取消构建的用户", required = false) - private String cancelUserId; - @Schema(title = "本次执行的编排版本号", required = true) - private Integer curVersion; - @Schema(title = "本次执行的编排版本名", required = true) - private String curVersionName; - @Schema(title = "流水线当前最新版本号", required = true) - private Integer latestVersion; - @Schema(title = "最新一次的构建buildNo", required = true) - private Integer latestBuildNum; - @Schema(title = "最近修改人", required = false) - private String lastModifyUser; - @Deprecated - @Schema(title = "执行耗时(排除系统耗时)流水线执行结束时才赋值", required = true) - private Long executeTime = 0L; - @Schema(title = "流水线任务执行错误", required = false) - private List errorInfoList; - @Schema(title = "已执行stage的状态", required = false) - private List stageStatus; - @Schema(title = "触发审核人列表", required = false) - private List triggerReviewers; - @Schema(title = "当前查询的执行次数", required = false) - private Integer executeCount; - @Deprecated - @Schema(title = "历史重试执行人列表(有序)", required = true) - private List startUserList; - @Schema(title = "历史重试人列表(有序)", required = true) - private List recordList; - @Schema(title = "构建信息", required = false) - private String buildMsg; - @Schema(title = "原材料", required = false) - private List material; - @Schema(title = "备注", required = false) - private String remark; - @Schema(title = "是否为调试构建", required = false) - private Boolean debug = false; - @Schema(title = "触发信息(包括代码库等)", required = false) - private WebhookInfo webhookInfo; - @Schema(title = "约束模式下的模板信息", required = false) - private TemplateInfo templateInfo; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineCollection.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineCollection.java deleted file mode 100644 index 1395d056..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineCollection.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineCollection - * @Description TODO - * @Date 2025/3/31 17:39 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "流水线收藏模型") -public class PipelineCollection { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线id", required = false) - private String pipelineId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineCount.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineCount.java deleted file mode 100644 index b95fcc7e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineCount.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PipelineCount - * @Description TODO - * @Date 2025/3/31 17:39 - */ -@Data -@AllArgsConstructor -@Schema(title = "流水线数量相关") -public class PipelineCount { - @Schema(title = "全部流水线个数", required = true) - private int totalCount; - @Schema(title = "我的收藏个数", required = true) - private int myFavoriteCount; - @Schema(title = "我的流水线的个数", required = true) - private int myPipelineCount; - @Schema(title = "回收站流水线的个数", required = true) - private int recycleCount; - @Schema(title = "最近使用的流水线的个数", required = true) - private final int recentUseCount; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineLatestBuild.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineLatestBuild.java deleted file mode 100644 index 97da4ec1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineLatestBuild.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineLatestBuild - * @Description TODO - * @Date 2025/3/31 17:40 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "流水线最新构建详情") -public class PipelineLatestBuild { - @Schema(title = "ID", required = true) - private String buildId; - @Schema(title = "启动用户", required = true) - private String startUser; - @Schema(title = "Start time", required = true) - private String startTime; - @Schema(title = "End time", required = false) - private String endTime; - @Schema(title = "Build status", required = false) - private String status; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineResourceVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineResourceVersion.java deleted file mode 100644 index fe31d820..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineResourceVersion.java +++ /dev/null @@ -1,96 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.enums.BranchVersionAction; -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.process.api.process.pojo.setting.PipelineVersionSimple; -import cd.casic.ci.process.api.process.utils.PipelineVersionUtils; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @author by mianbin - * @Classname PipelineResourceVersion - * @Description TODO - * @Date 2025/3/31 17:40 - */ -@Data -@AllArgsConstructor -@Schema(title = "流水线版本-详细内容") -public class PipelineResourceVersion { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "记录版本号", required = true) - private int version; - @Schema(title = "JSON编排内容(POJO)", required = true) - private Model model; - @Schema(title = "YAML编排内容", required = false) - private String yaml; - @Schema(title = "YAML编排版本", required = false) - private String yamlVersion; - @Schema(title = "版本名称", required = true) - private String versionName; - @Schema(title = "创建者", required = true) - private String creator; - @Schema(title = "版本创建时间", required = true) - private LocalDateTime createTime; - @Schema(title = "更新操作人", required = true) - private String updater; - @Schema(title = "版本修改时间", required = true) - private LocalDateTime updateTime; - @Schema(title = "发布版本号", required = false) - private Integer versionNum; - @Schema(title = "编排版本号", required = false) - private Integer pipelineVersion; - @Schema(title = "触发器版本号", required = false) - private Integer triggerVersion; - @Schema(title = "设置版本号", required = false) - private Integer settingVersion; - @Schema(title = "是否还有构建记录引用该版本标识", required = false) - private Boolean referFlag; - @Schema(title = "关联构建记录总数", required = false) - private Integer referCount; - @Schema(title = "草稿版本标识", required = false) - private VersionStatus status; - @Schema(title = "分支版本状态", required = false) - private BranchVersionAction branchAction; - @Schema(title = "版本变更说明", required = false) - private String description; - @Schema(title = "调试构建ID", required = false) - private String debugBuildId; - @Schema(title = "该版本的来源版本(空时一定为主路径)", required = false) - private Integer baseVersion; - - public PipelineVersionSimple toSimple() { - return new PipelineVersionSimple( - pipelineId, - creator, - createTime, - updater, - updateTime != null ? updateTime : null, - version, - versionName != null ? versionName : PipelineVersionUtils.getVersionName( - versionNum != null ? versionNum : version, - versionNum != null ? versionNum : version, - 0, - 0 - ), - referFlag, - referCount, - versionNum, - pipelineVersion, - triggerVersion, - settingVersion, - status != null ? status : VersionStatus.RELEASED, - debugBuildId, - baseVersion, - description, - yamlVersion - ); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineRule.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineRule.java deleted file mode 100644 index 4b966903..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineRule.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineRule - * @Description TODO - * @Date 2025/3/31 17:44 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "流水线规则") -public class PipelineRule { - @Schema(title = "规则名称", required = true) - private String ruleName; - @Schema(title = "业务标识", required = true) - private String busCode; - @Schema(title = "处理器", required = true) - private String processor; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlInfo.java deleted file mode 100644 index 3c87560c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineYamlInfo - * @Description TODO - * @Date 2025/3/31 17:44 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "流水线yml关联") -public class PipelineYamlInfo { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "代码库ID") - private String repoHashId; - @Schema(title = "ci文件路径") - private String filePath; - @Schema(title = "流水线ID") - private String pipelineId; - @Schema(title = "yaml文件状态") - private String status; - @Schema(title = "流水线创建者") - private String creator; - @Schema(title = "默认分支") - private String defaultBranch; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlSyncInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlSyncInfo.java deleted file mode 100644 index f90c164c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlSyncInfo.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.enums.RepoYamlSyncStatusEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineYamlSyncInfo - * @Description TODO - * @Date 2025/3/31 17:44 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "pac同步文件信息") -public class PipelineYamlSyncInfo { - @Schema(title = "文件路径", required = true) - private String filePath; - - @Schema(title = "文件url", required = true) - private String fileUrl = null; - - @Schema(title = "同步状态", required = true) - private RepoYamlSyncStatusEnum syncStatus = RepoYamlSyncStatusEnum.SYNC; - - @Schema(title = "原因", required = false) - private String reason = null; - - @Schema(title = "原因详情", required = false) - private String reasonDetail = null; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlVersion.java deleted file mode 100644 index 2f66b641..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlVersion.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PipelineYamlVersion - * @Description TODO - * @Date 2025/3/31 17:45 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "流水线yml版本") -public class PipelineYamlVersion { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "代码库ID") - private String repoHashId; - @Schema(title = "ci文件路径") - private String filePath; - @Schema(title = "ci文件blob_id") - private String blobId; - @Schema(title = "ci文件commitId") - private String commitId; - @Schema(title = "ci文件来源分支/tag") - private String ref; - @Schema(title = "流水线ID") - private String pipelineId; - @Schema(title = "流水线版本") - private int version; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlView.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlView.java deleted file mode 100644 index 4f3e04d8..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlView.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PipelineYamlView - * @Description TODO - * @Date 2025/3/31 17:46 - */ -@Data -@Schema(title = "yaml流水线组") -public class PipelineYamlView { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "代码库ID") - private String repoHashId; - @Schema(title = "ci文件路径") - private String directory; - @Schema(title = "流水线组ID") - private Long viewId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlVo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlVo.java deleted file mode 100644 index 08aaf806..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PipelineYamlVo.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.enums.ScmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PipelineYamlVo - * @Description TODO - * @Date 2025/3/31 17:46 - */ -@Data -@AllArgsConstructor -@Schema(title = "流水线yaml展示信息") -public class PipelineYamlVo { - @Schema(title = "代码库hashId", required = true) - private String repoHashId; - @Schema(title = "代码库类型", required = true) - private ScmType scmType; - @Schema(title = "yaml文件路径", required = true) - private String filePath; - @Schema(title = "代码库项目路径", required = false) - private String pathWithNamespace; - @Schema(title = "仓库网页url", required = false) - private String webUrl; - @Schema(title = "yaml文件url", required = false) - private String fileUrl; - @Schema(title = "yaml文件状态", required = false) - private String status; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PrefetchReleaseResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PrefetchReleaseResult.java deleted file mode 100644 index bd677480..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PrefetchReleaseResult.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname PrefetchReleaseResult - * @Description TODO - * @Date 2025/3/31 17:47 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "配置流水线结果") -public class PrefetchReleaseResult { - @Schema(title = "流水线ID", required = true) - private String pipelineId; - - @Schema(title = "流水线名称", required = true) - private String pipelineName; - - @Schema(title = "草稿版本号", required = true) - private int version; - - @Schema(title = "发布版本号", required = false) - private int newVersionNum; - - @Schema(title = "生成版本名称", required = false) - private String newVersionName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ProjectBuildId.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ProjectBuildId.java deleted file mode 100644 index a46357fd..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/ProjectBuildId.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname ProjectBuildId - * @Description TODO - * @Date 2025/3/31 17:47 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "构建模型-ID") -public class ProjectBuildId { - @Schema(title = "构建ID", required = true) - private String id; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "构建序号", required = false) - private Integer buildNum; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PushPipelineResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PushPipelineResult.java deleted file mode 100644 index 2e4d9c50..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/PushPipelineResult.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname PushPipelineResult - * @Description TODO - * @Date 2025/3/31 17:48 - */ -@Data -@AllArgsConstructor -@Schema(title = "推送流水线结果") -public class PushPipelineResult { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "代码库ID") - private String repoHashId; - @Schema(title = "ci文件路径") - private String filePath; - @Schema(title = "分支名") - private String branch; - @Schema(title = "mr url") - private String mrUrl; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SimplePipeline.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SimplePipeline.java deleted file mode 100644 index 38fa83e3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SimplePipeline.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname SimplePipeline - * @Description TODO - * @Date 2025/3/31 17:49 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "流水线模型-列表信息") -public class SimplePipeline { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "流水线描述", required = false) - private String pipelineDesc; - @Schema(title = "流水线任务数量", required = true) - private int taskCount; - @Schema(title = "是否被删除了", required = false) - private boolean isDelete; - @Schema(title = "是否模板实例化的流水线", required = true) - private boolean instanceFromTemplate; - @Schema(title = "自增id", required = true) - private Long id; - @Schema(title = "创建人", required = false) - private String createUser; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/StartUpInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/StartUpInfo.java deleted file mode 100644 index fdeaebb1..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/StartUpInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname StartUpInfo - * @Description TODO - * @Date 2025/3/31 17:49 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "子流水线参数键值对") -public class StartUpInfo { - @Schema(title = "子流水线参数名", required = true) - private String id; - @Schema(title = "子流水线参数值", required = true) - private Object name; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineIdAndName.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineIdAndName.java deleted file mode 100644 index b355237e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineIdAndName.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import lombok.AllArgsConstructor; -import lombok.Data; - -/** - * @author by mianbin - * @Classname SubPipelineIdAndName - * @Description 子流水线ID和名称 - * @Date 2025/3/31 17:51 - */ -@Data -@AllArgsConstructor -public class SubPipelineIdAndName { - private String projectId; - private String pipelineId; - private String pipelineName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineRef.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineRef.java deleted file mode 100644 index 135ea3fe..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineRef.java +++ /dev/null @@ -1,68 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.atom.SubPipelineType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname SubPipelineRef - * @Description TODO - * @Date 2025/3/31 17:51 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "子流水线依赖信息") -public class SubPipelineRef { - @Schema(title = "流水线Id", required = true) - private String pipelineId; - @Schema(title = "流水线名称", required = true) - private String pipelineName; - @Schema(title = "流水线项目Id", required = true) - private String projectId; - @Schema(title = "流水线项目渠道", required = true) - private String channel; - @Schema(title = "插件", required = true) - private Element element; - @Schema(title = "插件所在位置[stageIndex-containerIndex-taskIndex]", required = true) - private String taskPosition; - @Schema(title = "子流水线流水线Id", required = true) - private String subPipelineId; - @Schema(title = "子流水线项目Id", required = true) - private String subProjectId; - @Schema(title = "子流水线名称", required = true) - private String subPipelineName; - @Schema(title = "校验权限用户", required = true) - private String userId = ""; - @Schema(title = "插件启用状态", required = true) - private boolean elementEnable = true; - @Schema(title = "是否为模板流水线", required = true) - private boolean isTemplate = false; - @Schema(title = "插件参数[projectId]", required = false) - private String taskProjectId = ""; - @Schema(title = "插件参数[type]", required = false) - private SubPipelineType taskPipelineType = SubPipelineType.ID; - @Schema(title = "插件参数[pipelineId]", required = false) - private String taskPipelineId = ""; - @Schema(title = "插件参数[pipelineName]", required = false) - private String taskPipelineName = ""; - - // 递归检查使用 - public String refKey() { - return projectId + "|" + pipelineId; - } - - // 递归检查使用 - public String subRefKey() { - return subProjectId + "|" + subPipelineId; - } - - // 链路打印 - public String chainKey() { - return projectId + "|" + pipelineId + "|" + taskPosition; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineStartUpInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineStartUpInfo.java deleted file mode 100644 index 075f9fa4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineStartUpInfo.java +++ /dev/null @@ -1,49 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @author by mianbin - * @Classname SubPipelineStartUpInfo - * @Description TODO - * @Date 2025/3/31 17:52 - */ -@Data -@Schema(title = "构建模型-ID") -public class SubPipelineStartUpInfo { - @Schema(title = "参数key值", required = true) - private String key; - @Schema(title = "key值是否可以更改", required = true) - private boolean keyDisable; - @Schema(title = "key值前端组件类型", required = true) - private String keyType; - @Schema(title = "key值获取方式", required = true) - private String keyListType; - @Schema(title = "key值获取路径", required = true) - private String keyUrl; - @Schema - private List keyUrlQuery; - @Schema(title = "key值获取集合", required = true) - private List keyList; - @Schema(title = "key值是否多选", required = true) - private boolean keyMultiple; - @Schema(title = "参数value值", required = true) - private Object value; - @Schema(title = "value值是否可以更改", required = true) - private boolean valueDisable; - @Schema(title = "value值前端组件类型", required = true) - private String valueType; - @Schema(title = "value值获取方式", required = true) - private String valueListType; - @Schema(title = "value值获取路径", required = true) - private String valueUrl; - @Schema - private List valueUrlQuery; - @Schema(title = "value值获取集合", required = true) - private List valueList; - @Schema(title = "value值是否多选", required = true) - private boolean valueMultiple; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineStatus.java deleted file mode 100644 index 90e3ebe3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineStatus.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import javax.lang.model.type.ErrorType; - -/** - * @author by mianbin - * @Classname SubPipelineStatus - * @Description TODO - * @Date 2025/3/31 17:52 - */ -@Data -@Schema(title = "构建模型-ID") -public class SubPipelineStatus { - @Schema(title = "子流水线状态", required = true) - private String status; - @Schema(title = "错误类型", required = false) - private ErrorType errorType; - @Schema(title = "错误码", required = false) - private Integer errorCode; - @Schema(title = "错误信息", required = false) - private String errorMsg; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineTaskParam.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineTaskParam.java deleted file mode 100644 index 24f01a7a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/SubPipelineTaskParam.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.pojo.element.atom.SubPipelineType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname SubPipelineTaskParam - * @Description TODO - * @Date 2025/3/31 17:53 - */ -@Data -@NoArgsConstructor -@Schema(title = "子流水线插件参数") -public class SubPipelineTaskParam { - @Schema(title = "源参数值[projectId]", required = false) - private String taskProjectId = ""; - - @Schema(title = "源参数值[type]", required = false) - private SubPipelineType taskPipelineType = SubPipelineType.ID; - - @Schema(title = "源参数值[pipelineId]", required = false) - private String taskPipelineId; - - @Schema(title = "源参数值[pipelineName]", required = false) - private String taskPipelineName; - - @Schema(title = "解析后[projectId]", required = false) - private String projectId = ""; - - @Schema(title = "解析后[pipelineId]", required = false) - private String pipelineId = ""; - - @Schema(title = "解析后[pipelineName]", required = false) - private String pipelineName = ""; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/TemplateInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/TemplateInfo.java deleted file mode 100644 index a4423994..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/TemplateInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline; - -import cd.casic.ci.common.pipeline.enums.PipelineInstanceTypeEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author by mianbin - * @Classname TemplateInfo - * @Description TODO - * @Date 2025/3/31 17:53 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "子流水线参数键值对") -public class TemplateInfo { - @Schema(title = "模板ID", required = true) - private String templateId; - - @Schema(title = "模板名称", required = true) - private String templateName; - - @Schema(title = "版本号", required = true) - private Long version; - - @Schema(title = "版本名称", required = true) - private String versionName; - - @Schema(title = "关联模式", required = true) - private PipelineInstanceTypeEnum instanceType; - - @Schema(title = "版本描述", required = true) - private String desc; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/enums/PipelineRuleBusCodeEnum.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/enums/PipelineRuleBusCodeEnum.java deleted file mode 100644 index e993878a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/enums/PipelineRuleBusCodeEnum.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline.enums; - -import lombok.Getter; - -/** - * @author by mianbin - * @Classname PipelineRuleBusCodeEnum - * @Description TODO - * @Date 2025/3/31 17:10 - */ -@Getter -public enum PipelineRuleBusCodeEnum { - BUILD_NUM -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/enums/PipelineYamlStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/enums/PipelineYamlStatus.java deleted file mode 100644 index 192d6308..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/enums/PipelineYamlStatus.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline.enums; - -/** - * @author by mianbin - * @Classname PipelineYamlStatus - * @Description YAML状态 - * @Date 2025/3/31 17:11 - */ -public enum PipelineYamlStatus { - // 状态OK,已合入到主干 - OK, - // 主干已删除 - DELETED, - // 没有合入到主干 - UN_MERGED; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordContainer.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordContainer.java deleted file mode 100644 index 87a1ee7e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordContainer.java +++ /dev/null @@ -1,174 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline.record; - -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.TriggerContainer; -import cd.casic.ci.common.pipeline.container.VMBuildContainer; -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.common.pipeline.utils.ElementUtils; -import cd.casic.ci.process.api.process.pojo.app.StartBuildContext; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author by mianbin - * @Classname BuildRecordContainer - * @Description TODO - * @Date 2025/3/31 17:12 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -@Schema(title = "构建详情记录-插件任务") -public class BuildRecordContainer { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "编排版本号", required = true) - private int resourceVersion; - @Schema(title = "步骤ID", required = true) - private String stageId; - @Schema(title = "作业容器ID", required = true) - private String containerId; - @Schema(title = "执行次数", required = true) - private int executeCount; - @Schema(title = "执行变量", required = true) - private Map containerVar; - @Schema(title = "作业容器类型", required = true) - private String containerType; - @Schema(title = "构建状态", required = false) - private String status; - @Schema(title = "是否为构建矩阵组", required = false) - private Boolean containPostTaskFlag; - @Schema(title = "是否为构建矩阵组", required = false) - private Boolean matrixGroupFlag; - @Schema(title = "所在矩阵组ID", required = false) - private String matrixGroupId; - @Schema(title = "开始时间", required = true) - private LocalDateTime startTime; - @Schema(title = "结束时间", required = true) - private LocalDateTime endTime; - @Schema(title = "业务时间戳集合", required = true) - private Map timestamps; - - public BuildRecordContainer(String projectId, String pipelineId, int resourceVersion, String buildId, String stageId, String id, String classType, int executeCount, Boolean matrixGroupFlag, String s, Map containerVar, Map kvHashMap) { - this.buildId = buildId; - this.projectId = projectId; - this.pipelineId = pipelineId; - this.resourceVersion = resourceVersion; - this.stageId = stageId; - this.containerId = id; - this.containerType = classType; - this.executeCount = executeCount; - this.matrixGroupFlag = matrixGroupFlag; - this.containerVar = containerVar; - this.status = s; - this.timestamps = kvHashMap; - this.startTime = LocalDateTime.now(); - this.endTime = LocalDateTime.now(); - } - - public static class BuildRecordContainerHelper { - @SuppressWarnings("ComplexMethod") - public static void addRecords( - List buildRecordContainers, - String stageId, - boolean stageEnableFlag, - Container container, - StartBuildContext context, - BuildStatus buildStatus, - List taskBuildRecords - ) { - Map containerVar = new HashMap<>(); - containerVar.put(Container.class.getDeclaredFields()[0].getName(), container.getName()); - if (container.getContainerHashId() != null) { - containerVar.put(Container.class.getDeclaredFields()[1].getName(), container.getContainerHashId()); - } - Integer startVMTaskSeq = container.getStartVMTaskSeq(); - if (startVMTaskSeq != null) { - containerVar.put(Container.class.getDeclaredFields()[2].getName(), startVMTaskSeq); - } - if (container instanceof TriggerContainer) { - TriggerContainer triggerContainer = (TriggerContainer) container; - containerVar.put(triggerContainer.getClass().getDeclaredFields()[0].getName(), triggerContainer.getParams()); - if (triggerContainer.getBuildNo() != null) { - containerVar.put(triggerContainer.getClass().getDeclaredFields()[1].getName(), triggerContainer.getBuildNo()); - } - if (triggerContainer.getTemplateParams() != null) { - containerVar.put(triggerContainer.getClass().getDeclaredFields()[2].getName(), triggerContainer.getTemplateParams()); - } - } else if (container instanceof VMBuildContainer) { - VMBuildContainer vmBuildContainer = (VMBuildContainer) container; - if (vmBuildContainer.getShowBuildResource() != null) { - containerVar.put(VMBuildContainer.class.getDeclaredFields()[0].getName(), vmBuildContainer.getShowBuildResource()); - } - } - buildRecordContainers.add( - new BuildRecordContainer( - context.getProjectId(), - context.getPipelineId(), - context.getResourceVersion(), - context.getBuildId(), - stageId, - container.getId(), - container.getClassType(), - context.getExecuteCount(), - container.getMatrixGroupFlag(), - buildStatus != null ? buildStatus.name() : null, - containerVar, - new HashMap<>() - ) - ); - if (taskBuildRecords == null || container.getMatrixGroupFlag()) { - return; - } - for (int index = 0; index < container.getElements().size(); index++) { - Element element = container.getElements().get(index); - if (buildStatus == BuildStatus.SKIP && !ElementUtils.getTaskAddFlag( - element, - stageEnableFlag, - container.containerEnabled(), - container.getMatrixGroupFlag() - )) { - continue; - } - int taskSeq = startVMTaskSeq != null && startVMTaskSeq > 1 && index < startVMTaskSeq - 1 ? index + 1 : index + 2; - taskBuildRecords.add( - new BuildRecordTask( - context.getProjectId(), - context.getPipelineId(), - context.getBuildId(), - stageId, - container.getId(), - element.getId(), - element.getClassType(), - element.getAtomCode(), - context.getExecuteCount(), - context.getResourceVersion(), - taskSeq, - buildStatus != null ? buildStatus.name() : null, - element.initTaskVar(), - new HashMap<>(), - element.getAdditionalOptions() != null - && element.getAdditionalOptions().getElementPostInfo() != null - && !element.getAdditionalOptions().getElementPostInfo().getParentElementId().equals(element.getId()) - ? element.getAdditionalOptions().getElementPostInfo() - : null - ) - ); - } - } - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordModel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordModel.java deleted file mode 100644 index 30dfc8e4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordModel.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -/** - * @author by mianbin - * @Classname BuildRecordModel - * @Description TODO - * @Date 2025/3/31 17:15 - */ -@Data -@Schema(title = "构建详情记录-插件任务") -public class BuildRecordModel { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "编排版本号", required = true) - private int resourceVersion; - @Schema(title = "构建号", required = true) - private int buildNum; - @Schema(title = "执行次数", required = true) - private int executeCount; - @Schema(title = "执行变量", required = true) - private Map modelVar; - @Schema(title = "触发时间", required = false) - private LocalDateTime queueTime; - @Schema(title = "触发人", required = true) - private String startUser; - @Schema(title = "触发器", required = true) - private String startType; - @Schema(title = "构建状态", required = false) - private String status; - @Schema(title = "取消人", required = false) - private String cancelUser; - @Schema(title = "开始时间", required = true) - private LocalDateTime startTime; - @Schema(title = "结束时间", required = true) - private LocalDateTime endTime; - @Schema(title = "流水线任务执行错误", required = false) - private List errorInfoList; - @Schema(title = "业务时间戳集合", required = false) - private Map timestamps; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordStage.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordStage.java deleted file mode 100644 index d29ed629..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordStage.java +++ /dev/null @@ -1,71 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline.record; - -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.app.StartBuildContext; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author by mianbin - * @Classname BuildRecordStage - * @Description TODO - * @Date 2025/3/31 17:16 - */ -@Data -@AllArgsConstructor -@Schema(title = "构建详情记录-插件任务") -public class BuildRecordStage { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "编排版本号", required = true) - private int resourceVersion; - @Schema(title = "步骤ID", required = true) - private String stageId; - @Schema(title = "执行次数", required = true) - private int executeCount; - @Schema(title = "步骤序号", required = true) - private int stageSeq; - @Schema(title = "执行变量", required = true) - private Map stageVar; - @Schema(title = "构建状态", required = false) - private String status; - @Schema(title = "开始时间", required = true) - private LocalDateTime startTime; - @Schema(title = "结束时间", required = true) - private LocalDateTime endTime; - @Schema(title = "业务时间戳集合", required = true) - private Map timestamps; - - public static void addRecords(List recordStages, Stage stage, StartBuildContext context, int stageIndex, BuildStatus buildStatus, List containerBuildRecords, List taskBuildRecords) { - recordStages.add(new BuildRecordStage( - context.getBuildId(), - context.getProjectId(), - context.getPipelineId(), - context.getResourceVersion(), - stage.getId(), - context.getExecuteCount(), - stageIndex, - new HashMap<>(), - buildStatus != null ? buildStatus.name() : null, - null, - null, - new HashMap<>() - )); - stage.getContainers().forEach(container -> { - BuildRecordContainer.BuildRecordContainerHelper.addRecords(containerBuildRecords, stage.getId(), stage.stageEnabled(), container, context, buildStatus, taskBuildRecords); - }); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordTask.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordTask.java deleted file mode 100644 index c92361da..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/BuildRecordTask.java +++ /dev/null @@ -1,122 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.EnvControlTaskType; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.ElementPostInfo; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildTask; -import cn.hutool.json.JSONUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author by mianbin - * @Classname BuildRecordTask - * @Description TODO - * @Date 2025/3/31 17:19 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "构建详情记录-插件任务") -public class BuildRecordTask { - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "编排版本号", required = true) - private int resourceVersion; - @Schema(title = "步骤ID", required = true) - private String stageId; - @Schema(title = "作业容器ID", required = true) - private String containerId; - @Schema(title = "任务ID", required = true) - private String taskId; - @Schema(title = "任务序号", required = true) - private int taskSeq; - @Schema(title = "执行次数", required = true) - private int executeCount; - @Schema(title = "执行变量", required = true) - private Map taskVar = new HashMap<>(); - @Schema(title = "插件post信息", required = false) - private ElementPostInfo elementPostInfo; - @Schema(title = "插件类型标识", required = true) - private String classType; - @Schema(title = "市场插件标识", required = true) - private String atomCode; - @Schema(title = "构建状态", required = false) - private String status; - @Schema(title = "分裂前原类型标识", required = false) - private String originClassType; - @Schema(title = "开始时间", required = true) - private LocalDateTime startTime; - @Schema(title = "结束时间", required = true) - private LocalDateTime endTime; - @Schema(title = "业务时间戳集合", required = true) - private Map timestamps = new HashMap<>(); - @Schema(title = "异步执行状态", required = true) - private String asyncStatus; - - public BuildRecordTask(String projectId, String pipelineId, String buildId, String stageId, String id, String id1, String classType, String atomCode, int executeCount, int resourceVersion, int taskSeq, String s, Map stringObjectMap, Map kvHashMap, ElementPostInfo elementPostInfo) { - this.buildId = buildId; - this.projectId = projectId; - this.pipelineId = pipelineId; - this.resourceVersion = resourceVersion; - this.stageId = stageId; - this.containerId = id; - this.taskId = id1; - this.taskSeq = taskSeq; - this.executeCount = executeCount; - this.taskVar = stringObjectMap; - this.timestamps = kvHashMap; - this.classType = classType; - this.atomCode = atomCode; - this.status = s; - this.elementPostInfo = elementPostInfo; - this.startTime = LocalDateTime.now(); - this.endTime = LocalDateTime.now(); - } - - public static class BuildRecordTaskHelper { - public static void addRecords(List buildRecordTasks, List buildTaskList, int resourceVersion) { - for (PipelineBuildTask task : buildTaskList) { - // 自动填充的构建机控制插件,不需要存入Record - if (EnvControlTaskType.parse(task.getTaskType()) != null) { - continue; - } - Element element = JSONUtil.toBean(JSONUtil.toJsonStr(task.getTaskParams()), Element.class); - BuildRecordTask recordTask = new BuildRecordTask(); - recordTask.setProjectId(task.getProjectId()); - recordTask.setPipelineId(task.getPipelineId()); - recordTask.setBuildId(task.getBuildId()); - recordTask.setStageId(task.getStageId()); - recordTask.setContainerId(task.getContainerId()); - recordTask.setTaskSeq(task.getTaskSeq()); - recordTask.setTaskId(task.getTaskId()); - recordTask.setClassType(task.getTaskType()); - recordTask.setAtomCode(task.getAtomCode() != null ? task.getAtomCode() : task.getTaskAtom()); - recordTask.setExecuteCount(task.getExecuteCount() != null ? task.getExecuteCount() : 1); - recordTask.setResourceVersion(resourceVersion); - recordTask.setTaskVar(element.initTaskVar()); - recordTask.setTimestamps(new HashMap<>()); - if (task.getAdditionalOptions() != null && task.getAdditionalOptions().getElementPostInfo() != null - && !task.getAdditionalOptions().getElementPostInfo().getParentElementId().equals(task.getTaskId())) { - recordTask.setElementPostInfo(task.getAdditionalOptions().getElementPostInfo()); - } - recordTask.setStartTime(task.getStartTime()); - recordTask.setEndTime(task.getEndTime()); - buildRecordTasks.add(recordTask); - } - } - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/MergeBuildRecordParam.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/MergeBuildRecordParam.java deleted file mode 100644 index ebfcce36..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/pipeline/record/MergeBuildRecordParam.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.pipeline.record; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname MergeBuildRecordParam - * @Description TODO - * @Date 2025/3/31 17:21 - */ -@Data -@AllArgsConstructor -@Schema(title = "合并流水线变量模型参数") -public class MergeBuildRecordParam { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "构建ID", required = true) - private String buildId; - @Schema(title = "执行次数", required = true) - private int executeCount; - @Schema(title = "执行变量模型", required = true) - private Map recordModelMap; - @Schema(title = "流水线基础模型", required = true) - private Map pipelineBaseModelMap; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/report/ReportEmail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/report/ReportEmail.java deleted file mode 100644 index 2c9c9b9b..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/report/ReportEmail.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.report; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.Set; - -/** - * @author by mianbin - * @Classname ReportEmail - * @Description TODO - * @Date 2025/3/31 17:06 - */ -@Schema(title = "自定义产出物报告-发送弹窗") -@Data -@AllArgsConstructor -public class ReportEmail { - @Schema(title = "接收人列表", required = false) - private Set receivers; - @Schema(title = "标题", required = false) - private String title; - @Schema(title = "message内容", required = false) - private String message; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/report/enums/ReportTypeEnum.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/report/enums/ReportTypeEnum.java deleted file mode 100644 index f5797591..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/report/enums/ReportTypeEnum.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.report.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * @author by mianbin - * @Classname ReportTypeEnum - * @Description 该枚举类定义了报告的类型 - * @Date 2025/3/31 17:07 - */ -@Getter -@AllArgsConstructor -public enum ReportTypeEnum { - /** - * 内部报告类型 - */ - INTERNAL("INTERNAL"), - /** - * 第三方报告类型 - */ - THIRDPARTY("THIRDPARTY"); - - private final String value; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/JobCommonSetting.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/JobCommonSetting.java deleted file mode 100644 index d8ec305b..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/JobCommonSetting.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:JobCommonSetting - * @Date:2025/03/24 20:20 - * @Filename:JobCommonSetting - * @description:Todo - */ -@Data -@Schema(title = "流水线job公共配置信息") -public class JobCommonSetting { - @Schema(title = "每个job最大task个数", required = true) - private int maxTaskNum; - @Schema(title = "task公共配置", required = true) - private TaskCommonSetting taskCommonSetting; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineBranchVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineBranchVersion.java deleted file mode 100644 index d4b95060..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineBranchVersion.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:PipelineBranchVersion - * @Date:2025/03/24 20:21 - * @Filename:PipelineBranchVersion - * @description:Todo - */ -@Data -@Schema(title = "流水线分支版本") -public class PipelineBranchVersion { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "分支名", required = false) - private String branch; - @Schema(title = "版本号", required = false) - private int version; - @Schema(title = "创建者", required = false) - private String creator; - @Schema(title = "更新者", required = false) - private String updater; - @Schema(title = "创建时间", required = false) - private LocalDateTime createTime; - @Schema(title = "更新时间", required = false) - private LocalDateTime updateTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineCommonSetting.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineCommonSetting.java deleted file mode 100644 index eac9cea8..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineCommonSetting.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:PipelineCommonSetting - * @Date:2025/03/24 20:21 - * @Filename:PipelineCommonSetting - * @description:Todo - */ -@Data -@Schema(title = "流水线公共配置信息") -public class PipelineCommonSetting { - @Schema(title = "每条流水线最大stage个数", required = true) - private int maxStageNum; - @Schema(title = "流水线stage公共配置信息", required = true) - private StageCommonSetting stageCommonSetting; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineModelVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineModelVersion.java deleted file mode 100644 index d29c2aa7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineModelVersion.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:PipelineModelVersion - * @Date:2025/03/24 20:21 - * @Filename:PipelineModelVersion - * @description:Todo - */ -@Data -@Schema(title = "流水线模型版本") -public class PipelineModelVersion { - @Schema(title = "项目ID", required = true) - private String projectId; - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线创建人", required = true) - private String creator; - @Schema(title = "流水线模型", required = true) - private String model; - @Schema(title = "流水线模型版本", required = false) - private Integer version; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineResourceAndSetting.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineResourceAndSetting.java deleted file mode 100644 index 1055a855..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineResourceAndSetting.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.process.api.process.pojo.PipelineDetail; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineResourceVersion; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:PipelineResourceAndSetting - * @Date:2025/03/24 20:21 - * @Filename:PipelineResourceAndSetting - * @description:Todo - */ -@Data -@Schema(title = "流水线资源与设置") -public class PipelineResourceAndSetting { - @Schema(title = "流水线模型", required = true) - private PipelineDetail pipelineInfo; - @Schema(title = "流水线资源版本", required = true) - private PipelineResourceVersion pipelineResource; - @Schema(title = "流水线设置", required = false) - @Valid - private PipelineSetting setting; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineRunType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineRunType.java deleted file mode 100644 index 6272120c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineRunType.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:PipelineRunType - * @Date:2025/03/24 20:22 - * @Filename:PipelineRunType - * @description:Todo - */ -public enum PipelineRunType { - @Schema(title = "可同时运行多个构建任务(默认)") - MULTIPLE, - @Schema(title = "同一时间最多只能运行一个构建任务") - SINGLE, - @Schema(title = "最多只能运行一个构建任务,且失败时锁定") - SINGLE_LOCK, - @Schema(title = "锁定流水线,任何触发方式都无法运行") - LOCK; - public static int toValue(PipelineRunType type) { - return switch (type) { - case MULTIPLE -> 1; - case SINGLE -> 2; - case SINGLE_LOCK -> 3; - case LOCK -> 4; - default -> 1; - }; - } - - public static PipelineRunType valueOf(int value) { - return switch (value) { - case 1 -> MULTIPLE; - case 2 -> SINGLE; - case 3 -> SINGLE_LOCK; - case 4 -> LOCK; - default -> MULTIPLE; - }; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineSettingVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineSettingVersion.java deleted file mode 100644 index 49d3bb1f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineSettingVersion.java +++ /dev/null @@ -1,57 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineRunLockType; -import cd.casic.ci.common.pipeline.pojo.setting.Subscription; -import cd.casic.ci.project.dal.pojo.PipelineAsCodeSettings; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:PipelineSettingVersion - * @Date:2025/03/24 20:22 - * @Filename:PipelineSettingVersion - * @description:Todo - */ -@Data -@Schema(title = "流水线版本记录") -public class PipelineSettingVersion { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "流水线名称", required = false) - private String pipelineName; - @Schema(title = "版本", required = false) - private int version; - @Schema(title = "描述", required = false) - private String desc; - @Schema(title = "标签列表", required = false) - private List labels; - @Schema(title = "构建号生成规则", required = false) - //@Field(patternStyle = BkStyleEnum.BUILD_NUM_RULE_STYLE, required = false) - private String buildNumRule; - @Schema(title = "订阅成功通知组", required = false) - private List successSubscriptionList; - @Schema(title = "订阅失败通知组", required = false) - private List failSubscriptionList; - @Schema(title = "Lock 类型", required = false) - private PipelineRunLockType runLockType; - @Schema(title = "最大排队时长", required = false) - private Integer waitQueueTimeMinute; - @Schema(title = "最大排队数量", required = false) - private Integer maxQueueSize; - @Schema(title = "并发时,设定的group", required = false) - //@Field(patternStyle = BkStyleEnum.PIPELINE_CONCURRENCY_GROUP_STYLE, required = false) - private String concurrencyGroup; - @Schema(title = "并发时,是否相同group取消正在执行的流水线", required = false) - private Boolean concurrencyCancelInProgress; - @Schema(title = "并发构建数量限制", required = false) - private Integer maxConRunningQueueSize; - @Schema(title = "YAML流水线特殊配置", required = false) - private PipelineAsCodeSettings pipelineAsCodeSettings; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineVersionSimple.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineVersionSimple.java deleted file mode 100644 index 393f7898..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/PipelineVersionSimple.java +++ /dev/null @@ -1,83 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; -import java.time.ZoneOffset; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:PipelineVersionSimple - * @Date:2025/03/24 20:23 - * @Filename:PipelineVersionSimple - * @description:Todo - */ -@Data -@Schema(title = "流水线版本摘要") -public class PipelineVersionSimple { - @Schema(title = "流水线ID", required = true) - private String pipelineId; - @Schema(title = "流水线创建人", required = true) - private String creator; - @Schema(title = "创建时间戳", required = true) - private long createTime; - @Schema(title = "更新操作人", required = true) - private String updater; - @Schema(title = "更新时间戳", required = true) - private Long updateTime; - @Schema(title = "流水线版本号", required = true) - private int version; - @Schema(title = "流水线版本名称", required = true) - private String versionName; - @Schema(title = "YAML编排版本", required = false) - private String yamlVersion; - @Schema(title = "是否还有构建记录引用该版本标识", required = false) - private Boolean referFlag; - @Schema(title = "关联构建记录总数", required = false) - private Integer referCount; - @Schema(title = "发布版本号", required = false) - private Integer versionNum; - @Schema(title = "编排版本号", required = false) - private Integer pipelineVersion; - @Schema(title = "触发器版本号", required = false) - private Integer triggerVersion; - @Schema(title = "配置版本号", required = false) - private Integer settingVersion; - @Schema(title = "草稿版本标识", required = false) - private VersionStatus status; - @Schema(title = "版本变更说明", required = false) - private String description; - @Schema(title = "调试构建ID", required = false) - private String debugBuildId; - @Schema(title = "该版本的来源版本(空时一定为主路径)", required = false) - private Integer baseVersion; - @Schema(title = "基准版本的版本名称") - private String baseVersionName; - @Schema(title = "当前最新正式版本标识", required = false) - private Boolean latestReleasedFlag; - - public PipelineVersionSimple(String pipelineId, String creator, LocalDateTime createTime, String updater, LocalDateTime localDateTime, int version, String s, Boolean referFlag, Integer referCount, Integer versionNum, Integer pipelineVersion, Integer triggerVersion, Integer settingVersion, VersionStatus versionStatus, String debugBuildId, Integer baseVersion, String description, String yamlVersion) { - this.pipelineId = pipelineId; - this.creator = creator; - this.createTime = createTime.toEpochSecond(ZoneOffset.of("+8")); - this.updater = updater; - this.updateTime = localDateTime.toEpochSecond(ZoneOffset.of("+8")); - this.version = version; - this.versionName = s; - this.referFlag = referFlag; - this.referCount = referCount; - this.versionNum = versionNum; - this.pipelineVersion = pipelineVersion; - this.triggerVersion = triggerVersion; - this.settingVersion = settingVersion; - this.status = versionStatus; - this.debugBuildId = debugBuildId; - this.baseVersion = baseVersion; - this.description = description; - this.yamlVersion = yamlVersion; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/StageCommonSetting.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/StageCommonSetting.java deleted file mode 100644 index 0fed2643..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/StageCommonSetting.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:StageCommonSetting - * @Date:2025/03/24 20:24 - * @Filename:StageCommonSetting - * @description:Todo - */ -@Data -@Schema(title = "流水线stage公共配置信息") -public class StageCommonSetting { - @Schema(title = "每个stage最大job个数", required = true) - private int maxJobNum; - @Schema(title = "job公共配置", required = true) - private JobCommonSetting jobCommonSetting; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/SubscriptionResponse.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/SubscriptionResponse.java deleted file mode 100644 index 159cb67a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/SubscriptionResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSubscriptionType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:SubscriptionResponse - * @Date:2025/03/24 20:25 - * @Filename:SubscriptionResponse - * @description:Todo - */ -@Data -@Schema(title = "设置-订阅消息") -public class SubscriptionResponse { - @Schema(title = "通知人员", required = false) - private String users = ""; - @Schema(title = "通知方式(email, rtx)", required = true) - private List types = new CopyOnWriteArrayList(); - @Schema(title = "分组id", required = false) - private List groups = List.of(); - @Schema(title = "通知内容带上流水线详情连接", required = false) - private Boolean detailFlag = false; - @Schema(title = "自定义通知内容", required = false) - private String content = ""; - -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/TaskCommonSetting.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/TaskCommonSetting.java deleted file mode 100644 index 679f6363..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/TaskCommonSetting.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:TaskCommonSetting - * @Date:2025/03/24 20:37 - * @Filename:TaskCommonSetting - * @description:Todo - */ -@Data -@Schema(title = "流水线task公共配置信息") -public class TaskCommonSetting { - @Schema(title = "最大输入参数个数", required = true) - private int maxInputNum; - @Schema(title = "最大输出参数个数", required = true) - private int maxOutputNum; - @Schema(title = "输入参数组件配置", required = true) - private List inputComponentCommonSettings; - @Schema(title = "输出参数组件配置", required = true) - private List outputComponentCommonSettings; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/TaskComponentCommonSetting.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/TaskComponentCommonSetting.java deleted file mode 100644 index 40e860a0..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/TaskComponentCommonSetting.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:TaskComponentCommonSetting - * @Date:2025/03/24 20:37 - * @Filename:TaskComponentCommonSetting - * @description:Todo - */ -@Data -@Schema(title = "流水线task组件公共配置信息") -public class TaskComponentCommonSetting { - @Schema(title = "组件类型", required = true) - private String componentType; - @Schema(title = "组件大小最大值(单位:字符)", required = true) - private int maxSize; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/UpdatePipelineModelRequest.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/UpdatePipelineModelRequest.java deleted file mode 100644 index 32b58cad..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/setting/UpdatePipelineModelRequest.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.setting; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.setting - * @Project:ops-pro - * @name:UpdatePipelineModelRequest - * @Date:2025/03/24 20:38 - * @Filename:UpdatePipelineModelRequest - * @description:Todo - */ -@Data -@Schema(title = "更新流水线模型请求报文") -public class UpdatePipelineModelRequest { - @Schema(title = "流水线模型版本集合", required = true) - private List pipelineModelVersionList; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/task/PipelineBuildTaskInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/task/PipelineBuildTaskInfo.java deleted file mode 100644 index 9329b1e7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/task/PipelineBuildTaskInfo.java +++ /dev/null @@ -1,77 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.task; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import javax.lang.model.type.ErrorType; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.task - * @Project:ops-pro - * @name:PipelineBuildTaskInfo - * @Date:2025/03/24 20:40 - * @Filename:PipelineBuildTaskInfo - * @description:Todo - */ -@Data -@Schema(title = "流水线构建任务信息") -public class PipelineBuildTaskInfo { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "模板id", required = false) - private String templateId; - @Schema(title = "构建id", required = false) - private String buildId; - @Schema(title = "阶段id", required = false) - private String stageId; - @Schema(title = "容器id", required = false) - private String containerId; - @Schema(title = "容器hash id", required = false) - private String containerHashId; - @Schema(title = "容器类型", required = false) - private String containerType; - @Schema(title = "任务序列", required = false) - private int taskSeq; - @Schema(title = "任务id", required = false) - private String taskId; - @Schema(title = "任务名称", required = false) - private String taskName; - @Schema(title = "任务类型", required = false) - private String taskType; - @Schema(title = "任务atom代码", required = false) - private String taskAtom; - @Schema(title = "状态", required = false) - private BuildStatus status; - @Schema(title = "任务参数集合", required = false) - private Map taskParams; - @Schema(title = "其他选项", required = false) - private ElementAdditionalOptions additionalOptions; - @Schema(title = "执行次数", required = false) - private Integer executeCount = 1; - @Schema(title = "启动者", required = false) - private String starter; - @Schema(title = "审批人", required = false) - private String approver; - @Schema(title = "子构建id", required = false) - private String subBuildId; - @Schema(title = "启动时间", required = false) - private Long startTime; - @Schema(title = "结束时间", required = false) - private Long endTime; - @Schema(title = "错误类型", required = false) - private ErrorType errorType; - @Schema(title = "错误代码", required = false) - private Integer errorCode; - @Schema(title = "错误信息", required = false) - private String errorMsg; - - public String getTaskParam(String paramName) { - return taskParams.getOrDefault(paramName, "").toString().trim(); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/task/TaskBuildEndParam.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/task/TaskBuildEndParam.java deleted file mode 100644 index dfa1c8c5..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/task/TaskBuildEndParam.java +++ /dev/null @@ -1,43 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.task; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import javax.lang.model.type.ErrorType; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.pojo.task - * @Project:ops-pro - * @name:TaskBuildEndParam - * @Date:2025/03/24 20:41 - * @Filename:TaskBuildEndParam - * @description:Todo - */ -@Data -@Schema(title = "任务构建结束参数") -public class TaskBuildEndParam { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "构建id", required = false) - private String buildId; - @Schema(title = "容器作业id", required = false) - private String containerId; - @Schema(title = "任务id", required = false) - private String taskId; - @Schema(title = "执行次数", required = false) - private int executeCount; - @Schema(title = "状态", required = false) - private BuildStatus buildStatus; - @Schema(title = "插件版本", required = false) - private String atomVersion; - @Schema(title = "错误类型", required = false) - private ErrorType errorType; - @Schema(title = "错误代码", required = false) - private Integer errorCode; - @Schema(title = "错误信息", required = false) - private String errorMsg; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/BatchTemplateInstanceCreate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/BatchTemplateInstanceCreate.java deleted file mode 100644 index 4493f121..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/BatchTemplateInstanceCreate.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:BatchTemplateInstanceCreate - * @Date:2025/03/24 18:54 - * @Filename:BatchTemplateInstanceCreate - * @description:Todo - */ -@Data -public class BatchTemplateInstanceCreate { - private List param; - private List instances; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/CopyTemplateReq.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/CopyTemplateReq.java deleted file mode 100644 index 54f05585..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/CopyTemplateReq.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:CopyTemplateReq - * @Date:2025/03/24 18:55 - * @Filename:CopyTemplateReq - * @description:Todo - */ -@Data -public class CopyTemplateReq { - @Schema(title = "模板名字", required = false) - private String templateName; - @Schema(title = "是否复制设置", required = false) - private Boolean isCopySetting; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/HighlightType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/HighlightType.java deleted file mode 100644 index a0a05b77..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/HighlightType.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:HighlightType - * @Date:2025/03/24 18:55 - * @Filename:HighlightType - * @description:Todo - */ -@Getter -public enum HighlightType { - @Schema(title = "通知", required = true) - NOTIFY, - @Schema(title = "标签", required = true) - LABEL, - @Schema(title = "并发", required = true) - CONCURRENCY, - @Schema(title = "流水线模型", required = true) - PIPELINE_MODEL; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/MarketTemplateRequest.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/MarketTemplateRequest.java deleted file mode 100644 index 7cd99587..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/MarketTemplateRequest.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:MarketTemplateRequest - * @Date:2025/03/24 18:55 - * @Filename:MarketTemplateRequest - * @description:Todo - */ -@Data -public class MarketTemplateRequest { - @Schema(title = "项目列表", required = true) - private ArrayList projectCodeList; - @Schema(title = "模板代码", required = true) - private String templateCode; - @Schema(title = "模板名称", required = true) - private String templateName; - @Schema(title = "模板logo", required = false) - private String logoUrl; - @Schema(title = "范畴代码列表", required = false) - private List categoryCodeList; - @Schema(title = "是否为公共模版", required = true) - private Boolean publicFlag; - @Schema(title = "发布者", required = false) - private String publisher; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/OptionalTemplateList.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/OptionalTemplateList.java deleted file mode 100644 index e3400375..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/OptionalTemplateList.java +++ /dev/null @@ -1,94 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:OptionalTemplateList - * @Date:2025/03/24 18:55 - * @Filename:OptionalTemplateList - * @description:Todo - */ -@Data -public class OptionalTemplateList { - @Schema(title = "数量", required = false) - private Integer count; - - @Schema(title = "页数", required = false) - private Integer page; - - @Schema(title = "每页数量", required = false) - private Integer pageSize; - - @Schema(title = "模板列表", required = false) - private Map templates; -} - -@Data -class OptionalTemplate { - @Schema(title = "模版名称", required = true) - private String name; - - @Schema(title = "模版ID", required = true) - private String templateId; - - @Schema(title = "项目ID", required = true) - private String projectId; - - @Schema(title = "版本ID", required = true) - private Long version; - - @Schema(title = "最新版本号", required = true) - private String versionName; - - @Schema(title = "模板类型", required = true) - private String templateType; - - @Schema(title = "模板类型描述", required = true) - private String templateTypeDesc; - - @Schema(title = "应用范畴", required = true) - private List category; - - @Schema(title = "模版logo", required = true) - private String logoUrl; - - @Schema(title = "阶段集合", required = true) - private List stages; - - @Schema(title = "克隆模板设置项是否存在", required = false) - private CloneTemplateSettingExist cloneTemplateSettingExist; - - @Schema(title = "模版描述", required = false) - private String desc; -} - -@Data -@AllArgsConstructor -class CloneTemplateSettingExist { - private Boolean notifySettingExist; - private Boolean concurrencySettingExist; - private Boolean labelSettingExist; - private Boolean inheritedDialect; - private String pipelineDialect; - - public static CloneTemplateSettingExist fromSetting(PipelineSetting setting, Set pipelinesWithLabels) { - return new CloneTemplateSettingExist( - !setting.notifySettingIsNull(), - !setting.concurrencySettingIsNull(), - pipelinesWithLabels != null && pipelinesWithLabels.contains(setting.getPipelineId()), - setting.getPipelineAsCodeSettings().getInheritedDialect(), - setting.getPipelineAsCodeSettings().getPipelineDialect() - ); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/SaveAsTemplateReq.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/SaveAsTemplateReq.java deleted file mode 100644 index 0ccc63ae..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/SaveAsTemplateReq.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:SaveAsTemplateReq - * @Date:2025/03/24 18:58 - * @Filename:SaveAsTemplateReq - * @description:Todo - */ -@Data -public class SaveAsTemplateReq { - private String pipelineId; - private String templateName; - private Boolean isCopySetting; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateCompareModel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateCompareModel.java deleted file mode 100644 index 4327022b..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateCompareModel.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateCompareModel - * @Date:2025/03/24 18:59 - * @Filename:TemplateCompareModel - * @description:Todo - */ -@Data -public class TemplateCompareModel { - @Schema(title = "构建号", required = false) - private BuildNo buildNo; - @Schema(title = "流水线变量列表", required = false) - private List params; - @Schema(title = "流水线模型", required = false) - private Model model; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateCompareModelResult.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateCompareModelResult.java deleted file mode 100644 index 63c631f3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateCompareModelResult.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateCompareModelResult - * @Date:2025/03/24 18:59 - * @Filename:TemplateCompareModelResult - * @description:Todo - */ -@Data -public class TemplateCompareModelResult { - @Schema(title = "版本列表", required = false) - private List versions; - @Schema(title = "来源模板模型", required = false) - private TemplateCompareModel origin; - @Schema(title = "目标模板模型", required = false) - private TemplateCompareModel target; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateDetailInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateDetailInfo.java deleted file mode 100644 index 65df0d7c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateDetailInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.Model; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateDetailInfo - * @Date:2025/03/24 18:59 - * @Filename:TemplateDetailInfo - * @description:Todo - */ - -@Data -public class TemplateDetailInfo { - @Schema(title = "模板代码", required = true) - private String templateCode; - @Schema(title = "模板名称", required = false) - private String templateName; - @Schema(title = "模板模型", required = false) - private Model templateModel; - @Schema(title = "模板版本号", required = true) - private Long templateVersion; - @Schema(title = "模板版本名称", required = false) - private String templateVersionName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateId.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateId.java deleted file mode 100644 index d15df702..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateId.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateId - * @Date:2025/03/24 18:59 - * @Filename:TemplateId - * @description:Todo - */ -@Data -public class TemplateId { - @Schema(title = "模板id", required = false) - private String id; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceBaseStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceBaseStatus.java deleted file mode 100644 index 4b1e9afa..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceBaseStatus.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateInstanceBaseStatus - * @Date:2025/03/24 18:59 - * @Filename:TemplateInstanceBaseStatus - * @description:Todo - */ -@Getter -public enum TemplateInstanceBaseStatus { - @Schema(title = "初始化", required = true) - INIT, - @Schema(title = "实例化中", required = true) - INSTANCING; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceCreate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceCreate.java deleted file mode 100644 index a15e0473..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceCreate.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateInstanceCreate - * @Date:2025/03/24 19:00 - * @Filename:TemplateInstanceCreate - * @description:Todo - */ -@Data -public class TemplateInstanceCreate { - @Schema(title = "流水线名称", required = false) - private String pipelineName; - @Schema(title = "构建号(推荐版本号)", required = false) - private BuildNo buildNo; - @Schema(title = "流水线变量列表", required = false) - private List param; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceItemStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceItemStatus.java deleted file mode 100644 index 1a3c9ab0..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceItemStatus.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateInstanceItemStatus - * @Date:2025/03/24 19:00 - * @Filename:TemplateInstanceItemStatus - * @description:Todo - */ -@Getter -public enum TemplateInstanceItemStatus { - @Schema(title = "初始化", required = true) - INIT; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstancePage.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstancePage.java deleted file mode 100644 index d4893f3c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstancePage.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateInstancePage - * @Date:2025/03/24 19:07 - * @Filename:TemplateInstancePage - * @description:Todo - */ -@Data -public class TemplateInstancePage { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "模板id", required = false) - private String templateId; - @Schema(title = "模板生成的流水线实例列表", required = false) - private List instances; - @Schema(title = "最新版本", required = false) - private TemplateVersion latestVersion; - @Schema(title = "数量", required = false) - private Integer count; - @Schema(title = "页数", required = false) - private Integer page; - @Schema(title = "每页数量", required = false) - private Integer pageSize; - @Schema(title = "是否有创建模板实例权限", required = false) - private Boolean hasCreateTemplateInstancePerm; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceParams.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceParams.java deleted file mode 100644 index 6f642bbf..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceParams.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateInstanceParams - * @Date:2025/03/24 19:08 - * @Filename:TemplateInstanceParams - * @description:Todo - */ - -@Data -public class TemplateInstanceParams { - @Schema(title = "流水线模型", required = false) - private String pipelineId; - @Schema(title = "流水线名称", required = false) - private String pipelineName; - @Schema(title = "构建号,不建议使用", required = false) - private BuildNo buildNo; - @Schema(title = "流水线变量列表", required = false) - private List param; - @Schema(title = "是否更新了推荐版本号基准值", required = false) - private Boolean updateBuildNo; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceUpdate.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceUpdate.java deleted file mode 100644 index 68b0850f..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstanceUpdate.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import io.swagger.v3.oas.annotations.media.Schema; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateInstanceUpdate - * @Date:2025/03/24 19:08 - * @Filename:TemplateInstanceUpdate - * @description:Todo - */ -public class TemplateInstanceUpdate { - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "流水线那名称", required = false) - private String pipelineName; - @Schema(title = "构建版本号", required = false) - private BuildNo buildNo; - @Schema(title = "流水线变量列表, 建议先通过v4_app_template_get获取,再按需修改。", required = false) - private List param; - @Schema(title = "重置实例推荐版本为基准值", required = false) - private Boolean resetBuildNo; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstances.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstances.java deleted file mode 100644 index f976fa03..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateInstances.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateInstances - * @Date:2025/03/24 19:08 - * @Filename:TemplateInstances - * @description:Todo - */ -@Data -public class TemplateInstances { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "模型id", required = false) - private String templateId; - @Schema(title = "实例列表", required = false) - private List instances; - @Schema(title = "最新版本", required = false) - private TemplateVersion latestVersion; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateListModel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateListModel.java deleted file mode 100644 index 0e533f62..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateListModel.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import org.mapstruct.ap.shaded.freemarker.template.TemplateModel; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateListModel - * @Date:2025/03/24 19:09 - * @Filename:TemplateListModel - * @description:Todo - */ -@Data -public class TemplateListModel { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "是否有操作权限", required = false) - private Boolean hasPermission; - @Schema(title = "模型", required = false) - private List models; - @Schema(title = "数量", required = false) - private Integer count; - @Schema(title = "是否有创建模板权限", required = false) - private Boolean hasCreatePermission; - @Schema(title = "是否开启模板权限", required = false) - private Boolean enableTemplatePermissionManage; -} - - diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateModel.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateModel.java deleted file mode 100644 index 373ed8c3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateModel.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateModel - * @Date:2025/03/24 19:19 - * @Filename:TemplateModel - * @description:Todo - */ -@Data -@Schema(title = "模板模型") -public class TemplateModel { - @Schema(title = "模版名称", required = true) - private String name; - @Schema(title = "模版ID", required = true) - private String templateId; - @Schema(title = "版本ID", required = true) - private Long version; - @Schema(title = "最新版本号", required = true) - private String versionName; - @Schema(title = "模板类型", required = true) - private String templateType; - @Schema(title = "模板类型描述", required = true) - private String templateTypeDesc; - @Schema(title = "模版logo", required = true) - private String logoUrl; - @Schema(title = "是否关联到市场", required = true) - private Boolean storeFlag; - @Schema(title = "关联的代码库", required = true) - private List associateCodes; - @Schema(title = "关联的流水线", required = true) - private List associatePipelines; - @Schema(title = "是否有可更新实例", required = true) - private Boolean hasUpdateInstance; - @Schema(title = "是否有模版操作权限", required = true) - private Boolean hasPermission; - @Schema(title = "是否有模版查看权限", required = true) - private Boolean canView; - @Schema(title = "是否有模版编辑权限", required = true) - private Boolean canEdit; - @Schema(title = "是否有模版删除权限", required = true) - private Boolean canDelete; - @Schema(title = "创建者", required = false) - private String creator; - @Schema(title = "创建时间", required = false) - private String createTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateModelDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateModelDetail.java deleted file mode 100644 index e6c845af..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateModelDetail.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateModelDetail - * @Date:2025/03/24 19:27 - * @Filename:TemplateModelDetail - * @description:Todo - */ -@Data -public class TemplateModelDetail { - @Schema(title = "版本列表", required = false) - private List versions; - @Schema(title = "当前版本", required = false) - private TemplateVersion currentVersion; - @Schema(title = "最新版本", required = false) - private TemplateVersion latestVersion; - @Schema(title = "模板名称", required = false) - private String templateName; - @Schema(title = "解释说明", required = false) - private String description; - @Schema(title = "创建者", required = false) - private String creator; - @Schema(title = "模板模型", required = false) - private Model template; - @Schema(title = "模板类型", required = false) - private String templateType; - @Schema(title = "logo的url地址", required = false) - private String logoUrl; - @Schema(title = "是否有操作权限", required = false) - private boolean hasPermission; - @Schema(title = "参数列表", required = false) - private List params; - @Schema(title = "模板参数构建", required = false) - private List templateParams; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateOperationMessage.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateOperationMessage.java deleted file mode 100644 index c87b1204..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateOperationMessage.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateOperationMessage - * @Date:2025/03/24 19:29 - * @Filename:TemplateOperationMessage - * @description:Todo - */ - -@Data -public class TemplateOperationMessage { - @Schema(title = "成功的流水线", required = false) - private List successPipelines; - - @Schema(title = "失败的流水线", required = false) - private List failurePipelines; - - @Schema(title = "失败信息", required = false) - private Map failureMessages; - - @Schema(title = "成功的流水线id", required = false) - private List successPipelinesId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateOperationRet.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateOperationRet.java deleted file mode 100644 index 09d2fe92..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateOperationRet.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateOperationRet - * @Date:2025/03/24 19:30 - * @Filename:TemplateOperationRet - * @description:Todo - */ -@Data -@Schema(title = "返回模型") -public class TemplateOperationRet { - @Schema(title = "状态码", required = false) - private int status; - @Schema(title = "data 信息", required = false) - private TemplateOperationMessage data; - @Schema(title = "message 信息", required = false) - private String message; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipeline.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipeline.java deleted file mode 100644 index 4ba12b0e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipeline.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplatePipeline - * @Date:2025/03/24 19:30 - * @Filename:TemplatePipeline - * @description:Todo - */ -@Data -@Schema(title = "模板实例化的流水线") -public class TemplatePipeline { - @Schema(title = "模板id", required = false) - private String templateId; - @Schema(title = "版本名称", required = false) - private String versionName; - @Schema(title = "版本", required = false) - private long version; - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "流水线名称", required = false) - private String pipelineName; - @Schema(title = "更新时间", required = false) - private long updateTime; - @Schema(title = "是否有编辑权限", required = false) - private boolean hasPermission; - @Schema(title = "流水线模板状态", required = false) - private TemplatePipelineStatus status; - @Schema(title = "模板实例化错误信息", required = false) - private String instanceErrorInfo; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipelineInfo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipelineInfo.java deleted file mode 100644 index e7328659..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipelineInfo.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplatePipelineInfo - * @Date:2025/03/24 19:30 - * @Filename:TemplatePipelineInfo - * @description:Todo - */ -@Data -@Schema(title = "流水线模板信息") -public class TemplatePipelineInfo { - @Schema(title = "模板id", required = false) - private String templateId; - @Schema(title = "版本名称", required = false) - private String versionName; - @Schema(title = "版本", required = false) - private Long version; - @Schema(title = "流水线id", required = false) - private String pipelineId; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipelineStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipelineStatus.java deleted file mode 100644 index cd0574ae..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePipelineStatus.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplatePipelineStatus - * @Date:2025/03/24 19:31 - * @Filename:TemplatePipelineStatus - * @description:Todo - */ -public enum TemplatePipelineStatus { - PENDING_UPDATE, // 待更新 - UPDATING, // 更新中 - UPDATED, // 已更新 - FAILED // 更新失败 -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePreviewDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePreviewDetail.java deleted file mode 100644 index c68f1b14..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplatePreviewDetail.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.common.pipeline.pojo.transfer.TransferMark; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplatePreviewDetail - * @Date:2025/03/24 19:31 - * @Filename:TemplatePreviewDetail - */ -@Data -public class TemplatePreviewDetail { - @Schema(title = "模板模型") - private Model template; - @Schema(title = "模板Yaml") - private String templateYaml; - @Schema(title = "是否有操作权限", required = false) - private boolean hasPermission; - @Schema(title = "预览流水线设置") - private PipelineSetting setting; - @Schema(title = "高亮位置,可能多个") - private List highlightMarkList; - @Schema(title = "是否支持YAML解析", required = true) - private boolean yamlSupported = true; - @Schema(title = "YAML解析异常信息") - private String yamlInvalidMsg; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateType.java deleted file mode 100644 index ef4143e9..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateType.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import lombok.AllArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateType - * @Date:2025/03/24 19:31 - * @Filename:TemplateType - * @description:Todo - */ -@AllArgsConstructor -public enum TemplateType { - CUSTOMIZE("customize"), // 自定义模板 - CONSTRAINT("constraint"), // 来自商店 - PUBLIC("public"); // 公共模版 - - private final String value; - - public static String getTemplateTypeDesc(String type) { - return switch (type) { - case "CONSTRAINT" -> CONSTRAINT.value; - case "PUBLIC" -> PUBLIC.value; - default -> CUSTOMIZE.value; - }; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateVersion.java deleted file mode 100644 index d129fad4..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateVersion.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateVersion - * @Date:2025/03/24 19:32 - * @Filename:TemplateVersion - * @description:Todo - */ -@Data -@Schema(title = "模板版本信息") -public class TemplateVersion { - @Schema(title = "版本号", required = false) - private long version; - @Schema(title = "版本名称", required = false) - private String versionName; - @Schema(title = "更新时间", required = false) - private long updateTime; - @Schema(title = "构建者", required = false) - private String creator; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateWithPermission.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateWithPermission.java deleted file mode 100644 index eb1d1888..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/template/TemplateWithPermission.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.template; - -import io.swagger.v3.oas.annotations.media.Schema; -import kotlin.Result; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.template - * @Project:ops-pro - * @name:TemplateWithPermission - * @Date:2025/03/24 19:32 - * @Filename:TemplateWithPermission - * @description:Todo - */ -@Data -@Schema(title = "模板-权限实体") -public class TemplateWithPermission { - @Schema(title = "拥有列表权限的模板记录", required = true) - private Result templatesWithListPermRecords; - @Schema(title = "拥有查看权限的模板列表ID", required = true) - private List templatesWithViewPermIds; - @Schema(title = "拥有编辑权限的模板列表ID", required = true) - private List templatesWithEditPermIds; - @Schema(title = "拥有删除权限的模板列表ID", required = true) - private List templatesWithDeletePermIds; - @Schema(title = "数量", required = true) - private int count; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerDetail.java deleted file mode 100644 index 500f45bf..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerDetail.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerDetail - * @Date:2025/03/24 17:23 - * @Filename:PipelineTriggerDetail - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线触发详情") -public class PipelineTriggerDetail { - @Schema(title = "流水线触发详情ID") - private Long detailId; - @Schema(title = "蓝盾项目ID") - private String projectId; - @Schema(title = "事件ID") - private Long eventId; - @Schema(title = "触发状态") - private String status; - @Schema(title = "流水线Id") - private String pipelineId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "构建Id") - private String buildId; - @Schema(title = "构建编号") - private String buildNum; - @Schema(title = "原因") - private String reason; - @Schema(title = "原因详情") - private PipelineTriggerReasonDetail reasonDetail; - @Schema(title = "创建时间") - private Long createTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerDetailBuilder.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerDetailBuilder.java deleted file mode 100644 index 4c74d23d..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerDetailBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerDetailBuilder - * @Date:2025/03/24 17:29 - * @Filename:PipelineTriggerDetailBuilder - * @description:Todo - */ -@Data -public class PipelineTriggerDetailBuilder { - private Long detailId; - private String projectId; - private Long eventId; - private String status; - private String pipelineId; - private String pipelineName; - private String buildId; - private String buildNum; - private String reason; - private PipelineTriggerReasonDetail reasonDetail; - private Long createTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEvent.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEvent.java deleted file mode 100644 index 56d2f573..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEvent.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.time.LocalDateTime; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerEvent - * @Date:2025/03/24 17:24 - * @Filename:PipelineTriggerEvent - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线触发事件") -public class PipelineTriggerEvent { - @Schema(title = "请求ID") - private String requestId; - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "事件ID") - private Long eventId; - @Schema(title = "触发类型") - private String triggerType; - @Schema(title = "事件源") - private String eventSource; - @Schema(title = "事件类型") - private String eventType; - @Schema(title = "触发人") - private String triggerUser; - @Schema(title = "事件描述") - private String eventDesc; - @Schema(title = "重放事件ID") - private String replayRequestId; - @Schema(title = "事件请求参数, 记录手动/openapi/定时/远程触发启动参数") - private Map requestParams; - @Schema(title = "触发时间") - private LocalDateTime createTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEventBuilder.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEventBuilder.java deleted file mode 100644 index 0b89e7cd..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEventBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import lombok.Builder; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerEventBuilder - * @Date:2025/03/24 17:31 - * @Filename:PipelineTriggerEventBuilder - * @description:Todo - */ -@Data -@Builder -public class PipelineTriggerEventBuilder { - private String requestId; - private String projectId; - private Long eventId; - private String triggerType; - private String eventSource; - private String eventType; - private String triggerUser; - private String eventDesc; - private String replayRequestId; - private Map requestParams; - private LocalDateTime createTime; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEventVo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEventVo.java deleted file mode 100644 index 0c1b260b..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerEventVo.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerEventVo - * @Date:2025/03/24 17:25 - * @Filename:PipelineTriggerEventVo - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线触发事件视图对象") -public class PipelineTriggerEventVo { - @Schema(title = "事件明细ID") - private Long detailId; - @Schema(title = "蓝盾项目ID") - private String projectId; - @Schema(title = "事件ID") - private Long eventId; - @Schema(title = "触发类型") - private String triggerType; - @Schema(title = "事件触发源,代码库触发-代码库ID") - private String eventSource; - @Schema(title = "事件类型") - private String eventType; - @Schema(title = "触发人") - private String triggerUser; - @Schema(title = "事件描述") - private String eventDesc; - @Schema(title = "事件时间") - private Long eventTime; - @Schema(title = "触发状态") - private String status; - @Schema(title = "流水线Id") - private String pipelineId; - @Schema(title = "流水线名称") - private String pipelineName; - @Schema(title = "构建Id") - private String buildId; - @Schema(title = "构建编号") - private String buildNum; - @Schema(title = "原因") - private String reason; - @Schema(title = "失败原因详情") - private List reasonDetailList; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedErrorCode.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedErrorCode.java deleted file mode 100644 index bc7b062d..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedErrorCode.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerFailedErrorCode - * @Date:2025/03/24 17:25 - * @Filename:PipelineTriggerFailedErrorCode - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线触发事件原因详情-有错误码异常") -public class PipelineTriggerFailedErrorCode implements PipelineTriggerReasonDetail { - @Schema(title = "错误码") - private String errorCode; - @Schema(title = "错误参数") - private List params; - - @Override - public List getReasonDetailList() { - // 实现逻辑 - return null; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedFix.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedFix.java deleted file mode 100644 index 4b8660db..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedFix.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerFailedFix - * @Date:2025/03/24 17:26 - * @Filename:PipelineTriggerFailedFix - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线触发事件原因详情-兼容历史数据") -public class PipelineTriggerFailedFix implements PipelineTriggerReasonDetail { - @Schema(title = "原因详情列表") - private List reasonDetailList; - - @Override - public List getReasonDetailList() { - // 实现逻辑 - return null; - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedMatch.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedMatch.java deleted file mode 100644 index d8292913..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedMatch.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerFailedMatch - * @Date:2025/03/24 17:26 - * @Filename:PipelineTriggerFailedMatch - * @description:Todo - */ -@Data -@Schema(title = "流水线触发事件原因详情-触发匹配失败") -public class PipelineTriggerFailedMatch implements PipelineTriggerReasonDetail { - @Schema(title = "匹配失败的插件") - private List elements; - - public static final String classType = "match"; - - @Override - public List getReasonDetailList() { - return elements.stream() - .map(it -> { - return it.getElementName() + " | " + "chinese"; - }) - .toList(); - } -} - -@Data -@Schema(title = "流水线触发匹配失败") -class PipelineTriggerFailedMatchElement { - @Schema(title = "触发插件ID") - private String elementId; - @Schema(title = "触发插件Code") - private String elementAtomCode; - @Schema(title = "触发插件名称") - private String elementName; - @Schema(title = "触发原因,JSON字符串,便于国际化") - private String reasonMsg; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedMsg.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedMsg.java deleted file mode 100644 index dada9ff7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerFailedMsg.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerFailedMsg - * @Date:2025/03/24 17:26 - * @Filename:PipelineTriggerFailedMsg - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线触发事件原因详情-不需要转换的错误信息") -public class PipelineTriggerFailedMsg implements PipelineTriggerReasonDetail { - @Schema(title = "错误信息") - private String msg; - - @Override - public List getReasonDetailList() { - // 实现逻辑 - return null; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReason.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReason.java deleted file mode 100644 index 51cfd77e..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReason.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import lombok.AllArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerReason - * @Date:2025/03/24 17:34 - * @Filename:PipelineTriggerReason - * @description:Todo - */ -@AllArgsConstructor -public enum PipelineTriggerReason { - TRIGGER_SUCCESS("Trigger success"), - TRIGGER_FAILED("Trigger failed"), - TRIGGER_NOT_MATCH("Does not meet the trigger condition :%s"), - UNKNOWN_ERROR("Unknown error"); - - private String trigger; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReasonDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReasonDetail.java deleted file mode 100644 index 15a68312..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReasonDetail.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.v3.oas.annotations.media.Schema; - -import java.util.List; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerReasonDetail - * @Date:2025/03/24 17:27 - * @Filename:PipelineTriggerReasonDetail - * @description:Todo - */ - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = PipelineTriggerFailedMatch.class, name = "match"), - @JsonSubTypes.Type(value = PipelineTriggerFailedErrorCode.class, name = "errorCode"), - @JsonSubTypes.Type(value = PipelineTriggerFailedMsg.class, name = "msg"), - @JsonSubTypes.Type(value = PipelineTriggerFailedFix.class, name = "fix") -}) -@Schema(title = "流水线触发事件原因详情-基类") -public interface PipelineTriggerReasonDetail { - @JsonIgnore - List getReasonDetailList(); -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReasonStatistics.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReasonStatistics.java deleted file mode 100644 index 685d729c..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerReasonStatistics.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerReasonStatistics - * @Date:2025/03/24 17:27 - * @Filename:PipelineTriggerReasonStatistics - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "流水线触发原因统计") -public class PipelineTriggerReasonStatistics { - @Schema(title = "触发成功数") - private int triggerSuccess; - @Schema(title = "触发失败数") - private int triggerFailed; - @Schema(title = "触发不匹配数") - private int triggerNotMatch; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerStatus.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerStatus.java deleted file mode 100644 index ba6b4025..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerStatus.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerStatus - * @Date:2025/03/24 17:27 - * @Filename:PipelineTriggerStatus - * @description:Todo - */ -public enum PipelineTriggerStatus { - @Schema(title = "成功") - SUCCEED, - @Schema(title = "失败") - FAILED -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerType.java deleted file mode 100644 index 1d7a8337..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/PipelineTriggerType.java +++ /dev/null @@ -1,88 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import cd.casic.ci.common.pipeline.pojo.IdValue; -import cd.casic.ci.log.scm.enums.ScmType; -import io.swagger.v3.oas.annotations.media.Schema; - -import java.text.MessageFormat; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:PipelineTriggerType - * @Date:2025/03/24 17:27 - * @Filename:PipelineTriggerType - * @description:Todo - */ -public enum PipelineTriggerType { - @Schema(title = "SVN 代码库") - CODE_SVN, - @Schema(title = "GIT 代码库") - CODE_GIT, - @Schema(title = "Gitlab 代码库") - CODE_GITLAB, - @Schema(title = "Github 代码库") - GITHUB, - @Schema(title = "TGIT 代码库") - CODE_TGIT, - @Schema(title = "P4 代码库") - CODE_P4, - @Schema(title = "手动触发") - MANUAL, - @Schema(title = "定时触发") - TIME_TRIGGER, - @Schema(title = "服务触发") - OPENAPI, - @Schema(title = "流水线触发") - PIPELINE, - @Schema(title = "远程触发") - REMOTE; - - // 通用触发类型 - private static final List commonTriggerTypes = List.of(MANUAL, TIME_TRIGGER, REMOTE); - - public static List toMap(ScmType scmType, String userId) { - List triggerTypes; - if (scmType == null) { - triggerTypes = Arrays.asList(PipelineTriggerType.values()); - } else { - triggerTypes = Arrays.stream(PipelineTriggerType.values()) - .filter(it -> scmType.name().equals(it.name())) - .collect(Collectors.toList()); - triggerTypes.addAll(commonTriggerTypes); - } - return triggerTypes.stream() - .map(it -> new IdValue( - it.name(), - MessageFormat.format( - "TRIGGER_TYPE_" + it.name(), - it.name(), - userId - ) - )) - .collect(Collectors.toList()); - } - - public static ScmType toScmType(String triggerType) { - return Arrays.stream(ScmType.values()) - .map(Enum::name) - .anyMatch(triggerType::equals) - ? ScmType.valueOf(triggerType) - : null; - } - - public static boolean webhookTrigger(String triggerType) { - return List.of( - CODE_SVN.name(), - CODE_GIT.name(), - CODE_GITLAB.name(), - GITHUB.name(), - CODE_TGIT.name(), - CODE_P4.name() - ).contains(triggerType); - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/RepoTriggerEventDetail.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/RepoTriggerEventDetail.java deleted file mode 100644 index 7b88790a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/RepoTriggerEventDetail.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:RepoTriggerEventDetail - * @Date:2025/03/24 17:27 - * @Filename:RepoTriggerEventDetail - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "代码库webhook事件记录") -public class RepoTriggerEventDetail { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "事件ID") - private Long eventId; - @Schema(title = "总流水线数") - private int total; - @Schema(title = "成功的流水线数") - private int success; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/RepoTriggerEventVo.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/RepoTriggerEventVo.java deleted file mode 100644 index 88560ab0..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/trigger/RepoTriggerEventVo.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.trigger; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.trigger - * @Project:ops-pro - * @name:RepoTriggerEventVo - * @Date:2025/03/24 17:28 - * @Filename:RepoTriggerEventVo - * @description:Todo - */ -@Data -@NoArgsConstructor -@Schema(title = "代码库webhook事件记录") -public class RepoTriggerEventVo { - @Schema(title = "项目ID") - private String projectId; - @Schema(title = "事件ID") - private Long eventId; - @Schema(title = "代码库ID") - private String repoHashId; - @Schema(title = "事件描述") - private String eventDesc; - @Schema(title = "触发时间") - private Long eventTime; - @Schema(title = "总流水线数") - private int total; - @Schema(title = "成功的流水线数") - private int success; -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/PipelineWebhook.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/PipelineWebhook.java deleted file mode 100644 index 590c2aa3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/PipelineWebhook.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.webhook; - -import cd.casic.ci.log.scm.enums.RepositoryType; -import cd.casic.ci.log.scm.enums.ScmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.webhook - * @Project:ops-pro - * @name:PipelineWebhook - * @Date:2025/03/24 17:08 - * @Filename:PipelineWebhook - * @description:Todo - */ -@Data -@Schema(title = "流水线http回调模型") -public class PipelineWebhook { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "代码库类型,见ScmType枚举", required = false) - private ScmType repositoryType; - @Schema(title = "代码库标识类型, ID 代码库HashId / NAME 别名", required = false) - private RepositoryType repoType; - @Schema(title = "插件配置的代码库HashId,repoHashId与repoName 不能同时为空,如果两个都不为空就用repoName", required = false) - private String repoHashId; // repoHashId 与 repoName 不能同时为空,如果两个都不为空就用repoName - @Schema(title = "代码库别名", required = false) - private String repoName; - @Schema(title = "代码库自增ID,唯一", required = false) - private Long id; - @Schema(title = "项目名称", required = false) - private String projectName; - @Schema(title = "拉取当前代码库所在的插件ID", required = false) - private String taskId; - @Schema(title = "事件类型", required = false) - private String eventType; - @Schema(title = "代码库hashId,插件配置解析后的代码库ID", required = false) - private String repositoryHashId; - @Schema(title = "代码库平台ID", required = false) - private String externalId; - @Schema(title = "代码库平台仓库名", required = false) - private String externalName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/PipelineWebhookVersion.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/PipelineWebhookVersion.java deleted file mode 100644 index d78edc7a..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/PipelineWebhookVersion.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.webhook; - -import cd.casic.ci.log.scm.enums.RepositoryType; -import cd.casic.ci.log.scm.enums.ScmType; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.webhook - * @Project:ops-pro - * @name:PipelineWebhookVersion - * @Date:2025/03/24 17:08 - * @Filename:PipelineWebhookVersion - * @description:Todo - */ -@Data -@Schema(title = "流水线Webhook版本") -public class PipelineWebhookVersion { - @Schema(title = "项目id", required = false) - private String projectId; - @Schema(title = "流水线id", required = false) - private String pipelineId; - @Schema(title = "流水线版本", required = false) - private Integer version; - @Schema(title = "插件ID", required = false) - private String taskId; - @Schema(title = "插件参数", required = false) - private String taskParams; - @Schema(title = "插件代码库类型配置, ID 代码库HashId / NAME 别名", required = false) - private RepositoryType taskRepoType; - @Schema(title = "插件配置的代码库HashId,repoHashId与repoName 不能同时为空,如果两个都不为空就用repoName", required = false) - private String taskRepoHashId; // repoHashId 与 repoName 不能同时为空,如果两个都不为空就用repoName - @Schema(title = "代码库别名", required = false) - private String taskRepoName; - @Schema(title = "代码库类型,见ScmType枚举", required = false) - private ScmType repositoryType; - @Schema(title = "代码库hashId,插件配置解析后的代码库ID", required = false) - private String repositoryHashId; - @Schema(title = "事件类型", required = false) - private String eventType; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookEventType.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookEventType.java deleted file mode 100644 index 2eec5ae7..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookEventType.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.webhook; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.webhook - * @Project:ops-pro - * @name:WebhookEventType - * @Date:2025/03/24 17:09 - * @Filename:WebhookEventType - * @description:Todo - */ -@Data -@Schema(title = "WEBHOOK-事件类型") -public class WebhookEventType { - @Schema(title = "eventType", required = true) - private String eventType; - @Schema(title = "eventTypeName", required = true) - private String eventTypeName; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookTriggerParams.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookTriggerParams.java deleted file mode 100644 index a460d7d3..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookTriggerParams.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.webhook; - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.webhook - * @Project:ops-pro - * @name:WebhookTriggerParams - * @Date:2025/03/24 17:09 - * @Filename:WebhookTriggerParams - * @description:Todo - */ - -@Data -@Schema(title = "参数") -public class WebhookTriggerParams { - @Schema(title = "启动参数(webhook之类的预置参数)", required = true) - private Map params; - @Schema(title = "启动参数(用户自定义参数)", required = false) - private List userParams; - @Schema(title = "手动触发参数", required = false) - private Map startValues; - @Schema(title = "触发审核人列表", required = false) - private List triggerReviewers; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookTriggerPipeline.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookTriggerPipeline.java deleted file mode 100644 index 863b42ae..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/pojo/webhook/WebhookTriggerPipeline.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.api.process.pojo.webhook; - -import lombok.Data; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.pipelineciprocessapi.process.pojo.webhook - * @Project:ops-pro - * @name:WebhookTriggerPipeline - * @Date:2025/03/24 17:09 - * @Filename:WebhookTriggerPipeline - * @description:Todo - */ -@Data -public class WebhookTriggerPipeline { - private String projectId; - private String pipelineId; - private Integer version; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/Constants.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/Constants.java deleted file mode 100644 index 361c2fe0..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/Constants.java +++ /dev/null @@ -1,143 +0,0 @@ -package cd.casic.ci.process.api.process.utils; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.utils - * @Project:ops-pro - * @name:Constants - * @Date:2025/03/27 11:09 - * @Filename:Constants - */ -public class Constants { - public static final String PIPELINE_VERSION = "BK_CI_PIPELINE_VERSION"; - public static final String PIPELINE_START_PARENT_PROJECT_ID = "BK_CI_PARENT_PROJECT_ID"; - public static final String PIPELINE_START_PARENT_PIPELINE_ID = "BK_CI_PARENT_PIPELINE_ID"; - public static final String PIPELINE_START_PARENT_PIPELINE_NAME = "BK_CI_PARENT_PIPELINE_NAME"; - public static final String PIPELINE_START_PARENT_BUILD_ID = "BK_CI_PARENT_BUILD_ID"; - public static final String PIPELINE_START_PARENT_BUILD_NUM = "BK_CI_PARENT_BUILD_NUM"; - public static final String PIPELINE_START_PARENT_BUILD_TASK_ID = "BK_CI_PARENT_BUILD_TASK_ID"; - public static final String PIPELINE_START_PARENT_EXECUTE_COUNT = "BK_CI_PARENT_EXECUTE_COUNT"; - public static final String PIPELINE_START_USER_ID = "BK_CI_START_USER_ID"; - public static final String PIPELINE_START_USER_NAME = "BK_CI_START_USER_NAME"; - public static final String PIPELINE_START_WEBHOOK_USER_ID = "BK_CI_START_WEBHOOK_USER_ID"; - public static final String PIPELINE_START_PIPELINE_USER_ID = "BK_CI_START_PIPELINE_USER_ID"; - public static final String PIPELINE_START_SERVICE_USER_ID = "BK_CI_START_SERVICE_USER_ID"; - public static final String PIPELINE_START_MANUAL_USER_ID = "BK_CI_START_MANUAL_USER_ID"; - public static final String PIPELINE_START_TIME_TRIGGER_USER_ID = "BK_CI_START_TIME_TRIGGER_USER_ID"; - public static final String PIPELINE_START_REMOTE_USER_ID = "BK_CI_START_REMOTE_USER_ID"; - public static final String PIPELINE_START_REMOTE_CLIENT_IP = "BK_CI_START_REMOTE_CLIENT_IP"; - public static final String PIPELINE_START_TYPE = "BK_CI_START_TYPE"; - public static final String PIPELINE_START_CHANNEL = "BK_CI_START_CHANNEL"; - public static final String PIPELINE_BUILD_NUM = "BK_CI_BUILD_NUM"; - public static final String PIPELINE_BUILD_LAST_UPDATE = "BK_CI_BUILD_LAST_UPDATE"; - public static final String PIPELINE_BUILD_SVN_REVISION = "BK_CI_BUILD_SVN_REVISION"; - public static final String PIPELINE_BUILD_NUM_ALIAS = "BK_CI_BUILD_NUM_ALIAS"; - public static final String PIPELINE_BUILD_URL = "BK_CI_BUILD_URL"; - public static final String PIPELINE_TIMER_DISABLE = "BK_CI_TIMER_DISABLE"; - public static final String PIPELINE_START_SUB_RUN_MODE = "BK_CI_SUB_PIPELINE_RUN_MODE"; - - public static final String GIT_MR_NUMBER = "BK_CI_GIT_MR_NUMBER"; - public static final String GITHUB_PR_NUMBER = "BK_CI_GITHUB_PR_NUMBER"; - - public static final String PIPELINE_NAME = "BK_CI_PIPELINE_NAME"; - public static final String PIPELINE_ID = "BK_CI_PIPELINE_ID"; - public static final String WORKSPACE = "WORKSPACE"; - - public static final String PIPELINE_TIME_DURATION = "BK_CI_BUILD_TOTAL_TIME"; - - public static final String PIPELINE_BUILD_ID = "BK_CI_BUILD_ID"; - public static final String PIPELINE_VMSEQ_ID = "BK_CI_BUILD_JOB_ID"; - public static final String PIPELINE_ELEMENT_ID = "BK_CI_BUILD_TASK_ID"; - public static final String PIPELINE_TURBO_TASK_ID = "BK_CI_TURBO_ID"; - public static final String PROJECT_NAME = "BK_CI_PROJECT_NAME"; - public static final String REPORT_DYNAMIC_ROOT_URL = "BK_CI_REPORT_DYNAMIC_ROOT_URL"; - - public static final String PROJECT_NAME_CHINESE = "BK_CI_PROJECT_NAME_CN"; - - public static final String PIPELINE_START_MOBILE = "BK_CI_IS_MOBILE"; - - public static final String PIPELINE_START_TASK_ID = "BK_CI_START_TASK_ID"; - public static final String PIPELINE_RETRY_COUNT = "BK_CI_RETRY_COUNT"; - public static final String PIPELINE_RETRY_BUILD_ID = "BK_CI_RETRY_BUILD_ID"; - public static final String PIPELINE_RETRY_START_TASK_ID = "BK_CI_RETRY_TASK_ID"; - public static final String PIPELINE_RETRY_ALL_FAILED_CONTAINER = "BK_CI_RETRY_ALL_FAILED_CONTAINER"; - public static final String PIPELINE_SKIP_FAILED_TASK = "BK_CI_SKIP_FAILED_TASK"; - - public static final String BK_CI_BUILD_FAIL_TASKS = "BK_CI_BUILD_FAIL_TASKS"; - public static final String BK_CI_BUILD_FAIL_TASKNAMES = "BK_CI_BUILD_FAIL_TASKNAMES"; - - public static final String PIPELINE_VIEW_MY_PIPELINES = "myPipeline"; - public static final String PIPELINE_VIEW_MY_LIST_PIPELINES = "myListPipeline"; - public static final String PIPELINE_VIEW_FAVORITE_PIPELINES = "collect"; - public static final String PIPELINE_VIEW_ALL_PIPELINES = "allPipeline"; - public static final String PIPELINE_VIEW_UNCLASSIFIED = "unclassified"; - public static final String PIPELINE_VIEW_RECENT_USE = "recentUse"; - - public static final String PIPELINE_MATERIAL_URL = "BK_CI_PIEPLEINE_MATERIAL_URL"; - public static final String PIPELINE_MATERIAL_BRANCHNAME = "BK_CI_PIPELINE_MATERIAL_BRANCHNAME"; - public static final String PIPELINE_MATERIAL_ALIASNAME = "BK_CI_PIPELINE_MATERIAL_ALIASNAME"; - public static final String PIPELINE_MATERIAL_NEW_COMMIT_ID = "BK_CI_PIPELINE_MATERIAL_NEW_COMMIT_ID"; - public static final String PIPELINE_MATERIAL_NEW_COMMIT_COMMENT = "BK_CI_PIPELINE_MATERIAL_NEW_COMMIT_COMMENT"; - public static final String PIPELINE_MATERIAL_NEW_COMMIT_TIMES = "BK_CI_PIPELINE_MATERIAL_NEW_COMMIT_TIMES"; - - public static final String MAJORVERSION = "BK_CI_MAJOR_VERSION"; - public static final String MINORVERSION = "BK_CI_MINOR_VERSION"; - public static final String FIXVERSION = "BK_CI_FIX_VERSION"; - public static final String BUILD_NO = "BK_CI_BUILD_NO"; - public static final String BUILD_STATUS = "BK_CI_BUILD_STATUS"; - public static final String BK_DOCKER_TARGE_IMAGE_TAG = "BK_DOCKER_TARGE_IMAGE_TAG"; - public static final String BK_DOCKER_TARGE_IMAGE_NAME = "BK_DOCKER_TARGE_IMAGE_NAME"; - - public static final String JOB_RETRY_TASK_ID = "job.retry_task_id"; - - public static final String PIPELINE_CREATE_USER = "BK_CI_PIPELINE_CREATE_USER"; - public static final String PIPELINE_UPDATE_USER = "BK_CI_PIPELINE_UPDATE_USER"; - public static final String PIPELINE_BUILD_REMARK = "BK_CI_BUILD_REMARK"; - public static final String PIPELINE_ATOM_NAME = "BK_CI_ATOM_NAME"; - public static final String PIPELINE_ATOM_CODE = "BK_CI_ATOM_CODE"; - public static final String PIPELINE_ATOM_VERSION = "BK_CI_ATOM_VERSION"; - public static final String PIPELINE_TASK_NAME = "BK_CI_TASK_NAME"; - public static final String PIPELINE_STEP_ID = "BK_CI_STEP_ID"; - public static final String PIPELINE_ATOM_TIMEOUT = "BK_CI_ATOM_TIMEOUT"; - public static final String PIPELINE_DIALECT = "BK_CI_PIPELINE_DIALECT"; - - public static final String BK_CI_MATERIAL_ID = "BK_CI_MATERIAL_ID"; - public static final String BK_CI_MATERIAL_NAME = "BK_CI_MATERIAL_NAME"; - public static final String BK_CI_MATERIAL_URL = "BK_CI_MATERIAL_URL"; - - public static final String BK_CI_AUTHORIZER = "BK_CI_AUTHORIZER"; - - public static final int PIPELINE_SETTING_MAX_QUEUE_SIZE_DEFAULT = 10; - public static final int TASK_FAIL_RETRY_MAX_COUNT = 5; - public static final int TASK_FAIL_RETRY_MIN_COUNT = 1; - public static final int PIPELINE_SETTING_MAX_QUEUE_SIZE_MIN = 0; - public static final int PIPELINE_SETTING_MAX_QUEUE_SIZE_MAX = 200; - public static final int PIPELINE_SETTING_MAX_CON_QUEUE_SIZE_DEFAULT = 50; - public static final int PIPELINE_SETTING_MAX_CON_QUEUE_SIZE_MAX = 200; - public static final int PIPELINE_SETTING_WAIT_QUEUE_TIME_MINUTE_DEFAULT = 1; - public static final int PIPELINE_SETTING_WAIT_QUEUE_TIME_MINUTE_MIN = 1; - public static final int PIPELINE_SETTING_WAIT_QUEUE_TIME_MINUTE_MAX = 1440; - public static final int PIPELINE_TASK_MESSAGE_STRING_LENGTH_MAX = 4000; - public static final int PIPELINE_MESSAGE_STRING_LENGTH_MAX = 30000; - public static final int PIPELINE_CON_RUNNING_CONTAINER_SIZE_MAX = 30; - public static final int PIPELINE_MATRIX_MAX_CON_RUNNING_SIZE_DEFAULT = 5; - public static final int PIPELINE_MATRIX_CON_RUNNING_SIZE_MAX = 20; - public static final int PIPELINE_STAGE_CONTAINERS_COUNT_MAX = 256; - public static final int PIPELINE_CONDITION_EXPRESSION_LENGTH_MAX = 512; - public static final int PIPELINE_VARIABLES_STRING_LENGTH_MAX = 4000; - - public static final String PIPELINE_TIME_START = "CI_BUILD_START_TIME"; - public static final String PIPELINE_TIME_END = "CI_BUILD_END_TIME"; - public static final String PIPELINE_BUILD_MSG = "CI_BUILD_MSG"; - - public static final int PIPELINE_RES_NUM_MIN = 50; - - public static final String KEY_PIPELINE_ID = "pipelineId"; - public static final String KEY_PIPELINE_NAME = "pipelineName"; - public static final String KEY_PROJECT_ID = "projectId"; - public static final String KEY_TEMPLATE_ID = "templateId"; - public static final String KEY_STAGE = "stage"; - public static final String KEY_JOB = "job"; - public static final String KEY_TASK = "task"; - public static final String KEY_TASK_ATOM = "taskAtom"; -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/CredentialUtils.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/CredentialUtils.java deleted file mode 100644 index 66e20672..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/CredentialUtils.java +++ /dev/null @@ -1,94 +0,0 @@ -package cd.casic.ci.process.api.process.utils; - - -import cd.casic.ci.log.scm.dal.pojo.CodeP4Repository; -import cd.casic.ci.log.scm.dal.pojo.CodeSvnRepository; -import cd.casic.ci.log.scm.dal.pojo.Repository; -import cd.casic.ci.ticket.dal.enums.CredentialType; -import cd.casic.framework.commons.util.encrypt.DHUtil; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.springframework.util.StringUtils; - -import java.util.Base64; -import java.util.List; -import java.util.Optional; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.utils - * @Project:ops-pro - * @name:CredentialUtils - * @Date:2025/03/27 14:35 - * @Filename:CredentialUtils - * @description:Todo - */ -@Slf4j -public class CredentialUtils { - - public static Credential getCredential(Repository repository, List credentials, CredentialType credentialType) { - if (repository instanceof CodeSvnRepository && ((CodeSvnRepository) repository).getSvnType() == CodeSvnRepository.SVN_TYPE_HTTP) { - return switch (credentialType) { - case USERNAME_PASSWORD -> { - if (credentials.size() <= 1) { - log.warn("Fail to get the username of the svn repo {}", repository); - yield new Credential(repository.getUserName(), credentials.get(0), null); - } else { - yield new Credential(credentials.get(0), credentials.get(1), null); - } - } - case TOKEN_USERNAME_PASSWORD -> { - yield new Credential( - credentials.get(0), - Optional.of(credentials.get(1)).orElse(""), - Optional.of(credentials.get(2)).orElse(""), - null - ); - } - default -> new Credential(repository.getUserName(), credentials.get(0), null); - }; - } else if (repository instanceof CodeSvnRepository && credentialType == CredentialType.TOKEN_SSH_PRIVATEKEY) { - return new Credential( - credentials.get(0), - Optional.of(credentials.get(1)).orElse(""), - repository.getUserName(), - Optional.of(credentials.get(2)).orElse("") - ); - } else if (repository instanceof CodeP4Repository && credentialType == CredentialType.USERNAME_PASSWORD) { - return new Credential(credentials.get(0), "", credentials.get(1)); - } else { - String privateKey = credentials.get(0); - String passPhrase = credentials.size() > 1 && !credentials.get(1).isEmpty() ? credentials.get(1) : null; - return new Credential(repository.getUserName(), privateKey, passPhrase); - } - } - - public static String decode(String encode, String publicKey, byte[] privateKey) { - if (!StringUtils.hasText(encode)) return ""; - byte[] decodedBytes = Base64.getDecoder().decode(encode); - byte[] publicKeyBytes = Base64.getDecoder().decode(publicKey); - return new String(DHUtil.decrypt(decodedBytes, publicKeyBytes, privateKey)); - } - - @Data - public static class Credential { - private String username; - private String privateKey; - private String passPhrase; - private String svnToken; - private CredentialType credentialType; - - public Credential(String username, String privateKey, String passPhrase) { - this.username = username; - this.privateKey = privateKey; - this.passPhrase = passPhrase; - } - - public Credential(String svnToken, String username, String privateKey, String passPhrase) { - this.svnToken = svnToken; - this.username = username; - this.privateKey = privateKey; - this.passPhrase = passPhrase; - } - } -} diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/DependOnUtils.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/DependOnUtils.java deleted file mode 100644 index 52195888..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/DependOnUtils.java +++ /dev/null @@ -1,208 +0,0 @@ -package cd.casic.ci.process.api.process.utils; - -import cd.casic.ci.common.pipeline.constant.HttpStatus; -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.NormalContainer; -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.container.VMBuildContainer; -import cd.casic.ci.common.pipeline.enums.DependOnType; -import cd.casic.ci.common.pipeline.option.JobControlOption; -import cd.casic.ci.common.pipeline.pojo.DependOnConfig; -import cd.casic.ci.common.pipeline.utils.EnvUtils; -import cd.casic.ci.process.api.process.constant.ProcessMessageCode; -import lombok.extern.slf4j.Slf4j; - -import java.util.*; -import java.util.regex.Pattern; - -/** - * @Author:mianbin - * @Package:cd.casic.ci.process.api.process.utils - * @Project:ops-pro - * @name:DependOnUtils - * @Date:2025/03/27 14:39 - * @Filename:DependOnUtils - * @description:Todo - */ -@Slf4j -public class DependOnUtils { - - private static final Pattern regex = Pattern.compile("[,;]"); - - public static void checkRepeatedJobId(Stage stage) { - Set jobIdSet = new HashSet<>(); - for (Container c : stage.getContainers()) { - String jobId = c.getJobId(); - if (jobId == null || jobId.isEmpty()) { - continue; - } - if (jobIdSet.contains(jobId)) { - String jobName = getContainerName(stage, c, jobId); - log.error( - HttpStatus.CONFLICT.getReasonPhrase(), - ProcessMessageCode.ERROR_PIPELINE_JOBID_EXIST, - new String[]{jobName, jobId}, - jobName + " 的jobId(" + jobId + ")已存在" - ); - } - jobIdSet.add(jobId); - } - removeNonexistentJob(stage, jobIdSet); - } - - private static void removeNonexistentJob(Stage stage, Set jobIdSet) { - for (Container c : stage.getContainers()) { - JobControlOption jobControlOption = getJobControlOption(c); - if (jobControlOption == null) { - continue; - } - boolean isEmpty = jobControlOption.getDependOnId() == null || jobControlOption.getDependOnId().isEmpty(); - if (jobControlOption.getDependOnType() != DependOnType.ID || isEmpty) { - continue; - } - List existJobIds = new ArrayList<>(); - for (String jobId : jobControlOption.getDependOnId()) { - if (jobIdSet.contains(jobId)) { - existJobIds.add(jobId); - } - } - jobControlOption.setDependOnId(existJobIds); - } - } - - public static void initDependOn(Stage stage, Map params) { - Map allJobId2JobMap = new HashMap<>(); - for (Container c : stage.getContainers()) { - String jobId = c.getJobId(); - if (jobId == null || jobId.isEmpty()) { - continue; - } - allJobId2JobMap.put(jobId, c); - } - if (allJobId2JobMap.isEmpty()) { - return; - } - - Map> cycleCheckJobMap = new HashMap<>(); - for (Container c : stage.getContainers()) { - JobControlOption jobControlOption = getJobControlOption(c); - if (jobControlOption == null) { - continue; - } - List dependOnJobIds = getDependOnJobIds( - new DependOnConfig( - jobControlOption.getDependOnType(), - jobControlOption.getDependOnId(), - jobControlOption.getDependOnName() - ), - params - ); - if (dependOnJobIds.isEmpty()) { - continue; - } - String jobId = c.getJobId(); - if (jobId != null && !jobId.isEmpty()) { - cycleCheckJobMap.put(jobId, dependOnJobIds); - } - Map containerId2JobIds = new HashMap<>(); - for (String dependOnJobId : dependOnJobIds) { - Container dependOnJob = allJobId2JobMap.get(dependOnJobId); - if (dependOnJob == null) { - continue; - } - containerId2JobIds.put(dependOnJob.getId(), dependOnJobId); - } - if (!containerId2JobIds.isEmpty()) { - jobControlOption.setDependOnContainerId2JobIds(containerId2JobIds); - } - } - - Map visited = new HashMap<>(); - for (String jobId : cycleCheckJobMap.keySet()) { - dsf(jobId, cycleCheckJobMap, visited, stage, allJobId2JobMap); - } - } - - public static boolean enableDependOn(Container container) { - JobControlOption jobControlOption = getJobControlOption(container); - if (jobControlOption == null) { - return false; - } - switch (jobControlOption.getDependOnType()) { - case ID: - return jobControlOption.getDependOnId() != null && !jobControlOption.getDependOnId().isEmpty(); - case NAME: - return jobControlOption.getDependOnName() != null && !jobControlOption.getDependOnName().isEmpty(); - default: - return false; - } - } - - private static List getDependOnJobIds(DependOnConfig dependOnConfig, Map params) { - switch (dependOnConfig.getDependOnType()) { - case ID: - if (dependOnConfig.getDependOnId() == null || dependOnConfig.getDependOnId().isEmpty()) { - return new ArrayList<>(); - } - return dependOnConfig.getDependOnId(); - case NAME: - if (dependOnConfig.getDependOnName() == null || dependOnConfig.getDependOnName().isEmpty()) { - return new ArrayList<>(); - } - String[] dependONames = regex.split(dependOnConfig.getDependOnName()); - List result = new ArrayList<>(); - for (String name : dependONames) { - result.add(EnvUtils.parseEnv(name, params)); - } - return result; - default: - return new ArrayList<>(); - } - } - - private static boolean dsf(String jobId, Map> dependOnMap, Map visited, Stage stage, Map allJobId2JobMap) { - if (visited.getOrDefault(jobId, 0) == 1) { - return true; - } - if (visited.getOrDefault(jobId, 0) == 2) { - return false; - } - - visited.put(jobId, 1); - List dependOnJobIds = dependOnMap.get(jobId); - if (dependOnJobIds != null) { - for (String dependOnJobId : dependOnJobIds) { - if (dsf(dependOnJobId, dependOnMap, visited, stage, allJobId2JobMap)) { - String jobName = getContainerName(stage, allJobId2JobMap.get(jobId), jobId); - String dependJobName = getContainerName(stage, allJobId2JobMap.get(dependOnJobId), dependOnJobId); - log.error( - ProcessMessageCode.ERROR_PIPELINE_DEPENDON_CYCLE, - new String[]{jobName, dependJobName} - ); - } - } - } - visited.put(jobId, 2); - return false; - } - - private static String getContainerName(Stage stage, Container container, String jobId) { - if (container == null) { - return jobId; - } - String namePrefix = stage.getName(); - if (namePrefix != null && namePrefix.startsWith("stage-")) { - namePrefix = namePrefix.substring("stage-".length()); - } - return namePrefix + "-" + container.getId(); - } - - private static JobControlOption getJobControlOption(Container container) { - if (container instanceof VMBuildContainer) { - return ((VMBuildContainer) container).getJobControlOption(); - } else if (container instanceof NormalContainer) { - return ((NormalContainer) container).getJobControlOption(); - } - return null; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/PipelineVarUtil.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/PipelineVarUtil.java deleted file mode 100644 index 03c812de..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/PipelineVarUtil.java +++ /dev/null @@ -1,343 +0,0 @@ -package cd.casic.ci.process.api.process.utils; - -import cd.casic.ci.common.pipeline.constant.StringConstant; -import cd.casic.ci.common.pipeline.enums.BuildFormPropertyType; -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cn.hutool.core.lang.Pair; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import java.util.*; -import java.util.regex.Pattern; - -/** - * @author by mianbin - * @Classname PipelineVarUtil - * @Description TODO - * @Date 2025/4/1 16:52 - */ -@Slf4j -@Component -public class PipelineVarUtil { - - private static final Pattern tPattern = Pattern.compile("\\$[{]{2}(?[^$^{}]+)[}]{2}"); - public static final String CONTEXT_PREFIX = "variables."; - public static final int MAX_VERSION_LEN = 64; - - // 前置拼接映射 - private static final Map oldPrefixMappingNew = new HashMap<>(); - private static final Map newPrefixMappingOld = new HashMap<>(); - - // 旧变量到新变量的映射 - private static final Map oldVarMappingNewVar = new HashMap<>(); - private static final Map newVarMappingOldVar = new HashMap<>(); - - // CI 预置上下文转换映射关系 - private static final Map contextVarMappingBuildVar = new HashMap<>(); - private static final Map contextVarMappingBuildVarRevert = new HashMap<>(); - private static final Map reverseContextVarMappingBuildVar = new HashMap<>(); - - static { - // 初始化 oldPrefixMappingNew - oldPrefixMappingNew.put("pipeline.material.url", "PIPELINE_MATERIAL_URL"); - oldPrefixMappingNew.put("pipeline.material.branchName", "PIPELINE_MATERIAL_BRANCHNAME"); - // 其他旧前缀到新前缀的映射... - - // 初始化 newPrefixMappingOld - for (Map.Entry entry : oldPrefixMappingNew.entrySet()) { - newPrefixMappingOld.put(entry.getValue(), entry.getKey()); - } - - // 初始化 oldVarMappingNewVar - oldVarMappingNewVar.put("pipeline.start.isMobile", "PIPELINE_START_MOBILE"); - oldVarMappingNewVar.put("repoName", "PIPELINE_REPO_NAME"); - // 其他旧变量到新变量的映射... - - // 初始化 newVarMappingOldVar - for (Map.Entry entry : oldVarMappingNewVar.entrySet()) { - newVarMappingOldVar.put(entry.getValue(), entry.getKey()); - } - - // 初始化 contextVarMappingBuildVar - contextVarMappingBuildVar.put("ci.project_name", "PROJECT_NAME_CHINESE"); - contextVarMappingBuildVar.put("ci.build_msg", "PIPELINE_BUILD_MSG"); - // 其他 CI 预置上下文到构建变量的映射... - - // 初始化 contextVarMappingBuildVarRevert - contextVarMappingBuildVarRevert.put("PIPELINE_START_USER_NAME", "ci.actor"); - - // 初始化 reverseContextVarMappingBuildVar - for (Map.Entry entry : contextVarMappingBuildVar.entrySet()) { - reverseContextVarMappingBuildVar.put(entry.getValue(), entry.getKey()); - } - } - - /** - * 检查[keyword]字符串是不是一个变量语法, ${{ varName }}, 如果不是则返回false - * 注意:已不再支持 ${ var } 旧的语法定义变量,只支持全新 ${{ var }} 的语法 - */ - public static boolean isVar(String keyword) { - return keyword != null && !keyword.isEmpty() && tPattern.matcher(keyword).matches(); - } - - /** - * 检查[keyword]串中有没有变量,比如 "abc_${{ varName }} is true" 将识别出存在 varName变量,会返回true - */ - public boolean haveVar(String keyword) { - return tPattern.matcher(keyword).find(); - } - - /** - * 获取反向变量名 - */ - public String fetchReverseVarName(String contextKey) { - Map varMap = new HashMap<>(reverseContextVarMappingBuildVar); - varMap.putAll(contextVarMappingBuildVarRevert); - return varMap.get(contextKey); - } - - /** - * 填充CI预置变量 - */ - public static void fillContextVarMap(Map varMap, Map buildVar) { - for (Map.Entry entry : contextVarMappingBuildVar.entrySet()) { - String varKey = entry.getValue(); - if (buildVar.containsKey(varKey) && buildVar.get(varKey) != null && !buildVar.get(varKey).isEmpty()) { - varMap.put(entry.getKey(), buildVar.get(varKey)); - } - } - } - - /** - * 填充CI预置变量 - */ - public static Map fillContextVarMap(Map buildVar) { - Map varMap = new HashMap<>(); - fillContextVarMap(varMap, buildVar); - varMap.putAll(buildVar); - return varMap; - } - - /** - * 获取CI预置变量 - */ - public String fetchContextInBuildVars(String contextKey, Map buildVar) { - String varKey = contextVarMappingBuildVar.get(contextKey); - return buildVar.get(varKey); - } - - /** - * 获取CI预置变量名 - */ - public String fetchVarName(String contextKey) { - return contextVarMappingBuildVar.get(contextKey); - } - - /** - * 填充旧变量名,兼容用户在流水线中旧的写法 - */ - public void fillOldVarWithType(Map> varMaps) { - turningWithType(newVarMappingOldVar, varMaps, false); - prefixTurningWithType(newPrefixMappingOld, varMaps, false); - } - - /** - * 填充旧变量名,兼容用户在流水线中旧的写法 - */ - public void fillOldVar(Map vars) { - turning(newVarMappingOldVar, vars, false); - prefixTurning(newPrefixMappingOld, vars, false); - } - - /** - * 填充variable变量 - */ - public Map fillVariableMap(Map pipelineParamMap) { - Map allVars = new HashMap<>(); - for (Map.Entry entry : pipelineParamMap.entrySet()) { - String name = entry.getKey(); - String value = entry.getValue(); - allVars.put(name, value); - if (!name.startsWith(CONTEXT_PREFIX)) { - allVars.put(CONTEXT_PREFIX + name, value); - } - } - return allVars; - } - - /** - * 从新变量前缀的变量中查出并增加旧变量,会做去重 - */ - public Map mixOldVarAndNewVar(Map vars) { - prefixTurning(newPrefixMappingOld, vars, false); - Map allVars = new HashMap<>(); - for (Map.Entry entry : vars.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - String oldVarName = newVarToOldVar(key); - if (oldVarName != null && !oldVarName.isEmpty()) { - allVars.put(oldVarName, value); - allVars.put(key, value); - } else { - String newVarName = oldVarToNewVar(key); - if (newVarName != null && !newVarName.isEmpty() && !vars.containsKey(newVarName)) { - allVars.put(newVarName, value); - } - if (!allVars.containsKey(key) || "BuildNo".equals(key)) { - allVars.put(key, value); - } - } - } - return allVars; - } - - /** - * 将[varMaps]找到旧变量并替换成新变量,并删除掉旧变量 - */ - public void replaceOldByNewVar(Map> varMaps) { - turningWithType(oldVarMappingNewVar, varMaps, true); - prefixTurningWithType(oldPrefixMappingNew, varMaps, true); - } - - /** - * 遍历[varMaps]中的fullKey,与[mapping]中的key做完成匹配,匹配成功后从[mapping]取出value作newKey - * 并写入到[varMaps],最后根据[replace]值为true决定要删除[varMaps]中的fullKey - */ - private void turningWithType(Map mapping, Map> varMaps, boolean replace) { - for (Map.Entry entry : mapping.entrySet()) { - String oldKey = entry.getKey(); - String newKey = entry.getValue(); - if (varMaps.containsKey(oldKey) && !varMaps.containsKey(newKey)) { - varMaps.put(newKey, varMaps.get(oldKey)); - if (replace && !"BuildNo".equals(oldKey)) { - varMaps.remove(oldKey); - } - } - } - } - - /** - * 遍历[vars]中的fullKey,与[mapping]中的key做完成匹配,匹配成功后从[mapping]取出value作newKey - * 并写入到[vars],最后根据[replace]值为true决定要删除[vars]中的fullKey - */ - private void turning(Map mapping, Map vars, boolean replace) { - for (Map.Entry entry : mapping.entrySet()) { - String oldKey = entry.getKey(); - String newKey = entry.getValue(); - if (vars.containsKey(oldKey) && !vars.containsKey(newKey)) { - vars.put(newKey, vars.get(oldKey)); - if (replace) { - vars.remove(oldKey); - } - } - } - } - - /** - * 遍历[vars]中的fullKey,与[mapping]中的key做前缀匹配,匹配成功后从[mapping]取出value,替换掉fullKey的前缀key,组成newKey - * 并写入到[vars],最后根据[replace]值为true决定要删除[vars]中的fullKey - */ - private void prefixTurning(Map mapping, Map vars, boolean replace) { - Set keys = new HashSet<>(vars.keySet()); - for (String fullKey : keys) { - for (Map.Entry entry : mapping.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - if (fullKey.startsWith(key)) { - String newKey = value + fullKey.substring(key.length()); - vars.put(newKey, vars.get(fullKey)); - if (replace) { - vars.remove(fullKey); - } - break; - } - } - } - } - - /** - * 遍历[varMaps]中的fullKey,与[mapping]中的key做前缀匹配,匹配成功后从[mapping]取出value,替换掉fullKey的前缀key,组成newKey - * 并写入到[varMaps],最后根据[replace]值为true决定要删除[varMaps]中的fullKey - */ - private void prefixTurningWithType(Map mapping, Map> varMaps, boolean replace) { - Set keys = new HashSet<>(varMaps.keySet()); - for (String fullKey : keys) { - for (Map.Entry entry : mapping.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - if (fullKey.startsWith(key)) { - String newKey = value + fullKey.substring(key.length()); - varMaps.put(newKey, varMaps.get(fullKey)); - if (replace) { - varMaps.remove(fullKey); - } - break; - } - } - } - } - - public static String oldVarToNewVar(String oldVarName) { - return oldVarMappingNewVar.get(oldVarName); - } - - public String newVarToOldVar(String newVarName) { - return newVarMappingOldVar.get(newVarName); - } - - public Map contextVarMap() { - return contextVarMappingBuildVar; - } - - /** - * 从流水线启动参数[buildParameters]中找出推荐版本号,由[MAJORVERSION].[MINORVERSION].[FIXVERSION].[BUILD_NO]组成 - * 需要注意的是,旧的参数命名继续兼容有效,由{MarjorVersion}.{MinorVersion}.{FixVersion}.{BuildNo} 组成,所以启动参数切记 - * 不要与此命名相同造成了冲突 - */ - public String getRecommendVersion(List buildParameters) { - String recommendVersionPrefix = getRecommendVersionPrefix(buildParameters); - if (recommendVersionPrefix == null) { - return null; - } - String buildNo = null; - for (BuildParameters param : buildParameters) { - if ("BUILD_NO".equals(param.getKey()) || "BuildNo".equals(param.getKey())) { - buildNo = param.getValue() != null ? param.getValue().toString() : null; - break; - } - } - if (buildNo == null) { - return null; - } - return StringConstant.coerceAtMaxLength(recommendVersionPrefix + "." + buildNo, MAX_VERSION_LEN); - } - - /** - * 从流水线启动参数[buildParameters]中找出版本号前缀,由[MAJORVERSION].[MINORVERSION].[FIXVERSION] 组成, - * 如果[buildParameters]中不存在上述3类参数,则返回空 - * 需要注意的是,旧的参数命名继续兼容有效,由{MarjorVersion}.{MinorVersion}.{FixVersion} 组成,所以启动参数切记 - * 不要与此命名相同造成了冲突 - */ - public String getRecommendVersionPrefix(List buildParameters) { - String majorVersion = null; - String minorVersion = null; - String fixVersion = null; - for (BuildParameters param : buildParameters) { - if ("MAJORVERSION".equals(param.getKey()) || "MajorVersion".equals(param.getKey())) { - majorVersion = param.getValue() != null ? param.getValue().toString() : null; - } else if ("MINORVERSION".equals(param.getKey()) || "MinorVersion".equals(param.getKey())) { - minorVersion = param.getValue() != null ? param.getValue().toString() : null; - } else if ("FIXVERSION".equals(param.getKey()) || "FixVersion".equals(param.getKey())) { - fixVersion = param.getValue() != null ? param.getValue().toString() : null; - } - } - if (majorVersion == null || minorVersion == null || fixVersion == null) { - return null; - } - return majorVersion + "." + minorVersion + "." + fixVersion; - } - - public boolean recommendVersionKey(String key) { - return "MAJORVERSION".equals(key) || "MINORVERSION".equals(key) || "FIXVERSION".equals(key); - } -} \ No newline at end of file diff --git a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/PipelineVersionUtils.java b/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/PipelineVersionUtils.java deleted file mode 100644 index a89a2b45..00000000 --- a/modules/module-ci-process-api/src/main/java/cd/casic/ci/process/api/process/utils/PipelineVersionUtils.java +++ /dev/null @@ -1,187 +0,0 @@ -package cd.casic.ci.process.api.process.utils; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.container.*; -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.process.api.process.pojo.setting.PipelineSettingVersion; -import cn.hutool.core.collection.CollUtil; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - * @author by mianbin - * @Classname PipelineVersionUtils - * @Description TODO - * @Date 2025/4/1 19:52 - */ -public class PipelineVersionUtils { - - public String getVersionNameByModel( - int currPipelineVersion, - int currTriggerVersion, - int settingVersion, - int versionNum, - Model originModel, - Model newModel - ) { - int pipelineVersion = getPipelineVersion(currPipelineVersion, originModel, newModel); - pipelineVersion = Math.max(pipelineVersion, 1); - int triggerVersion = getTriggerVersion(currTriggerVersion, originModel, newModel); - triggerVersion = Math.max(triggerVersion, 1); - return "V" + versionNum + "(P" + pipelineVersion + ".T" + triggerVersion + "." + settingVersion + ")"; - } - - public static String getVersionName(Integer versionNum, Integer pipelineVersion, Integer triggerVersion, Integer settingVersion) { - boolean isNull = versionNum == null || pipelineVersion == null || triggerVersion == null || settingVersion == null; - return isNull ? null : "V" + versionNum + "(P" + pipelineVersion + ".T" + triggerVersion + "." + settingVersion + ")"; - } - - public int getTriggerVersion(int currVersion, Model originModel, Model newModel) { - try { - boolean changed = false; - TriggerContainer originTrigger = (TriggerContainer) originModel.getStages().get(0).getContainers().get(0); - originTrigger.setParams(Collections.emptyList()); - TriggerContainer newTrigger = (TriggerContainer) newModel.getStages().get(0).getContainers().get(0); - newTrigger.setParams(Collections.emptyList()); - if (originTrigger.equals(newTrigger)) { - List originElements = originTrigger.getElements(); - List newElements = newTrigger.getElements(); - for (int i = 0; i < originElements.size(); i++) { - Element origin = originElements.get(i); - Element newElement = newElements.get(i); - if (!origin.equals(newElement)) { - changed = true; - } - if (origin.elementEnabled() != newElement.elementEnabled()) { - changed = true; - } - } - } else { - changed = true; - } - return changed ? currVersion + 1 : currVersion; - } catch (Throwable ignore) { - return currVersion + 1; - } - } - - public int getPipelineVersion( - int currVersion, - Model originModel, - Model newModel - ) { - List originStages = originModel.getStages().subList(1, originModel.getStages().size()); - List newStages = newModel.getStages().subList(1, newModel.getStages().size()); - List originParams = ((TriggerContainer) originModel.getStages().get(0).getContainers().get(0)).getParams(); - List newParams = ((TriggerContainer) newModel.getStages().get(0).getContainers().get(0)).getParams(); - return CollUtil.disjunction(originStages, newStages).size() == 0 && originParams.equals(newParams) ? currVersion : currVersion + 1; - } - - public int getSettingVersion( - int currVersion, - PipelineSettingVersion originSetting, - PipelineSettingVersion newSetting - ) { - return originSetting.equals(newSetting) ? currVersion : currVersion + 1; - } - - private boolean differ(List thisStages, List otherStages) { - if (!thisStages.equals(otherStages) && thisStages.size() != otherStages.size()) { - return false; - } - for (int sIndex = 0; sIndex < thisStages.size(); sIndex++) { - Stage thisStage = thisStages.get(sIndex); - Stage otherStage = otherStages.get(sIndex); - if (!thisStage.equals(otherStage) || thisStage.getContainers().size() != otherStage.getContainers().size() - || !thisStage.getCheckIn().equals(otherStage.getCheckIn()) - || !thisStage.getCheckOut().equals(otherStage.getCheckOut()) - || !thisStage.getStageControlOption().equals(otherStage.getStageControlOption())) { - return false; - } - List thisContainers = thisStage.getContainers(); - List otherContainers = otherStage.getContainers(); - for (int cIndex = 0; cIndex < thisContainers.size(); cIndex++) { - Container thisContainer = thisContainers.get(cIndex); - Container otherContainer = otherContainers.get(cIndex); - if (!thisContainer.equals(otherContainer) && thisContainer.getElements().size() != otherContainer.getElements().size()) { - return false; - } - if (thisContainer instanceof VMBuildContainer && otherContainer instanceof VMBuildContainer) { - VMBuildContainer thisVMBuild = (VMBuildContainer) thisContainer; - VMBuildContainer otherVMBuild = (VMBuildContainer) otherContainer; - if (!thisVMBuild.equals(otherVMBuild) || !thisVMBuild.getDispatchType().equals(otherVMBuild.getDispatchType()) - || !thisVMBuild.getJobControlOption().equals(otherVMBuild.getJobControlOption())) { - return false; - } - } else if (thisContainer instanceof NormalContainer && otherContainer instanceof NormalContainer) { - NormalContainer thisNormal = (NormalContainer) thisContainer; - NormalContainer otherNormal = (NormalContainer) otherContainer; - if (!thisNormal.equals(otherNormal) || !thisNormal.getJobControlOption().equals(otherNormal.getJobControlOption())) { - return false; - } - } else { - return false; - } - List thisElements = thisContainer.getElements(); - List otherElements = otherContainer.getElements(); - for (int eIndex = 0; eIndex < thisElements.size(); eIndex++) { - Element thisElement = thisElements.get(eIndex); - Element otherElement = otherElements.get(eIndex); - if (!thisElement.equals(otherElement)) { - return false; - } - if (!thisElement.getAdditionalOptions().equals(otherElement.getAdditionalOptions())) { - return false; - } - - if (CollUtil.disjunction(thisElements, otherElements).size() == 0) { - return false; - } - } - } - } - return true; - } - - public boolean differ(Element thisElement, Element otherElement) { - if (thisElement.getClass() != otherElement.getClass()) { - return true; - } - java.lang.reflect.Field[] v1Fields = thisElement.getClass().getDeclaredFields(); - java.lang.reflect.Field[] v2Fields = otherElement.getClass().getDeclaredFields(); - if (v1Fields.length != v2Fields.length) { - return true; - } - java.util.Map v1Map = new java.util.HashMap<>(); - java.util.Map v2Map = new java.util.HashMap<>(); - try { - for (java.lang.reflect.Field field : v1Fields) { - field.setAccessible(true); - v1Map.put(field.getName(), field.get(thisElement)); - } - for (java.lang.reflect.Field field : v2Fields) { - field.setAccessible(true); - v2Map.put(field.getName(), field.get(otherElement)); - } - if (v1Map.size() != v2Map.size()) { - return true; - } - for (Map.Entry entry : v1Map.entrySet()) { - String key = entry.getKey(); - Object value = entry.getValue(); - if (!v2Map.containsKey(key)) { - return true; - } - if (!v2Map.get(key).equals(value)) { - return true; - } - } - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - return false; - } -} diff --git a/modules/module-ci-process-biz/pom.xml b/modules/module-ci-process-biz/pom.xml deleted file mode 100644 index 2f06a3ce..00000000 --- a/modules/module-ci-process-biz/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-process-biz - - - - cd.casic.boot - module-ci-process-api - - - cd.casic.boot - spring-boot-starter-mq - - - io.github.resilience4j - resilience4j-circuitbreaker - 2.3.0 - - - - \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/Cmd.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/Cmd.java deleted file mode 100644 index 7de9c5cc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/Cmd.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.command; - -/** - * @author by mianbin - * @Classname Cmd - * @Description 定义引擎命令 - * @Date 2025/4/7 19:37 - */ -public interface Cmd { - /** - * 当前[commandContext]上下文能否满足运行条件 - * - * @param commandContext 命令上下文 - * @return 如果满足运行条件返回 true,否则返回 false - */ - boolean canExecute(T commandContext); - - /** - * 本命令[commandContext]上下文执行核心处理逻辑 - * - * @param commandContext 命令上下文 - */ - void execute(T commandContext); - - /** - * 执行总入口,将调用[canExecute]判断是否满足再执行[execute]函数, - * 并将[chain]链式传递[commandContext]继续执行下去 - * - * @param commandContext 命令上下文 - * @param chain 命令链 - */ - default void doExecute(T commandContext, CmdChain chain) { - if (canExecute(commandContext)) { - execute(commandContext); - } - chain.doCommand(commandContext); - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/CmdChain.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/CmdChain.java deleted file mode 100644 index 455f7c94..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/CmdChain.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.command; - -/** - * @author by mianbin - * @Classname CmdChain - * @Description 引擎控制命令链 - * @Date 2025/4/7 19:37 - */ -public interface CmdChain { - - /** - * 使用泛型的命令上下文[commandContext]执行命令 - * [commandContext]具备传递和存储中间数据,由各部件定义 - * - * @param commandContext 命令上下文 - */ - default void doCommand(T commandContext) { - if (commandContext.getCmdFlowSeq() < 0) { // 校正 - commandContext.setCmdFlowSeq(0); - } - // 每次调用,都增1,走向下一条命令链 - Cmd nextCmd = nextCommand(commandContext); - if (nextCmd != null) { - nextCmd.doExecute(commandContext, this); - } - } - - /** - * 获取下一个命令 - * - * @param commandContext 命令上下文 - * @return 下一个命令,如果没有则返回 null - */ - Cmd nextCommand(T commandContext); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/CmdContext.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/CmdContext.java deleted file mode 100644 index 5bd638dd..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/command/CmdContext.java +++ /dev/null @@ -1,27 +0,0 @@ -package cd.casic.ci.process.command; - -import cd.casic.framework.commons.util.watcher.Watcher; -import lombok.Data; - -import java.util.Map; - -/** - * @author by mianbin - * @Classname CmdContext - * @Description 命令上下文基础类 - * @Date 2025/4/7 19:35 - */ -@Data -public class CmdContext { - protected int executeCount; - protected int cmdFlowSeq; - protected final Map variables; - protected final Watcher watcher; - - public CmdContext(int cmdFlowSeq, Map variables, Watcher watcher) { - this.cmdFlowSeq = cmdFlowSeq; - this.executeCount = 1; // 对应 Kotlin 中的初始值 - this.variables = variables; - this.watcher = watcher; - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/BuildJobResourceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/BuildJobResourceImpl.java deleted file mode 100644 index 8543e401..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/BuildJobResourceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package cd.casic.ci.process.engine; - -import cd.casic.ci.common.pipeline.pojo.JobHeartbeatRequest; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.process.api.engine.BuildJobResource; -import cd.casic.ci.process.api.engine.pojo.HeartBeatInfo; -import cd.casic.ci.process.api.process.pojo.BuildJobResult; -import cd.casic.ci.process.api.process.pojo.BuildTask; -import cd.casic.ci.process.api.process.pojo.BuildTaskResult; -import cd.casic.ci.process.api.process.pojo.BuildVariables; -import kotlin.Result; -import lombok.extern.slf4j.Slf4j; - -/** - * @author by mianbin - * @Classname BuildJobResourceImpl - * @Description TODO - * @Date 2025/4/7 19:01 - */ -@Slf4j -public class BuildJobResourceImpl implements BuildJobResource { - @Override - public Result jobStarted(String projectId, String buildId, String vmSeqId, String vmName, String retryCount) { - log.info("$()|$()|$())|$()|callback pipeline event", projectId, buildId, vmSeqId, vmName); - return null; - } - - @Override - public Result claimTask(String projectId, String buildId, String vmSeqId, String vmName) { - return null; - } - - @Override - public Result completeTask(String projectId, String buildId, String vmSeqId, String vmName, BuildTaskResult result) { - return null; - } - - @Override - public Result jobEnd(String projectId, String buildId, String vmSeqId, String vmName, BuildJobResult result) { - return null; - } - - @Override - public Result jobTimeout(String projectId, String pipelineId, String buildId, String vmSeqId) { - return null; - } - - @Override - public Result jobHeartbeat(String buildId, String vmSeqId, String vmName) { - return null; - } - - @Override - public Result jobHeartbeatV1(String projectId, String buildId, String vmSeqId, String vmName, Integer executeCount, JobHeartbeatRequest jobHeartbeatRequest) { - return null; - } - - @Override - public Result submitError(String projectId, String pipelineId, String buildId, String vmSeqId, ErrorInfo errorInfo) { - return null; - } - - @Override - public Result getBuildDetailUrl(String projectId, String pipelineId, String buildId) { - return null; - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/callback/listener/ProjectCallbackEventListener.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/callback/listener/ProjectCallbackEventListener.java deleted file mode 100644 index 42175114..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/callback/listener/ProjectCallbackEventListener.java +++ /dev/null @@ -1,93 +0,0 @@ -package cd.casic.ci.process.process.callback.listener; - - -import cd.casic.ci.process.process.engine.control.CallBackControl; -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import cd.casic.ci.project.dal.pojo.ProjectVO; -import cd.casic.ci.project.pojo.ProjectUpdateInfo; -import cd.casic.ci.project.pojo.mq.ProjectBroadCastEvent; -import cd.casic.ci.project.pojo.mq.ProjectCreateBroadCastEvent; -import cd.casic.ci.project.pojo.mq.ProjectEnableStatusBroadCastEvent; -import cd.casic.ci.project.pojo.mq.ProjectUpdateBroadCastEvent; -import cd.casic.ci.project.service.ProjectService; -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessageListener; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -@Service -@Slf4j -public class ProjectCallbackEventListener extends AbstractRedisStreamMessageListener { - @Resource - private CallBackControl callBackControl; - private ProjectService projectService; - @Override - public void onMessage(ProjectBroadCastEvent event) { - log.info("Receive ProjectEvent from MQ [$event]"); - try { - if (event instanceof ProjectUpdateBroadCastEvent) { - onReceiveProjectUpdate((ProjectUpdateBroadCastEvent)event); - } else if (event instanceof ProjectEnableStatusBroadCastEvent) { - onReceiveProjectEnable((ProjectEnableStatusBroadCastEvent)event); - } else if (event instanceof ProjectCreateBroadCastEvent) { - onReceiveProjectCreate((ProjectCreateBroadCastEvent)event); - } - } catch (Exception e) { - log.error("BKSystemMonitor| project callback listener execute error", e); - } - } - /** - * 处理创建项目事件 - * @param event ProjectCreateBroadCastEvent - */ - private void onReceiveProjectCreate(ProjectCreateBroadCastEvent event){ - ProjectCreateInfo projectInfo = event.getProjectInfo(); - callBackControl.projectCreate( - projectInfo.getEnglishName(), - projectInfo.getProjectName(), - event.getUserId()); - } - /** - * 处理更新项目事件 - * @param event ProjectUpdateBroadCastEvent - */ - private void onReceiveProjectUpdate(ProjectUpdateBroadCastEvent event){ - ProjectUpdateInfo projectInfo = event.getProjectInfo(); - callBackControl.projectUpdate( - projectInfo.getEnglishName(), - projectInfo.getProjectName(), - event.getUserId() - ); - } - /** - * 处理项目禁用事件 - * @param event ProjectEnableStatusBroadCastEvent - */ - private void onReceiveProjectEnable(ProjectEnableStatusBroadCastEvent event){ - ProjectVO project = getProject(event.getProjectId()); - if (project!=null) { - if (event.getEnable()) { - callBackControl.projectEnable(event.getProjectId(),project.getProjectName(),event.getUserId()); - } else { - callBackControl.projectDisable(event.getProjectId(),project.getProjectName(),event.getUserId()); - } - } - } - - - private ProjectVO getProject(String projectEnglishName){ - if (StringUtils.isEmpty(projectEnglishName)) { - return null; - } - try { - return projectService.getByEnglishName(projectEnglishName); - } catch (Exception e) { - log.warn( - "fail to get project info|projectEnglishName[$projectEnglishName]", - e - ); - return null; - } - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/constant/AllocIdGenerateConstant.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/constant/AllocIdGenerateConstant.java deleted file mode 100644 index 9e276f66..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/constant/AllocIdGenerateConstant.java +++ /dev/null @@ -1,6 +0,0 @@ -package cd.casic.ci.process.process.constant; - -public class AllocIdGenerateConstant { - public static final String AUDIT_RESOURCE="AUDIT_RESOURCE"; - public static final String PROJECT_PIPELINE_CALLBACK_HISTORY="PROJECT_PIPELINE_CALLBACK_HISTORY"; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceBaseDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceBaseDao.java deleted file mode 100644 index 5820533a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceBaseDao.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.atom; - -import cd.casic.ci.process.process.dataObject.TPipelineAtomReplaceBaseRecord; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线原子替换基础 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineAtomReplaceBaseDao { - - /** - * 创建原子替换基础记录 - * - * @param baseId 基础ID - * @param projectId 项目ID - * @param pipelineIdList 流水线ID列表 - * @param fromAtomCode 源原子代码 - * @param toAtomCode 目标原子代码 - * @param userId 用户ID - */ - void createAtomReplaceBase( - @Param("baseId") String baseId, - @Param("projectId") String projectId, - @Param("pipelineIdList") List pipelineIdList, - @Param("fromAtomCode") String fromAtomCode, - @Param("toAtomCode") String toAtomCode, - @Param("userId") String userId - ); - - /** - * 获取原子替换基础记录列表 - * - * @param statusList 状态列表 - * @param descFlag 是否降序 - * @param page 页码 - * @param pageSize 每页大小 - * @return 原子替换基础记录列表 - */ - List getAtomReplaceBaseList( - @Param("statusList") List statusList, - @Param("descFlag") boolean descFlag, - @Param("page") int page, - @Param("pageSize") int pageSize - ); - - /** - * 更新原子替换基础记录 - * - * @param baseId 基础ID - * @param status 状态 - * @param userId 用户ID - */ - void updateAtomReplaceBase( - @Param("baseId") String baseId, - @Param("status") String status, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceHistoryDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceHistoryDao.java deleted file mode 100644 index 37124240..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceHistoryDao.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.atom; - - -import cd.casic.ci.process.api.process.pojo.PipelineAtomReplaceHistory; -import cd.casic.ci.process.process.dataObject.TPipelineAtomReplaceHistoryRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线原子替换历史 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineAtomReplaceHistoryDao { - - /** - * 创建原子替换历史 - * - * @param pipelineAtomReplaceHistory 原子替换历史信息 - */ - void createAtomReplaceHistory( - @Param("pipelineAtomReplaceHistory") PipelineAtomReplaceHistory pipelineAtomReplaceHistory - ); - - /** - * 获取原子替换历史列表 - * - * @param baseId 基础ID - * @param itemId 项ID - * @param projectId 项目ID - * @param busType 业务类型 - * @param statusList 状态列表 - * @param descFlag 是否降序 - * @param page 页码 - * @param pageSize 每页大小 - * @return 原子替换历史记录列表 - */ - List getAtomReplaceHistoryList( - @Param("baseId") String baseId, - @Param("itemId") String itemId, - @Param("projectId") String projectId, - @Param("busType") String busType, - @Param("statusList") List statusList, - @Param("descFlag") Boolean descFlag, - @Param("page") Integer page, - @Param("pageSize") Integer pageSize - ); - - /** - * 更新原子替换历史 - * - * @param id ID - * @param status 状态 - * @param log 日志 - * @param userId 用户ID - */ - void updateAtomReplaceHistory( - @Param("id") String id, - @Param("status") String status, - @Param("log") String log, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceItemDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceItemDao.java deleted file mode 100644 index 332afff0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceItemDao.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.atom; - -import cd.casic.ci.process.process.dataObject.TPipelineAtomReplaceItemRecord; - -import cd.casic.ci.process.process.pojo.AtomVersionReplaceInfo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线原子替换项 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineAtomReplaceItemDao { - public void createAtomReplaceItem( - @Param("baseId") String baseId, - @Param("fromAtomCode") String fromAtomCode, - @Param("toAtomCode") String toAtomCode, - @Param("versionInfoList") List versionInfoList, - @Param("userId") String userId - ); - - - - TPipelineAtomReplaceItemRecord getAtomReplaceItemListByBaseId( - @Param("baseId") String baseId, - @Param("statusList") List statusList, - @Param("descFlag") Boolean descFlag, - @Param("page") Integer page, - @Param("pageSize") Integer pageSize - ); -// TODO 这是一个类似wrapper的拼接条件方法 -// private fun TPipelineAtomReplaceItem.getAtomReplaceItemListCondition( -// baseId: String, -// statusList: List? -// ): MutableList - - Long getAtomReplaceItemCountByBaseId( - @Param("baseId") String baseId, - @Param("statusList") List statusList - ); - TPipelineAtomReplaceItemRecord getAtomReplaceItem( - @Param("itemId") String itemId - ); - int deleteByBaseId(@Param("baseId") String baseId); - - int updateAtomReplaceItemByBaseId( - @Param("baseId") String baseId, - @Param("status") String status, - @Param("userId") String userId - ); - - int updateAtomReplaceItemByItemId( - @Param("itemId") String itemId, - @Param("status") String status, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/audit/AuditDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/audit/AuditDao.java deleted file mode 100644 index 6e92c773..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/audit/AuditDao.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.audit; - -import cd.casic.ci.process.api.process.pojo.audit.QueryAudit; -import cd.casic.ci.process.process.dataObject.TAuditResourceRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 审计记录 Mapper 接口 - */ -@Mapper -@Repository -public interface AuditDao { - - Long create( - @Param("resourceType") String resourceType, - @Param("resourceId") String resourceId, - @Param("resourceName") String resourceName, - @Param("userId") String userId, - @Param("action") String action, - @Param("actionContent") String actionContent, - @Param("projectId") String projectId, - @Param("id") Long id - ); - List listByResourceTye( - @Param("queryAudit") QueryAudit queryAudit, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - Long countByResourceTye(@Param("queryAudit")QueryAudit queryAudit); - -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/auth/PipelineRemoteAuthDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/auth/PipelineRemoteAuthDao.java deleted file mode 100644 index 00e9bd18..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/auth/PipelineRemoteAuthDao.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.auth; - -import cd.casic.ci.process.process.dataObject.TPipelineRemoteAuthRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线远程认证 Mapper 接口 - */ -@Repository -public interface PipelineRemoteAuthDao { - - /** - * 创建远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @param authType 认证类型 - * @param authContent 认证内容 - * @param userId 用户ID - * @return 远程认证记录ID - */ - long create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId, - @Param("authType") String authType, - @Param("authContent") String authContent, - @Param("userId") String userId - ); - - /** - * 更新远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @param authType 认证类型 - * @param authContent 认证内容 - * @param userId 用户ID - * @return 影响的行数 - */ - int update( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId, - @Param("authType") String authType, - @Param("authContent") String authContent, - @Param("userId") String userId - ); - - /** - * 删除远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId - ); - - /** - * 获取远程认证记录列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 远程认证记录列表 - */ - List list( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @return 远程认证记录 - */ - TPipelineRemoteAuthRecord get( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/PipelineCallbackDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/PipelineCallbackDao.java deleted file mode 100644 index baec0bf2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/PipelineCallbackDao.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.ci.process.process.dal.callback; - - - -import cd.casic.ci.common.pipeline.pojo.event.PipelineCallbackEvent; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线回调Mapper接口 - */ -@Repository -public interface PipelineCallbackDao { - - /** - * 保存流水线回调 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param userId 用户ID - * @param list 回调事件列表 - * @return 影响的行数 - */ - int save( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("list") List list - ); - - /** - * 获取流水线回调列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param event 事件类型 - * @return 回调记录列表 - */ - // TODO T_PIPELINE_CALLBACK 这个表找不到 -// Result list( -// @Param("projectId") String projectId, -// @Param("pipelineId") String pipelineId, -// @Param("event") String event -// ); - - /** - * 删除流水线回调 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param names 回调名称集合 - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("names") Set names - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackDao.java deleted file mode 100644 index ffe039ff..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackDao.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.callback; - -import cd.casic.ci.process.process.dataObject.TProjectPipelineCallbackRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * 项目流水线回调 Mapper 接口 - */ -@Repository -public interface ProjectPipelineCallbackDao { - - /** - * 可直接更新或插入 - */ - int save( - @Param("projectId") String projectId, - @Param("events") String events, - @Param("userId") String userId, - @Param("callbackUrl") String callbackUrl, - @Param("secretToken") String secretToken, - @Param("id") Long id, - @Param("secretParam") String secretParam - ); - - - List listProjectCallback( - @Param("projectId")String projectId, - @Param("events")String events, - @Param("enable")Boolean enable - ); - - List listByPage( - @Param("projectId")String projectId, - @Param("offset")Integer offset, - @Param("limit")Integer limit - ); - - Long countByPage(String projectId); - - TProjectPipelineCallbackRecord get( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - int deleteById( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - int deleteByProjectId( - @Param("projectId") String projectId - ); - - int disable( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - int enable( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - List getDisableCallbackList( - @Param("projectId") String projectId, - @Param("url") String url, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - int enableByIds( - @Param("projectId") String projectId, - @Param("ids") Listids - ); - - int updateFailureTime( - @Param("projectId") String projectId, - @Param("id") Long id, - @Param("failureTime") LocalDateTime failureTime - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackHistoryDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackHistoryDao.java deleted file mode 100644 index 8f4119b6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackHistoryDao.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.callback; - -import cd.casic.ci.process.process.dataObject.TProjectPipelineCallbackHistoryRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 项目流水线回调历史 Mapper 接口 - */ -@Repository -public interface ProjectPipelineCallbackHistoryDao { - - void create( - @Param("projectId") String projectId, - @Param("callBackUrl") String callBackUrl, - @Param("events") String events, - @Param("status") String status, - @Param("errorMsg") String errorMsg, - @Param("requestHeaders") String requestHeaders, - @Param("requestBody") String requestBody, - @Param("responseCode") Integer responseCode, - @Param("responseBody") String responseBody, - @Param("startTime") Long startTime, - @Param("endTime") Long endTime, - @Param("id") Long id - ); - TProjectPipelineCallbackHistoryRecord get(@Param("id") Long id); - - List list( - @Param("projectId") String projectId, - @Param("callBackUrl") String callBackUrl, - @Param("events") String events, - @Param("startTime") Long startTime, - @Param("endTime") Long endTime, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - Long count( - String projectId, - String callBackUrl, - String events, - Long startTime, - Long endTime - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/engin/PipelineTriggerReviewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/engin/PipelineTriggerReviewDao.java deleted file mode 100644 index 044804f6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/engin/PipelineTriggerReviewDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dal.engin; - -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface PipelineTriggerReviewDao { - Integer createReviewRecord( - @Param("buildId") String buildId, - @Param("pipelineId") String pipelineId, - @Param("projectId") String projectId, - @Param("reviewers") List reviewers - ); - Integer updateOperator( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("userId") String userId - ); - List getTriggerReviewers( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId - ); - -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineGroupDao.java deleted file mode 100644 index 7b63f598..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineGroupDao.java +++ /dev/null @@ -1,130 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - - -import cd.casic.ci.process.process.dataObject.TPipelineGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线分组 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineGroupDao { - - /** - * 创建流水线分组 - * - * @param projectId 项目ID - * @param name 分组名称 - * @param userId 用户ID - * @param id 主键ID - * @return 分组ID - */ - Long createPipelineGroup( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("userId") String userId, - @Param("id") Long id - ); - - /** - * 更新流水线分组 - * - * @param projectId 项目ID - * @param groupId 分组ID - * @param name 分组名称 - * @param userId 用户ID - * @return 是否更新成功 - */ - boolean update( - @Param("projectId") String projectId, - @Param("groupId") Long groupId, - @Param("name") String name, - @Param("userId") String userId - ); - - /** - * 删除流水线分组 - * - * @param projectId 项目ID - * @param groupId 分组ID - * @param userId 用户ID - * @return 是否删除成功 - */ - boolean deletePipelineGroup( - @Param("projectId") String projectId, - @Param("groupId") Long groupId, - @Param("userId") String userId - ); - - /** - * 获取项目下的所有分组 - * - * @param projectId 项目ID - * @return 分组记录列表 - */ - List list( - @Param("projectId") String projectId - ); - - /** - * 统计项目下的分组数量 - * - * @param projectId 项目ID - * @return 分组数量 - */ - long count( - @Param("projectId") String projectId - ); - - /** - * 统计项目下指定名称的分组数量 - * - * @param projectId 项目ID - * @param name 分组名称 - * @return 分组数量 - */ - long countByName( - @Param("projectId") String projectId, - @Param("name") String name - ); - - /** - * 根据ID获取分组 - * - * @param id 分组ID - * @return 分组记录 - */ - TPipelineGroupRecord get( - @Param("id") Long id - ); - - /** - * 根据ID列表获取分组 - * - * @param projectId 项目ID - * @param ids 分组ID集合 - * @return 分组记录列表 - */ - List listByIds( - @Param("projectId") String projectId, - @Param("ids") Set ids - ); - - /** - * 获取项目下的指定分组 - * - * @param projectId 项目ID - * @param groupId 分组ID - * @return 分组记录 - */ - TPipelineGroupRecord get( - @Param("projectId") String projectId, - @Param("groupId") Long groupId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelDao.java deleted file mode 100644 index 4a29aaa0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelDao.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.api.process.pojo.classify.PipelineLabel; - -import org.apache.ibatis.annotations.Param; - - -import java.util.List; - -/** - * 流水线标签 Mapper 接口 - */ -public interface PipelineLabelDao { - - /** - * 创建标签 - * - * @param projectId 项目ID - * @param name 标签名称 - * @param desc 标签描述 - * @param userId 用户ID - * @return 标签ID - */ - long create( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("desc") String desc, - @Param("userId") String userId - ); - - /** - * 更新标签 - * - * @param projectId 项目ID - * @param id 标签ID - * @param name 标签名称 - * @param desc 标签描述 - * @param userId 用户ID - * @return 影响的行数 - */ - int update( - @Param("projectId") String projectId, - @Param("id") long id, - @Param("name") String name, - @Param("desc") String desc, - @Param("userId") String userId - ); - - /** - * 删除标签 - * - * @param projectId 项目ID - * @param id 标签ID - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("id") long id - ); - - /** - * 获取标签列表 - * - * @param projectId 项目ID - * @return 标签列表 - */ - List list( - @Param("projectId") String projectId - ); - - /** - * 获取标签 - * - * @param projectId 项目ID - * @param id 标签ID - * @return 标签 - */ - PipelineLabel get( - @Param("projectId") String projectId, - @Param("id") long id - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelPipelineDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelPipelineDao.java deleted file mode 100644 index 2eccb659..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelPipelineDao.java +++ /dev/null @@ -1,150 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.process.dataObject.TPipelineLabelPipelineRecord; -import cd.casic.ci.process.process.pojo.PipelineLabelRelateInfo; -import cn.hutool.core.lang.Pair; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线和标签对应关系Mapper接口 - */ -@Repository -public interface PipelineLabelPipelineDao { - - /** - * 创建流水线标签关系 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param labelId 标签ID - * @param userId 用户ID - * @param id 主键ID - * @return 影响的行数 - */ - int create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("labelId") Long labelId, - @Param("userId") String userId, - @Param("id") Long id - ); - /** - * 批量创建流水线标签关系 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param pipelineLabelRels 流水线标签关系列表 - * @param userId 用户ID - * @return 影响的行数 - */ - int batchCreate( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("pipelineLabelRels") List> pipelineLabelRels, - @Param("userId") String userId - ); - - /** - * 删除流水线标签关系 - * - * @param projectId 项目ID - * @param id 主键ID - * @param userId 用户ID - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("id") Long id, - @Param("userId") String userId - ); - - /** - * 删除流水线的所有标签关系 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param userId 用户ID - * @return 影响的行数 - */ - int deleteByPipeline( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId - ); - - /** - * 删除标签的所有流水线关系 - * - * @param projectId 项目ID - * @param labelId 标签ID - * @param userId 用户ID - * @return 影响的行数 - */ - int deleteByLabel( - @Param("projectId") String projectId, - @Param("labelId") Long labelId, - @Param("userId") String userId - ); - - /** - * 获取标签关联的流水线列表 - * - * @param projectId 项目ID - * @param labelId 标签ID集合 - * @return 流水线标签关系记录列表 - */ - TPipelineLabelPipelineRecord listPipelines( - @Param("projectId") String projectId, - @Param("labelId") Set labelId - ); - - /** - * 获取流水线关联的标签列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 流水线标签关系记录列表 - */ - TPipelineLabelPipelineRecord listLabels( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取已存在标签关系的流水线ID集合 - * - * @param projectId 项目ID - * @param pipelineIds 流水线ID集合 - * @return 流水线ID集合 - */ - Set exitsLabelPipelines( - @Param("projectId") String projectId, - @Param("pipelineIds") Set pipelineIds - ); - - /** - * 获取流水线标签关系列表 - * - * @param pipelineIds 流水线ID集合 - * @param projectId 项目ID - * @return 流水线标签关系记录列表 - */ - TPipelineLabelPipelineRecord listPipelineLabelRels( - @Param("pipelineIds") List pipelineIds, - @Param("projectId") String projectId - ); - - /** - * 获取流水线标签关联信息列表 - * - * @param projectIds 项目ID列表 - * @return 流水线标签关联信息列表 - */ - List getPipelineLabelRelateInfos( - @Param("projectIds") List projectIds - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewDao.java deleted file mode 100644 index 3f8cf318..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewDao.java +++ /dev/null @@ -1,362 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - - -import cd.casic.ci.process.process.dataObject.TPipelineViewRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 流水线视图Mapper接口 - */ -@Repository -public interface PipelineViewDao { - - /** - * 创建视图(基础版) - * - * @param projectId 项目ID - * @param name 视图名称 - * @param isProject 是否项目视图 - * @param filterByPipelineName 按流水线名称过滤 - * @param filterByCreator 按创建者过滤 - * @param userId 用户ID - * @param id 视图ID(可选) - * @return 创建的视图ID - */ - Long create( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("isProject") Boolean isProject, - @Param("filterByPipelineName") String filterByPipelineName, - @Param("filterByCreator") String filterByCreator, - @Param("userId") String userId, - @Param("id") Long id - ); - - /** - * 创建视图(高级版) - * - - * @param projectId 项目ID - * @param name 视图名称 - * @param logic 逻辑表达式 - * @param isProject 是否项目视图 - * @param filters 过滤器 - * @param userId 用户ID - * @param id 视图ID(可选) - * @param viewType 视图类型 - * @return 创建的视图ID - */ - Long create( - - @Param("projectId") String projectId, - @Param("name") String name, - @Param("logic") String logic, - @Param("isProject") Boolean isProject, - @Param("filters") String filters, - @Param("userId") String userId, - @Param("id") Long id, - @Param("viewType") Integer viewType - ); - - /** - * 更新视图(基础版) - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @param name 视图名称 - * @param isProject 是否项目视图 - * @param filterByPipelineName 按流水线名称过滤 - * @param filterByCreator 按创建者过滤 - * @return 是否更新成功 - */ - Boolean update( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("name") String name, - @Param("isProject") Boolean isProject, - @Param("filterByPipelineName") String filterByPipelineName, - @Param("filterByCreator") String filterByCreator - ); - - /** - * 更新视图(高级版) - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @param name 视图名称 - * @param logic 逻辑表达式 - * @param isProject 是否项目视图 - * @param filters 过滤器 - * @param viewType 视图类型 - * @return 是否更新成功 - */ - Boolean update( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("name") String name, - @Param("logic") String logic, - @Param("isProject") Boolean isProject, - @Param("filters") String filters, - @Param("viewType") Integer viewType - ); - - /** - * 删除视图 - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @return 是否删除成功 - */ - Boolean delete( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取项目下的所有视图 - * - - * @param projectId 项目ID - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId - ); - - /** - * 获取项目下指定类型的视图 - * - - * @param projectId 项目ID - * @param viewType 视图类型 - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("viewType") Integer viewType - ); - - /** - * 获取项目下指定是否项目视图的列表 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject - ); - - /** - * 获取用户创建的视图列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("userId") String userId - ); - - /** - * 获取用户创建的指定类型视图列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param isProject 是否项目视图 - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("isProject") Boolean isProject - ); - - /** - * 获取用户视图列表(支持多种过滤条件) - * - - * @param userId 用户ID - * @param projectId 项目ID - * @param isProject 是否项目视图(可选) - * @param viewType 视图类型(可选) - * @return 视图记录列表 - */ - List list( - - @Param("userId") String userId, - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("viewType") Integer viewType - ); - - /** - * 获取指定ID的视图列表 - * - - * @param projectId 项目ID(可选) - * @param viewIds 视图ID集合 - * @param viewType 视图类型(可选) - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("viewIds") Collection viewIds, - @Param("viewType") Integer viewType - ); - - /** - * 分页获取视图列表 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @param viewName 视图名称(可选) - * @param limit 每页数量 - * @param offset 偏移量 - * @return 视图记录列表 - */ - TPipelineViewRecord listByPage( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("viewName") String viewName, - @Param("limit") Integer limit, - @Param("offset") Integer offset - ); - - /** - * 获取所有项目或用户视图 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @param userId 用户ID - * @return 视图记录列表 - */ - TPipelineViewRecord listAll( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("userId") String userId - ); - - /** - * 获取动态项目ID列表 - * - - * @return 项目ID列表 - */ - List listDynamicProjectId(); - - /** - * 获取项目的动态视图列表 - * - - * @param projectId 项目ID - * @return 视图记录列表 - */ - TPipelineViewRecord listDynamicViewByProjectId( - - @Param("projectId") String projectId - ); - - /** - * 获取项目或用户视图列表 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @param userId 用户ID - * @return 视图记录列表 - */ - TPipelineViewRecord listProjectOrUser( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("userId") String userId - ); - - /** - * 获取指定视图 - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @return 视图记录 - */ - TPipelineViewRecord get( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取用户创建的指定视图 - * - - * @param userId 用户ID - * @param projectId 项目ID - * @param viewId 视图ID - * @return 视图记录 - */ - TPipelineViewRecord get( - - @Param("userId") String userId, - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 统计同名视图数量 - * - - * @param projectId 项目ID - * @param name 视图名称 - * @param creator 创建者(可选) - * @param isProject 是否项目视图 - * @param excludeIds 排除的ID集合 - * @return 数量 - */ - Integer countByName( - - @Param("projectId") String projectId, - @Param("name") String name, - @Param("creator") String creator, - @Param("isProject") Boolean isProject, - @Param("excludeIds") Collection excludeIds - ); - TPipelineViewRecord fetchAnyByName( - String projectId, - String name, - Boolean isProject - ); - - - Integer countForLimit( - @Param("projectId")String projectId, - @Param("isProject") Boolean isProject, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewGroupDao.java deleted file mode 100644 index b8be76e4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewGroupDao.java +++ /dev/null @@ -1,216 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.process.dataObject.TPipelineViewGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** - * 流水线视图分组 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineViewGroupDao { - - /** - * 创建视图分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @param pipelineId 流水线ID - * @param userId 用户ID - */ - void create( - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId - ); - - /** - * 获取视图分组列表(分页) - * - * @param viewId 视图ID - * @param offset 偏移量 - * @param limit 每页数量 - * @return 视图分组记录列表 - */ - List list( - @Param("viewId") Long viewId, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - /** - * 获取多个视图的分组列表 - * - * @param projectId 项目ID - * @param viewIds 视图ID列表 - * @return 视图分组记录列表 - */ - List listByViewIds( - @Param("projectId") String projectId, - @Param("viewIds") List viewIds - ); - - /** - * 获取指定视图的分组列表 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @return 视图分组记录列表 - */ - List listByViewId( - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取项目下的所有视图分组 - * - * @param projectId 项目ID - * @return 视图分组记录列表 - */ - List listByProjectId( - @Param("projectId") String projectId - ); - - /** - * 获取流水线所属的视图分组 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 视图分组记录列表 - */ - List listByPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取流水线所属的视图ID列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 视图ID列表 - */ - List listViewIdListByPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取视图包含的流水线ID列表 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @return 流水线ID列表 - */ - List listPipelineIdByViewId( - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取多个流水线所属的视图分组 - * - * @param projectId 项目ID - * @param pipelineIds 流水线ID集合 - * @return 视图分组记录列表 - */ - List listByPipelineIds( - @Param("projectId") String projectId, - @Param("pipelineIds") Collection pipelineIds - ); - - /** - * 统计流水线所属的视图分组数量 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 数量 - */ - Integer countByPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 移除视图分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @param pipelineId 流水线ID - */ - void remove( - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("pipelineId") String pipelineId - ); - - /** - * 移除视图的所有分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - */ - void remove( - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 批量移除视图分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @param pipelineIds 流水线ID列表 - */ - void batchRemove( - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("pipelineIds") List pipelineIds - ); - - /** - * 统计多个视图的分组数量 - * - * @param projectId 项目ID - * @param viewIds 视图ID集合 - * @param filterPipelineIds 过滤的流水线ID列表(可选) - * @return 视图ID到数量的映射 - */ - Map countByViewId( - @Param("projectId") String projectId, - @Param("viewIds") Collection viewIds, - @Param("filterPipelineIds") List filterPipelineIds - ); - - /** - * 获取不重复的流水线ID列表 - * - * @param projectId 项目ID - * @param viewIds 视图ID集合 - * @return 流水线ID列表 - */ - List distinctPipelineIds( - @Param("projectId") String projectId, - @Param("viewIds") Collection viewIds - ); - - /** - * 删除流水线的视图分组 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 是否删除成功 - */ - boolean delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewTopDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewTopDao.java deleted file mode 100644 index c568f618..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewTopDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.process.dataObject.TPipelineViewTopRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视图置顶Mapper接口 - */ -@Repository -public interface PipelineViewTopDao { - /** - * 添加视图置顶 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void add(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 移除视图置顶 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void remove(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 获取用户的置顶视图列�? * * @param projectId 项目ID * @param userId 用户ID * @return 置顶视图记录列表 - */ - List list(@Param("projectId") String projectId, @Param("userId") String userId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/packageInfo.md b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/packageInfo.md deleted file mode 100644 index 548d2fb4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/packageInfo.md +++ /dev/null @@ -1,84 +0,0 @@ -# DAO与Mapper包名映射关系 - -## 1. audit模块 -```kotlin -com.tencent.devops.process.audit.dao -↓ -com.tencent.devops.process.dal.mapper.audit -``` - -## 2. report模块 -```kotlin -com.tencent.devops.process.report.dao -↓ -com.tencent.devops.process.dal.mapper.report -``` - -## 3. pipeline模块 -```kotlin -com.tencent.devops.process.pipeline.dao -↓ -com.tencent.devops.process.dal.mapper.pipeline -``` - -## 4. template模块 -```kotlin -com.tencent.devops.process.template.dao -↓ -com.tencent.devops.process.dal.mapper.template -``` - -## 5. view模块 -```kotlin -com.tencent.devops.process.view.dao -↓ -com.tencent.devops.process.dal.mapper.view -``` - -## 6. label模块 -```kotlin -com.tencent.devops.process.label.dao -↓ -com.tencent.devops.process.dal.mapper.label -``` - -## 7. record模块 -```kotlin -com.tencent.devops.process.record.dao -↓ -com.tencent.devops.process.dal.mapper.record -``` - -## 8. trigger模块 -```kotlin -com.tencent.devops.process.trigger.dao -↓ -com.tencent.devops.process.dal.mapper.trigger -``` - -## 9. atom模块 -```kotlin -com.tencent.devops.process.atom.dao -↓ -com.tencent.devops.process.dal.mapper.atom -``` - -## 10. auth模块 -```kotlin -com.tencent.devops.process.auth.dao -↓ -com.tencent.devops.process.dal.mapper.auth -``` - -## 包名映射规律 -1. 基础包名相同:`com.tencent.devops.process` -2. 模块名相同:如`pipeline`、`template`等 -3. 后缀不同: - - DAO包:`.dao` - - Mapper包:`.dal.mapper` -4. 完整映射模式: - ```kotlin - com.tencent.devops.process.{module}.dao - ↓ - com.tencent.devops.process.dal.mapper.{module} - ``` diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildDao.java deleted file mode 100644 index f799e6fb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildDao.java +++ /dev/null @@ -1,398 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.process.api.engine.pojo.BuildInfo; -import cd.casic.ci.process.api.engine.pojo.BuildRetryInfo; -import cd.casic.ci.process.api.process.enums.HistorySearchType; -import cd.casic.ci.process.api.process.pojo.BuildStageStatus; -import cd.casic.ci.process.api.process.pojo.app.StartBuildContext; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -public interface PipelineBuildDao { - void create( StartBuildContext startBuildContext); - - void updateBuildRetryInfo( - String projectId, - String pipelineId, - String buildId, - BuildRetryInfo retryInfo - ); - - List getBuildTasksByStatus( - - String projectId, - String pipelineId, - Set statusSet - ); - - int countAllBuildWithStatus( - String projectId, - String pipelineId, - Set status - ); -/* -* TODO Record2 是JOOQ包的对象,这个项目使用mybatis,后续具体分析 -* */ -// List> getBuildTasksByConcurrencyGroup( -// -// String projectId, -// String concurrencyGroup, -// List statusSet -// ); -// -// List> getBuildTasksByConcurrencyGroupNull( -// -// String projectId, -// String pipelineId, -// List statusSet -// ); - - BuildInfo getBuildInfo( - - String projectId, - String buildId - ); - - BuildInfo getUserBuildInfo( - - String projectId, - String buildId - ); - - String getStartUser( - - String projectId, - String buildId - ); - - List listBuildInfoByBuildIds( - - Collection buildIds, - String projectId, - String startBeginTime, - String endBeginTime - ); - - List listBuildInfoByBuildIdsOnly( - - Collection buildIds - ); - - Collection listPipelineBuildInfo( - - String projectId, - String pipelineId, - int offset, - int limit, - Boolean updateTimeDesc - ); - - Collection listPipelineBuildNum( - - String projectId, - String pipelineId, - int offset, - int limit, - Integer debugVersion - ); - - BuildInfo getBuildInfoByBuildNum( - String projectId, - String pipelineId, - Integer buildNum, - Set statusSet, - boolean debug - ); - - BuildInfo getOneQueueBuild( - String projectId, - String pipelineId - ); - - BuildInfo getOneConcurrencyQueueBuild( - - String projectId, - String concurrencyGroup, - String pipelineId - ); - - void startBuild( - - String projectId, - String buildId, - LocalDateTime startTime, - Boolean debug - ); - - void finishBuild( - - String projectId, - String buildId, - BuildStatus buildStatus, - Long executeTime, - String recommendVersion, - String remark, - List errorInfoList, - Boolean debug - ); - - BuildInfo getLatestBuild( - - String projectId, - String pipelineId, - boolean debug - ); - - BuildInfo getLatestFinishedBuild( - - String projectId, - String pipelineId - ); - - BuildInfo getLatestFailedBuild( - - String projectId, - String pipelineId - ); - - BuildInfo getLatestSucceedBuild( - - String projectId, - String pipelineId - ); - - boolean updateStatus( - - String projectId, - String buildId, - BuildStatus oldBuildStatus, - BuildStatus newBuildStatus, - LocalDateTime startTime, - List errorInfoList - ); - - void updateExecuteCount( - - String projectId, - String buildId, - int executeCount - ); - - int count( - - String projectId, - String pipelineId, - List status, - Long startTimeEndTime, - Integer debugVersion - ); - - int countByStatus( - - String projectId, - String pipelineId, - List status, - Long startTimeEndTime, - Boolean onlyDebug - ); - - int count( - - String projectId, - String pipelineId, - List materialAlias, - String materialUrl, - List materialBranch, - String materialCommitId, - String materialCommitMessage, - List status, - List trigger, - Long queueTimeStartTime, - Long queueTimeEndTime, - Long startTimeStartTime, - Long startTimeEndTime, - Long endTimeStartTime, - Long endTimeEndTime, - Long totalTimeMin, - Long totalTimeMax, - String remark, - Integer buildNoStart, - Integer buildNoEnd, - String buildMsg, - List startUser, - Boolean debug, - List triggerAlias, - List triggerBranch, - List triggerUser - ); - - Collection listPipelineBuildInfo( - - String projectId, - String pipelineId, - List materialAlias, - String materialUrl, - List materialBranch, - String materialCommitId, - String materialCommitMessage, - List status, - List trigger, - Long queueTimeStartTime, - Long queueTimeEndTime, - Long startTimeStartTime, - Long startTimeEndTime, - Long endTimeStartTime, - Long endTimeEndTime, - Long totalTimeMin, - Long totalTimeMax, - String remark, - int offset, - int limit, - Integer buildNoStart, - Integer buildNoEnd, - String buildMsg, - List startUser, - Boolean updateTimeDesc, - Boolean debug, - List triggerAlias, - List triggerBranch, - List triggerUser - ); - - void updateBuildRemark( - - String projectId, - String pipelineId, - String buildId, - String remark - ); - - void updateRecommendVersion( - - String projectId, - String buildId, - String recommendVersion - ); - - Collection listHistorySearchOptions( - - String projectId, - String pipelineId, - Integer debugVersion, - HistorySearchType type - ); - - BuildInfo getBuildByBuildNum( - - String projectId, - String pipelineId, - int buildNum, - Integer debugVersion - ); - - List getBuilds( - - String projectId, - String pipelineId, - Set buildStatus, - Integer debugVersion - ); - - int updateArtifactList( - - String artifactList, - String projectId, - String pipelineId, - String buildId - ); - - void updateBuildMaterial( - - String projectId, - String buildId, - String material - ); - - int updateBuildStageStatus( - - String projectId, - String buildId, - List stageStatus, - BuildStatus oldBuildStatus, - BuildStatus newBuildStatus, - List errorInfoList - ); - - String getBuildParameters( - - String projectId, - String buildId - ); - - boolean updateBuildParameters( - - String projectId, - String pipelineId, - String buildId, - Collection buildParameters, - boolean debug - ); - - int countBuildNumByTime( - - String projectId, - String pipelineId, - LocalDateTime startTime, - LocalDateTime endTime, - Integer debugVersion - ); - - BuildInfo getBuildInfo( - - String projectId, - String pipelineId, - String buildId - ); - - int countBuildNumByVersion( - - String projectId, - String pipelineId, - int version - ); - -// List> batchCountBuildNumByVersion( -// -// String projectId, -// String pipelineId, -// Set versions -// ); - - String getDebugResourceStr( - - String projectId, - String buildId - ); - - List getDebugHistory( - - String projectId, - String pipelineId, - Integer version - ); - - int clearDebugHistory( - - String projectId, - String pipelineId, - Integer version - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildTemplateAcrossInfoDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildTemplateAcrossInfoDao.java deleted file mode 100644 index 45218c61..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildTemplateAcrossInfoDao.java +++ /dev/null @@ -1,172 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.process.api.process.pojo.BuildTemplateAcrossInfo; -import cd.casic.ci.process.process.dataObject.TPipelineBuildTemplateAcrossInfoRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线构建模板跨项目信息Mapper接口 - */ -@Repository -public interface PipelineBuildTemplateAcrossInfoDao { - - /** - * 创建模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param templateId 模板ID - * @param templateType 模板类型 - * @param templateInstancesIds 模板实例ID列表 - * @param targetProjectId 目标项目ID - * @param userId 用户ID - * @return 影响行数 - */ - int create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("templateId") String templateId, - @Param("templateType") BuildTemplateAcrossInfo.TemplateAcrossInfoType templateType, - @Param("templateInstancesIds") List templateInstancesIds, - @Param("targetProjectId") String targetProjectId, - @Param("userId") String userId - ); - - /** - * 批量创建模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param userId 用户ID - * @param templateAcrossInfos 模板跨项目信息列表 - * @return 影响行数 - */ - int batchCreate( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("userId") String userId, - @Param("templateAcrossInfos") List templateAcrossInfos - ); - - /** - * 批量更新模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param templateAcrossInfos 模板跨项目信息列表 - * @return 影响行数 - */ - int batchUpdate( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("templateAcrossInfos") List templateAcrossInfos - ); - - /** - * 获取模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param templateId 模板ID - * @return 模板跨项目信息记录列表 - */ - List get( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("templateId") String templateId - ); - - /** - * 根据模板ID获取跨项目信息 - * - - * @param projectId 项目ID - * @param templateId 模板ID - * @return 模板跨项目信息记录列表 - */ - List getByTemplateId( - - @Param("projectId") String projectId, - @Param("templateId") String templateId - ); - - /** - * 更新构建ID - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param templateId 模板ID - * @param buildId 构建ID - * @return 影响行数 - */ - int updateBuildId( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("templateId") String templateId, - @Param("buildId") String buildId - ); - - /** - * 删除模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param templateId 模板ID - * @return 影响行数 - */ - int delete( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("templateId") String templateId - ); - - /** - * 根据流水线ID删除跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 影响行数 - */ - int deleteByPipelineId( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 根据构建ID删除跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @return 影响行数 - */ - int deleteByBuildId( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildVarDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildVarDao.java deleted file mode 100644 index 1e1337ea..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildVarDao.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 流水线构建变量 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineBuildVarDao { - - /** - * 创建构建变量 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param varName 变量名 - * @param varValue 变量值 - * @return 构建变量ID - */ - long save( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("varName") String varName, - @Param("varValue") String varValue, - @Param("readOnly") Boolean readOnly - ); - - /** - * 更新构建变量 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param varType 变量类型 - * @return 影响的行数 - */ - int update( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("name") String name, - @Param("value") String value, - @Param("varType") String varType, - @Param("readOnly") Boolean readOnly - ); - - - - Map getVars( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("keys") Set keys - ); - - List getVarsWithType( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("key") String key - ); - - int deleteBuildVar( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("varName") String varName, - @Param("readOnly") Boolean readOnly - ); - - void batchSave( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("variables") List variables - ); - - void batchUpdate( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("variables") List variables - ); - - void deleteBuildVars( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId - ); - - void deletePipelineBuildVar( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - Set fetchVarByLikeKey( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("readOnly") Boolean readOnly, - @Param("likeStr") String likeStr - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineInfoDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineInfoDao.java deleted file mode 100644 index 177b1aed..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineInfoDao.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.process.api.engine.pojo.PipelineInfo; -import cd.casic.ci.process.api.process.pojo.PipelineCollation; -import cd.casic.ci.process.api.process.pojo.PipelineSortType; -import cd.casic.ci.process.process.dataObject.TPipelineInfoRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -/** - * 流水线信息 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineInfoDao { - - int create( - @Param("pipelineId") String pipelineId, - @Param("projectId") String projectId, - @Param("version") int version, - @Param("pipelineName") String pipelineName, - @Param("pipelineDesc") String pipelineDesc, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode, - @Param("manualStartup") boolean manualStartup, - @Param("canElementSkip") boolean canElementSkip, - @Param("taskCount") int taskCount, - @Param("id") Long id, - @Param("latestVersionStatus") VersionStatus latestVersionStatus, - @Param("pipelineDisable") Boolean pipelineDisable - ); - - boolean update( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("version") Integer version, - @Param("pipelineName") String pipelineName, - @Param("pipelineDesc") String pipelineDesc, - @Param("manualStartup") Boolean manualStartup, - @Param("canElementSkip") Boolean canElementSkip, - @Param("taskCount") int taskCount, - @Param("latestVersion") int latestVersion, - @Param("updateLastModifyUser") Boolean updateLastModifyUser, - @Param("latestVersionStatus") VersionStatus latestVersionStatus, - @Param("locked") Boolean locked - ); - - int countByPipelineIds( - @Param("projectId") String projectId, - @Param("channelCode") ChannelCode channelCode, - @Param("pipelineIds") List pipelineIds - ); - - int countByProjectIds( - @Param("projectIds") Collection projectIds, - @Param("channelCode") ChannelCode channelCode, - @Param("keyword") String keyword - ); - - int countByProjectIds( - @Param("projectIds") Collection projectIds, - @Param("channelCodes") List channelCodes, - @Param("keyword") String keyword - ); - - List listPipelineIdByProject( - @Param("projectId") String projectId - ); - - TPipelineInfoRecord listPipelineInfoByProject( - - @Param("projectId") String projectId, - @Param("limit") int limit, - @Param("offset") int offset, - @Param("deleteFlag") Boolean deleteFlag, - @Param("timeDescFlag") boolean timeDescFlag, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord searchByProject( - - @Param("pipelineName") String pipelineName, - @Param("projectCode") String projectCode, - @Param("limit") int limit, - @Param("offset") int offset, - @Param("channelCode") ChannelCode channelCode - ); - - int countPipelineInfoByProject( - - @Param("pipelineName") String pipelineName, - @Param("projectCode") String projectCode, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord searchByProject( - @Param("projectId") String projectId - ); - - TPipelineInfoRecord listPipelinesByProject( - - @Param("projectId") String projectId, - @Param("deleteFlag") Boolean deleteFlag, - @Param("days") Long days, - @Param("offset") Integer offset, - @Param("limit") Integer limit, - @Param("sortType") PipelineSortType sortType, - @Param("collation") PipelineCollation collation, - @Param("filterByPipelineName") String filterByPipelineName - ); - - int countPipeline( - - @Param("projectId") String projectId, - @Param("deleteFlag") Boolean deleteFlag, - @Param("days") Long days, - @Param("filterByPipelineName") String filterByPipelineName - ); - - TPipelineInfoRecord listDeletePipelineBefore( - - @Param("updateTime") LocalDateTime updateTime, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - boolean isNameExist( - - @Param("projectId") String projectId, - @Param("pipelineName") String pipelineName, - @Param("channelCode") ChannelCode channelCode - ); - - boolean isNameExist( - - @Param("projectId") String projectId, - @Param("pipelineName") String pipelineName, - @Param("channelCode") ChannelCode channelCode, - @Param("excludePipelineId") String excludePipelineId - ); - - TPipelineInfoRecord getPipelineInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord getPipelineInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("channelCode") ChannelCode channelCode, - @Param("delete") Boolean delete, - @Param("days") Long days - ); - - int softDelete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("changePipelineName") String changePipelineName, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode - ); - - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - TPipelineInfoRecord listInfoByPipelineIds( - @Param("projectId") String projectId, - @Param("pipelineIds") Set pipelineIds, - @Param("filterDelete") boolean filterDelete - ); - - TPipelineInfoRecord getPipelineInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("version") int version - ); - -// Record1 getPipelineInfoNum( -// -// @Param("projectIds") Set projectIds, -// @Param("channelCodes") Set channelCodes -// ); - - TPipelineInfoRecord listInfoByPipelineName( - - @Param("projectId") String projectId, - @Param("pipelineNames") Set pipelineNames, - @Param("filterDelete") boolean filterDelete - ); - - PipelineInfo convert( - @Param("t") TPipelineInfoRecord t, - @Param("templateId") String templateId - ); - - void restore( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord searchByProjectId( - @Param("pipelineName") String pipelineName, - @Param("projectCode") String projectCode, - @Param("limit") int limit, - @Param("offset") int offset, - @Param("channelCodes") List channelCodes - ); - - int getPipelineVersion( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode - ); -// TODO -// Result> listByProject( -// -// @Param("projectId") String projectId -// ); - - TPipelineInfoRecord getPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int countExcludePipelineIds( - @Param("projectId") String projectId, - @Param("excludePipelineIds") List excludePipelineIds, - @Param("channelCode") ChannelCode channelCode, - @Param("includeDelete") boolean includeDelete, - @Param("filterPipelineIds") List filterPipelineIds - ); - - TPipelineInfoRecord getPipelineByAutoId( - @Param("ids") List ids, - @Param("projectId") String projectId - ); - - void updateLatestStartTime( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("startTime") LocalDateTime startTime - ); - - List getIdByCreateTimePeriod( - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime, - @Param("page") int page, - @Param("pageSize") int pageSize - ); - - TPipelineInfoRecord listByPipelineIds( - @Param("projectId") String projectId, - @Param("excludePipelineIds") List excludePipelineIds, - @Param("channelCode") ChannelCode channelCode, - @Param("limit") int limit, - @Param("offset") int offset - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineJobMutexGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineJobMutexGroupDao.java deleted file mode 100644 index eb895ede..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineJobMutexGroupDao.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.process.process.dataObject.TPipelineJobMutexGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 流水线任务互斥组 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineJobMutexGroupDao { - - TPipelineJobMutexGroupRecord getByProjectId( - @Param("projectId") String projectId - ); - - boolean insert( - @Param("projectId") String projectId, - @Param("jobMutexGroupName") String jobMutexGroupName - ); - - boolean create( - @Param("projectId") String projectId, - @Param("jobMutexGroupName") String jobMutexGroupName - ); - - boolean exit( - @Param("projectId") String projectId, - @Param("jobMutexGroupName") String jobMutexGroupName - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineModelTaskDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineModelTaskDao.java deleted file mode 100644 index 44d86ac4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineModelTaskDao.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.api.engine.pojo.PipelineModelTask; -import cd.casic.ci.process.process.dataObject.TPipelineModelTaskRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.Collection; - -/** - * 流水线模型任务数据访问接口 - */ -@Mapper -@Repository -public interface PipelineModelTaskDao { - - void batchSave( - @Param("modelTasks") Collection modelTasks - ); - - void deletePipelineTasks( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int getPipelineCountByAtomCode( - @Param("atomCode") String atomCode, - @Param("projectCode") String projectCode - ); - -// Result> batchGetPipelineCountByAtomCode( -// @Param("dslContext") DSLContext dslContext, -// @Param("atomCodeList") List atomCodeList, -// @Param("projectCode") String projectCode -// ); -// -// Result> batchGetPipelineIdByAtomCode( -// @Param("projectId") String projectId, -// @Param("atomCodeList") List atomCodeList, -// @Param("limit") int limit, -// @Param("offset") int offset -// ); - - TPipelineModelTaskRecord getModelTasks( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("isAtomVersionNull") Boolean isAtomVersionNull - ); - - TPipelineModelTaskRecord listByPipelineIds( - @Param("projectId") String projectId, - @Param("pipelineIds") Collection pipelineIds - ); - -// Result listByAtomCode( -// @Param("atomCode") String atomCode, -// @Param("projectId") String projectId, -// @Param("version") String version, -// @Param("startUpdateTime") LocalDateTime startUpdateTime, -// @Param("endUpdateTime") LocalDateTime endUpdateTime, -// @Param("page") Integer page, -// @Param("pageSize") Integer pageSize -// ); - - long countByAtomCode( - @Param("atomCode") String atomCode, - @Param("projectId") String projectId, - @Param("version") String version, - @Param("startUpdateTime") LocalDateTime startUpdateTime, - @Param("endUpdateTime") LocalDateTime endUpdateTime - ); - -// Result listByAtomCodeAndPipelineIds( -// @Param("atomCode") String atomCode, -// @Param("pipelineIds") Set pipelineIds -// ); - - void updateTaskAtomVersion( - @Param("atomVersion") String atomVersion, - @Param("createTime") LocalDateTime createTime, - @Param("updateTime") LocalDateTime updateTime, - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("stageId") String stageId, - @Param("containerId") String containerId, - @Param("taskId") String taskId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineRecentUseDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineRecentUseDao.java deleted file mode 100644 index a4e319e1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineRecentUseDao.java +++ /dev/null @@ -1,76 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * 最近使用的流水线Mapper接口 - */ -@Repository -public interface PipelineRecentUseDao { - - /** - * 新增记录 - * - * @param projectId 项目ID - * @param userId 用户ID - * @param pipelineId 流水线ID - * @return 影响的行数 - */ - int add( - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取最近使用的流水线ID列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param limit 限制数量 - * @return 流水线ID列表 - */ - List listRecentPipelineIds( - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("limit") Integer limit - ); - - /** - * 获取最近使用时间列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param limit 限制数量 - * @return 使用时间列表 - */ - List listLastUseTimes( - - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("limit") Integer limit - ); - - /** - * 删除过期记录 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param endTime 结束时间 - * @return 影响的行数 - */ - int deleteExpire( - - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("endTime") LocalDateTime endTime - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineResourceDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineResourceDao.java deleted file mode 100644 index c030c783..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineResourceDao.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineResourceVersion; -import cd.casic.ci.process.api.process.pojo.setting.PipelineModelVersion; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -/** - * 流水线资源数据访问接口 - */ -@Mapper -@Repository -public interface PipelineResourceDao { - - /** - * 创建流水线资源 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param creator 创建者 - * @param version 版本号 - * @param versionName 版本名称 - * @param model 流水线模型 - * @param yamlStr YAML字符串 - * @param yamlVersion YAML版本 - * @param versionNum 版本序号 - * @param pipelineVersion 流水线版本 - * @param triggerVersion 触发器版本 - * @param settingVersion 设置版本 - */ - void create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("creator") String creator, - @Param("version") int version, - @Param("versionName") String versionName, - @Param("model") Model model, - @Param("yamlStr") String yamlStr, - @Param("yamlVersion") String yamlVersion, - @Param("versionNum") Integer versionNum, - @Param("pipelineVersion") Integer pipelineVersion, - @Param("triggerVersion") Integer triggerVersion, - @Param("settingVersion") Integer settingVersion - ); - - /** - * 更新发布版本 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param version 版本号 - * @param versionName 版本名称 - * @param model 流水线模型 - * @param yamlStr YAML字符串 - * @param yamlVersion YAML版本 - * @param versionNum 版本序号 - * @param pipelineVersion 流水线版本 - * @param triggerVersion 触发器版本 - * @param settingVersion 设置版本 - */ - void updateReleaseVersion( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("version") int version, - @Param("versionName") String versionName, - @Param("model") Model model, - @Param("yamlStr") String yamlStr, - @Param("yamlVersion") String yamlVersion, - @Param("versionNum") Integer versionNum, - @Param("pipelineVersion") Integer pipelineVersion, - @Param("triggerVersion") Integer triggerVersion, - @Param("settingVersion") Integer settingVersion - ); - - /** - * 获取发布版本资源 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 流水线资源版本 - */ - PipelineResourceVersion getReleaseVersionResource( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取最新版本模型字符串 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 模型字符串 - */ - String getLatestVersionModelString( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取指定版本模型字符串 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param version 版本号 - * @return 模型字符串 - */ - String getVersionModelString( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("version") Integer version - ); - - /** - * 获取最新模型资源列表 - * - * @param pipelineIds 流水线ID集合 - * @param projectId 项目ID - * @return 流水线ID、版本号、模型字符串 - */ - Map> listLatestModelResource( - @Param("pipelineIds") Set pipelineIds, - @Param("projectId") String projectId - ); - - /** - * 删除所有版本 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 影响的行数 - */ - int deleteAllVersion( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 更新流水线模型 - * - * @param userId 用户ID - * @param pipelineModelVersion 流水线模型版本 - */ - void updatePipelineModel( - @Param("userId") String userId, - @Param("pipelineModelVersion") PipelineModelVersion pipelineModelVersion - ); - - /** - * 更新设置版本 - * - * @param userId 用户ID - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param settingVersion 设置版本 - * @return 版本号 - */ - Integer updateSettingVersion( - @Param("userId") String userId, - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("settingVersion") int settingVersion - ); - - /** - * 获取模型字符串列表 - * - * @param projectId 项目ID - * @param pipelineIds 流水线ID集合 - * @return 流水线ID到模型字符串的映射 - */ - Map listModelString( - @Param("projectId") String projectId, - @Param("pipelineIds") Collection pipelineIds - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineSettingDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineSettingDao.java deleted file mode 100644 index 694e3b72..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineSettingDao.java +++ /dev/null @@ -1,97 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.pojo.PipelineAsCodeSettings; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.process.process.dataObject.TPipelineSettingRecord; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Set; - -public interface PipelineSettingDao { - int saveSetting( - @Param("setting") PipelineSetting setting, - @Param("isTemplate") boolean isTemplate - ); - - PipelineSetting getSetting( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - PipelineAsCodeSettings getPipelineAsCodeSettings( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - List getSettings( - - @Param("pipelineIds") Set pipelineIds, - @Param("projectId") String projectId - ); - - void batchUpdate( - - @Param("tPipelineSettingRecords") List tPipelineSettingRecords - ); -// TODO -// Result> getSimpleSettings( -// -// @Param("pipelineIds") Set pipelineIds, -// @Param("projectId") String projectId -// ); - - List getSetting( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("pipelineId") String pipelineId, - @Param("isTemplate") boolean isTemplate - ); - - void updateSettingName( - - @Param("pipelineIdList") List pipelineIdList, - @Param("name") String name - ); - - PipelineSetting updateSetting( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("name") String name, - @Param("desc") String desc - ); -//TODO -// Record1 getSettingByName( -// -// @Param("name") String name, -// @Param("projectId") String projectId, -// @Param("pipelineId") String pipelineId, -// @Param("isTemplate") boolean isTemplate -// ); - - int delete( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int updateMaxConRunningQueueSize( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("maxConRunningQueueSize") int maxConRunningQueueSize - ); - - int updatePipelineAsCodeSettings( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("pipelineAsCodeSettings") PipelineAsCodeSettings pipelineAsCodeSettings - ); - - List getNonInheritedPipelineIds( - - @Param("projectId") String projectId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineStageTagDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineStageTagDao.java deleted file mode 100644 index b1a5db23..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineStageTagDao.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.api.process.pojo.PipelineStageTag; -import cd.casic.ci.process.process.dataObject.TPipelineStageTagRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线阶段标签Mapper接口 - */ -@Repository -public interface PipelineStageTagDao { - - /** - * 添加阶段标签 - * - - * @param id 标签ID - * @param stageTagName 阶段标签名称 - * @param weight 权重 - * @return 影响的行数 - */ - int add( - @Param("id") String id, - @Param("stageTagName") String stageTagName, - @Param("weight") Integer weight - ); - - /** - * 删除阶段标签 - * - - * @param id 标签ID - * @return 影响的行数 - */ - int delete( - @Param("id") String id - ); - - /** - * 更新阶段标签 - * - - * @param id 标签ID - * @param stageTagName 阶段标签名称 - * @param weight 权重 - * @return 影响的行数 - */ - int update( - - @Param("id") String id, - @Param("stageTagName") String stageTagName, - @Param("weight") Integer weight - ); - - /** - * 获取阶段标签 - * - - * @param id 标签ID - * @return 阶段标签记录 - */ - TPipelineStageTagRecord getStageTag( - - @Param("id") String id - ); - - /** - * 获取所有阶段标签 - * - * @return 所有阶段标签记录 - */ - List getAllStageTag(); - - /** - * 获取默认阶段标签 - * - * @return 默认阶段标签记录 - */ - TPipelineStageTagRecord getDefaultStageTag(); - - /** - * 根据名称或权重统计标签数量 - * - - * @param stageTagName 阶段标签名称 - * @param weight 权重 - * @return 标签数量 - */ - Integer countByNameOrWeight( - @Param("stageTagName") String stageTagName, - @Param("weight") Integer weight - ); - static PipelineStageTag convert(TPipelineStageTagRecord record, Boolean defaultFlag){ - return new PipelineStageTag( - record.getId(), - record.getStageTagName(), - record.getWeight(), - defaultFlag, - record.getCreateTime().getTime(), - record.getUpdateTime().getTime() - ); - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlSyncDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlSyncDao.java deleted file mode 100644 index 109137db..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlSyncDao.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.process.dataObject.TPipelineYamlSyncRecord; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface PipelineYamlSyncDao { - /** - * 创建YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return YAML同步记录ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 更新YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 删除YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取YAML同步记录列表 * * @param projectId 项目ID * @return YAML同步记录列表 - */ - List list(@Param("projectId") String projectId); - - /** - * 获取YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return YAML同步记录 - */ - TPipelineYamlSyncRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlViewDao.java deleted file mode 100644 index 1c7520df..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlViewDao.java +++ /dev/null @@ -1,41 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.process.dataObject.TPipelineYamlViewRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线YAML视图 Dao 接口 - */ -@Mapper -@Repository -public interface PipelineYamlViewDao { - /** - * 创建YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return YAML视图ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 更新YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 删除YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取YAML视图列表 * * @param projectId 项目ID * @return YAML视图列表 - */ - List list(@Param("projectId") String projectId); - - /** - * 获取YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return YAML视图 - */ - TPipelineYamlViewRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/SubPipelineRefDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/SubPipelineRefDao.java deleted file mode 100644 index 35db8577..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/SubPipelineRefDao.java +++ /dev/null @@ -1,43 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.api.process.pojo.pipeline.SubPipelineRef; -import org.apache.commons.lang3.tuple.Triple; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.Set; - -/** - * 子流水线引用 Dao 接口 TODO 不知道是哪个�? - */ -@Mapper -@Repository -//TODO 不知道哪个表 -public interface SubPipelineRefDao { - void batchAdd( - @Param("subPipelineRefList") Collection subPipelineRefList - ); - -// Result list( -// @Param("projectId") String projectId, -// @Param("pipelineId") String pipelineId -// ); - - int deleteAll( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("taskId") String taskId - ); - - void batchDelete( - @Param("infos") Set> infos - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildDetailDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildDetailDao.java deleted file mode 100644 index 4d68d7c5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildDetailDao.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.process.process.dataObject.TPipelineBuildDetailRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; - -/** - * 构建详情 Mapper 接口 - */ -@Mapper -@Repository -public interface BuildDetailDao { - - /** - * 创建构建详情 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param startUser 启动用户 - * @param startType 启动类型 - * @param buildNum 构建编号 - * @param model 模型 - * @param buildStatus 构建状态 - */ - void create( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("startUser") String startUser, - @Param("startType") StartType startType, - @Param("buildNum") Integer buildNum, - @Param("model") String model, - @Param("buildStatus") BuildStatus buildStatus - ); - - /** - * 更新构建取消用户 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param cancelUser 取消用户 - */ - void updateBuildCancelUser( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("cancelUser") String cancelUser - ); - - /** - * 更新构建详情 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param model 模型 - * @param buildStatus 构建状态 - * @param cancelUser 取消用户 - * @return 更新数量 - */ - int update( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("model") String model, - @Param("buildStatus") BuildStatus buildStatus, - @Param("cancelUser") String cancelUser - ); - - /** - * 更新构建状态 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param buildStatus 构建状态 - * @param startTime 开始时间 - * @param endTime 结束时间 - */ - void updateStatus( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("buildStatus") BuildStatus buildStatus, - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime - ); - - /** - * 获取构建详情 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @return 构建详情记录 - */ - TPipelineBuildDetailRecord get( - @Param("projectId") String projectId, - @Param("buildId") String buildId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordContainerDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordContainerDao.java deleted file mode 100644 index 078dda96..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordContainerDao.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordContainer; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 构建记录容器 Mapper 接口 - */ -@Mapper -@Repository -public interface BuildRecordContainerDao { - - /** - * 批量保存构建记录容器 - * - * @param records 构建记录容器列表 - */ - void batchSave(@Param("records") List records); - - /** - * 更新构建记录容器 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @param executeCount 执行次数 - * @param containerVar 容器变量 - * @param buildStatus 构建状态 - * @param startTime 开始时间 - * @param endTime 结束时间 - * @param timestamps 时间戳 - */ - void updateRecord( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("containerId") String containerId, - @Param("executeCount") Integer executeCount, - @Param("containerVar") Map containerVar, - @Param("buildStatus") BuildStatus buildStatus, - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime, - @Param("timestamps") Map timestamps - ); - - /** - * 重试时清空结束时间 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @param executeCount 执行次数 - */ - void flushEndTimeWhenRetry( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("containerId") String containerId, - @Param("executeCount") Integer executeCount - ); - - /** - * 获取构建记录容器 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @param executeCount 执行次数 - * @return 构建记录容器 - */ - BuildRecordContainer getRecord( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("containerId") String containerId, - @Param("executeCount") Integer executeCount - ); - - /** - * 获取构建记录容器列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @param stageId 阶段ID - * @param matrixGroupId 矩阵组ID - * @param buildStatusSet 构建状态集合 - * @return 构建记录容器列表 - */ - List getRecords( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount, - @Param("stageId") String stageId, - @Param("matrixGroupId") String matrixGroupId, - @Param("buildStatusSet") Set buildStatusSet - ); - - /** - * 更新构建记录容器状态 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @param buildStatus 构建状态 - * @param stageId 阶段ID - */ - void updateRecordStatus( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount, - @Param("buildStatus") BuildStatus buildStatus, - @Param("stageId") String stageId - ); - - /** - * 获取最新的普通构建记录容器列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @param stageId 阶段ID - * @return 构建记录容器列表 - */ - List getLatestNormalRecords( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount, - @Param("stageId") String stageId - ); - - /** - * 获取最新的矩阵构建记录容器列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @return 构建记录容器列表 - */ - List getLatestMatrixRecords( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordModelDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordModelDao.java deleted file mode 100644 index f51ab62b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordModelDao.java +++ /dev/null @@ -1,57 +0,0 @@ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.BuildRecordInfo; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordModel; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -/** - * 构建记录模型Mapper接口 - */ -@Mapper -@Repository -public interface BuildRecordModelDao { - /** - * 创建构建记录模型 * * @param record 记录 * @return 影响行数 - */ - int createBuildRecordModel(@Param("record") BuildRecordModel record); - - /** - * 更新构建记录模型 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatus 构建状�? * @param modelVar 模型变量 * @param startTime 开始时�? * @param endTime 结束时间 * @param errorInfoList 错误信息列表 * @param cancelUser 取消用户 * @param timestamps 时间�? * @return 影响行数 - */ - int updateBuildRecordModel(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("buildStatus") BuildStatus buildStatus, @Param("modelVar") Map modelVar, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("errorInfoList") List errorInfoList, @Param("cancelUser") String cancelUser, @Param("timestamps") Map timestamps); - - /** - * 更新构建记录模型状�? * * @param projectId 项目ID * @param buildId 构建ID * @param buildStatus 构建状�? * @param executeCount 执行次数 * @return 影响行数 - */ - int updateBuildRecordModelStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("buildStatus") BuildStatus buildStatus, @Param("executeCount") int executeCount); - - /** - * 获取构建记录模型 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @return 记录 - */ - BuildRecordModel getBuildRecordModel(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount); - - /** - * 获取构建记录信息列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @return 记录信息列表 - */ - List getBuildRecordInfoList(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId); - - /** - * 更新构建取消用户 * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param cancelUser 取消用户 * @return 影响行数 - */ - int updateBuildCancelUser(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("cancelUser") String cancelUser); - - /** - * 获取构建取消用户 * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @return 取消用户 - */ - String getBuildCancelUser(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordStageDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordStageDao.java deleted file mode 100644 index 23c251f6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordStageDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordStage; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 构建记录阶段 Dao 接口 - */ -@Repository -public interface BuildRecordStageDao { - /** - * 批量保存记录 * * @param records 记录列表 * @return 影响的行�? - */ - int batchSave(@Param("records") List records); - - /** - * 更新记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param stageId 阶段ID * @param executeCount 执行次数 * @param stageVar 阶段变量 * @param buildStatus 构建状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param timestamps 时间�? * @return 影响的行�? - */ - int updateRecord(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("stageId") String stageId, @Param("executeCount") int executeCount, @Param("stageVar") Map stageVar, @Param("buildStatus") BuildStatus buildStatus, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("timestamps") Map timestamps); - - /** - * 获取记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatusSet 构建状态集�? * @return 构建记录阶段列表 - */ - List getRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("buildStatusSet") Set buildStatusSet); - - /** - * 获取最新的记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @return 构建记录阶段列表 - */ - List getLatestRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordTaskDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordTaskDao.java deleted file mode 100644 index 4f4a35f0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordTaskDao.java +++ /dev/null @@ -1,67 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordTask; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 构建记录任务 Dao 接口 - */ -@Mapper -@Repository -public interface BuildRecordTaskDao { - /** - * 批量保存构建记录任务 * * @param records 构建记录任务列表 - */ - void batchSave(@Param("records") List records); - - /** - * 更新构建记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @param taskVar 任务变量 * @param buildStatus 构建状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param timestamps 时间�? - */ - void updateRecord(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount, @Param("taskVar") Map taskVar, @Param("buildStatus") BuildStatus buildStatus, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("timestamps") Map timestamps); - - /** - * 更新构建记录状�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatus 构建状�? * @param stageId 阶段ID * @param containerId 容器ID - */ - void updateRecordStatus(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("buildStatus") BuildStatus buildStatus, @Param("stageId") String stageId, @Param("containerId") String containerId); - - /** - * 获取构建记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param containerId 容器ID * @param buildStatusSet 构建状态集�? * @return 构建记录任务列表 - */ - List getRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("containerId") String containerId, @Param("buildStatusSet") Set buildStatusSet); - - /** - * 获取最新的普通构建记录列�? * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param matrixContainerIds 矩阵容器ID列表 * @param stageId 阶段ID * @return 构建记录任务列表 - */ - List getLatestNormalRecords(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("matrixContainerIds") List matrixContainerIds, @Param("stageId") String stageId); - - /** - * 获取最新的矩阵构建记录列表 * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param matrixContainerIds 矩阵容器ID列表 * @return 构建记录任务列表 - */ - List getLatestMatrixRecords(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("matrixContainerIds") List matrixContainerIds); - - /** - * 获取构建记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @return 构建记录任务 - */ - BuildRecordTask getRecord(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount); - - /** - * 更新异步状�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @param asyncStatus 异步状�? - */ - void updateAsyncStatus(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount, @Param("asyncStatus") String asyncStatus); - - /** - * 重试时清空结束时�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 - */ - void flushEndTimeWhenRetry(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildContainerDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildContainerDao.java deleted file mode 100644 index 7b4f64cd..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildContainerDao.java +++ /dev/null @@ -1,97 +0,0 @@ -package cd.casic.ci.process.process.dal.record; - - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildContainer; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildContainerControlOption; -import org.apache.ibatis.annotations.Param; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -public interface PipelineBuildContainerDao { - void create( - @Param("buildContainer") PipelineBuildContainer buildContainer - ); - - void batchSave( - @Param("containerList") Collection containerList - ); - - void batchUpdate( - - @Param("containerList") List containerList - ); - - PipelineBuildContainer getByContainerId( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containerId") String containerId - ); - - int updateStatus( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containerId") String containerId, - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime, - @Param("controlOption") PipelineBuildContainerControlOption controlOption, - @Param("buildStatus") BuildStatus buildStatus - ); - - int updateControlOption( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containerId") String containerId, - @Param("controlOption") PipelineBuildContainerControlOption controlOption - ); - - List listByBuildId( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containsMatrix") Boolean containsMatrix, - @Param("statusSet") Set statusSet - ); - - int countStageContainers( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("onlyMatrixGroup") boolean onlyMatrixGroup - ); - - List listByMatrixGroupId( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("matrixGroupId") String matrixGroupId - ); - - Collection listBuildContainerIdsInMatrixGroup( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("matrixGroupId") String matrixGroupId, - @Param("stageId") String stageId - ); - - int deleteBuildContainerInMatrixGroup( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("matrixGroupId") String matrixGroupId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildStageDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildStageDao.java deleted file mode 100644 index 670802b2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildStageDao.java +++ /dev/null @@ -1,56 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.process.api.engine.pojo.PipelineBuildStage; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线构建阶�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineBuildStageDao { - /** - * 创建流水线构建阶�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param stageId 阶段ID * @param stageName 阶段名称 * @param status 状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param controlOption 控制选项 * @return 影响行数 - */ - int createPipelineBuildStage(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("stageId") String stageId, @Param("stageName") String stageName, @Param("status") String status, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("controlOption") String controlOption); - - /** - * 批量保存流水线构建阶�? * * @param stages 阶段列表 * @return 影响行数 - */ - int batchSavePipelineBuildStages(@Param("stages") List stages); - - /** - * 获取流水线构建阶�? * * @param projectId 项目ID * @param buildId 构建ID * @param stageId 阶段ID * @return 构建阶段 - */ - PipelineBuildStage getPipelineBuildStage(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("stageId") String stageId); - - /** - * 获取流水线构建阶段列�? * * @param projectId 项目ID * @param buildId 构建ID * @param status 状�? * @return 构建阶段列表 - */ - List listPipelineBuildStages(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("status") String status); - - /** - * 删除流水线构建阶�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数 - */ - int deletePipelineBuildStages(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 更新流水线构建阶段状�? * * @param projectId 项目ID * @param buildId 构建ID * @param stageId 阶段ID * @param status 状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param controlOption 控制选项 * @return 影响行数 - */ - int updatePipelineBuildStageStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("stageId") String stageId, @Param("status") String status, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("controlOption") String controlOption); - - /** - * 获取最大阶�? * * @param projectId 项目ID * @param buildId 构建ID * @return 最大阶�? - */ - PipelineBuildStage getMaxPipelineBuildStage(@Param("projectId") String projectId, @Param("buildId") String buildId); - - /** - * 根据状态获取流水线构建阶段 * * @param projectId 项目ID * @param buildId 构建ID * @param statuses 状态列�? * @return 构建阶段 - */ - PipelineBuildStage getPipelineBuildStageByStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("statuses") List statuses); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildSummaryDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildSummaryDao.java deleted file mode 100644 index 25f9f191..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildSummaryDao.java +++ /dev/null @@ -1,159 +0,0 @@ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import cd.casic.ci.process.api.process.pojo.PipelineCollation; -import cd.casic.ci.process.api.process.pojo.PipelineSortType; -import cd.casic.ci.process.process.dataObject.TPipelineBuildSummaryRecord; -import cd.casic.ci.process.process.dataObject.TPipelineInfoRecord; -import cd.casic.ci.process.process.pojo.LatestRunningBuild; -import cd.casic.ci.process.process.pojo.PipelineFilterParam; -import org.apache.ibatis.annotations.Param; - -import java.util.Collection; -import java.util.List; -import java.util.Set; - -public interface PipelineBuildSummaryDao { - void create( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildNo") BuildNo buildNo - ); - - void delete( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - TPipelineBuildSummaryRecord get( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - TPipelineBuildSummaryRecord getSummaries( - - @Param("projectId") String projectId, - @Param("pipelineIds") Set pipelineIds - ); - - void resetDebugInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("debugBuildNo") int debugBuildNo - ); - - void updateBuildNo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildNo") int buildNo, - @Param("debug") boolean debug - ); - - Integer getBuildNo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("debug") boolean debug - ); - - int updateBuildNum( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("debug") boolean debug, - @Param("buildNum") int buildNum, - @Param("buildNumAlias") String buildNumAlias - ); - - long listPipelineInfoBuildSummaryCount( - - @Param("projectId") String projectId, - @Param("channelCode") ChannelCode channelCode, - @Param("pipelineIds") Collection pipelineIds, - @Param("viewId") String viewId, - @Param("favorPipelines") List favorPipelines, - @Param("authPipelines") List authPipelines, - @Param("pipelineFilterParamList") List pipelineFilterParamList, - @Param("permissionFlag") Boolean permissionFlag, - @Param("includeDelete") Boolean includeDelete, - @Param("userId") String userId - ); - - TPipelineInfoRecord listPipelineInfoBuildSummary( - - @Param("projectId") String projectId, - @Param("channelCode") ChannelCode channelCode, - @Param("sortType") PipelineSortType sortType, - @Param("pipelineIds") Collection pipelineIds, - @Param("favorPipelines") List favorPipelines, - @Param("authPipelines") List authPipelines, - @Param("viewId") String viewId, - @Param("pipelineFilterParamList") List pipelineFilterParamList, - @Param("permissionFlag") Boolean permissionFlag, - @Param("page") Integer page, - @Param("pageSize") Integer pageSize, - @Param("pageOffsetNum") Integer pageOffsetNum, - @Param("includeDelete") Boolean includeDelete, - @Param("collation") PipelineCollation collation, - @Param("userId") String userId - ); - - void updateQueueCount( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("queueIncrement") int queueIncrement - ); - - int startLatestRunningBuild( - - @Param("latestRunningBuild") LatestRunningBuild latestRunningBuild, - @Param("executeCount") int executeCount, - @Param("debug") boolean debug - ); - - void updateCurrentBuildTask( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("currentTaskId") String currentTaskId, - @Param("currentTaskName") String currentTaskName - ); - - void finishLatestRunningBuild( - @Param("latestRunningBuild") LatestRunningBuild latestRunningBuild, - @Param("isStageFinish") boolean isStageFinish, - @Param("debug") boolean debug - ); - - void updateRunningCount( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("runningIncrement") int runningIncrement, - @Param("debug") boolean debug - ); - - TPipelineBuildSummaryRecord listSummaryByPipelineIds( - - @Param("pipelineIds") Collection pipelineIds, - @Param("projectId") String projectId - ); - - boolean fixPipelineSummaryCount( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("finishCount") int finishCount, - @Param("runningCount") Integer runningCount, - @Param("queueCount") Integer queueCount - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildTaskDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildTaskDao.java deleted file mode 100644 index 7ce2f443..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildTaskDao.java +++ /dev/null @@ -1,85 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildTask; -import cd.casic.ci.process.process.pojo.UpdateTaskInfo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** - * 流水线构建任�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineBuildTaskDao { - /** - * 创建流水线构建任�? * * @param buildTask 构建任务信息 - */ - void create(@Param("buildTask") PipelineBuildTask buildTask); - - /** - * 批量保存流水线构建任�? * * @param taskList 构建任务列表 - */ - void batchSave(@Param("taskList") Collection taskList); - - /** - * 批量更新流水线构建任�? * * @param taskList 构建任务列表 - */ - void batchUpdate(@Param("taskList") List taskList); - - /** - * 获取流水线构建任�? * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @param stepId 步骤ID * @param executeCount 执行次数 * @return 构建任务信息 - */ - PipelineBuildTask get(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("stepId") String stepId, @Param("executeCount") Integer executeCount); - - /** - * 获取任务状�? * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @return 任务状�? - */ - Integer getTaskStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId); - - /** - * 根据构建ID获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @return 任务列表 - */ - Collection getByBuildId(@Param("projectId") String projectId, @Param("buildId") String buildId); - - /** - * 根据条件获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @param containerId 容器ID * @param statusSet 状态集�? * @return 任务列表 - */ - List getTasksInCondition(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("containerId") String containerId, @Param("statusSet") Collection statusSet); - - /** - * 删除构建任务 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param containerId 容器ID * @return 删除数量 - */ - int deleteBuildTasksByContainerSeqId(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("containerId") String containerId); - - /** - * 更新子构建ID * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @param subBuildId 子构建ID * @param subProjectId 子项目ID * @return 更新数量 - */ - int updateSubBuildId(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("subBuildId") String subBuildId, @Param("subProjectId") String subProjectId); - - /** - * 更新任务信息 * * @param updateTaskInfo 更新任务信息 - */ - void updateTaskInfo(@Param("updateTaskInfo") UpdateTaskInfo updateTaskInfo); - - /** - * 根据构建ID统计任务数量 * * @param projectId 项目ID * @param buildIds 构建ID列表 * @return 统计结果 - */ - List> countGroupByBuildId(@Param("projectId") String projectId, @Param("buildIds") Collection buildIds); - - /** - * 更新任务参数 * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @param taskParam 任务参数 * @return 更新数量 - */ - int updateTaskParam(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("taskParam") String taskParam); - - /** - * 获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @return 任务列表 - */ - List> list(@Param("projectId") String projectId, @Param("buildId") String buildId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildVarDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildVarDao.java deleted file mode 100644 index f7ca53a6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildVarDao.java +++ /dev/null @@ -1,68 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 流水线构建变�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineBuildVarDao { - /** - * 保存构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param name 变量�? * @param value 变量�? * @param readOnly 是否只读 - */ - void save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("name") String name, @Param("value") Object value, @Param("readOnly") Boolean readOnly); - - /** - * 更新构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param name 变量�? * @param value 变量�? * @param valueType 变量类型 * @param rewriteReadOnly 是否重写只读 * @return 更新数量 - */ - int update(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("name") String name, @Param("value") Object value, @Param("valueType") String valueType, @Param("rewriteReadOnly") Boolean rewriteReadOnly); - - /** - * 获取构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param keys 变量名集�? * @return 变量映射 - */ - Map getVars(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("keys") Set keys); - - /** - * 获取带类型的构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param key 变量�? * @return 构建参数列表 - */ - List getVarsWithType(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("key") String key); - - /** - * 删除构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param varName 变量�? * @param readOnly 是否只读 * @return 删除数量 - */ - int deleteBuildVar(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("varName") String varName, @Param("readOnly") Boolean readOnly); - - /** - * 批量保存构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param variables 构建参数列表 - */ - void batchSave(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("variables") List variables); - - /** - * 批量更新构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param variables 构建参数列表 - */ - void batchUpdate(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("variables") List variables); - - /** - * 删除构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID - */ - void deleteBuildVars(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId); - - /** - * 删除流水线构建变�? * * @param projectId 项目ID * @param pipelineId 流水线ID - */ - void deletePipelineBuildVar(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 根据关键字模糊查询变�? * * @param projectId 项目ID * @param buildId 构建ID * @param readOnly 是否只读 * @param likeStr 模糊匹配字符�? * @return 变量值集�? - */ - Set fetchVarByLikeKey(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("readOnly") Boolean readOnly, @Param("likeStr") String likeStr); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/report/ReportDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/report/ReportDao.java deleted file mode 100644 index 67987377..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/report/ReportDao.java +++ /dev/null @@ -1,42 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.report; - -import cd.casic.ci.process.api.process.pojo.Report; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -/** - * 报告 Dao 接口 - */ -@Mapper -@Repository -public interface ReportDao { - /** - * 获取原子信息 * * @param buildId 构建ID * @param taskId 任务ID * @return 原子信息 - */ - Map getAtomInfo(@Param("buildId") String buildId, @Param("taskId") String taskId); - - /** - * 创建报告 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param elementId 元素ID * @param indexFile 索引文件 * @param name 名称 * @param type 类型 * @param atomCode 原子代码 * @param taskName 任务名称 * @param id 记录ID * @return 记录ID - */ - long createReport(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("elementId") String elementId, @Param("indexFile") String indexFile, @Param("name") String name, @Param("type") String type, @Param("atomCode") String atomCode, @Param("taskName") String taskName, @Param("id") Long id); - - /** - * 获取报告 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param elementId 元素ID * @return 报告 - */ - Report getReport(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("elementId") String elementId); - - /** - * 获取报告列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @return 报告列表 - */ - List getReportList(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId); - - /** - * 删除报告 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param elementId 元素ID * @return 影响的行�? - */ - int deleteReport(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("elementId") String elementId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingDao.java deleted file mode 100644 index 346f09ed..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingDao.java +++ /dev/null @@ -1,69 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.setting; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.process.process.dataObject.TPipelineSettingRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线设�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineSettingDao { - /** - * 获取流水线设�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 流水线设�? - */ - PipelineSetting getSetting(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取流水线设�? * * @param projectId 项目ID * @param name 设置名称 * @param pipelineId 流水线ID * @param isTemplate 是否模板 * @return 流水线设置列�? - */ - List getSetting(@Param("projectId") String projectId, @Param("name") String name, @Param("pipelineId") String pipelineId, @Param("isTemplate") Boolean isTemplate); - - /** - * 获取流水线设置列�? * * @param pipelineIds 流水线ID列表 * @param projectId 项目ID * @return 流水线设置列�? - */ - List getSettings(@Param("pipelineIds") Set pipelineIds, @Param("projectId") String projectId); - - /** - * 获取简单的流水线设�? * * @param pipelineIds 流水线ID列表 * @param projectId 项目ID * @return 简单的流水线设�? - */ - // TODO -// Result> getSimpleSettings(@Param("pipelineIds") Set pipelineIds, @Param("projectId") String projectId); - - /** - * 获取流水线设置数�? * * @param name 设置名称 * @param projectId 项目ID * @param pipelineId 流水线ID * @param isTemplate 是否模板 * @return 设置数量 - */ - Integer getSettingCount(@Param("name") String name, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("isTemplate") Boolean isTemplate); - - /** - * 创建流水线设�? * * @param setting 流水线设�? * @return 影响行数 - */ - int create(PipelineSetting setting); - - /** - * 更新流水线设�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param name 设置名称 * @param desc 描述 * @return 更新后的流水线设�? - */ - PipelineSetting updateSetting(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("name") String name, @Param("desc") String desc); - - /** - * 更新模板引用的设置名�? * * @param pipelineIdList 流水线ID列表 * @param name 设置名称 - */ - void updateSettingName(@Param("pipelineIdList") List pipelineIdList, @Param("name") String name); - - /** - * 批量更新流水线设�? * * @param records 流水线设置记录列�? - */ - void batchUpdate(List records); - - /** - * 删除流水线设�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数 - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingVersionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingVersionDao.java deleted file mode 100644 index a0fecda2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingVersionDao.java +++ /dev/null @@ -1,42 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.setting; - -import cd.casic.ci.process.api.process.pojo.setting.PipelineSettingVersion; -import cd.casic.ci.process.process.dataObject.TPipelineSettingVersionRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线设置版�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineSettingVersionDao { - /** - * 获取流水线设置版�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本�? * @return 流水线设置版�? - */ - PipelineSettingVersion getSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") Integer version); - - /** - * 获取最新的流水线设置版�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 最新的流水线设置版�? - */ - PipelineSettingVersion getLatestSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 创建流水线设置版�? * * @param setting 流水线设�? * @return 影响行数 - */ - int create(PipelineSettingVersion setting); - - /** - * 更新流水线设置版�? * * @param setting 流水线设�? * @return 影响行数 - */ - int update(PipelineSettingVersion setting); - - /** - * 批量更新流水线设置版�? * * @param records 流水线设置版本记录列�? - */ - void batchUpdate(List records); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineFavorDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineFavorDao.java deleted file mode 100644 index e0e82479..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineFavorDao.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.process.process.dataObject.TPipelineFavorRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 用户收藏流水线Mapper接口 - */ -@Repository -public interface PipelineFavorDao { - /** - * 保存用户收藏 * * @param userId 用户ID * @param projectId 项目ID * @param pipelineId 流水线ID * @param id 主键ID * @return 影响的行�? - */ - int save(@Param("userId") String userId, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("id") Long id); - - /** - * 删除用户收藏 * * @param userId 用户ID * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int delete(@Param("userId") String userId, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 删除流水线的所有用户收�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int deleteAllUserFavorByPipeline(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取用户收藏的流水线列表 * * @param userId 用户ID * @param projectId 项目ID * @return 收藏记录列表 - */ - TPipelineFavorRecord list(@Param("userId") String userId, @Param("projectId") String projectId); - - /** - * 获取用户所有收藏的流水线列�? * * @param userId 用户ID * @return 收藏记录列表 - */ - TPipelineFavorRecord listByUserId(@Param("userId") String userId); - - /** - * 统计用户收藏的流水线数量 * * @param projectId 项目ID * @param userId 用户ID * @return 收藏数量 - */ - int countByUserId(@Param("projectId") String projectId, @Param("userId") String userId); - - /** - * 获取用户收藏的指定流水线 * * @param userId 用户ID * @param projectId 项目ID * @param pipelineId 流水线ID * @return 收藏记录列表 - */ - TPipelineFavorRecord listByPipelineId(@Param("userId") String userId, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取最大ID * * @return 最大ID - */ - long getMaxId(); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineSettingVersionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineSettingVersionDao.java deleted file mode 100644 index 53b9704e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineSettingVersionDao.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.process.api.process.pojo.setting.PipelineSettingVersion; -import cd.casic.ci.process.process.dataObject.TPipelineSettingVersionRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线设置版本Mapper接口 - */ -@Repository -public interface PipelineSettingVersionDao { - /** - * 保存流水线设置版�? * @param dslContext DSL上下�? * @param setting 流水线设�? * @param version 版本�? * @param isTemplate 是否为模�? * @param id ID * @return 影响行数 - */ - int saveSetting(@Param("setting") PipelineSetting setting, @Param("version") int version, @Param("isTemplate") boolean isTemplate, @Param("id") Long id); - - /** - * 获取流水线设置版�? * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本�? * @return 流水线设置版�? - */ - PipelineSettingVersion getSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") int version); - - /** - * 获取最新的流水线设置版�? * @param projectId 项目ID * @param pipelineId 流水线ID * @return 最新的流水线设置版�? - */ - PipelineSettingVersion getLatestSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 根据流水线ID列表获取设置版本 * @param pipelineIds 流水线ID列表 * @return 流水线设置版本列�? - */ - List getSettingByPipelineIds(@Param("pipelineIds") List pipelineIds); - - /** - * 批量更新流水线设置版�? * @param records 流水线设置版本记录列�? - */ - void batchUpdate(@Param("records") List records); - - /** - * 删除所有版本的流水线设�? * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数 - */ - int deleteAllVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 删除指定版本的流水线设置 * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本�? * @return 影响行数 - */ - int deleteByVer(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") int version); - - /** - * 删除早期版本的流水线设置 * @param projectId 项目ID * @param pipelineId 流水线ID * @param currentVersion 当前版本 * @param maxPipelineResNum 最大流水线资源�? * @return 影响行数 - */ - int deleteEarlyVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("currentVersion") int currentVersion, @Param("maxPipelineResNum") int maxPipelineResNum); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceBaseDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceBaseDao.java deleted file mode 100644 index 0d0b6eaa..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceBaseDao.java +++ /dev/null @@ -1,41 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.process.process.dataObject.TTemplateInstanceBaseRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 模板实例基础 Dao 接口 - */ -@Mapper -@Repository -public interface TemplateInstanceBaseDao { - /** - * 创建模板实例基础记录 * * @param projectId 项目ID * @param templateId 模板ID * @param name 名称 * @param userId 用户ID * @return 模板实例基础记录ID - */ - long createTemplateInstanceBase(@Param("projectId") String projectId, @Param("templateId") String templateId, @Param("name") String name, @Param("userId") String userId); - - /** - * 更新模板实例基础记录 * * @param instanceId 实例ID * @param name 名称 * @param userId 用户ID - */ - void updateTemplateInstanceBase(@Param("instanceId") String instanceId, @Param("name") String name, @Param("userId") String userId); - - /** - * 删除模板实例基础记录 * * @param instanceId 实例ID - */ - void deleteTemplateInstanceBase(@Param("instanceId") String instanceId); - - /** - * 获取模板实例基础记录列表 * * @param projectId 项目ID * @return 模板实例基础记录列表 - */ - List getTemplateInstanceBaseList(@Param("projectId") String projectId); - - /** - * 获取模板实例基础记录 * * @param instanceId 实例ID * @return 模板实例基础记录 - */ - TTemplateInstanceBaseRecord getTemplateInstanceBase(@Param("instanceId") String instanceId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceItemDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceItemDao.java deleted file mode 100644 index eb44356f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceItemDao.java +++ /dev/null @@ -1,47 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.process.api.process.pojo.template.TemplateInstanceUpdate; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 模板实例�?Dao 接口 - */ -@Mapper -@Repository -public interface TemplateInstanceItemDao { - /** - * 创建模板实例�? * * @param projectId 项目ID * @param baseId 基础ID * @param instances 实例列表 * @param status 状�? * @param userId 用户ID - */ - void createTemplateInstanceItem(@Param("projectId") String projectId, @Param("baseId") String baseId, @Param("instances") List instances, @Param("status") String status, @Param("userId") String userId); - - /** - * 获取模板实例项列�? * * @param status 状�? * @param descFlag 是否降序 * @param page 页码 * @param pageSize 每页大小 * @return 模板实例项列�? - */ - List getTemplateInstanceItemList(@Param("status") String status, @Param("descFlag") boolean descFlag, @Param("page") int page, @Param("pageSize") int pageSize); - - /** - * 根据基础ID获取模板实例项列�? * * @param projectId 项目ID * @param baseId 基础ID * @param descFlag 是否降序 * @param page 页码 * @param pageSize 每页大小 * @return 模板实例项列�? - */ - List getTemplateInstanceItemListByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId, @Param("descFlag") boolean descFlag, @Param("page") int page, @Param("pageSize") int pageSize); - - /** - * 根据基础ID获取模板实例项数�? * * @param projectId 项目ID * @param baseId 基础ID * @return 数量 - */ - long getTemplateInstanceItemCountByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId); - - /** - * 根据流水线ID列表获取模板实例项列�? * * @param projectId 项目ID * @param pipelineIds 流水线ID列表 * @return 模板实例项列�? - */ - List getTemplateInstanceItemListByPipelineIds(@Param("projectId") String projectId, @Param("pipelineIds") Collection pipelineIds); - - /** - * 根据基础ID删除模板实例�? * * @param projectId 项目ID * @param baseId 基础ID - */ - void deleteByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerBranchDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerBranchDao.java deleted file mode 100644 index 3ce60236..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerBranchDao.java +++ /dev/null @@ -1,27 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.trigger; - -import cd.casic.ci.process.process.dataObject.TPipelineTimerBranchRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - - -@Repository -public -interface PipelineTimerBranchDao { - - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch, @Param("userId") String userId); - - - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch, @Param("userId") String userId); - - - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch); - - - List list(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId); - - TPipelineTimerBranchRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerDao.java deleted file mode 100644 index 3dbcdae4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.trigger; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.process.process.dataObject.TPipelineTimerRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 娴佹按绾垮畾鏃跺櫒 Dao 鎺ュ彛 - */ -@Mapper -public interface PipelineTimerDao { - - int save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("userId") String userId, @Param("crontabExpression") String crontabExpression, @Param("channelCode") ChannelCode channelCode, @Param("repoHashId") String repoHashId, @Param("branchs") String branchs, @Param("noScm") Boolean noScm); - - - TPipelineTimerRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - List list(@Param("offset") int offset, @Param("limit") int limit); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTriggerEventDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTriggerEventDao.java deleted file mode 100644 index 7bd0f3bc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTriggerEventDao.java +++ /dev/null @@ -1,45 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.trigger; - -import cd.casic.ci.process.api.process.pojo.trigger.PipelineTriggerDetail; -import cd.casic.ci.process.api.process.pojo.trigger.PipelineTriggerEvent; -import cd.casic.ci.process.api.process.pojo.trigger.PipelineTriggerEventVo; -import org.apache.ibatis.annotations.Param; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Set; - - -public interface PipelineTriggerEventDao { - - int save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventType") String eventType, @Param("eventId") String eventId, @Param("status") String status, @Param("errorMsg") String errorMsg); - - - int saveDetail(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventId") String eventId, @Param("detail") String detail); - - - List listTriggerDetail(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventType") String eventType, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("status") String status, @Param("page") int page, @Param("pageSize") int pageSize); - - - int countTriggerDetail(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventType") String eventType, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("status") String status); - - - List listByEventIds(@Param("eventIds") Set eventIds); - - - int updateStatus(@Param("eventId") String eventId, @Param("status") String status, @Param("errorMsg") String errorMsg); - - - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("beforeTime") LocalDateTime beforeTime); - - - List listTriggerDetail(@Param("pipelineName") String pipelineName, @Param("pipelineId") String pipelineId, @Param("eventId") Long eventId, @Param("eventSource") String eventSource, @Param("projectId") String projectId, @Param("eventType") String eventType, @Param("reason") String reason, @Param("triggerType") String triggerType, @Param("triggerUser") String triggerUser, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("limit") Integer limit, @Param("offset") Integer offset); - - - long countTriggerDetail(@Param("pipelineName") String pipelineName, @Param("pipelineId") String pipelineId, @Param("eventId") Long eventId, @Param("eventSource") String eventSource, @Param("projectId") String projectId, @Param("eventType") String eventType, @Param("reason") String reason, @Param("triggerType") String triggerType, @Param("triggerUser") String triggerUser, @Param("startTime") Long startTime, @Param("endTime") Long endTime); - - - Set getEventIdsByEvent(@Param("eventId") Long eventId, @Param("eventSource") String eventSource, @Param("projectId") String projectId, @Param("eventType") String eventType, @Param("triggerType") String triggerType, @Param("triggerUser") String triggerUser, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("limit") Integer limit, @Param("offset") Integer offset); - -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewDao.java deleted file mode 100644 index 900d4e53..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewDao.java +++ /dev/null @@ -1,61 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewDao { - /** - * 创建流水线视�? * * @param projectId 项目ID * @param name 视图名称 * @param isProject 是否项目视图 * @param filterByPipelineName 按流水线名称过滤 * @param filterByCreator 按创建者过�? * @param userId 用户ID * @param id 视图ID * @return 视图ID - */ - Long create(@Param("projectId") String projectId, @Param("name") String name, @Param("isProject") Boolean isProject, @Param("filterByPipelineName") String filterByPipelineName, @Param("filterByCreator") String filterByCreator, @Param("userId") String userId, @Param("id") Long id); - - /** - * 创建流水线视�? * * @param projectId 项目ID * @param name 视图名称 * @param logic 逻辑 * @param isProject 是否项目视图 * @param filters 过滤�? * @param userId 用户ID * @param id 视图ID * @param viewType 视图类型 * @return 视图ID - */ - Long createWithLogic(@Param("projectId") String projectId, @Param("name") String name, @Param("logic") String logic, @Param("isProject") Boolean isProject, @Param("filters") String filters, @Param("userId") String userId, @Param("id") Long id, @Param("viewType") Integer viewType); - - /** - * 更新流水线视�? * * @param projectId 项目ID * @param viewId 视图ID * @param name 视图名称 * @param isProject 是否项目视图 * @param filterByPipelineName 按流水线名称过滤 * @param filterByCreator 按创建者过�? * @return 是否更新成功 - */ - Boolean update(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("name") String name, @Param("isProject") Boolean isProject, @Param("filterByPipelineName") String filterByPipelineName, @Param("filterByCreator") String filterByCreator); - - /** - * 更新流水线视�? * * @param projectId 项目ID * @param viewId 视图ID * @param name 视图名称 * @param logic 逻辑 * @param isProject 是否项目视图 * @param filters 过滤�? * @param viewType 视图类型 * @return 是否更新成功 - */ - Boolean updateWithLogic(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("name") String name, @Param("logic") String logic, @Param("isProject") Boolean isProject, @Param("filters") String filters, @Param("viewType") Integer viewType); - - /** - * 删除流水线视�? * * @param projectId 项目ID * @param viewId 视图ID * @return 是否删除成功 - */ - Boolean delete(@Param("projectId") String projectId, @Param("viewId") Long viewId); - - /** - * 获取项目下的所有视�? * * @param projectId 项目ID * @return 视图列表 - */ - List list(@Param("projectId") String projectId); - - /** - * 获取项目下指定类型的视图 * * @param projectId 项目ID * @param viewType 视图类型 * @return 视图列表 - */ - List listByType(@Param("projectId") String projectId, @Param("viewType") Integer viewType); - - /** - * 获取用户可见的视图列�? * * @param userId 用户ID * @param projectId 项目ID * @param isProject 是否项目视图 * @param viewType 视图类型 * @return 视图列表 - */ - List listUserViews(@Param("userId") String userId, @Param("projectId") String projectId, @Param("isProject") Boolean isProject, @Param("viewType") Integer viewType); - - /** - * 获取指定ID的视图列�? * * @param projectId 项目ID * @param viewIds 视图ID列表 * @param viewType 视图类型 * @return 视图列表 - */ - List listByIds(@Param("projectId") String projectId, @Param("viewIds") List viewIds, @Param("viewType") Integer viewType); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewGroupDao.java deleted file mode 100644 index 6f4c0992..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewGroupDao.java +++ /dev/null @@ -1,36 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视图分�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewGroupDao { - /** - * 创建视图分组 * * @param projectId 项目ID * @param viewId 视图ID * @param pipelineId 流水线ID * @param userId 用户ID - */ - void create(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("pipelineId") String pipelineId, @Param("userId") String userId); - - /** - * 获取视图分组列表 * * @param viewId 视图ID * @param offset 偏移�? * @param limit 限制数量 * @return 视图分组列表 - */ - List list(@Param("viewId") Long viewId, @Param("offset") Integer offset, @Param("limit") Integer limit); - - /** - * 获取视图ID列表对应的分�? * * @param projectId 项目ID * @param viewIds 视图ID列表 * @return 视图分组列表 - */ - List listByViewIds(@Param("projectId") String projectId, @Param("viewIds") List viewIds); - - /** - * 获取指定视图的分�? * * @param projectId 项目ID * @param viewId 视图ID * @return 视图分组列表 - */ - List listByViewId(@Param("projectId") String projectId, @Param("viewId") Long viewId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewTopDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewTopDao.java deleted file mode 100644 index 17c6aaae..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewTopDao.java +++ /dev/null @@ -1,31 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewTopRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视图置�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewTopDao { - /** - * 添加置顶视图 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void add(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 移除置顶视图 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void remove(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 获取用户置顶的视图列�? * * @param projectId 项目ID * @param userId 用户ID * @return 置顶视图列表 - */ - List list(@Param("projectId") String projectId, @Param("userId") String userId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserLastViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserLastViewDao.java deleted file mode 100644 index d38b9d14..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserLastViewDao.java +++ /dev/null @@ -1,24 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewUserLastViewRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 流水线视图用户最后查看记�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewUserLastViewDao { - /** - * 获取用户最后查看的视图 * * @param userId 用户ID * @param projectId 项目ID * @return 最后查看记�? - */ - TPipelineViewUserLastViewRecord get(@Param("userId") String userId, @Param("projectId") String projectId); - - /** - * 保存用户最后查看的视图 * * @param userId 用户ID * @param projectId 项目ID * @param viewId 视图ID * @return 影响行数 - */ - int save(@Param("userId") String userId, @Param("projectId") String projectId, @Param("viewId") String viewId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserSettingsDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserSettingsDao.java deleted file mode 100644 index c5152bb1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserSettingsDao.java +++ /dev/null @@ -1,29 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewUserSettingsRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 流水线视图用户设�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewUserSettingsDao { - /** - * 获取用户设置 * * @param userId 用户ID * @param projectId 项目ID * @return 用户设置记录 - */ - TPipelineViewUserSettingsRecord get(@Param("userId") String userId, @Param("projectId") String projectId); - - /** - * 创建用户设置 * * @param userId 用户ID * @param projectId 项目ID * @param settings 设置内容 - */ - void create(@Param("userId") String userId, @Param("projectId") String projectId, @Param("settings") String settings); - - /** - * 更新用户设置 * * @param userId 用户ID * @param projectId 项目ID * @param settings 设置内容 - */ - void update(@Param("userId") String userId, @Param("projectId") String projectId, @Param("settings") String settings); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebHookQueueDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebHookQueueDao.java deleted file mode 100644 index 85f80a2a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebHookQueueDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.webhook; - -import cd.casic.ci.process.process.pojo.PipelineWebHookQueue; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线WebHook队列 Dao 接口 - */ -@Repository -public interface PipelineWebHookQueueDao { - /** - * 保存流水线WebHook队列 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param sourceProjectId 源项目ID * @param sourceRepoName 源仓库名�? * @param sourceBranch 源分�? * @param targetProjectId 目标项目ID * @param targetRepoName 目标仓库名称 * @param targetBranch 目标分支 * @param buildId 构建ID * @param id ID * @return 影响的行�? - */ - int save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("sourceProjectId") Long sourceProjectId, @Param("sourceRepoName") String sourceRepoName, @Param("sourceBranch") String sourceBranch, @Param("targetProjectId") Long targetProjectId, @Param("targetRepoName") String targetRepoName, @Param("targetBranch") String targetBranch, @Param("buildId") String buildId, @Param("id") Long id); - - /** - * 获取WebHook构建历史 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param sourceProjectId 源项目ID * @param sourceBranch 源分�? * @param targetProjectId 目标项目ID * @param targetBranch 目标分支 * @return WebHook队列列表 - */ - List getWebHookBuildHistory(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("sourceProjectId") Long sourceProjectId, @Param("sourceBranch") String sourceBranch, @Param("targetProjectId") Long targetProjectId, @Param("targetBranch") String targetBranch); - - /** - * 获取WebHook队列 * * @param projectId 项目ID * @param buildId 构建ID * @return WebHook队列 - */ - PipelineWebHookQueue get(@Param("projectId") String projectId, @Param("buildId") String buildId); - - /** - * 根据构建ID删除WebHook队列 * * @param projectId 项目ID * @param buildIds 构建ID列表 * @return 影响的行�? - */ - int deleteByBuildIds(@Param("projectId") String projectId, @Param("buildIds") List buildIds); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookRevisionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookRevisionDao.java deleted file mode 100644 index 4f851869..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookRevisionDao.java +++ /dev/null @@ -1,39 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.webhook; - -import cd.casic.ci.process.process.dataObject.TPipelineWebhookRevisionRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线Webhook修订版本 Dao 接口 - */ -@Repository -public interface PipelineWebhookRevisionDao { - /** - * 创建Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @param content 内容 * @param userId 用户ID * @return Webhook修订版本记录ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId, @Param("content") String content, @Param("userId") String userId); - - /** - * 更新Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @param content 内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId, @Param("content") String content, @Param("userId") String userId); - - /** - * 删除Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId); - - /** - * 获取Webhook修订版本记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return Webhook修订版本记录列表 - */ - List list(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @return Webhook修订版本记录 - */ - TPipelineWebhookRevisionRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookVersionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookVersionDao.java deleted file mode 100644 index b7cfbbf2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookVersionDao.java +++ /dev/null @@ -1,39 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.webhook; - -import cd.casic.ci.process.process.dataObject.TPipelineWebhookVersionRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线Webhook版本 Dao 接口 - */ -@Repository -public interface PipelineWebhookVersionDao { - /** - * 创建Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @param content 内容 * @param userId 用户ID * @return Webhook版本记录ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version, @Param("content") String content, @Param("userId") String userId); - - /** - * 更新Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @param content 内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version, @Param("content") String content, @Param("userId") String userId); - - /** - * 删除Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version); - - /** - * 获取Webhook版本记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return Webhook版本记录列表 - */ - List list(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @return Webhook版本记录 - */ - TPipelineWebhookVersionRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/DeptInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/DeptInfoRecord.java deleted file mode 100644 index c99b844d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/DeptInfoRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class DeptInfoRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目所属二级机构ID") - private Integer deptId; - @Schema(description="项目所属二级机构名称") - private String deptName; - @Schema(description="层级ID") - private Integer level; - @Schema(description="") - private Integer parentDeptId; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/ProjectInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/ProjectInfoRecord.java deleted file mode 100644 index 463678a2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/ProjectInfoRecord.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class ProjectInfoRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="审核状态") - private Integer approvalStatus; - @Schema(description="批准时间") - private Date approvalTime; - @Schema(description="批准人") - private String approver; - @Schema(description="应用ID") - private Integer ccAppId; - @Schema(description="创建时间") - private Date createdAt; - @Schema(description="创建者") - private String creator; - @Schema(description="创建者事业群名称") - private String creatorBgName; - @Schema(description="创建者中心名字") - private String creatorCenterName; - @Schema(description="创建者项目所属二级机构名称") - private String creatorDeptName; - @Schema(description="英文名称") - private String englishName; - @Schema(description="是否停用") - private Boolean isOfflined; - @Schema(description="是否保密") - private Boolean isSecrecy; - @Schema(description="事业群ID") - private Integer projectBgId; - @Schema(description="事业群名称") - private String projectBgName; - @Schema(description="中心ID") - private String projectCenterId; - @Schema(description="中心名字") - private String projectCenterName; - @Schema(description="机构ID") - private Integer projectDeptId; - @Schema(description="项目所属二级机构名称") - private String projectDeptName; - @Schema(description="项目ID") - private String projectId; - @Schema(description="项目名称") - private String projectName; - @Schema(description="项目类型") - private Integer projectType; - @Schema(description="是否用蓝鲸") - private Boolean useBk; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/RolePermissionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/RolePermissionRecord.java deleted file mode 100644 index 9124e477..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/RolePermissionRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class RolePermissionRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="过期时间") - private Date expireTime; - @Schema(description="角色ID") - private Integer roleId; - @Schema(description="") - private Integer urlActionId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date modifyTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/RoleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/RoleRecord.java deleted file mode 100644 index 690408a6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/RoleRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class RoleRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="描述") - private String description; - @Schema(description="名称") - private String name; - @Schema(description="分支名") - private String chName; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date modifyTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SchemaVersionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SchemaVersionRecord.java deleted file mode 100644 index ce221f78..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SchemaVersionRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class SchemaVersionRecord { - @Schema(description="") - private Integer installedRank; - @Schema(description="版本号") - private String version; - @Schema(description="描述") - private String description; - @Schema(description="类型") - private String type; - @Schema(description="打包脚本") - private String script; - @Schema(description="校验和") - private Integer checksum; - @Schema(description="安装者") - private String installedBy; - @Schema(description="安装时间") - private Date installedOn; - @Schema(description="执行时间") - private Integer executionTime; - @Schema(description="是否成功") - private Integer success; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SpringSessionAttributesRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SpringSessionAttributesRecord.java deleted file mode 100644 index 9d8df250..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SpringSessionAttributesRecord.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class SpringSessionAttributesRecord { - @Schema(description="SESSION ID") - private String sessionId; - @Schema(description="属性名称") - private String attributeName; - @Schema(description="属性字节") - private byte[] attributeBytes; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SpringSessionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SpringSessionRecord.java deleted file mode 100644 index 3f0d43b9..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/SpringSessionRecord.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class SpringSessionRecord { - @Schema(description="SESSION ID") - private String sessionId; - @Schema(description="创建时间") - private Long creationTime; - @Schema(description="") - private Long lastAccessTime; - @Schema(description="") - private Integer maxInactiveInterval; - @Schema(description="") - private String principalName; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TActivityRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TActivityRecord.java deleted file mode 100644 index c84e8010..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TActivityRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TActivityRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="类型") - private String type; - @Schema(description="名称") - private String name; - @Schema(description="英文名称") - private String englishName; - @Schema(description="跳转链接") - private String link; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="状态") - private String status; - @Schema(description="创建者") - private String creator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentBatchInstallTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentBatchInstallTokenRecord.java deleted file mode 100644 index d7785eca..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentBatchInstallTokenRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAgentBatchInstallTokenRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="token用户") - private String userId; - @Schema(description="Base64编码后TOKEN") - private String token; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="过期时间") - private Date expiredTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentFailureNotifyUserRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentFailureNotifyUserRecord.java deleted file mode 100644 index 05fca2bc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentFailureNotifyUserRecord.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAgentFailureNotifyUserRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="用户ID") - private String userId; - @Schema(description="通知类型") - private String notifyTypes; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentPipelineRefRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentPipelineRefRecord.java deleted file mode 100644 index 52a67816..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentPipelineRefRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAgentPipelineRefRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="节点ID") - private Long nodeId; - @Schema(description="构建机ID") - private Long agentId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pieplineName; - @Schema(description="构建序列号") - private String vmSeqId; - @Schema(description="JOB ID") - private String jobId; - @Schema(description="JOB NAME") - private String jobName; - @Schema(description="最近构建时间") - private Date lastBuildTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentShareProjectRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentShareProjectRecord.java deleted file mode 100644 index b61abfc0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAgentShareProjectRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAgentShareProjectRecord { - @Schema(description="AgentID") - private Long agentId; - @Schema(description="主项目ID") - private String mainProjectId; - @Schema(description="共享的目标项目ID") - private String sharedProjectId; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAiScoreRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAiScoreRecord.java deleted file mode 100644 index a6cd5667..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAiScoreRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAiScoreRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="任务ID") - private String label; - @Schema(description="是否已归档") - private Integer archive; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="赞的人") - private String goodUsers; - @Schema(description="踩的人") - private String badUsers; - @Schema(description="大模型生成的内容") - private String aiMsg; - @Schema(description="Prompt for system") - private String systemMsg; - @Schema(description="Prompt for user") - private String userMsg; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppCodeGroupRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppCodeGroupRecord.java deleted file mode 100644 index e3b22229..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppCodeGroupRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAppCodeGroupRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="APP编码") - private String appCode; - @Schema(description="事业群ID") - private Integer bgId; - @Schema(description="事业群名称") - private String bgName; - @Schema(description="项目所属二级机构ID") - private Integer deptId; - @Schema(description="项目所属二级机构名称") - private String deptName; - @Schema(description="中心ID") - private Integer centerId; - @Schema(description="中心名字") - private String centerName; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="跟新人") - private String updater; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppCodeProjectRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppCodeProjectRecord.java deleted file mode 100644 index 8b47022e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppCodeProjectRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAppCodeProjectRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="APP编码") - private String appCode; - @Schema(description="项目ID") - private String projectId; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppEnvRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppEnvRecord.java deleted file mode 100644 index c019707f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppEnvRecord.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAppEnvRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="编译环境ID") - private Integer appId; - @Schema(description="路径") - private String path; - @Schema(description="名称") - private String name; - @Schema(description="描述") - private String description; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppUserInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppUserInfoRecord.java deleted file mode 100644 index 51f0e159..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppUserInfoRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAppUserInfoRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="APP编码") - private String appCode; - @Schema(description="APP管理员ID") - private String managerId; - @Schema(description="是否删除") - private Boolean isDelete; - @Schema(description="添加人员") - private String createUser; - @Schema(description="添加时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppVersionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppVersionRecord.java deleted file mode 100644 index f1722b02..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppVersionRecord.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAppVersionRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="编译环境ID") - private Integer appId; - @Schema(description="版本号") - private String version; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppsRecord.java deleted file mode 100644 index f2ab92a3..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAppsRecord.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAppsRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="名称") - private String name; - @Schema(description="操作系统") - private String os; - @Schema(description="执行所在路径") - private String binPath; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomApproveRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomApproveRelRecord.java deleted file mode 100644 index a27dfd36..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomApproveRelRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomApproveRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="调试项目编码") - private String testProjectCode; - @Schema(description="审批ID") - private String approveId; - @Schema(description="创建者") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomBuildAppRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomBuildAppRelRecord.java deleted file mode 100644 index 2fdf3aac..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomBuildAppRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomBuildAppRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="构建信息Id") - private String buildInfoId; - @Schema(description="编译环境版本Id(对应T_APP_VERSION主键)") - private Integer appVersionId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomBuildInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomBuildInfoRecord.java deleted file mode 100644 index 98ee1185..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomBuildInfoRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomBuildInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="语言") - private String language; - @Schema(description="打包脚本") - private String script; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="代码存放路径") - private String repositoryPath; - @Schema(description="样例工程路径") - private String sampleProjectPath; - @Schema(description="是否启用 1 启用 0 禁用") - private Boolean enable; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomDevLanguageEnvVarRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomDevLanguageEnvVarRecord.java deleted file mode 100644 index 67a8969a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomDevLanguageEnvVarRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomDevLanguageEnvVarRecord { - @Schema(description="主键") - private String id; - @Schema(description="插件开发语言") - private String language; - @Schema(description="环境变量key值") - private String envKey; - @Schema(description="环境变量value值") - private String envValue; - @Schema(description="适用构建机类型 PUBLIC:公共构建机,THIRD:第三方构建机,ALL:所有") - private String buildHostType; - @Schema(description="适用构建机操作系统 WINDOWS:windows构建机,LINUX:linux构建机,MAC_OS:mac构建机,ALL:所有") - private String buildHostOs; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomDisplayConfigRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomDisplayConfigRecord.java deleted file mode 100644 index fd441ef4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomDisplayConfigRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomDisplayConfigRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="插件代码") - private String atomCode; - @Schema(description="插件名称") - private String atomName; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomEnvInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomEnvInfoRecord.java deleted file mode 100644 index 861592fb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomEnvInfoRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomEnvInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件Id") - private String atomId; - @Schema(description="安装包路径") - private String pkgPath; - @Schema(description="语言") - private String language; - @Schema(description="支持插件开发语言的最低版本") - private String minVersion; - @Schema(description="插件执行入口") - private String target; - @Schema(description="插件SHA签名串") - private String shaContent; - @Schema(description="插件执行前置命令") - private String preCmd; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="插件包名") - private String pkgName; - @Schema(description="入口参数") - private String postEntryParam; - @Schema(description="执行条件") - private String postCondition; - @Schema(description="支持的操作系统名称") - private String osName; - @Schema(description="支持的操作系统架构") - private String osArch; - @Schema(description="运行时版本") - private String runtimeVersion; - @Schema(description="是否为默认环境信息") - private Boolean defaultFlag; - @Schema(description="插件运行结束后是否立即杀掉其进程") - private Boolean finishKillFlag; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFailDetailDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFailDetailDataRecord.java deleted file mode 100644 index f9e0b631..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFailDetailDataRecord.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomFailDetailDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="渠道代码") - private String channelCode; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序号") - private Integer buildNum; - @Schema(description="插件代码") - private String atomCode; - @Schema(description="插件名称") - private String atomName; - @Schema(description="插件在model中的位置") - private String atomPosition; - @Schema(description="插件分类代码") - private String classifyCode; - @Schema(description="插件分类名称") - private String classifyName; - @Schema(description="启动用户") - private String startUser; - @Schema(description="启动时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="错误的类型标识") - private Integer errorType; - @Schema(description="错误的标识码") - private Integer errorCode; - @Schema(description="错误描述") - private String errorMsg; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFailSummaryDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFailSummaryDataRecord.java deleted file mode 100644 index 1c85448a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFailSummaryDataRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomFailSummaryDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="渠道代码") - private String channelCode; - @Schema(description="插件代码") - private String atomCode; - @Schema(description="插件名称") - private String atomName; - @Schema(description="插件分类代码") - private String classifyCode; - @Schema(description="插件分类名称") - private String classifyName; - @Schema(description="错误的类型标识") - private Integer errorType; - @Schema(description="错误次数") - private Integer errorCount; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFeatureRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFeatureRecord.java deleted file mode 100644 index 94131499..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomFeatureRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomFeatureRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="可见范围") - private Integer visibilityLevel; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="是否推荐") - private Boolean recommendFlag; - @Schema(description="插件代码库不开源原因") - private String privateReason; - @Schema(description="是否删除") - private Boolean deleteFlag; - @Schema(description="yaml可用标识") - private Boolean yamlFlag; - @Schema(description="质量红线可用标识") - private Boolean qualityFlag; - @Schema(description="是否认证标识") - private Boolean certificationFlag; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomIndexStatisticsDailyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomIndexStatisticsDailyRecord.java deleted file mode 100644 index ecabf25d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomIndexStatisticsDailyRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomIndexStatisticsDailyRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="插件代码") - private String atomCode; - @Schema(description="插件错误合规次数") - private Integer failComplianceCount; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="失败执行次数") - private Integer failExecuteCount; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomLabelRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomLabelRelRecord.java deleted file mode 100644 index 6ff90d26..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomLabelRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomLabelRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="标签ID") - private String labelId; - @Schema(description="插件Id") - private String atomId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomMonitorDataDailyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomMonitorDataDailyRecord.java deleted file mode 100644 index 64b468d8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomMonitorDataDailyRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomMonitorDataDailyRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="插件代码") - private String atomCode; - @Schema(description="执行次数") - private Long executeCount; - @Schema(description="错误类型") - private Integer errorType; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOfflineRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOfflineRecord.java deleted file mode 100644 index e133d86f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOfflineRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomOfflineRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="") - private Integer bufferDay; - @Schema(description="过期时间") - private Date expireTime; - @Schema(description="状态") - private Integer status; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOperateLogRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOperateLogRecord.java deleted file mode 100644 index 91dc2758..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOperateLogRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomOperateLogRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件Id") - private String atomId; - @Schema(description="日志内容") - private String content; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOverviewDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOverviewDataRecord.java deleted file mode 100644 index 93e60407..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomOverviewDataRecord.java +++ /dev/null @@ -1,49 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import java.math.BigDecimal; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomOverviewDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="渠道代码") - private String channelCode; - @Schema(description="插件代码") - private String atomCode; - @Schema(description="插件名称") - private String atomName; - @Schema(description="插件分类代码") - private String classifyCode; - @Schema(description="插件分类名称") - private String classifyName; - @Schema(description="成功率") - private BigDecimal successRate; - @Schema(description="总平均耗时,单位:毫秒") - private Long avgCostTime; - @Schema(description="总执行次数") - private Long totalExecuteCount; - @Schema(description="成功执行次数") - private Long successExecuteCount; - @Schema(description="失败执行次数") - private Long failExecuteCount; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomPipelineBuildRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomPipelineBuildRelRecord.java deleted file mode 100644 index 8a584ed0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomPipelineBuildRelRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomPipelineBuildRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件Id") - private String atomId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomPipelineRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomPipelineRelRecord.java deleted file mode 100644 index b53ab659..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomPipelineRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomPipelineRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomRecord.java deleted file mode 100644 index 82275c16..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomRecord.java +++ /dev/null @@ -1,90 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="名称") - private String name; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="插件大类") - private String classType; - @Schema(description="生效范围") - private String serviceScope; - @Schema(description="适用Job类型,AGENT: 编译环境,AGENT_LESS:无编译环境") - private String jobType; - @Schema(description="操作系统") - private String os; - @Schema(description="所属分类ID") - private String classifyId; - @Schema(description="文档跳转链接") - private String docsLink; - @Schema(description="原子类型") - private Integer atomType; - @Schema(description="原子状态") - private Integer atomStatus; - @Schema(description="插件状态信息") - private String atomStatusMsg; - @Schema(description="简介") - private String summary; - @Schema(description="描述") - private String description; - @Schema(description="类别") - private Integer categroy; - @Schema(description="版本号") - private String version; - @Schema(description="LOGO URL地址") - private String logoUrl; - @Schema(description="插件图标") - private String icon; - @Schema(description="是否为默认原子") - private Boolean defaultFlag; - @Schema(description="是否为最新版本原子") - private Boolean latestFlag; - @Schema(description="无构建环境原子是否可以在有构建环境运行标识") - private Boolean buildLessRunFlag; - @Schema(description="代码库哈希ID") - private String repositoryHashId; - @Schema(description="代码库链接") - private String codeSrc; - @Schema(description="是否免费") - private Boolean payFlag; - @Schema(description="前端渲染模板版本") - private String htmlTemplateVersion; - @Schema(description="自定义扩展容器前端表单属性字段的JSON串") - private String props; - @Schema(description="预留字段") - private String data; - @Schema(description="原子发布者") - private String publisher; - @Schema(description="权值") - private Integer weight; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="可见范围") - private Integer visibilityLevel; - @Schema(description="发布时间") - private Date pubTime; - @Schema(description="插件代码库不开源原因") - private String privateReason; - @Schema(description="是否删除") - private Boolean deleteFlag; - @Schema(description="代码库分支") - private String branch; - @Schema(description="是否是分支测试版本") - private Boolean branchTestFlag; - @Schema(description="是否为最新测试版本原子, TRUE:最新 FALSE:非最新") - private Boolean latestTestFlag; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomVersionLogRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomVersionLogRecord.java deleted file mode 100644 index 18c3f75c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAtomVersionLogRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAtomVersionLogRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="插件Id") - private String atomId; - @Schema(description="发布类型") - private Integer releaseType; - @Schema(description="日志内容") - private String content; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuditResourceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuditResourceRecord.java deleted file mode 100644 index a58850c9..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuditResourceRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuditResourceRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="资源类型") - private String resourceType; - @Schema(description="资源ID") - private String resourceId; - @Schema(description="资源名称") - private String resourceName; - @Schema(description="用户ID") - private String userId; - @Schema(description="操作") - private String action; - @Schema(description="操作内容") - private String actionContent; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="状态") - private String status; - @Schema(description="项目ID") - private String projectId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthActionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthActionRecord.java deleted file mode 100644 index 2e1bf0ad..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthActionRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthActionRecord { - @Schema(description="操作ID") - private String action; - @Schema(description="蓝盾-关联资源类型") - private String resourceType; - @Schema(description="IAM-关联资源类型") - private String relatedResourceType; - @Schema(description="操作名称") - private String actionName; - @Schema(description="动作英文名称") - private String englishName; - @Schema(description="创建者") - private String createUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="是否删除") - private Boolean delete; - @Schema(description="操作类型") - private String actionType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupInfoRecord.java deleted file mode 100644 index 02b9bd30..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupInfoRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthGroupInfoRecord { - @Schema(description="主健ID") - private Integer id; - @Schema(description="用户组名称") - private String groupName; - @Schema(description="用户组标识 默认用户组标识一致") - private String groupCode; - @Schema(description="用户组类型 0默认分组") - private Boolean groupType; - @Schema(description="用户组所属项目") - private String projectCode; - @Schema(description="是否删除 0 可用 1删除") - private Boolean isDelete; - @Schema(description="添加人") - private String createUser; - @Schema(description="修改人") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="用户组别名") - private String displayName; - @Schema(description="关联系统ID") - private String relationId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupPerssionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupPerssionRecord.java deleted file mode 100644 index 69f01746..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupPerssionRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthGroupPerssionRecord { - @Schema(description="主健ID") - private String id; - @Schema(description="权限动作") - private String authAction; - @Schema(description="用户组编号 默认7个内置组编号固定 自定义组编码随机") - private String groupCode; - @Schema(description="创建人") - private String createUser; - @Schema(description="修改人") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupUserRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupUserRecord.java deleted file mode 100644 index a82fa50a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthGroupUserRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthGroupUserRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="用户ID") - private String userId; - @Schema(description="用户组ID") - private String groupId; - @Schema(description="添加用户") - private String createUser; - @Schema(description="添加时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthHandoverDetailRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthHandoverDetailRecord.java deleted file mode 100644 index 8d4d28d7..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthHandoverDetailRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthHandoverDetailRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="流程单号") - private String flowNo; - @Schema(description="组/授权资源ID") - private String itemId; - @Schema(description="组/授权资源关联的资源类型") - private String resourceType; - @Schema(description="交接类型-group/authorization") - private String handoverType; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthHandoverOverviewRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthHandoverOverviewRecord.java deleted file mode 100644 index 8c97bf5f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthHandoverOverviewRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthHandoverOverviewRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="项目名称") - private String projectName; - @Schema(description="流程单号") - private String flowNo; - @Schema(description="标题") - private String title; - @Schema(description="申请人") - private String applicant; - @Schema(description="审批人") - private String approver; - @Schema(description="审批结果,0-审批中,1-审批成功,2-审批拒绝,3-撤销") - private Integer status; - @Schema(description="用户组数") - private Integer groupCount; - @Schema(description="授权个数") - private Integer authorizationCount; - @Schema(description="备注") - private String remark; - @Schema(description="最后操作人") - private String lastOperator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthIamCallbackRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthIamCallbackRecord.java deleted file mode 100644 index 5d818a7f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthIamCallbackRecord.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthIamCallbackRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="目标服务网关") - private String gateway; - @Schema(description="目标接口路径") - private String path; - @Schema(description="是否删除 true-是 false-否") - private Boolean deleteFlag; - @Schema(description="资源类型") - private String resource; - @Schema(description="接入系统") - private String system; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthItsmCallbackRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthItsmCallbackRecord.java deleted file mode 100644 index 8836068e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthItsmCallbackRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthItsmCallbackRecord { - @Schema(description="自增ID") - private Integer id; - @Schema(description="权限中心申请单ID") - private Integer applyId; - @Schema(description="ITSM申请单号") - private String sn; - @Schema(description="项目英文名") - private String englishName; - @Schema(description="权限中心审批单ID") - private String callbackId; - @Schema(description="申请人") - private String applicant; - @Schema(description="最后审批人") - private String approver; - @Schema(description="审批结果,0-审批拒绝,1-审批成功") - private Boolean approveResult; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerApprovalRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerApprovalRecord.java deleted file mode 100644 index 25589119..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerApprovalRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthManagerApprovalRecord { - @Schema(description="自增ID") - private Integer id; - @Schema(description="用户ID") - private String userId; - @Schema(description="管理员权限ID") - private Integer managerId; - @Schema(description="权限过期时间") - private Date expiredTime; - @Schema(description="审批单生效时间") - private Date startTime; - @Schema(description="审批单失效时间") - private Date endTime; - @Schema(description="发送状态 0-审核流程中 ,1-用户拒绝续期,2-用户同意续期,3-审批人拒绝续期,4-审批人同意续期") - private Integer status; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerRecord.java deleted file mode 100644 index 1e483ba0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthManagerRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="名称") - private String name; - @Schema(description="组织ID") - private Integer organizationId; - @Schema(description="层级ID") - private Integer level; - @Schema(description="权限策略ID") - private Integer strategyid; - @Schema(description="是否删除") - private Integer isDelete; - @Schema(description="创建用户") - private String createUser; - @Schema(description="修改用户") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerUserHistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerUserHistoryRecord.java deleted file mode 100644 index a7ce9b49..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerUserHistoryRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthManagerUserHistoryRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="用户ID") - private String userId; - @Schema(description="管理员权限ID") - private Integer managerId; - @Schema(description="权限生效起始时间") - private Date startTime; - @Schema(description="权限生效结束时间") - private Date endTime; - @Schema(description="创建用户") - private String createUser; - @Schema(description="修改用户") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerUserRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerUserRecord.java deleted file mode 100644 index 016e98ee..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerUserRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthManagerUserRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="用户ID") - private String userId; - @Schema(description="管理员权限ID") - private Integer managerId; - @Schema(description="权限生效起始时间") - private Date startTime; - @Schema(description="权限生效结束时间") - private Date endTime; - @Schema(description="创建用户") - private String createUser; - @Schema(description="修改用户") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerWhitelistRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerWhitelistRecord.java deleted file mode 100644 index 97d53d8b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthManagerWhitelistRecord.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthManagerWhitelistRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="管理策略ID") - private Integer managerId; - @Schema(description="用户ID") - private String userId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthMigrationRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthMigrationRecord.java deleted file mode 100644 index cf702192..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthMigrationRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthMigrationRecord { - @Schema(description="项目ID") - private String projectCode; - @Schema(description="迁移状态, 0-迁移中,1-迁移成功,2-迁移失败") - private Integer status; - @Schema(description="迁移前用户组数") - private Integer beforeGroupCount; - @Schema(description="迁移后用户组数") - private Integer afterGroupCount; - @Schema(description="迁移后资源数和资源用户组数") - private String resourceCount; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="总耗时") - private Long totalTime; - @Schema(description="错误信息") - private String errorMessage; - @Schema(description="迁移项目的网关路由tags") - private String routerTag; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthMonitorSpaceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthMonitorSpaceRecord.java deleted file mode 100644 index 5a1cf853..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthMonitorSpaceRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthMonitorSpaceRecord { - @Schema(description="项目ID") - private String projectCode; - @Schema(description="监控空间业务ID") - private Long spaceBizId; - @Schema(description="监控空间ID") - private String spaceUid; - @Schema(description="创建人") - private String creator; - @Schema(description="更新者") - private String updateUser; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2AccessTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2AccessTokenRecord.java deleted file mode 100644 index 3396188d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2AccessTokenRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthOauth2AccessTokenRecord { - @Schema(description="ACCESS_TOKEN") - private String accessToken; - @Schema(description="客户端ID") - private String clientId; - @Schema(description="登录的用户名,客户端模式该值为空") - private String userName; - @Schema(description="用于密码模式") - private String passWord; - @Schema(description="授权模式") - private String grantType; - @Schema(description="过期时间") - private Long expiredTime; - @Schema(description="REFRESH_TOKEN,客户端模式该值为空") - private String refreshToken; - @Schema(description="授权范围ID") - private Integer scopeId; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ClientDetailsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ClientDetailsRecord.java deleted file mode 100644 index 9012bea4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ClientDetailsRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthOauth2ClientDetailsRecord { - @Schema(description="客户端标识") - private String clientId; - @Schema(description="客户端秘钥") - private String clientSecret; - @Schema(description="客户端名称") - private String clientName; - @Schema(description="授权操作范围") - private String scope; - @Schema(description="图标") - private String icon; - @Schema(description="授权模式") - private String authorizedGrantTypes; - @Schema(description="跳转链接") - private String webServerRedirectUri; - @Schema(description="access_token有效时间") - private Long accessTokenValidity; - @Schema(description="refresh_token有效时间") - private Long refreshTokenValidity; - @Schema(description="创建人") - private String createUser; - @Schema(description="修改人") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2CodeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2CodeRecord.java deleted file mode 100644 index 5aa2ea9c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2CodeRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthOauth2CodeRecord { - @Schema(description="客户端标识") - private String clientId; - @Schema(description="授权码") - private String code; - @Schema(description="用户名") - private String userName; - @Schema(description="过期时间") - private Long expiredTime; - @Schema(description="授权范围ID") - private Integer scopeId; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2RefreshTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2RefreshTokenRecord.java deleted file mode 100644 index e0e83e2c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2RefreshTokenRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthOauth2RefreshTokenRecord { - @Schema(description="REFRESH_TOKEN") - private String refreshToken; - @Schema(description="客户端ID") - private String clientId; - @Schema(description="过期时间") - private Long expiredTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ScopeOperationRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ScopeOperationRecord.java deleted file mode 100644 index 688e2517..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ScopeOperationRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthOauth2ScopeOperationRecord { - @Schema(description="主健ID") - private Integer id; - @Schema(description="授权操作ID") - private String operationId; - @Schema(description="授权操作中文名称") - private String operationNameCn; - @Schema(description="授权操作英文名称") - private String operationNameEn; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ScopeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ScopeRecord.java deleted file mode 100644 index 69e718c1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthOauth2ScopeRecord.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthOauth2ScopeRecord { - @Schema(description="主健ID") - private Integer id; - @Schema(description="授权范围") - private String scope; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceAuthorizationRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceAuthorizationRecord.java deleted file mode 100644 index 25df241b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceAuthorizationRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceAuthorizationRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="资源类型") - private String resourceType; - @Schema(description="资源ID") - private String resourceCode; - @Schema(description="资源名") - private String resourceName; - @Schema(description="授予人") - private String handoverFrom; - @Schema(description="授予人中文名称") - private String handoverFromCnName; - @Schema(description="授予时间") - private Date handoverTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupApplyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupApplyRecord.java deleted file mode 100644 index 5ddca4f1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupApplyRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceGroupApplyRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="成员ID") - private String memberId; - @Schema(description="IAM组ID") - private Integer iamGroupId; - @Schema(description="状态, 0-审批中,1-审批成功,2-审批超时") - private Integer status; - @Schema(description="检查次数,用于同步组数据") - private Integer numberOfChecks; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupConfigRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupConfigRecord.java deleted file mode 100644 index 54740038..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupConfigRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceGroupConfigRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="资源类型") - private String resourceType; - @Schema(description="用户组标识") - private String groupCode; - @Schema(description="用户组名称") - private String groupName; - @Schema(description="创建模式,0-开启时创建,1-启用权限管理时创建") - private Boolean createMode; - @Schema(description="用户组类型 0-默认组 1-自定义组") - private Integer groupType; - @Schema(description="用户组描述") - private String description; - @Schema(description="用户组授权范围") - private String authorizationScopes; - @Schema(description="用户组拥有的资源操作") - private String actions; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupMemberRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupMemberRecord.java deleted file mode 100644 index 1b70c3ab..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupMemberRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceGroupMemberRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="资源类型") - private String resourceType; - @Schema(description="资源ID") - private String resourceCode; - @Schema(description="用户组标识") - private String groupCode; - @Schema(description="IAM组ID") - private Integer iamGroupId; - @Schema(description="成员ID") - private String memberId; - @Schema(description="成员名") - private String memberName; - @Schema(description="成员类型,用户/组织/模板") - private String memberType; - @Schema(description="过期时间") - private Date expiredTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupPermissionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupPermissionRecord.java deleted file mode 100644 index 4517bdf2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupPermissionRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceGroupPermissionRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="用户组关联的资源类型") - private String resourceType; - @Schema(description="用户组关联的资源ID") - private String resourceCode; - @Schema(description="用户组关联的IAM资源ID") - private String iamResourceCode; - @Schema(description="用户组标识") - private String groupCode; - @Schema(description="关联的IAM组ID") - private Integer iamGroupId; - @Schema(description="操作ID") - private String action; - @Schema(description="动作关联的资源类型") - private String actionRelatedResourceType; - @Schema(description="组权限关联的资源类型") - private String relatedResourceType; - @Schema(description="组权限关联的资源ID") - private String relatedResourceCode; - @Schema(description="组权限关联的资源ID") - private String relatedIamResourceCode; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupRecord.java deleted file mode 100644 index 81cecdd2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceGroupRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceGroupRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="资源类型") - private String resourceType; - @Schema(description="资源ID") - private String resourceCode; - @Schema(description="资源名") - private String resourceName; - @Schema(description="IAM资源ID") - private String iamResourceCode; - @Schema(description="用户组标识") - private String groupCode; - @Schema(description="用户组名称") - private String groupName; - @Schema(description="是否为默认组,0-非默认组,1-默认组") - private Boolean defaultGroup; - @Schema(description="关联的IAM组ID") - private String relationId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="用户组描述") - private String description; - @Schema(description="人员模板ID") - private Integer iamTemplateId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceRecord.java deleted file mode 100644 index 988a3dd8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="资源类型") - private String resourceType; - @Schema(description="资源ID") - private String resourceCode; - @Schema(description="资源名") - private String resourceName; - @Schema(description="IAM资源ID") - private String iamResourceCode; - @Schema(description="开启权限管理,0-不启用,1-启用") - private Boolean enable; - @Schema(description="关联的IAM分级管理员ID") - private String relationId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="创建者") - private String createUser; - @Schema(description="修改人") - private String updateUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceSyncRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceSyncRecord.java deleted file mode 100644 index 315d92e1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceSyncRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceSyncRecord { - @Schema(description="项目ID") - private String projectCode; - @Schema(description="迁移状态, 0-同步中,1-同步成功,2-同步失败") - private Integer status; - @Schema(description="错误信息") - private String errorMessage; - @Schema(description="总耗时") - private Long totalTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceTypeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceTypeRecord.java deleted file mode 100644 index 619b6210..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthResourceTypeRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthResourceTypeRecord { - @Schema(description="资源类型") - private String resourceType; - @Schema(description="ID") - private Integer id; - @Schema(description="资源名称") - private String name; - @Schema(description="资源英文名称") - private String englishName; - @Schema(description="资源描述") - private String desc; - @Schema(description="资源英文描述") - private String englishDesc; - @Schema(description="父类资源") - private String parent; - @Schema(description="所属系统") - private String system; - @Schema(description="创建者") - private String createUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新者") - private String updateUser; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="是否删除") - private Boolean delete; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthStrategyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthStrategyRecord.java deleted file mode 100644 index 9aa9fbf8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthStrategyRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthStrategyRecord { - @Schema(description="策略主键ID") - private Integer id; - @Schema(description="策略名称") - private String strategyName; - @Schema(description="策略内容") - private String strategyBody; - @Schema(description="是否删除 0未删除 1删除") - private Integer isDelete; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建人") - private String createUser; - @Schema(description="修改人") - private String updateUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthTemporaryVerifyRecordRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthTemporaryVerifyRecordRecord.java deleted file mode 100644 index fc0ad808..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthTemporaryVerifyRecordRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthTemporaryVerifyRecordRecord { - @Schema(description="用户ID") - private String userId; - @Schema(description="项目ID") - private String projectCode; - @Schema(description="资源类型") - private String resourceType; - @Schema(description="资源ID") - private String resourceCode; - @Schema(description="操作ID") - private String action; - @Schema(description="鉴权结果") - private Boolean verifyResult; - @Schema(description="最后鉴权时间") - private Date lastVerifyTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthUserBlacklistRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthUserBlacklistRecord.java deleted file mode 100644 index 8e58093f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthUserBlacklistRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthUserBlacklistRecord { - @Schema(description="") - private Integer id; - @Schema(description="用户ID") - private String userId; - @Schema(description="拉黑原因") - private String remark; - @Schema(description="拉黑时间") - private Date createTime; - @Schema(description="是否生效 1生效 0不生效") - private Boolean status; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthUserInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthUserInfoRecord.java deleted file mode 100644 index 7ac7e661..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TAuthUserInfoRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TAuthUserInfoRecord { - @Schema(description="") - private Integer id; - @Schema(description="用户ID") - private String userid; - @Schema(description="邮箱") - private String email; - @Schema(description="手机号") - private String phone; - @Schema(description="注册时间") - private Date createTime; - @Schema(description="用户类型 0.页面注册 1.GitHub 2.Gitlab") - private Integer userType; - @Schema(description="最后登陆时间") - private Date lastLoginTime; - @Schema(description="用户状态,0--正常,1--冻结") - private Integer userStatus; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TBuildResourceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TBuildResourceRecord.java deleted file mode 100644 index 6089de52..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TBuildResourceRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TBuildResourceRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="构建资源代码") - private String buildResourceCode; - @Schema(description="构建资源名称") - private String buildResourceName; - @Schema(description="是否为默认原子") - private Boolean defaultFlag; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TBusinessConfigRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TBusinessConfigRecord.java deleted file mode 100644 index eb81c5ba..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TBusinessConfigRecord.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TBusinessConfigRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="业务名称") - private String business; - @Schema(description="要控制的功能特性") - private String feature; - @Schema(description="业务取值") - private String businessValue; - @Schema(description="配置值") - private String configValue; - @Schema(description="配置描述") - private String description; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCategoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCategoryRecord.java deleted file mode 100644 index c173d6d2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCategoryRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCategoryRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="范畴代码") - private String categoryCode; - @Schema(description="范畴名称") - private String categoryName; - @Schema(description="范畴图标链接") - private String iconUrl; - @Schema(description="类型") - private Integer type; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertEnterpriseRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertEnterpriseRecord.java deleted file mode 100644 index ca412ccd..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertEnterpriseRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCertEnterpriseRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="证书ID") - private String certId; - @Schema(description="证书 mp 文件名称") - private String certMpFileName; - @Schema(description="证书 开发者名称") - private String certDeveloperName; - @Schema(description="证书 团队名称") - private String certTeamName; - @Schema(description="证书 uuid") - private String certUuid; - @Schema(description="更新时间") - private Date certUpdateTime; - @Schema(description="证书 过期时间") - private Date certExpireDate; - @Schema(description="证书 创建时间") - private Date certCreateTime; - @Schema(description="证书 mp 文件内容") - private byte[] certMpFileContent; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertRecord.java deleted file mode 100644 index 57d946e6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCertRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="证书ID") - private String certId; - @Schema(description="证书用户ID") - private String certUserId; - @Schema(description="证书类型") - private String certType; - @Schema(description="证书备注") - private String certRemark; - @Schema(description="证书 p12 文件名称") - private String certP12FileName; - @Schema(description="证书 mp 文件名称") - private String certMpFileName; - @Schema(description="证书 jks 文件名称") - private String certJksFileName; - @Schema(description="证书 jsk 别名") - private String certJksAlias; - @Schema(description="证书 jks 凭据ID") - private String certJksAliasCredentialId; - @Schema(description="证书 开发者名称") - private String certDeveloperName; - @Schema(description="证书 团队名称") - private String certTeamName; - @Schema(description="证书 uuid") - private String certUuid; - @Schema(description="证书 过期时间") - private Date certExpireDate; - @Schema(description="证书 创建时间") - private Date certCreateTime; - @Schema(description="证书 更新时间") - private Date certUpdateTime; - @Schema(description="凭证ID") - private String credentialId; - @Schema(description="证书 p12 文件内容") - private byte[] certP12FileContent; - @Schema(description="证书 mp 文件内容") - private byte[] certMpFileContent; - @Schema(description="证书 jsk 文件内容") - private byte[] certJksFileContent; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertTlsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertTlsRecord.java deleted file mode 100644 index 76ee959b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCertTlsRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCertTlsRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="证书ID") - private String certId; - @Schema(description="服务器crt证书名") - private String certServerCrtFileName; - @Schema(description="服务器key证书名") - private String certServerKeyFileName; - @Schema(description="客户端crt证书名") - private String certClientCrtFileName; - @Schema(description="客户端key证书名") - private String certClientKeyFileName; - @Schema(description="证书创建时间") - private Date certCreateTime; - @Schema(description="证书更新时间") - private Date certUpdateTime; - @Schema(description="Base64编码的加密后的证书内容") - private byte[] certServerCrtFile; - @Schema(description="Base64编码的加密后的证书内容") - private byte[] certServerKeyFile; - @Schema(description="Base64编码的加密后的证书内容") - private byte[] certClientCrtFile; - @Schema(description="Base64编码的加密后的证书内容") - private byte[] certClientKeyFile; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TClassifyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TClassifyRecord.java deleted file mode 100644 index 15f99d2f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TClassifyRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TClassifyRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="所属镜像分类代码") - private String classifyCode; - @Schema(description="所属镜像分类名称") - private String classifyName; - @Schema(description="权值") - private Integer weight; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="类型") - private Integer type; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCommonNotifyMessageTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCommonNotifyMessageTemplateRecord.java deleted file mode 100644 index b7885e32..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCommonNotifyMessageTemplateRecord.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCommonNotifyMessageTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板代码") - private String templateCode; - @Schema(description="模板名称") - private String templateName; - @Schema(description="适用的通知类型(EMAIL:邮件 RTX:企业微信 WECHAT:微信 SMS:短信)") - private String notifyTypeScope; - @Schema(description="优先级") - private Integer priority; - @Schema(description="邮件来源") - private Integer source; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TContainerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TContainerRecord.java deleted file mode 100644 index ae93cc08..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TContainerRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TContainerRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="名称") - private String name; - @Schema(description="类型") - private String type; - @Schema(description="操作系统") - private String os; - @Schema(description="是否必须") - private Integer required; - @Schema(description="最大排队时间") - private Integer maxQueueMinutes; - @Schema(description="最大运行时间") - private Integer maxRunningMinutes; - @Schema(description="自定义扩展容器前端表单属性字段的JSON串") - private String props; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TContainerResourceRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TContainerResourceRelRecord.java deleted file mode 100644 index cef202d3..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TContainerResourceRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TContainerResourceRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="资源ID") - private String resourceId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointMetadataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointMetadataRecord.java deleted file mode 100644 index 0cad13d5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointMetadataRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TControlPointMetadataRecord { - @Schema(description="元数据ID") - private String metadataId; - @Schema(description="元数据类型") - private String metadataType; - @Schema(description="元数据名称") - private String metadataName; - @Schema(description="任务ID") - private String taskId; - @Schema(description="是否在线") - private Boolean online; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointRecord.java deleted file mode 100644 index 0c1736a7..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TControlPointRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="名称") - private String name; - @Schema(description="任务信息列表") - private String taskList; - @Schema(description="是否在线") - private Boolean online; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointTaskRecord.java deleted file mode 100644 index 2adf28aa..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TControlPointTaskRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TControlPointTaskRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="原子控制阶段") - private String controlStage; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountInterceptRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountInterceptRecord.java deleted file mode 100644 index 490a5aed..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountInterceptRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCountInterceptRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="日期") - private Date date; - @Schema(description="计数") - private Integer count; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="拦截数") - private Integer interceptCount; - @Schema(description="RULE_INTERCEPT_COUNT + count)") - private Integer ruleInterceptCount; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountPipelineRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountPipelineRecord.java deleted file mode 100644 index 38555e51..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountPipelineRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCountPipelineRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="日期") - private Date date; - @Schema(description="计数") - private Integer count; - @Schema(description="上次拦截时间") - private Date lastInterceptTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="拦截数") - private Integer interceptCount; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountRuleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountRuleRecord.java deleted file mode 100644 index 76b84ac0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCountRuleRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCountRuleRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="规则ID") - private Long ruleId; - @Schema(description="日期") - private Date date; - @Schema(description="计数") - private Integer count; - @Schema(description="拦截数") - private Integer interceptCount; - @Schema(description="上次拦截时间") - private Date lastInterceptTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCredentialRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCredentialRecord.java deleted file mode 100644 index f49f53e9..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TCredentialRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TCredentialRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="凭据 ID") - private String credentialId; - @Schema(description="凭据名称") - private String credentialName; - @Schema(description="凭据用户ID") - private String credentialUserId; - @Schema(description="凭据类型") - private String credentialType; - @Schema(description="凭据备注") - private String credentialRemark; - @Schema(description="凭据内容") - private String credentialV1; - @Schema(description="凭据内容") - private String credentialV2; - @Schema(description="凭据内容") - private String credentialV3; - @Schema(description="凭据内容") - private String credentialV4; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="修改人") - private String updateUser; - @Schema(description="") - private Boolean allowAcrossProject; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDataSourceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDataSourceRecord.java deleted file mode 100644 index 3b0dd31c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDataSourceRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDataSourceRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="集群名称") - private String clusterName; - @Schema(description="模块标识") - private String moduleCode; - @Schema(description="数据源名称") - private String dataSourceName; - @Schema(description="容量是否满标识 true:是,false:否") - private Boolean fullFlag; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="数据源URL地址") - private String dsUrl; - @Schema(description="数据源标签") - private String tag; - @Schema(description="数据库类型,DB:普通数据库,ARCHIVE_DB:归档数据库") - private String type; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchJobDailyMetricsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchJobDailyMetricsRecord.java deleted file mode 100644 index 8d836b90..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchJobDailyMetricsRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchJobDailyMetricsRecord { - @Schema(description="自增ID") - private Long id; - @Schema(description="日期,格式:2023-12-09") - private String theDate; - @Schema(description="项目ID") - private String projectId; - @Schema(description="运营ID") - private String productId; - @Schema(description="job构建类型") - private String jobType; - @Schema(description="构建来源,包含:BS,CODECC,AM,GIT等") - private String channelCode; - @Schema(description="job最大并发构建次数") - private Integer maxJobConcurrency; - @Schema(description="当天累计JOB耗时") - private Integer sumJobCost; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildContainerPoolNoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildContainerPoolNoRecord.java deleted file mode 100644 index 230d835b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildContainerPoolNoRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchKubernetesBuildContainerPoolNoRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="VmSeqID") - private String vmSeqId; - @Schema(description="流水线重试次数") - private Integer executeCount; - @Schema(description="容器名称") - private String containerName; - @Schema(description="构建机池编号") - private String poolNo; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildHisRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildHisRecord.java deleted file mode 100644 index 8f2fb4a1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildHisRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchKubernetesBuildHisRecord { - @Schema(description="") - private Long id; - @Schema(description="pipeline id") - private String pipelineId; - @Schema(description="build id") - private String buidldId; - @Schema(description="vm seq id") - private String vmSeqId; - @Schema(description="容器名称") - private String containerName; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; - @Schema(description="CPU") - private Integer cpu; - @Schema(description="内存") - private String memory; - @Schema(description="磁盘") - private String disk; - @Schema(description="构建密钥") - private String secretKey; - @Schema(description="并发构建池") - private String poolNo; - @Schema(description="流水线重试次数") - private Integer executeCount; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildHistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildHistoryRecord.java deleted file mode 100644 index e09bff87..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildHistoryRecord.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchKubernetesBuildHistoryRecord { - @Schema(description="") - private Long id; - @Schema(description="蓝盾项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线构建ID") - private String buildId; - @Schema(description="流水线CONTAINER_ID") - private String vmSeqId; - @Schema(description="构件池ID") - private Integer poolNo; - @Schema(description="构建容器ID") - private String containerName; - @Schema(description="构建密钥") - private String secretKey; - @Schema(description="构建容器CPU配额") - private Double cpu; - @Schema(description="构建容器内存配额 单位M") - private String memory; - @Schema(description="构建容器磁盘配额 单位G") - private String disk; - @Schema(description="流水线重试次数") - private Integer executeCount; - @Schema(description="DISPATCH类型") - private String dispatchType; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildPoolRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildPoolRecord.java deleted file mode 100644 index 3d32ee33..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildPoolRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchKubernetesBuildPoolRecord { - @Schema(description="") - private Long id; - @Schema(description="流水线构建ID") - private String buildId; - @Schema(description="流水线CONTAINER_ID") - private String vmSeqId; - @Schema(description="构建容器ID") - private String containerName; - @Schema(description="流水线重试次数") - private Integer executeCount; - @Schema(description="构建池编号") - private Integer poolNo; - @Schema(description="DISPATCH类型") - private String dispatchType; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildRecord.java deleted file mode 100644 index c2b3760e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesBuildRecord.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchKubernetesBuildRecord { - @Schema(description="") - private String pipelineId; - @Schema(description="") - private String vmSeqId; - @Schema(description="") - private Integer poolNo; - @Schema(description="") - private String projectId; - @Schema(description="") - private String containerName; - @Schema(description="") - private String images; - @Schema(description="") - private Integer status; - @Schema(description="") - private Date createdTime; - @Schema(description="") - private Date updateTime; - @Schema(description="") - private String userId; - @Schema(description="是否处于debug状态") - private Boolean debugStatus; - @Schema(description="debug时间") - private Date debugTime; - @Schema(description="CPU") - private Integer cpu; - @Schema(description="内存") - private String memory; - @Schema(description="磁盘") - private String disk; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesPerformanceConfigRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesPerformanceConfigRecord.java deleted file mode 100644 index 8418fde4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesPerformanceConfigRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchKubernetesPerformanceConfigRecord { - @Schema(description="主键") - private Long id; - @Schema(description="DISPATCH类型") - private String dispatchType; - @Schema(description="蓝盾项目ID") - private String projectId; - @Schema(description="基础配置ID") - private Long optionId; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesPerformanceOptionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesPerformanceOptionRecord.java deleted file mode 100644 index 1ad9ede9..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchKubernetesPerformanceOptionRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchKubernetesPerformanceOptionRecord { - @Schema(description="主键") - private Long id; - @Schema(description="DISPATCH类型") - private String dispatchType; - @Schema(description="CPU") - private Double cpu; - @Schema(description="内存 单位M") - private String memory; - @Schema(description="磁盘 单位G") - private String disk; - @Schema(description="描述") - private String description; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineBuildRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineBuildRecord.java deleted file mode 100644 index 61b5daed..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineBuildRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineBuildRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序列号") - private String vmSeqId; - @Schema(description="虚拟机ID") - private Long vmId; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="状态") - private Integer status; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerBuildRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerBuildRecord.java deleted file mode 100644 index d628de2f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerBuildRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerBuildRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序列号") - private Integer vmSeqId; - @Schema(description="密钥") - private String secretKey; - @Schema(description="状态") - private Integer status; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="构建机地域") - private String zone; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="发送信息") - private String dispatchMessage; - @Schema(description="启动信息") - private String startupMessage; - @Schema(description="消息队列的路由KEY") - private String routeKey; - @Schema(description="") - private Long dockerInstId; - @Schema(description="版本ID") - private Integer versionId; - @Schema(description="模板ID") - private Integer templateId; - @Schema(description="命名空间ID") - private Long namespaceId; - @Schema(description="构建机IP") - private String dockerIp; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="构建容器池序号") - private Integer poolNo; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerDebugRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerDebugRecord.java deleted file mode 100644 index 8118a38d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerDebugRecord.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerDebugRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建序列号") - private String vmSeqId; - @Schema(description="构建池序号") - private Integer poolNo; - @Schema(description="状态") - private Integer status; - @Schema(description="TOKEN") - private String token; - @Schema(description="镜像名称") - private String imageName; - @Schema(description="主机标签") - private String hostTag; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="构建机地域") - private String zone; - @Schema(description="构建机环境变量") - private String buildEnv; - @Schema(description="注册用户名") - private String registryUser; - @Schema(description="注册用户密码") - private String registryPwd; - @Schema(description="镜像类型") - private String imageType; - @Schema(description="镜像是否为公共镜像:0否1是") - private Boolean imagePublicFlag; - @Schema(description="镜像研发来源:0自研1第三方") - private Integer imageRdType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerEnableRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerEnableRecord.java deleted file mode 100644 index 3b5b9ecc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerEnableRecord.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerEnableRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建序列号") - private Integer vmSeqId; - @Schema(description="是否启用") - private Integer enable; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerHostRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerHostRecord.java deleted file mode 100644 index 0550cf86..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerHostRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerHostRecord { - @Schema(description="用户组所属项目") - private String projectCode; - @Schema(description="主机ip") - private String hostIp; - @Schema(description="评论") - private String remark; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="类型") - private Integer type; - @Schema(description="消息队列的路由KEY") - private String routeKey; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerHostZoneRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerHostZoneRecord.java deleted file mode 100644 index c601cc3a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerHostZoneRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerHostZoneRecord { - @Schema(description="主机ip") - private String hostIp; - @Schema(description="构建机地域") - private String zone; - @Schema(description="是否启用") - private Integer enable; - @Schema(description="评论") - private String remark; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="类型") - private Integer type; - @Schema(description="消息队列的路由KEY") - private String routeKey; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerIpInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerIpInfoRecord.java deleted file mode 100644 index 6f6befa6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerIpInfoRecord.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerIpInfoRecord { - @Schema(description="主键") - private Long id; - @Schema(description="DOCKER IP") - private String dockerIp; - @Schema(description="DOCKER PORT") - private Integer dockerHostPort; - @Schema(description="节点容器总容量") - private Integer capacity; - @Schema(description="节点容器已使用容量") - private Integer usedNum; - @Schema(description="节点容器CPU负载") - private Integer cpuLoad; - @Schema(description="节点容器MEM负载") - private Integer memLoad; - @Schema(description="节点容器DISK负载") - private Integer diskLoad; - @Schema(description="节点容器DISK IO负载") - private Integer diskIoLoad; - @Schema(description="节点是否可用") - private Boolean enable; - @Schema(description="节点是否作为专用机") - private Boolean specialOn; - @Schema(description="是否为灰度节点") - private Boolean grayEnv; - @Schema(description="构建集群类型") - private String clusterName; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerPoolRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerPoolRecord.java deleted file mode 100644 index 650c0f4a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerPoolRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerPoolRecord { - @Schema(description="主键") - private Long id; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建机序号") - private String vmSeq; - @Schema(description="构建池序号") - private Integer poolNo; - @Schema(description="构建池状态") - private Integer status; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskDriftRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskDriftRecord.java deleted file mode 100644 index ce3dec13..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskDriftRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerTaskDriftRecord { - @Schema(description="主键") - private Long id; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建机序号") - private String vmSeq; - @Schema(description="旧构建容器IP") - private String oldDockerIp; - @Schema(description="新构建容器IP") - private String newDockerIp; - @Schema(description="旧容器IP负载") - private String oldDockerIpInfo; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskRecord.java deleted file mode 100644 index 35bea145..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskRecord.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerTaskRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="构建机ID") - private String agentId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序列号") - private Integer vmSeqId; - @Schema(description="状态") - private Integer status; - @Schema(description="密钥") - private String secretKey; - @Schema(description="镜像名称") - private String imageName; - @Schema(description="渠道号,默认为DS") - private String channelCode; - @Schema(description="主机标签") - private String hostTag; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="构建机地域") - private String zone; - @Schema(description="注册用户名") - private String registryUser; - @Schema(description="注册用户密码") - private String registryPwd; - @Schema(description="镜像类型") - private String imageType; - @Schema(description="构建Job唯一标识") - private String containerHashId; - @Schema(description="镜像是否为公共镜像:0否1是") - private Boolean imagePublicFlag; - @Schema(description="镜像研发来源:0自研1第三方") - private Integer imageRdType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskSimpleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskSimpleRecord.java deleted file mode 100644 index ccecf44f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchPipelineDockerTaskSimpleRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchPipelineDockerTaskSimpleRecord { - @Schema(description="主键") - private Long id; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建机序号") - private String vmSeq; - @Schema(description="构建容器IP") - private String dockerIp; - @Schema(description="构建资源配置") - private Integer dockerResourceOption; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchProjectRunTimeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchProjectRunTimeRecord.java deleted file mode 100644 index dc623845..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchProjectRunTimeRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchProjectRunTimeRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="VM 类型") - private String vmType; - @Schema(description="运行时长") - private Long runTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaJobSystemRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaJobSystemRecord.java deleted file mode 100644 index f979a327..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaJobSystemRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchQuotaJobSystemRecord { - @Schema(description="自增ID") - private Long id; - @Schema(description="构建机类型") - private String vmType; - @Schema(description="构建来源,包含:BS,CODECC,AM,GIT等") - private String channelCode; - @Schema(description="系统最大并发JOB数") - private Integer runningJobsMaxSystem; - @Schema(description="单项目默认最大并发JOB数") - private Integer runningJobsMaxProject; - @Schema(description="系统默认所有单个JOB最大执行时间") - private Integer runningTimeJobMax; - @Schema(description="默认单项目所有JOB最大执行时间") - private Integer runningTimeJobMaxProject; - @Schema(description="项目执行job数量告警阈值") - private Integer projectRunningJobThreshold; - @Schema(description="项目执行job时间告警阈值") - private Integer projectRunningTimeThreshold; - @Schema(description="系统执行job数量告警阈值") - private Integer systemRunningJobThreshold; - @Schema(description="操作人") - private String operator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaProjectRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaProjectRecord.java deleted file mode 100644 index b3446623..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaProjectRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchQuotaProjectRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="VM 类型") - private String vmType; - @Schema(description="构建来源,包含:BS,CODECC,AM,GIT等") - private String channelCode; - @Schema(description="项目最大并发JOB数") - private Integer runningJobsMax; - @Schema(description="项目单JOB最大执行时间") - private Integer runningTimeJobMax; - @Schema(description="项目所有JOB最大执行时间") - private Integer runningTimeProjectMax; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="操作人") - private String operator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaSystemRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaSystemRecord.java deleted file mode 100644 index 4e0c22d0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchQuotaSystemRecord.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchQuotaSystemRecord { - @Schema(description="构建机类型") - private String vmType; - @Schema(description="蓝盾系统最大并发JOB数") - private Integer runningJobsMaxSystem; - @Schema(description="单项目默认最大并发JOB数") - private Integer runningJobsMaxProject; - @Schema(description="系统默认所有单个JOB最大执行时间") - private Integer runningTimeJobMax; - @Schema(description="默认单项目所有JOB最大执行时间") - private Integer runningTimeJobMaxProject; - @Schema(description="工蜂CI系统总最大并发JOB数量") - private Integer runningJobsMaxGitciSystem; - @Schema(description="工蜂CI单项目最大并发JOB数量") - private Integer runningJobsMaxGitciProject; - @Schema(description="工蜂CI单JOB最大执行时间") - private Integer runningTimeJobMaxGitci; - @Schema(description="工蜂CI单项目最大执行时间") - private Integer runningTimeJobMaxProjectGitci; - @Schema(description="项目执行job数量告警阈值") - private Integer projectRunningJobThreshold; - @Schema(description="项目执行job时间告警阈值") - private Integer projectRunningTimeThreshold; - @Schema(description="系统执行job数量告警阈值") - private Integer systemRunningJobThreshold; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="操作人") - private String operator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchRunningJobsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchRunningJobsRecord.java deleted file mode 100644 index 9176fdb5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchRunningJobsRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchRunningJobsRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="VM 类型") - private String vmType; - @Schema(description="构建来源,包含:BS,CODECC,AM,GIT等") - private String channelCode; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序列号") - private String vmSeqId; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="构建机启动时间") - private Date agentStartTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentBuildRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentBuildRecord.java deleted file mode 100644 index f2846f3c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentBuildRecord.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchThirdpartyAgentBuildRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="构建机ID") - private String agentId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序列号") - private String vmSeqId; - @Schema(description="状态") - private Integer status; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="工作空间") - private String workspace; - @Schema(description="构建次数") - private Integer buildNum; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="任务名称") - private String taskName; - @Schema(description="节点IP") - private String agentIp; - @Schema(description="第三方构建机NODE_ID") - private Long nodeId; - @Schema(description="第三方构建机docker构建信息") - private Object dockerInfo; - @Schema(description="流水线执行次数") - private Integer executeCount; - @Schema(description="容器ID日志使用") - private String containerHashId; - @Schema(description="第三方构建所属环境") - private Long envId; - @Schema(description="这次调度被排除的agent节点") - private Object ignoreEnvAgentIds; - @Schema(description="当前构建所属jobid") - private String jobId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentDockerDebugRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentDockerDebugRecord.java deleted file mode 100644 index 4e886ba4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentDockerDebugRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchThirdpartyAgentDockerDebugRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建机ID") - private String agentId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序列号") - private String vmSeqId; - @Schema(description="调试用户") - private String userId; - @Schema(description="状态") - private Integer status; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="工作空间") - private String workspace; - @Schema(description="第三方构建机docker构建信息") - private Object dockerInfo; - @Schema(description="启动构建时的错误信息") - private String errMsg; - @Schema(description="debug链接") - private String debugUrl; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentQueueRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentQueueRecord.java deleted file mode 100644 index 096eafa0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDispatchThirdpartyAgentQueueRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDispatchThirdpartyAgentQueueRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序列号") - private String vmSeqId; - @Schema(description="排队资源,随着类型不同而不同") - private String data; - @Schema(description="排队资源类型") - private String dataType; - @Schema(description="额外的事件信息") - private Object info; - @Schema(description="重试次数") - private Integer retryTime; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDockerResourceOptionsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDockerResourceOptionsRecord.java deleted file mode 100644 index c563ee1d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TDockerResourceOptionsRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TDockerResourceOptionsRecord { - @Schema(description="主键") - private Long id; - @Schema(description="CPU配置") - private Integer cpuPeriod; - @Schema(description="CPU配置") - private Integer cpuQuota; - @Schema(description="内存:32G") - private Long memoryLimitBytes; - @Schema(description="磁盘:100G") - private Integer disk; - @Schema(description="磁盘写入速率,120m/s") - private Long blkioDeviceWriteBps; - @Schema(description="磁盘读入速率,120m/s") - private Long blkioDeviceReadBps; - @Schema(description="描述") - private String description; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEmailsNotifyMessageTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEmailsNotifyMessageTemplateRecord.java deleted file mode 100644 index 2e11b373..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEmailsNotifyMessageTemplateRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEmailsNotifyMessageTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板ID") - private String commonTemplateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifior; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="邮件标题") - private String title; - @Schema(description="邮件内容") - private String body; - @Schema(description="邮件格式(0:文本 1:html网页)") - private Integer bodyFormat; - @Schema(description="邮件类型(0:外部邮件 1:内部邮件)") - private Integer emailType; - @Schema(description="腾讯云邮件模板id") - private Integer tencentCloudTemplateId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvNodeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvNodeRecord.java deleted file mode 100644 index c7e3a81b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvNodeRecord.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvNodeRecord { - @Schema(description="环境ID") - private Long envId; - @Schema(description="节点ID") - private Long nodeId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="是否启用节点") - private Boolean enableNode; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvRecord.java deleted file mode 100644 index 96a81d71..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvRecord { - @Schema(description="主键ID") - private Long envId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="环境名称") - private String envName; - @Schema(description="环境描述") - private String envDesc; - @Schema(description="环境类型(开发环境{DEV}|测试环境{TEST}|构建环境{BUILD})") - private String envType; - @Schema(description="环境变量") - private String envVars; - @Schema(description="创建人") - private String createdUser; - @Schema(description="修改人") - private String updatedUser; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="环境哈希ID") - private String envHashId; - @Schema(description="是否删除") - private Boolean isDeleted; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvShareProjectRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvShareProjectRecord.java deleted file mode 100644 index 2f33bb37..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvShareProjectRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvShareProjectRecord { - @Schema(description="环境ID") - private Long envId; - @Schema(description="主项目ID") - private String mainProjectId; - @Schema(description="共享的目标项目ID") - private String sharedProjectId; - @Schema(description="环境名称") - private String envName; - @Schema(description="目标项目名称") - private String sharedProjectName; - @Schema(description="类型") - private String type; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentAgentPipelineRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentAgentPipelineRecord.java deleted file mode 100644 index ed231c7f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentAgentPipelineRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvironmentAgentPipelineRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建机ID") - private Long agentId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="用户ID") - private String userId; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="状态") - private Integer status; - @Schema(description="Pipeline Type") - private String pipeline; - @Schema(description="") - private String response; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentSlaveGatewayRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentSlaveGatewayRecord.java deleted file mode 100644 index eb886a48..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentSlaveGatewayRecord.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvironmentSlaveGatewayRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="名称") - private String name; - @Schema(description="展示名称") - private String showName; - @Schema(description="网关地址") - private String gateway; - @Schema(description="文件网关地址") - private String fileGateway; - @Schema(description="是否在界面可见") - private Boolean visibility; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyAgentActionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyAgentActionRecord.java deleted file mode 100644 index 6af93bf5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyAgentActionRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvironmentThirdpartyAgentActionRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建机ID") - private Long agentId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="操作") - private String action; - @Schema(description="操作时间") - private Date actionTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyAgentRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyAgentRecord.java deleted file mode 100644 index bbab4cba..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyAgentRecord.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvironmentThirdpartyAgentRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="节点ID") - private Long nodeId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="主机名称") - private String hostname; - @Schema(description="ip地址") - private String ip; - @Schema(description="操作系统") - private String os; - @Schema(description="检测操作系统") - private String detectOs; - @Schema(description="状态") - private Integer status; - @Schema(description="密钥") - private String secretKey; - @Schema(description="创建者") - private String createdUser; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="主机IP") - private String startRemoteIp; - @Schema(description="目标服务网关") - private String gateway; - @Schema(description="版本号") - private String version; - @Schema(description="主版本") - private String masterVersion; - @Schema(description="并行任务计数") - private Integer parallelTaskCount; - @Schema(description="构建机安装路径") - private String agentInstallPath; - @Schema(description="启动者") - private String startedUser; - @Schema(description="环境变量") - private String agentEnvs; - @Schema(description="文件网关路径") - private String fileGateway; - @Schema(description="agent config 配置项Json") - private String agentProps; - @Schema(description="Docker构建机并行任务计数") - private Integer dockerParallelTaskCount; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyEnableProjectsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyEnableProjectsRecord.java deleted file mode 100644 index 58c7edc5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TEnvironmentThirdpartyEnableProjectsRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TEnvironmentThirdpartyEnableProjectsRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="是否启用") - private Integer enalbe; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TErrorCodeInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TErrorCodeInfoRecord.java deleted file mode 100644 index 0715edd4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TErrorCodeInfoRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TErrorCodeInfoRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="错误类型") - private Integer errorType; - @Schema(description="错误的标识码") - private Integer errorCode; - @Schema(description="错误描述") - private String errorMsg; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="关联插件Code") - private String atomCode; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TErrorTypeDictRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TErrorTypeDictRecord.java deleted file mode 100644 index 329a7e65..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TErrorTypeDictRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TErrorTypeDictRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="错误类型") - private Integer errorType; - @Schema(description="错误类型名称") - private String name; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFavoriteRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFavoriteRecord.java deleted file mode 100644 index 3b54a706..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFavoriteRecord.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TFavoriteRecord { - @Schema(description="主键id") - private Long id; - @Schema(description="服务id") - private Long serviceId; - @Schema(description="用户") - private String username; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFileInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFileInfoRecord.java deleted file mode 100644 index 7ba31660..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFileInfoRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TFileInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="用户组所属项目") - private String projectCode; - @Schema(description="文件类型") - private String fileType; - @Schema(description="文件路径") - private String filePath; - @Schema(description="文件名字") - private String fileName; - @Schema(description="文件大小") - private Long fileSize; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFilePropsInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFilePropsInfoRecord.java deleted file mode 100644 index afb652cd..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFilePropsInfoRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TFilePropsInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="属性字段key") - private String propsKey; - @Schema(description="属性字段value") - private String propsValue; - @Schema(description="文件ID") - private String fileId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFileTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFileTaskRecord.java deleted file mode 100644 index 13bed8fb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TFileTaskRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TFileTaskRecord { - @Schema(description="任务ID") - private String taskId; - @Schema(description="文件类型") - private String fileType; - @Schema(description="文件路径") - private String filePath; - @Schema(description="机器ip地址") - private String machineIp; - @Schema(description="本地路径") - private String localPath; - @Schema(description="状态") - private Integer status; - @Schema(description="用户ID") - private String userId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitBasicSettingRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitBasicSettingRecord.java deleted file mode 100644 index 88e66713..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitBasicSettingRecord.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitBasicSettingRecord { - @Schema(description="GIT项目ID") - private Long id; - @Schema(description="GIT项目名") - private String name; - @Schema(description="GIT项目URL") - private String url; - @Schema(description="GIT项目HomePage") - private String homePage; - @Schema(description="GIT项目httpUrl") - private String gitHttpUrl; - @Schema(description="GIT项目sshUrl") - private String gitSshUrl; - @Schema(description="是否启用CI功能") - private Boolean enableCi; - @Schema(description="Build pushed branches") - private Boolean buildPushedBranches; - @Schema(description="Build pushed pull request") - private Boolean buildPushedPullRequest; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="蓝盾项目Code") - private String projectCode; - @Schema(description="是否开启MR锁定") - private Boolean enableMrBlock; - @Schema(description="CI开启人,用于Oauth权限校验") - private String enableUserId; - @Schema(description="CI开启人所在事业群") - private String creatorBgName; - @Schema(description="CI开启人所在部门") - private String creatorDeptName; - @Schema(description="CI开启人所在中心") - private String creatorCenterName; - @Schema(description="GIT项目的描述信息") - private String gitProjectDesc; - @Schema(description="GIT项目的头像信息") - private String gitProjectAvatar; - @Schema(description="最后一次构建的CI信息") - private String lastCiInfo; - @Schema(description="OAUTH身份的修改者") - private String oauthOperator; - @Schema(description="项目中的构建是否发送commitcheck") - private Boolean enableCommitCheck; - @Schema(description="带有名空间的项目路径") - private String pathWithNameSpace; - @Schema(description="带有名空间的项目名称") - private String nameWithNameSpace; - @Schema(description="项目中的MR是否发送评论") - private Boolean enableMrComment; - @Schema(description="pr、mr触发时的权限校验(存储为json字符串)") - private String triggerReviewSetting; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitPipelineRepoResourceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitPipelineRepoResourceRecord.java deleted file mode 100644 index 470828d8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitPipelineRepoResourceRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitPipelineRepoResourceRecord { - @Schema(description="ID") - private Long id; - @Schema(description="触发库工蜂项目ID") - private String sourceGitProjectPath; - @Schema(description="流水线主库工蜂项目ID") - private Long targetGitProjectId; - @Schema(description="对应蓝盾流水线ID") - private String pipelineId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitPipelineResourceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitPipelineResourceRecord.java deleted file mode 100644 index c8ab36f3..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitPipelineResourceRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitPipelineResourceRecord { - @Schema(description="ID") - private Long id; - @Schema(description="GIT项目ID") - private Long gitProjectId; - @Schema(description="工程中yml文件路径") - private String filePath; - @Schema(description="对应蓝盾流水线ID") - private String pipelineId; - @Schema(description="GITCI流水线名称") - private String displayName; - @Schema(description="最初创建人") - private String creator; - @Schema(description="流水线启用状态") - private Boolean enabled; - @Schema(description="最新一次构建ID") - private String latestBuildId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="YAML版本号") - private String version; - @Schema(description="文件子路径") - private String directory; - @Schema(description="") - private String lastUpdateBranch; - @Schema(description="最后一次修改的model的MD5值") - private String lastEditModelMd5; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventBuildRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventBuildRecord.java deleted file mode 100644 index e9cf90fd..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventBuildRecord.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitRequestEventBuildRecord { - @Schema(description="ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="EVENT_ID") - private Long eventId; - @Schema(description="初始yaml") - private String originYaml; - @Schema(description="格式化后的yaml") - private String normalizedYaml; - @Schema(description="蓝盾流水线ID") - private String pipelineId; - @Schema(description="蓝盾流水线BuildId") - private String buildId; - @Schema(description="GIT项目ID") - private Long gitProjectId; - @Schema(description="branch") - private String branch; - @Schema(description="触发类型:push,tag_push,merge_request,issue,note,") - private String objectKind; - @Schema(description="描述") - private String description; - @Schema(description="触发人") - private String triggerUser; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="源分支的所属库ID(为了支持fork库)") - private Long sourceGitProjectId; - @Schema(description="替换完模板的yaml") - private String parsedYaml; - @Schema(description="构建状态") - private String buildStatus; - @Schema(description="YAML版本号") - private String version; - @Schema(description="") - private String commitMessage; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventNotBuildRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventNotBuildRecord.java deleted file mode 100644 index cc741532..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventNotBuildRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitRequestEventNotBuildRecord { - @Schema(description="ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="EVENT_ID") - private Long eventId; - @Schema(description="初始yaml") - private String originYaml; - @Schema(description="格式化后的yaml") - private String normalizedYaml; - @Schema(description="未触发构建原因") - private String reason; - @Schema(description="GIT项目ID") - private Long gitProjectId; - @Schema(description="") - private String reasonDetail; - @Schema(description="匹配上的流水线ID") - private String pipelineId; - @Schema(description="yml文件路径") - private String filePath; - @Schema(description="替换完模板的yaml") - private String parsedYaml; - @Schema(description="YAML版本号") - private String version; - @Schema(description="git分支") - private String branch; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventRecord.java deleted file mode 100644 index 3af8e0f9..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestEventRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitRequestEventRecord { - @Schema(description="ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="触发类型:push,tag_push,merge_request,issue,note,") - private String objectKind; - @Schema(description="operation_kind, create, delete, update") - private String operationKind; - @Schema(description="open, close, reopen, update, push-update, merge") - private String extensionAction; - @Schema(description="GIT项目ID") - private Long gitProjectId; - @Schema(description="branch") - private String branch; - @Schema(description="targetBranch") - private String targetBranch; - @Schema(description="commit id") - private String commitId; - @Schema(description="") - private String commitMsg; - @Schema(description="commit timestamp") - private String commitTimestamp; - @Schema(description="user name") - private String userName; - @Schema(description="total_commits_count") - private Long totalCommitCount; - @Schema(description="merge_request_id") - private Long mergeRequestId; - @Schema(description="event") - private String event; - @Schema(description="描述") - private String description; - @Schema(description="") - private String mrTitle; - @Schema(description="fork库GIT项目ID") - private Long sourceGitProjectId; - @Schema(description="") - private String commitMessage; - @Schema(description="yaml变更文件列表") - private String changeYamlList; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestRepoEventRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestRepoEventRecord.java deleted file mode 100644 index 8e1b4c75..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitRequestRepoEventRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitRequestRepoEventRecord { - @Schema(description="ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="EVENT_ID") - private Long eventId; - @Schema(description="蓝盾流水线ID") - private String pipelineId; - @Schema(description="蓝盾流水线BuildId") - private String buildId; - @Schema(description="流水线主库projectId") - private Long targetGitProjectId; - @Schema(description="触发库projectId") - private Long sourceGitProjectId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitUserMessageRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitUserMessageRecord.java deleted file mode 100644 index a0fe37f1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitUserMessageRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitUserMessageRecord { - @Schema(description="ID") - private Integer id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="消息接收人") - private String userId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="消息类型") - private String messageType; - @Schema(description="消息ID") - private String messageId; - @Schema(description="是否已读") - private Boolean haveRead; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="消息标题") - private String messageTitle; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitWebStarterYamlRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitWebStarterYamlRecord.java deleted file mode 100644 index 3aeb0691..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGitWebStarterYamlRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGitWebStarterYamlRecord { - @Schema(description="") - private String name; - @Schema(description="") - private String description; - @Schema(description="") - private String iconName; - @Schema(description="") - private String categories; - @Schema(description="") - private String yamlContent; - @Schema(description="") - private String iconUrl; - @Schema(description="") - private String yamlUrl; - @Schema(description="") - private Date createTime; - @Schema(description="") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGrayTestRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGrayTestRecord.java deleted file mode 100644 index 689849a0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGrayTestRecord.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGrayTestRecord { - @Schema(description="主键id") - private Long id; - @Schema(description="服务id") - private Long serviceId; - @Schema(description="用户") - private String username; - @Schema(description="服务状态") - private String status; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGroupRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGroupRecord.java deleted file mode 100644 index 90d90097..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TGroupRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TGroupRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="名称") - private String name; - @Schema(description="内部人员") - private String innerUsers; - @Schema(description="内部人员计数") - private Integer innerUsersCount; - @Schema(description="外部人员") - private String outerUsers; - @Schema(description="外部人员计数") - private Integer outerUsersCount; - @Schema(description="评论") - private String remark; - @Schema(description="创建者") - private String creator; - @Schema(description="更新人") - private String updator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/THistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/THistoryRecord.java deleted file mode 100644 index 9d7c2508..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/THistoryRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class THistoryRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="规则ID") - private Long ruleId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="") - private String result; - @Schema(description="拦截列表") - private String interceptList; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="项目数量") - private Long projectNum; - @Schema(description="") - private Integer checkTimes; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TI18nMessageRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TI18nMessageRecord.java deleted file mode 100644 index 45fec6c3..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TI18nMessageRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TI18nMessageRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模块标识") - private String moduleCode; - @Schema(description="国际化语言信息") - private String language; - @Schema(description="国际化变量名") - private String key; - @Schema(description="国际化变量值") - private String value; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageAgentTypeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageAgentTypeRecord.java deleted file mode 100644 index 01cd9a1b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageAgentTypeRecord.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TImageAgentTypeRecord { - @Schema(description="主键") - private String id; - @Schema(description="镜像代码") - private String imageCode; - @Schema(description="机器类型 PUBLIC_DEVNET,PUBLIC_IDC,PUBLIC_DEVCLOUD") - private String agentType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageCategoryRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageCategoryRelRecord.java deleted file mode 100644 index 044dbec0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageCategoryRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TImageCategoryRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="镜像范畴ID") - private String categoryId; - @Schema(description="镜像ID") - private String imageId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageFeatureRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageFeatureRecord.java deleted file mode 100644 index c02daa58..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageFeatureRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TImageFeatureRecord { - @Schema(description="主键") - private String id; - @Schema(description="镜像代码") - private String imageCode; - @Schema(description="是否为公共镜像, TRUE:是 FALSE:不是") - private Boolean publicFlag; - @Schema(description="是否推荐, TRUE:是 FALSE:不是") - private Boolean recommendFlag; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="是否官方认证, TRUE:是 FALSE:不是") - private Boolean certificationFlag; - @Schema(description="权重(数值越大代表权重越高)") - private Integer weight; - @Schema(description="镜像类型:0:蓝鲸官方,1:第三方") - private Integer imageType; - @Schema(description="删除标识 true:是,false:否") - private Boolean deleteFlag; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageLabelRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageLabelRelRecord.java deleted file mode 100644 index 7ae7d6a1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageLabelRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TImageLabelRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="模板标签ID") - private String labelId; - @Schema(description="镜像ID") - private String imageId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageRecord.java deleted file mode 100644 index 8e3b95eb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageRecord.java +++ /dev/null @@ -1,66 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TImageRecord { - @Schema(description="主键") - private String id; - @Schema(description="镜像名称") - private String imageName; - @Schema(description="镜像代码") - private String imageCode; - @Schema(description="所属分类ID") - private String classifyId; - @Schema(description="版本号") - private String version; - @Schema(description="镜像来源,bkdevops:蓝盾源 third:第三方源") - private String imageSourceType; - @Schema(description="镜像仓库地址") - private String imageRepoUrl; - @Schema(description="镜像在仓库名称") - private String imageRepoName; - @Schema(description="ticket身份ID") - private String ticketId; - @Schema(description="镜像状态,0:初始化|1:提交中|2:验证中|3:验证失败|4:测试中|5:审核中|6:审核驳回|7:已发布|8:上架中止|9:下架中|10:已下架") - private Integer imageStatus; - @Schema(description="状态对应的描述,如上架失败原因") - private String imageStatusMsg; - @Schema(description="镜像大小") - private String imageSize; - @Schema(description="镜像tag") - private String imageTag; - @Schema(description="logo地址") - private String logoUrl; - @Schema(description="镜像图标(BASE64字符串)") - private String icon; - @Schema(description="镜像简介") - private String summary; - @Schema(description="镜像描述") - private String description; - @Schema(description="镜像发布者") - private String publisher; - @Schema(description="发布时间") - private Date pubTime; - @Schema(description="是否为最新版本镜像, TRUE:最新 FALSE:非最新") - private Boolean latestFlag; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="支持的构建机环境") - private String agentTypeScope; - @Schema(description="删除标识 true:是,false:否") - private Boolean deleteFlag; - @Schema(description="dockerFile类型(INPUT:手动输入,*_LINK:链接)") - private String dockerFileType; - @Schema(description="dockerFile内容") - private String dockerFileContent; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageVersionLogRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageVersionLogRecord.java deleted file mode 100644 index 3d787d77..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TImageVersionLogRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TImageVersionLogRecord { - @Schema(description="主键") - private String id; - @Schema(description="镜像ID") - private String imageId; - @Schema(description="发布类型,0:新上架 1:非兼容性升级 2:兼容性功能更新 3:兼容性问题修正") - private Integer releaseType; - @Schema(description="版本日志内容") - private String content; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLabelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLabelRecord.java deleted file mode 100644 index 9c13f5bf..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLabelRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TLabelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="镜像标签代码") - private String labelCode; - @Schema(description="标签名称") - private String labelName; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="类型") - private Integer type; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLeafAllocRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLeafAllocRecord.java deleted file mode 100644 index 1a59b0c4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLeafAllocRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TLeafAllocRecord { - @Schema(description="业务标签") - private String bizTag; - @Schema(description="当前最大ID值") - private Long maxId; - @Schema(description="步长,每一次请求获取的ID个数") - private Integer step; - @Schema(description="说明") - private String description; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogIndicesV2Record.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogIndicesV2Record.java deleted file mode 100644 index f5ac9f46..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogIndicesV2Record.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TLogIndicesV2Record { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建ID") - private String buildId; - @Schema(description="") - private String indexName; - @Schema(description="最后行号") - private Long lastLineNum; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="build is enable v2 or not") - private Boolean enable; - @Schema(description="multi es log cluster name") - private String logClusterName; - @Schema(description="use multi es log cluster or not") - private Boolean useCluster; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogStatusRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogStatusRecord.java deleted file mode 100644 index 1763d38e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogStatusRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TLogStatusRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建ID") - private String buildId; - @Schema(description="标签") - private String tag; - @Schema(description="子标签") - private String subTag; - @Schema(description="JOB ID") - private String jobId; - @Schema(description="真正的jobId,已经存在的 JOB_ID 字段其实是 container hash id") - private String userJobId; - @Schema(description="用户填写的插件id") - private String stepId; - @Schema(description="LogStorageMode") - private String mode; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="build is finished or not") - private Boolean finished; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogSubtagsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogSubtagsRecord.java deleted file mode 100644 index 7ea71ea3..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogSubtagsRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TLogSubtagsRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建ID") - private String buildId; - @Schema(description="插件标签") - private String tag; - @Schema(description="插件子标签") - private String subTags; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogoRecord.java deleted file mode 100644 index b57879dc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TLogoRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TLogoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="类型") - private String type; - @Schema(description="LOGO URL地址") - private String logoUrl; - @Schema(description="跳转链接") - private String link; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="显示顺序") - private Integer order; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TMessageCodeDetailRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TMessageCodeDetailRecord.java deleted file mode 100644 index d60faca8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TMessageCodeDetailRecord.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TMessageCodeDetailRecord { - @Schema(description="主键") - private String id; - @Schema(description="code码") - private String messageCode; - @Schema(description="模块代码") - private String moduleCode; - @Schema(description="中文简体描述信息") - private String messageDetailZhCn; - @Schema(description="中文繁体描述信息") - private String messageDetailZhTw; - @Schema(description="英文描述信息") - private String messageDetailEn; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNodeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNodeRecord.java deleted file mode 100644 index 4cd6b9e2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNodeRecord.java +++ /dev/null @@ -1,74 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNodeRecord { - @Schema(description="节点ID 主键ID") - private Long nodeId; - @Schema(description="节点ID字符串") - private String nodeStringId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="节点IP") - private String nodeIp; - @Schema(description="节点名称") - private String nodeName; - @Schema(description="节点状态") - private String nodeStatus; - @Schema(description="节点类型") - private String nodeType; - @Schema(description="集群ID") - private String nodeClusterId; - @Schema(description="节点命名空间") - private String nodeNamespace; - @Schema(description="创建者") - private String createdUser; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="过期时间") - private Date expireTime; - @Schema(description="操作系统名称") - private String osName; - @Schema(description="操作者") - private String operator; - @Schema(description="备份责任人") - private String bakOperator; - @Schema(description="构建机状态") - private Boolean agentStatus; - @Schema(description="别名") - private String displayName; - @Schema(description="镜像") - private String image; - @Schema(description="任务id") - private Long taskId; - @Schema(description="最近修改时间") - private Date lastModifyTime; - @Schema(description="最近修改者") - private String lastModifyUser; - @Schema(description="所属业务") - private Long bizId; - @Schema(description="节点哈希ID") - private String nodeHashId; - @Schema(description="流水线Job引用数") - private Integer pipelineRefCount; - @Schema(description="最近构建时间") - private Date lastBuildTime; - @Schema(description="CC的host_id") - private Long hostId; - @Schema(description="云区域id,公司内为0") - private Long cloudAreaId; - @Schema(description="agent版本") - private String agentVersion; - @Schema(description="从CC中查到的os类型") - private String osType; - @Schema(description="服务器id") - private Long serverId; - @Schema(description="系统任务更新数据时间") - private Date systemUpdateTime; - @Schema(description="机型") - private String size; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNoticeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNoticeRecord.java deleted file mode 100644 index 406b425d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNoticeRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNoticeRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="公告标题") - private String noticeTitle; - @Schema(description="生效日期") - private Date effectDate; - @Schema(description="失效日期") - private Date invalidDate; - @Schema(description="创建日期") - private Date createDate; - @Schema(description="更新日期") - private Date updateDate; - @Schema(description="公告内容") - private String noticeContent; - @Schema(description="跳转地址") - private String redirectUrl; - @Schema(description="消息类型:0.弹框 1.跑马灯") - private Integer noticeType; - @Schema(description="服务名称") - private String serviceName; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyEmailRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyEmailRecord.java deleted file mode 100644 index 54584d5d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyEmailRecord.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNotifyEmailRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="是否成功") - private Boolean success; - @Schema(description="邮件来源") - private String source; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="邮件接收者") - private String to; - @Schema(description="邮件标题") - private String title; - @Schema(description="邮件内容") - private String body; - @Schema(description="优先级") - private Integer priority; - @Schema(description="重试次数") - private Integer retryCount; - @Schema(description="最后错误内容") - private String lastError; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="邮件抄送接收者") - private String cc; - @Schema(description="邮件密送接收者") - private String bcc; - @Schema(description="格式") - private Integer format; - @Schema(description="类型") - private Integer type; - @Schema(description="内容md5值,由title和body计算得,频率限制时使用") - private String contentMd5; - @Schema(description="频率限制时长,单位分钟,即n分钟内不重发成功的消息") - private Integer frequencyLimit; - @Schema(description="tof系统id") - private String tofSysId; - @Schema(description="发送消息的系统id") - private String fromSysId; - @Schema(description="延迟发送的时间,秒") - private Integer delayseconds; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyRtxRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyRtxRecord.java deleted file mode 100644 index 1dc82d6e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyRtxRecord.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNotifyRtxRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="RTX通知批次ID") - private String batchId; - @Schema(description="是否成功") - private Boolean success; - @Schema(description="邮件来源") - private String source; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="通知接收者") - private String receivers; - @Schema(description="邮件标题") - private String title; - @Schema(description="邮件内容") - private String body; - @Schema(description="优先级") - private Integer priority; - @Schema(description="重试次数") - private Integer retryCount; - @Schema(description="最后错误内容") - private String lastError; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="内容md5值,由title和body计算得,频率限制时使用") - private String contentMd5; - @Schema(description="频率限制时长,单位分钟,即n分钟内不重发成功的消息") - private Integer frequencyLimit; - @Schema(description="tof系统id") - private String tofSysId; - @Schema(description="发送消息的系统id") - private String fromSysId; - @Schema(description="延迟发送的时间,秒") - private Integer delayseconds; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifySmsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifySmsRecord.java deleted file mode 100644 index b45a9c92..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifySmsRecord.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNotifySmsRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="是否成功") - private Boolean success; - @Schema(description="邮件来源") - private String source; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="通知接收者") - private String receivers; - @Schema(description="邮件内容") - private String body; - @Schema(description="优先级") - private Integer priority; - @Schema(description="重试次数") - private Integer retryCount; - @Schema(description="最后错误内容") - private String lastError; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="通知批次ID") - private String batchId; - @Schema(description="") - private String tNotifySmscol; - @Schema(description="内容md5值,由title和body计算得,频率限制时使用") - private String contentMd5; - @Schema(description="频率限制时长,单位分钟,即n分钟内不重发成功的消息") - private Integer frequencyLimit; - @Schema(description="tof系统id") - private String tofSysId; - @Schema(description="发送消息的系统id") - private String fromSysId; - @Schema(description="延迟发送的时间,秒") - private Integer delayseconds; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyVoiceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyVoiceRecord.java deleted file mode 100644 index 35de1373..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyVoiceRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNotifyVoiceRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="是否成功") - private Boolean success; - @Schema(description="语音接收者") - private String receivers; - @Schema(description="任务名称") - private String taskName; - @Schema(description="呼叫内容") - private String content; - @Schema(description="转接责任人") - private String transferReceiver; - @Schema(description="重试次数") - private Integer retryCount; - @Schema(description="最后错误内容") - private String lastError; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="tof系统id") - private String tofSysId; - @Schema(description="发送消息的系统id") - private String fromSysId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyWechatRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyWechatRecord.java deleted file mode 100644 index a6eeb63b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyWechatRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNotifyWechatRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="是否成功") - private Boolean success; - @Schema(description="邮件来源") - private String source; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="通知接收者") - private String receivers; - @Schema(description="邮件内容") - private String body; - @Schema(description="优先级") - private Integer priority; - @Schema(description="重试次数") - private Integer retryCount; - @Schema(description="最后错误内容") - private String lastError; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="内容md5值,由title和body计算得,频率限制时使用") - private String contentMd5; - @Schema(description="频率限制时长,单位分钟,即n分钟内不重发成功的消息") - private Integer frequencyLimit; - @Schema(description="tof系统id") - private String tofSysId; - @Schema(description="发送消息的系统id") - private String fromSysId; - @Schema(description="延迟发送的时间,秒") - private Integer delayseconds; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyWeworkRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyWeworkRecord.java deleted file mode 100644 index 393e0251..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TNotifyWeworkRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TNotifyWeworkRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="是否成功") - private Boolean success; - @Schema(description="通知接收者") - private String receivers; - @Schema(description="邮件内容") - private String body; - @Schema(description="最后错误内容") - private String lastError; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOpenapiMetricsForApiRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOpenapiMetricsForApiRecord.java deleted file mode 100644 index 1da161cb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOpenapiMetricsForApiRecord.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TOpenapiMetricsForApiRecord { - @Schema(description="api接口代码") - private String api; - @Schema(description="APP编码/api请求用户") - private String key; - @Schema(description="秒级并发量") - private Integer secondLevelConcurrency; - @Schema(description="峰值并发量") - private Integer peakConcurrency; - @Schema(description="5min调用量") - private Integer call5m; - @Schema(description="1h调用量") - private Integer call1h; - @Schema(description="24h调用量") - private Integer call24h; - @Schema(description="7d调用量") - private Integer call7d; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOpenapiMetricsForProjectRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOpenapiMetricsForProjectRecord.java deleted file mode 100644 index f715078d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOpenapiMetricsForProjectRecord.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TOpenapiMetricsForProjectRecord { - @Schema(description="项目id") - private String project; - @Schema(description="api接口代码") - private String api; - @Schema(description="APP编码/api请求用户") - private String key; - @Schema(description="历史累计调用") - private Integer callHistory; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOperationalProductRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOperationalProductRecord.java deleted file mode 100644 index c5be3940..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TOperationalProductRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TOperationalProductRecord { - @Schema(description="运营产品ID") - private Integer productId; - @Schema(description="运营产品名称") - private String productName; - @Schema(description="规划产品名称") - private String planProductName; - @Schema(description="部门名称") - private String deptName; - @Schema(description="BG名称") - private String bgName; - @Schema(description="创建时间") - private Date createdAt; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceBaseRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceBaseRecord.java deleted file mode 100644 index a73c5e2a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceBaseRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineAtomReplaceBaseRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID信息") - private String pipelineIdInfo; - @Schema(description="被替换插件代码") - private String fromAtomCode; - @Schema(description="被替换插件代码") - private String toAtomCode; - @Schema(description="状态") - private String status; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceHistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceHistoryRecord.java deleted file mode 100644 index de028d82..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceHistoryRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineAtomReplaceHistoryRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="业务ID") - private String busId; - @Schema(description="业务类型") - private String busType; - @Schema(description="源版本号") - private Integer sourceVersion; - @Schema(description="目标版本号") - private Integer targetVersion; - @Schema(description="状态") - private String status; - @Schema(description="日志") - private String log; - @Schema(description="插件替换基本信息ID") - private String baseId; - @Schema(description="插件替换项信息ID") - private String itemId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceItemRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceItemRecord.java deleted file mode 100644 index 220dc3d0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineAtomReplaceItemRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineAtomReplaceItemRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="被替换插件代码") - private String fromAtomCode; - @Schema(description="被替换插件版本号") - private String fromAtomVersion; - @Schema(description="替换插件代码") - private String toAtomCode; - @Schema(description="替换插件版本号") - private String toAtomVersion; - @Schema(description="状态") - private String status; - @Schema(description="插件参数替换信息") - private String paramReplaceInfo; - @Schema(description="插件替换基本信息ID") - private String baseId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildContainerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildContainerRecord.java deleted file mode 100644 index 9b6550a8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildContainerRecord.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildContainerRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="当前stageId") - private String stageId; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="容器类型") - private String containerType; - @Schema(description="") - private Integer seq; - @Schema(description="状态") - private Integer status; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="花费") - private Integer cost; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="状况") - private String conditions; - @Schema(description="容器全局唯一ID") - private String containerHashId; - @Schema(description="是否为构建矩阵") - private Boolean matrixGroupFlag; - @Schema(description="所属的矩阵组ID") - private String matrixGroupId; - @Schema(description="job id") - private String jobId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildDetailRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildDetailRecord.java deleted file mode 100644 index c59a44ff..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildDetailRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildDetailRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="") - private String projectId; - @Schema(description="构建次数") - private Integer buildNum; - @Schema(description="流水线模型") - private String model; - @Schema(description="启动者") - private String startUser; - @Schema(description="触发器") - private String trigger; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="状态") - private String status; - @Schema(description="取消者") - private String cancelUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHisDataClearRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHisDataClearRecord.java deleted file mode 100644 index a8b46213..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHisDataClearRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildHisDataClearRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="") - private Date delTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHistoryDebugRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHistoryDebugRecord.java deleted file mode 100644 index 6d0e0a19..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHistoryDebugRecord.java +++ /dev/null @@ -1,90 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildHistoryDebugRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="父级构建ID") - private String parentBuildId; - @Schema(description="父级任务ID") - private String parentTaskId; - @Schema(description="构建次数") - private Integer buildNum; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="编排版本号") - private Integer version; - @Schema(description="启动者") - private String startUser; - @Schema(description="触发器") - private String trigger; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="状态") - private Integer status; - @Schema(description="流水线各阶段状态") - private String stageStatus; - @Schema(description="流水线任务数量") - private Integer taskCount; - @Schema(description="首次任务id") - private String firstTaskId; - @Schema(description="项目渠道") - private String channel; - @Schema(description="触发者") - private String triggerUser; - @Schema(description="原材料") - private String material; - @Schema(description="排队开始时间") - private Date queueTime; - @Schema(description="构件列表信息") - private String artifactInfo; - @Schema(description="评论") - private String remark; - @Schema(description="执行时间") - private Long executeTime; - @Schema(description="构建环境参数") - private String buildParameters; - @Schema(description="WEBHOOK 类型") - private String webhookType; - @Schema(description="推荐版本号") - private String recommendVersion; - @Schema(description="错误类型") - private Integer errorType; - @Schema(description="错误码") - private Integer errorCode; - @Schema(description="错误描述") - private String errorMsg; - @Schema(description="WEBHOOK 信息") - private String webhookInfo; - @Schema(description="错误信息") - private String errorInfo; - @Schema(description="构建信息") - private String buildMsg; - @Schema(description="自定义构建号") - private String buildNumAlias; - @Schema(description="并发时,设定的group") - private String concurrencyGroup; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="触发库信息") - private String repoTriggerInfo; - @Schema(description="最大执行次数") - private Integer executeCount; - @Schema(description="是否进行过重试") - private Boolean isRetry; - @Schema(description="YAML的版本标记") - private String yamlVersion; - @Schema(description="本次调试的编排备份") - private String resourceModel; - @Schema(description="记录删除时间") - private Date deleteTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHistoryRecord.java deleted file mode 100644 index 6671f21e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildHistoryRecord.java +++ /dev/null @@ -1,86 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildHistoryRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="父级构建ID") - private String parentBuildId; - @Schema(description="父级任务ID") - private String parentTaskId; - @Schema(description="构建次数") - private Integer buildNum; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="编排版本号") - private Integer version; - @Schema(description="启动者") - private String startUser; - @Schema(description="触发器") - private String trigger; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="状态") - private Integer status; - @Schema(description="流水线各阶段状态") - private String stageStatus; - @Schema(description="流水线任务数量") - private Integer taskCount; - @Schema(description="首次任务id") - private String firstTaskId; - @Schema(description="项目渠道") - private String channel; - @Schema(description="触发者") - private String triggerUser; - @Schema(description="原材料") - private String material; - @Schema(description="排队开始时间") - private Date queueTime; - @Schema(description="构件列表信息") - private String artifactInfo; - @Schema(description="评论") - private String remark; - @Schema(description="执行时间") - private Long executeTime; - @Schema(description="构建环境参数") - private String buildParameters; - @Schema(description="WEBHOOK 类型") - private String webhookType; - @Schema(description="推荐版本号") - private String recommendVersion; - @Schema(description="错误类型") - private Integer errorType; - @Schema(description="错误码") - private Integer errorCode; - @Schema(description="错误描述") - private String errorMsg; - @Schema(description="WEBHOOK 信息") - private String webhookInfo; - @Schema(description="是否重试") - private Boolean isRetry; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="错误信息") - private String errorInfo; - @Schema(description="构建信息") - private String buildMsg; - @Schema(description="自定义构建号") - private String buildNumAlias; - @Schema(description="并发时,设定的group") - private String concurrencyGroup; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="正式版本名称") - private String versionName; - @Schema(description="YAML的版本标记") - private String yamlVersion; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordContainerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordContainerRecord.java deleted file mode 100644 index 130e2cd1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordContainerRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildRecordContainerRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="编排版本") - private Integer resourceVersion; - @Schema(description="步骤ID") - private String stageId; - @Schema(description="构建状态") - private String status; - @Schema(description="当次执行的变量记录") - private String containerVar; - @Schema(description="容器类型") - private String containerType; - @Schema(description="包含POST插件标识") - private Boolean containPostTask; - @Schema(description="矩阵标识") - private Boolean matrixGroupFlag; - @Schema(description="所属的矩阵组ID") - private String matrixGroupId; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="运行中产生的时间戳集合") - private String timestamps; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordModelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordModelRecord.java deleted file mode 100644 index da77aaeb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordModelRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildRecordModelRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="编排版本") - private Integer resourceVersion; - @Schema(description="构建次数") - private Integer buildNum; - @Schema(description="启动者") - private String startUser; - @Schema(description="当次执行的变量记录") - private String modelVar; - @Schema(description="触发方式") - private String startType; - @Schema(description="触发时间") - private Date queueTime; - @Schema(description="启动时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="构建状态") - private String status; - @Schema(description="错误信息") - private String errorInfo; - @Schema(description="取消者") - private String cancelUser; - @Schema(description="运行中产生的时间戳集合") - private String timestamps; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordStageRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordStageRecord.java deleted file mode 100644 index 95eb3a89..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordStageRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildRecordStageRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="步骤ID") - private String stageId; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="编排版本号") - private Integer resourceVersion; - @Schema(description="步骤序列") - private Integer seq; - @Schema(description="当次执行的变量记录") - private String stageVar; - @Schema(description="构建状态") - private String status; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="运行中产生的时间戳集合") - private String timestamps; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordTaskRecord.java deleted file mode 100644 index afe913cc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildRecordTaskRecord.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildRecordTaskRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="任务ID") - private String taskId; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="编排版本号") - private Integer resourceVersion; - @Schema(description="步骤ID") - private String stageId; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="任务序列") - private Integer taskSeq; - @Schema(description="构建状态") - private String status; - @Schema(description="当次执行的变量记录") - private String taskVar; - @Schema(description="市场插件的POST关联信息") - private String postInfo; - @Schema(description="项目ID") - private String classType; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="所在矩阵组ID") - private String originClassType; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="运行中产生的时间戳集合") - private String timestamps; - @Schema(description="插件异步执行状态") - private String asyncStatus; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildStageRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildStageRecord.java deleted file mode 100644 index 28a35e37..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildStageRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildStageRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="当前stageId") - private String stageId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="") - private Integer seq; - @Schema(description="状态") - private Integer status; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="花费") - private Integer cost; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="状况") - private String conditions; - @Schema(description="准入检查配置") - private String checkIn; - @Schema(description="准出检查配置") - private String checkOut; - @Schema(description="当前stageId 阶段ID (用户可编辑)") - private String stageIdForUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildSummaryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildSummaryRecord.java deleted file mode 100644 index 4cd469b4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildSummaryRecord.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildSummaryRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="构建次数") - private Integer buildNum; - @Schema(description="构建号") - private Integer buildNo; - @Schema(description="完成次数") - private Integer finishCount; - @Schema(description="运行次数") - private Integer runningCount; - @Schema(description="排队次数") - private Integer queueCount; - @Schema(description="最近构建ID") - private String latestBuildId; - @Schema(description="最近任务ID") - private String latestTaskId; - @Schema(description="最近启动者") - private String latestStartUser; - @Schema(description="最近启动时间") - private Date latestStartTime; - @Schema(description="最近结束时间") - private Date latestEndTime; - @Schema(description="最近任务计数") - private Integer latestTaskCount; - @Schema(description="最近任务名称") - private String latestTaskName; - @Schema(description="最近状态") - private Integer latestStatus; - @Schema(description="自定义构建号") - private String buildNumAlias; - @Schema(description="调试构建次数") - private Integer debugBuildNum; - @Schema(description="调试构建号") - private Integer debugBuildNo; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildTaskRecord.java deleted file mode 100644 index 530dfc0e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildTaskRecord.java +++ /dev/null @@ -1,72 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildTaskRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="任务ID") - private String taskId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="当前stageId") - private String stageId; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="任务名称") - private String taskName; - @Schema(description="任务参数集合") - private String taskParams; - @Schema(description="任务类型") - private String taskType; - @Schema(description="任务atom代码") - private String taskAtom; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="执行人") - private String starter; - @Schema(description="批准人") - private String approver; - @Schema(description="状态") - private Integer status; - @Schema(description="执行次数") - private Integer executeCount; - @Schema(description="任务序列") - private Integer taskSeq; - @Schema(description="子项目id") - private String subProjectId; - @Schema(description="子构建id") - private String subBuildId; - @Schema(description="容器类型") - private String containerType; - @Schema(description="其他选项") - private String additionalOptions; - @Schema(description="总共时间") - private Long totalTime; - @Schema(description="错误类型") - private Integer errorType; - @Schema(description="错误码") - private Integer errorCode; - @Schema(description="错误描述") - private String errorMsg; - @Schema(description="对接平台代码") - private String platformCode; - @Schema(description="对接平台错误码") - private Integer platformErrorCode; - @Schema(description="构建Job唯一标识") - private String containerHashId; - @Schema(description="标识上下文的自定义ID") - private String stepId; - @Schema(description="job id") - private String jobId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildTemplateAcrossInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildTemplateAcrossInfoRecord.java deleted file mode 100644 index a177e6d5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildTemplateAcrossInfoRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildTemplateAcrossInfoRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="模板唯一UUID") - private String templateId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID (P-32位UUID)=34位") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="模板类型") - private String templateType; - @Schema(description="模板对应的实例ID") - private String templateInstanceIds; - @Schema(description="使用的项目ID") - private String targetProjectId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="创建人") - private String creator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildVarRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildVarRecord.java deleted file mode 100644 index 5d050e39..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineBuildVarRecord.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineBuildVarRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="键") - private String key; - @Schema(description="值") - private String value; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="变量类型") - private String varType; - @Schema(description="是否只读") - private Boolean readOnly; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineDataClearRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineDataClearRecord.java deleted file mode 100644 index d28bf4e4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineDataClearRecord.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineDataClearRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="") - private Date delTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFailDetailDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFailDetailDataRecord.java deleted file mode 100644 index b14add8d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFailDetailDataRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineFailDetailDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="渠道代码") - private String channelCode; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建序号") - private Integer buildNum; - @Schema(description="触发代码库地址") - private String repoUrl; - @Schema(description="触发代码库分支") - private String branch; - @Schema(description="启动用户") - private String startUser; - @Schema(description="启动时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; - @Schema(description="错误的类型标识") - private Integer errorType; - @Schema(description="错误的标识码") - private Integer errorCode; - @Schema(description="错误描述") - private String errorMsg; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFailSummaryDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFailSummaryDataRecord.java deleted file mode 100644 index 990355df..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFailSummaryDataRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineFailSummaryDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="渠道代码") - private String channelCode; - @Schema(description="错误的类型标识") - private Integer errorType; - @Schema(description="错误次数") - private Integer errorCount; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFavorRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFavorRecord.java deleted file mode 100644 index 4d8028ed..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineFavorRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineFavorRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="创建者") - private String createUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineGroupRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineGroupRecord.java deleted file mode 100644 index 02a8a844..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineGroupRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineGroupRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="名称") - private String name; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="创建者") - private String createUser; - @Schema(description="修改人") - private String updateUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineInfoRecord.java deleted file mode 100644 index 3a503290..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineInfoRecord.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineInfoRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="流水线描述") - private String pipelineDesc; - @Schema(description="版本号") - private Integer version; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="创建者") - private String creator; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="最近修改者") - private String lastModifyUser; - @Schema(description="项目渠道") - private String channel; - @Schema(description="是否手工启动") - private Integer manualStartup; - @Schema(description="是否跳过插件") - private Integer elementSkip; - @Schema(description="流水线任务数量") - private Integer taskCount; - @Schema(description="是否删除") - private Boolean delete; - @Schema(description="主键ID") - private Long id; - @Schema(description="流水线名称拼音") - private String pipelineNamePinyin; - @Schema(description="最近启动时间") - private Date latestStartTime; - @Schema(description="最新分布版本状态") - private String latestVersionStatus; - @Schema(description="是否锁定,PAC v3.0新增锁定,取代原来setting表中的LOCK") - private Boolean locked; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineJobMutexGroupRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineJobMutexGroupRecord.java deleted file mode 100644 index a818a2ee..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineJobMutexGroupRecord.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineJobMutexGroupRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="Job互斥组名字") - private String jobMutexGroupName; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineLabelPipelineRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineLabelPipelineRecord.java deleted file mode 100644 index f533d134..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineLabelPipelineRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineLabelPipelineRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="标签ID") - private Long labelId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="创建者") - private String createUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineLabelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineLabelRecord.java deleted file mode 100644 index d405e216..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineLabelRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineLabelRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="用户组ID") - private Long groupId; - @Schema(description="名称") - private String name; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="创建者") - private String createUser; - @Schema(description="修改人") - private String updateUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineModelTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineModelTaskRecord.java deleted file mode 100644 index 439e8b04..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineModelTaskRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineModelTaskRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="当前stageId") - private String stageId; - @Schema(description="构建容器ID") - private String containerId; - @Schema(description="任务ID") - private String taskId; - @Schema(description="任务名称") - private String taskName; - @Schema(description="插件大类") - private String classType; - @Schema(description="任务atom代码") - private String taskAtom; - @Schema(description="任务序列") - private Integer taskSeq; - @Schema(description="任务参数集合") - private String taskParams; - @Schema(description="操作系统") - private String os; - @Schema(description="其他选项") - private String additionalOptions; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="插件版本号") - private String atomVersion; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineOperationLogRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineOperationLogRecord.java deleted file mode 100644 index 419db48b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineOperationLogRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineOperationLogRecord { - @Schema(description="自增ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="操作版本号") - private Integer version; - @Schema(description="创建者") - private String operator; - @Schema(description="操作类型") - private String operationType; - @Schema(description="操作参数") - private String params; - @Schema(description="版本变更说明") - private String description; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineOverviewDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineOverviewDataRecord.java deleted file mode 100644 index 720e768f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineOverviewDataRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineOverviewDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="渠道代码") - private String channelCode; - @Schema(description="总平均耗时,单位:毫秒") - private Long totalAvgCostTime; - @Schema(description="成功平均耗时,单位:毫秒") - private Long successAvgCostTime; - @Schema(description="失败平均耗时,单位:毫秒") - private Long failAvgCostTime; - @Schema(description="总执行次数") - private Long totalExecuteCount; - @Schema(description="成功执行次数") - private Long successExecuteCount; - @Schema(description="失败执行次数") - private Long failExecuteCount; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelinePauseValueRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelinePauseValueRecord.java deleted file mode 100644 index 17d7580d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelinePauseValueRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelinePauseValueRecord { - @Schema(description="") - private String projectId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="任务ID") - private String taskId; - @Schema(description="默认变量") - private String defaultValue; - @Schema(description="暂停后用户提供的变量") - private String newValue; - @Schema(description="添加时间") - private Date createTime; - @Schema(description="执行次数") - private Integer executeCount; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRecentUseRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRecentUseRecord.java deleted file mode 100644 index dc49d552..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRecentUseRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineRecentUseRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="用户ID") - private String userId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="使用时间") - private Date useTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRemoteAuthRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRemoteAuthRecord.java deleted file mode 100644 index 508f5276..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRemoteAuthRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineRemoteAuthRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线权限") - private String pipelineAuth; - @Schema(description="项目ID") - private String projectId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="创建者") - private String createUser; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineResourceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineResourceRecord.java deleted file mode 100644 index a56beb33..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineResourceRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineResourceRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="版本号") - private Integer version; - @Schema(description="项目ID") - private String projectId; - @Schema(description="版本名称") - private String versionName; - @Schema(description="流水线模型") - private String model; - @Schema(description="YAML编排") - private String yaml; - @Schema(description="YAML的版本标记") - private String yamlVersion; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="流水线发布版本") - private Integer versionNum; - @Schema(description="流水线模型版本") - private Integer pipelineVersion; - @Schema(description="触发器模型版本") - private Integer triggerVersion; - @Schema(description="关联的流水线设置版本号") - private Integer settingVersion; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineResourceVersionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineResourceVersionRecord.java deleted file mode 100644 index ba6f36da..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineResourceVersionRecord.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineResourceVersionRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="版本号") - private Integer version; - @Schema(description="项目ID") - private String projectId; - @Schema(description="版本名称") - private String versionName; - @Schema(description="流水线模型") - private String model; - @Schema(description="YAML编排") - private String yaml; - @Schema(description="YAML的版本标记") - private String yamlVersion; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="是否还有构建记录引用该版本标识") - private Boolean referFlag; - @Schema(description="关联构建记录总数") - private Integer referCount; - @Schema(description="流水线发布版本") - private Integer versionNum; - @Schema(description="流水线模型版本") - private Integer pipelineVersion; - @Schema(description="触发器模型版本") - private Integer triggerVersion; - @Schema(description="关联的流水线设置版本号") - private Integer settingVersion; - @Schema(description="草稿的来源版本") - private Integer baseVersion; - @Schema(description="调试构建ID") - private String debugBuildId; - @Schema(description="版本状态") - private String status; - @Schema(description="分支状态") - private String branchAction; - @Schema(description="版本变更说明") - private String description; - @Schema(description="最近更新人") - private String updater; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="发布时间") - private Date releaseTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRuleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRuleRecord.java deleted file mode 100644 index 3c94cb66..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineRuleRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineRuleRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="规则名称") - private String ruleName; - @Schema(description="业务标识") - private String busCode; - @Schema(description="处理器") - private String processor; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineSettingRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineSettingRecord.java deleted file mode 100644 index 6ca78f5b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineSettingRecord.java +++ /dev/null @@ -1,79 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineSettingRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="描述") - private String desc; - @Schema(description="运行锁定类型") - private Integer runType; - @Schema(description="名称") - private String name; - @Schema(description="成功接受者") - private String successReceiver; - @Schema(description="失败接受者") - private String failReceiver; - @Schema(description="成功组") - private String successGroup; - @Schema(description="失败组") - private String failGroup; - @Schema(description="成功的通知方式") - private String successType; - @Schema(description="失败的通知方式") - private String failType; - @Schema(description="成功的企业微信群通知开关") - private Boolean successWechatGroupFlag; - @Schema(description="成功的企业微信群通知群ID") - private String successWechatGroup; - @Schema(description="失败的企业微信群通知开关") - private Boolean failWechatGroupFlag; - @Schema(description="失败的企业微信群通知群ID") - private String failWechatGroup; - @Schema(description="Lock 类型") - private Integer runLockType; - @Schema(description="成功的通知的流水线详情连接开关") - private Boolean successDetailFlag; - @Schema(description="失败的通知的流水线详情连接开关") - private Boolean failDetailFlag; - @Schema(description="成功的自定义通知内容") - private String successContent; - @Schema(description="失败的自定义通知内容") - private String failContent; - @Schema(description="最大排队时长") - private Integer waitQueueTimeSecond; - @Schema(description="最大排队数量") - private Integer maxQueueSize; - @Schema(description="是否模板") - private Boolean isTemplate; - @Schema(description="成功的企业微信群通知转为Markdown格式开关") - private Boolean successWechatGroupMarkdownFlag; - @Schema(description="失败的企业微信群通知转为Markdown格式开关") - private Boolean failWechatGroupMarkdownFlag; - @Schema(description="保存流水线编排的最大个数") - private Integer maxPipelineResNum; - @Schema(description="并发构建数量限制,为null时表示取系统默认值") - private Integer maxConRunningQueueSize; - @Schema(description="构建号生成规则") - private String buildNumRule; - @Schema(description="并发时,设定的group") - private String concurrencyGroup; - @Schema(description="并发时,是否相同group取消正在执行的流水线") - private Boolean concurrencyCancelInProgress; - @Schema(description="重试时清理变量表") - private Boolean cleanVariablesWhenRetry; - @Schema(description="YAML流水线相关配置") - private String pipelineAsCodeSettings; - @Schema(description="设置版本") - private Integer version; - @Schema(description="成功订阅设置") - private String successSubscription; - @Schema(description="失败订阅设置") - private String failureSubscription; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineSettingVersionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineSettingVersionRecord.java deleted file mode 100644 index 17abef6c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineSettingVersionRecord.java +++ /dev/null @@ -1,77 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineSettingVersionRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="版本号") - private Integer version; - @Schema(description="是否模板") - private Boolean isTemplate; - @Schema(description="名称") - private String name; - @Schema(description="描述") - private String desc; - @Schema(description="版本修改的标签") - private String labels; - @Schema(description="最大排队时长") - private Integer waitQueueTimeSecond; - @Schema(description="最大排队数量") - private Integer maxQueueSize; - @Schema(description="构建号生成规则") - private String buildNumRule; - @Schema(description="并发时,设定的group") - private String concurrencyGroup; - @Schema(description="并发时,是否相同group取消正在执行的流水线") - private Boolean concurrencyCancelInProgress; - @Schema(description="YAML流水线相关配置") - private String pipelineAsCodeSettings; - @Schema(description="成功订阅设置") - private String successSubscription; - @Schema(description="失败订阅设置") - private String failureSubscription; - @Schema(description="运行并发配置") - private Integer runLockType; - @Schema(description="") - private String successReceiver; - @Schema(description="") - private String failReceiver; - @Schema(description="") - private String successGroup; - @Schema(description="") - private String failGroup; - @Schema(description="") - private String successType; - @Schema(description="") - private String failType; - @Schema(description="") - private Boolean successWechatGroupFlag; - @Schema(description="") - private String successWechatGroup; - @Schema(description="") - private Boolean failWechatGroupFlag; - @Schema(description="") - private String failWechatGroup; - @Schema(description="") - private Boolean successDetailFlag; - @Schema(description="") - private Boolean failDetailFlag; - @Schema(description="") - private String successContent; - @Schema(description="") - private String failContent; - @Schema(description="") - private Boolean successWechatGroupMarkdownFlag; - @Schema(description="") - private Boolean failWechatGroupMarkdownFlag; - @Schema(description="并发构建数量限制,值为-1时表示取系统默认值。") - private Integer maxConRunningQueueSize; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineStageOverviewDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineStageOverviewDataRecord.java deleted file mode 100644 index d883ce29..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineStageOverviewDataRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineStageOverviewDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="渠道代码") - private String channelCode; - @Schema(description="阶段标签名称") - private String stageTagName; - @Schema(description="平均耗时,单位:毫秒") - private Long avgCostTime; - @Schema(description="总执行次数") - private Long executeCount; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineStageTagRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineStageTagRecord.java deleted file mode 100644 index d66d3f27..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineStageTagRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineStageTagRecord { - @Schema(description="主键") - private String id; - @Schema(description="阶段标签名称") - private String stageTagName; - @Schema(description="阶段标签权值") - private Integer weight; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTimerBranchRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTimerBranchRecord.java deleted file mode 100644 index 0741cb60..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTimerBranchRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineTimerBranchRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="代码库HASH ID") - private String repoHashId; - @Schema(description="分支") - private String branch; - @Schema(description="提交版本") - private String revision; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTimerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTimerRecord.java deleted file mode 100644 index 63f0ac4c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTimerRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineTimerRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="任务ID") - private String crontab; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目渠道") - private String channel; - @Schema(description="代码库HASH ID") - private String repoHashId; - @Schema(description="分支列表") - private String branchs; - @Schema(description="源代码未更新则不触发构建") - private Boolean noScm; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerDetailRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerDetailRecord.java deleted file mode 100644 index 379cd0e2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerDetailRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineTriggerDetailRecord { - @Schema(description="事件明细ID") - private Long detailId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="事件ID") - private Long eventId; - @Schema(description="状态(success or failure)") - private String status; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="流水线版本号") - private Integer version; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建编号") - private String buildNum; - @Schema(description="失败原因") - private String reason; - @Schema(description="原因详情") - private String reasonDetail; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerEventRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerEventRecord.java deleted file mode 100644 index dc76b66b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerEventRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineTriggerEventRecord { - @Schema(description="事件ID") - private Long eventId; - @Schema(description="事件时间") - private Date createTime; - @Schema(description="请求ID") - private String requestId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="触发类型") - private String triggerType; - @Schema(description="触发源,代码库hashId/触发人/远程ip") - private String eventSource; - @Schema(description="事件类型") - private String eventType; - @Schema(description="触发用户") - private String triggerUser; - @Schema(description="事件描述") - private String eventDesc; - @Schema(description="重放请求ID") - private String replayRequestId; - @Schema(description="请求参数") - private String requestParams; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerReviewRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerReviewRecord.java deleted file mode 100644 index 433a9ce6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineTriggerReviewRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineTriggerReviewRecord { - @Schema(description="构建ID") - private String buildId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="触发审核人列表") - private String triggerReviewer; - @Schema(description="触发审核操作人") - private String triggerOperator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="审核时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewGroupRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewGroupRecord.java deleted file mode 100644 index d41a0dc5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewGroupRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineViewGroupRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线组ID") - private Long viewId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="创建者") - private String creator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewRecord.java deleted file mode 100644 index d3651074..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineViewRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="名称") - private String name; - @Schema(description="流水线名称过滤器,已废弃,统一到filters管理") - private String filterByPipeineName; - @Schema(description="创建者过滤器,已废弃,统一到filters管理") - private String filterByCreator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="创建者") - private String createUser; - @Schema(description="是否项目") - private Boolean isProject; - @Schema(description="逻辑符") - private String logic; - @Schema(description="过滤器") - private String filters; - @Schema(description="1:动态流水线组 , 2:静态流水线组") - private Integer viewType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewTopRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewTopRecord.java deleted file mode 100644 index 6ef61914..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewTopRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineViewTopRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线组ID") - private Long viewId; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewUserLastViewRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewUserLastViewRecord.java deleted file mode 100644 index 15a33d74..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewUserLastViewRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineViewUserLastViewRecord { - @Schema(description="用户ID") - private String userId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="视图ID") - private String viewId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewUserSettingsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewUserSettingsRecord.java deleted file mode 100644 index a0ded1d0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineViewUserSettingsRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineViewUserSettingsRecord { - @Schema(description="用户ID") - private String userId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="属性配置表") - private String settings; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookBuildParameterRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookBuildParameterRecord.java deleted file mode 100644 index 78daae7c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookBuildParameterRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineWebhookBuildParameterRecord { - @Schema(description="") - private String buildId; - @Schema(description="") - private String projectId; - @Schema(description="") - private String pipelineId; - @Schema(description="") - private String buildParameters; - @Schema(description="") - private Date createTime; - @Schema(description="") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookQueueRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookQueueRecord.java deleted file mode 100644 index 8c4ed9c5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookQueueRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineWebhookQueueRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="源项目ID") - private Long sourceProjectId; - @Schema(description="源代码库名称") - private String sourceRepoName; - @Schema(description="源分支") - private String sourceBranch; - @Schema(description="目标项目ID") - private Long targetProjectId; - @Schema(description="目标代码库名称") - private String targetRepoName; - @Schema(description="目标分支") - private String targetBranch; - @Schema(description="构建ID") - private String buildId; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookRecord.java deleted file mode 100644 index a5dccaa9..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookRecord.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineWebhookRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="新版的git插件的类型") - private String repositoryType; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="存储库 HASH ID") - private String repoHashId; - @Schema(description="代码库别名") - private String repoName; - @Schema(description="代码库类型") - private String repoType; - @Schema(description="项目名称") - private String projectName; - @Schema(description="任务id") - private String taskId; - @Schema(description="是否删除") - private Boolean delete; - @Schema(description="事件类型") - private String eventType; - @Schema(description="代码库平台ID") - private String externalId; - @Schema(description="代码库hashId") - private String repositoryHashId; - @Schema(description="代码库平台仓库名") - private String externalName; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookRevisionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookRevisionRecord.java deleted file mode 100644 index c05a3ef0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookRevisionRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineWebhookRevisionRecord { - @Schema(description="") - private Long id; - @Schema(description="") - private String projectName; - @Schema(description="") - private String revision; - @Schema(description="") - private Date createTime; - @Schema(description="") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookVersionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookVersionRecord.java deleted file mode 100644 index 5f6a948b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineWebhookVersionRecord.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineWebhookVersionRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线版本") - private Integer version; - @Schema(description="插件ID") - private String taskId; - @Schema(description="插件参数") - private String taskParams; - @Schema(description="插件配置的hashId") - private String taskRepoHashId; - @Schema(description="插件配置的代码库别名") - private String taskRepoName; - @Schema(description="插件配置的代码库类型,ID|NAME") - private String taskRepoType; - @Schema(description="代码库类型") - private String repositoryType; - @Schema(description="代码库hashId") - private String repositoryHashId; - @Schema(description="事件类型") - private String eventType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlBranchFileRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlBranchFileRecord.java deleted file mode 100644 index 889d1c48..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlBranchFileRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineYamlBranchFileRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="代码库HASH ID") - private String repoHashId; - @Schema(description="分支") - private String branch; - @Schema(description="文件路径MD5") - private String filePathMd5; - @Schema(description="文件路径") - private String filePath; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlInfoRecord.java deleted file mode 100644 index 4d18eb35..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlInfoRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineYamlInfoRecord { - @Schema(description="蓝盾项目ID") - private String projectId; - @Schema(description="代码库HASH ID") - private String repoHashId; - @Schema(description="文件路径") - private String filePath; - @Schema(description="yaml文件目录") - private String directory; - @Schema(description="默认分支") - private String defaultBranch; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="状态") - private String status; - @Schema(description="创建人") - private String creator; - @Schema(description="修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlSyncRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlSyncRecord.java deleted file mode 100644 index 22b8fefe..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlSyncRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineYamlSyncRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="代码库HASH ID") - private String repoHashId; - @Schema(description="文件路径") - private String filePath; - @Schema(description="文件URL") - private String fileUrl; - @Schema(description="ci文件同步状态") - private String syncStatus; - @Schema(description="失败原因") - private String reason; - @Schema(description="原因详情") - private String reasonDetail; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlVersionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlVersionRecord.java deleted file mode 100644 index f42ba93b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlVersionRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineYamlVersionRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="蓝盾项目ID") - private String projectId; - @Schema(description="代码库HASH ID") - private String repoHashId; - @Schema(description="文件路径") - private String filePath; - @Schema(description="来源分支/tag") - private String ref; - @Schema(description="文件commitId") - private String commitId; - @Schema(description="提交时间") - private Date commitTime; - @Schema(description="文件blob_id") - private String blobId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线版本") - private Integer version; - @Schema(description="分支状态") - private String branchAction; - @Schema(description="创建人") - private String creator; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlViewRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlViewRecord.java deleted file mode 100644 index 24fc7839..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPipelineYamlViewRecord.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPipelineYamlViewRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="代码库HASH ID") - private String repoHashId; - @Schema(description="yaml文件目录") - private String directory; - @Schema(description="流水线组ID") - private Long viewId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPluginGitCheckRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPluginGitCheckRecord.java deleted file mode 100644 index be251465..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPluginGitCheckRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPluginGitCheckRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建编号") - private Integer buildNumber; - @Schema(description="代码库ID") - private String repoId; - @Schema(description="代码提交ID") - private String commitId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="代码库别名") - private String repoName; - @Schema(description="内容") - private String context; - @Schema(description="目标分支") - private String targetBranch; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPluginGithubCheckRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPluginGithubCheckRecord.java deleted file mode 100644 index d280e107..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TPluginGithubCheckRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TPluginGithubCheckRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建编号") - private Integer buildNumber; - @Schema(description="代码库ID") - private String repoId; - @Schema(description="代码提交ID") - private String commitId; - @Schema(description="") - private Long checkRunId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="代码库别名") - private String repoName; - @Schema(description="") - private String checkRunName; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectApprovalRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectApprovalRecord.java deleted file mode 100644 index 6bbe830f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectApprovalRecord.java +++ /dev/null @@ -1,66 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectApprovalRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目名称") - private String projectName; - @Schema(description="英文名称") - private String englishName; - @Schema(description="描述") - private String description; - @Schema(description="创建时间") - private Date createdAt; - @Schema(description="更新时间") - private Date updatedAt; - @Schema(description="创建者") - private String creator; - @Schema(description="更新人") - private String updator; - @Schema(description="事业群ID") - private Long bgId; - @Schema(description="事业群名称") - private String bgName; - @Schema(description="业务线ID") - private Long businessLineId; - @Schema(description="业务线名称") - private String businessLineName; - @Schema(description="项目所属二级机构ID") - private Long deptId; - @Schema(description="项目所属二级机构名称") - private String deptName; - @Schema(description="中心ID") - private Long centerId; - @Schema(description="中心名字") - private String centerName; - @Schema(description="logo地址") - private String logoAddr; - @Schema(description="批准人") - private String approver; - @Schema(description="审核状态") - private Integer approvalStatus; - @Schema(description="批准时间") - private Date approvalTime; - @Schema(description="扩展系统关联ID") - private String relationId; - @Schema(description="最大可授权人员范围") - private String subjectScopes; - @Schema(description="项目性质,0-公开,1-保密,2-机密") - private Integer authSecrecy; - @Schema(description="提示状态,0-不展示,1-展示创建成功,2-展示更新成功") - private Integer tipsStatus; - @Schema(description="项目类型") - private Integer projectType; - @Schema(description="运营产品ID") - private Integer productId; - @Schema(description="运营产品名称") - private String productName; - @Schema(description="项目其他配置") - private String properties; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectAtomRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectAtomRecord.java deleted file mode 100644 index 5977fdc7..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectAtomRecord.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectAtomRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="插件代码") - private String atomCode; - @Schema(description="插件名称") - private String atomName; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectBuildSummaryDailyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectBuildSummaryDailyRecord.java deleted file mode 100644 index 320d9ead..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectBuildSummaryDailyRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectBuildSummaryDailyRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="日期") - private Date theDate; - @Schema(description="产品ID") - private Integer productId; - @Schema(description="用户数") - private Integer userCount; - @Schema(description="总构建数") - private Integer buildCount; - @Schema(description="手动触发构建数") - private Integer manualBuildCount; - @Schema(description="openapi构建数") - private Integer openapiBuildCount; - @Schema(description="代码库构建数") - private Integer webhookBuildCount; - @Schema(description="远程触发构建数") - private Integer remoteBuildCount; - @Schema(description="定时触发构建数") - private Integer timeBuildCount; - @Schema(description="子流水线触发构建数") - private Integer subPipelineBuildCount; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectConfigRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectConfigRecord.java deleted file mode 100644 index 944f06ca..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectConfigRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectConfigRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="修改者") - private String updatedUser; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="") - private Boolean bcsvmEnalbed; - @Schema(description="") - private Integer bcsvmQuota; - @Schema(description="") - private Integer importQuota; - @Schema(description="") - private Boolean devCloudEnalbed; - @Schema(description="") - private Integer devCloudQuota; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectDataMigrateHistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectDataMigrateHistoryRecord.java deleted file mode 100644 index 0e1585f5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectDataMigrateHistoryRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectDataMigrateHistoryRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="模块标识") - private String moduleCode; - @Schema(description="被迁移集群名称") - private String sourceClusterName; - @Schema(description="被迁移数据源名称") - private String sourceDataSourceName; - @Schema(description="迁移集群名称") - private String targetClusterName; - @Schema(description="迁移数据源名称") - private String targetDataSourceName; - @Schema(description="迁移数据源标签") - private String targetDataTag; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectLabelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectLabelRecord.java deleted file mode 100644 index 37c6c83b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectLabelRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectLabelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="标签名称") - private String labelName; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectLabelRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectLabelRelRecord.java deleted file mode 100644 index 3f858f90..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectLabelRelRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectLabelRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="标签ID") - private String labelId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineCallbackHistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineCallbackHistoryRecord.java deleted file mode 100644 index 56a32714..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineCallbackHistoryRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectPipelineCallbackHistoryRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="事件") - private String events; - @Schema(description="回调url地址") - private String callbackUrl; - @Schema(description="状态") - private String status; - @Schema(description="错误描述") - private String errorMsg; - @Schema(description="请求头") - private String requestHeader; - @Schema(description="请求body") - private String requestBody; - @Schema(description="响应code") - private Integer responseCode; - @Schema(description="响应body") - private String responseBody; - @Schema(description="开始时间") - private Date startTime; - @Schema(description="结束时间") - private Date endTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineCallbackRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineCallbackRecord.java deleted file mode 100644 index 32c22c57..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineCallbackRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectPipelineCallbackRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="事件") - private String events; - @Schema(description="回调url地址") - private String callbackUrl; - @Schema(description="创建者") - private String creator; - @Schema(description="更新人") - private String updator; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="Send to your with http header: X-DEVOPS-WEBHOOK-TOKEN") - private String secretToken; - @Schema(description="启用") - private Boolean enable; - @Schema(description="失败时间") - private Date failureTime; - @Schema(description="鉴权参数") - private String secretParam; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineLabelInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineLabelInfoRecord.java deleted file mode 100644 index e53f46f2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectPipelineLabelInfoRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectPipelineLabelInfoRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="标签ID") - private Long labelId; - @Schema(description="标签名称") - private String labelName; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectThirdPlatformDataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectThirdPlatformDataRecord.java deleted file mode 100644 index 0c54e8bf..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectThirdPlatformDataRecord.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import java.math.BigDecimal; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectThirdPlatformDataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="项目ID") - private String projectId; - @Schema(description="codecc检查代码库平均分") - private BigDecimal repoCodeccAvgScore; - @Schema(description="已解决缺陷数") - private Integer resolvedDefectNum; - @Schema(description="使用质量红线的流水线执行被拦截次数") - private Integer qualityPipelineInterceptionNum; - @Schema(description="使用质量红线的流水线执行总次数") - private Integer qualityPipelineExecuteNum; - @Schema(description="编译加速节省时间,单位:秒") - private BigDecimal turboSaveTime; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUpdateHistoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUpdateHistoryRecord.java deleted file mode 100644 index 9895b97b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUpdateHistoryRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectUpdateHistoryRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="英文名称") - private String englishName; - @Schema(description="变更前项目名称") - private String beforeProjectName; - @Schema(description="变更后项目名称") - private String afterProjectName; - @Schema(description="变更前运营产品ID") - private Integer beforeProductId; - @Schema(description="变更后运营产品ID") - private Integer afterProductId; - @Schema(description="变更前组织架构") - private String beforeOrganization; - @Schema(description="变更后组织架构") - private String afterOrganization; - @Schema(description="变更前最大可授权人员范围") - private String beforeSubjectScopes; - @Schema(description="变更后最大可授权人员范围") - private String afterSubjectScopes; - @Schema(description="操作人") - private String operator; - @Schema(description="") - private Integer approvalStatus; - @Schema(description="创建时间") - private Date createdAt; - @Schema(description="更新时间") - private Date updatedAt; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUserDailyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUserDailyRecord.java deleted file mode 100644 index c1e55a45..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUserDailyRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectUserDailyRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="用户ID") - private String userId; - @Schema(description="日期") - private Date theDate; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUserOperateDailyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUserOperateDailyRecord.java deleted file mode 100644 index af090c16..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TProjectUserOperateDailyRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectUserOperateDailyRecord { - @Schema(description="项目ID") - private String projectId; - @Schema(description="用户ID") - private String userId; - @Schema(description="日期") - private Date theDate; - @Schema(description="操作") - private String operate; - @Schema(description="操作次数") - private Integer operateCount; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityControlPointRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityControlPointRecord.java deleted file mode 100644 index d141e539..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityControlPointRecord.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityControlPointRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="原子的ClassType") - private String elementType; - @Schema(description="控制点名称(原子名称)") - private String name; - @Schema(description="研发阶段") - private String stage; - @Schema(description="支持红线位置(准入-BEFORE, 准出-AFTER)") - private String availablePosition; - @Schema(description="默认红线位置") - private String defaultPosition; - @Schema(description="是否启用") - private Boolean enable; - @Schema(description="创建用户") - private String createUser; - @Schema(description="更新用户") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="插件版本") - private String atomVersion; - @Schema(description="测试的项目") - private String testProject; - @Schema(description="哈希ID") - private String controlPointHashId; - @Schema(description="") - private String tag; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityHisDetailMetadataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityHisDetailMetadataRecord.java deleted file mode 100644 index ad40cde1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityHisDetailMetadataRecord.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityHisDetailMetadataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="数据ID") - private String dataId; - @Schema(description="数据名称") - private String dataName; - @Schema(description="数据类型") - private String dataType; - @Schema(description="数据描述") - private String dataDesc; - @Schema(description="数据值") - private String dataValue; - @Schema(description="原子的ClassType") - private String elementType; - @Schema(description="工具/原子子类") - private String elementDetail; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建号") - private String buildNo; - @Schema(description="创建时间") - private Long createTime; - @Schema(description="额外信息") - private String extra; - @Schema(description="任务节点id") - private String taskId; - @Schema(description="任务节点名") - private String taskName; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityHisOriginMetadataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityHisOriginMetadataRecord.java deleted file mode 100644 index 176574a4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityHisOriginMetadataRecord.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityHisOriginMetadataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="构建号") - private String buildNo; - @Schema(description="返回数据") - private String resultData; - @Schema(description="创建时间") - private Long createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityIndicatorRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityIndicatorRecord.java deleted file mode 100644 index ff1918f6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityIndicatorRecord.java +++ /dev/null @@ -1,58 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityIndicatorRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="原子的ClassType") - private String elementType; - @Schema(description="产出原子") - private String elementName; - @Schema(description="工具/原子子类") - private String elementDetail; - @Schema(description="指标英文名") - private String enName; - @Schema(description="指标中文名") - private String cnName; - @Schema(description="指标所包含基础数据") - private String metadataIds; - @Schema(description="默认操作") - private String defaultOperation; - @Schema(description="可用操作") - private String operationAvailable; - @Schema(description="默认阈值") - private String threshold; - @Schema(description="阈值类型") - private String thresholdType; - @Schema(description="描述") - private String desc; - @Schema(description="是否只读") - private Boolean indicatorReadOnly; - @Schema(description="阶段") - private String stage; - @Schema(description="指标范围") - private String indicatorRange; - @Schema(description="是否启用") - private Boolean enable; - @Schema(description="指标类型") - private String type; - @Schema(description="指标标签,用于前端区分控制") - private String tag; - @Schema(description="创建用户") - private String createUser; - @Schema(description="更新用户") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="插件版本号") - private String atomVersion; - @Schema(description="日志提示") - private String logPrompt; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityMetadataRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityMetadataRecord.java deleted file mode 100644 index feb542d1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityMetadataRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityMetadataRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="数据ID") - private String dataId; - @Schema(description="数据名称") - private String dataName; - @Schema(description="原子的ClassType") - private String elementType; - @Schema(description="产出原子") - private String elementName; - @Schema(description="工具/原子子类") - private String elementDetail; - @Schema(description="value值前端组件类型") - private String valueType; - @Schema(description="描述") - private String desc; - @Schema(description="额外信息") - private String extra; - @Schema(description="创建者") - private String createUser; - @Schema(description="修改人") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleBuildHisOperationRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleBuildHisOperationRecord.java deleted file mode 100644 index 123a1db3..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleBuildHisOperationRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityRuleBuildHisOperationRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="规则id") - private Long ruleId; - @Schema(description="") - private String stageId; - @Schema(description="") - private String gateOptUser; - @Schema(description="") - private Date gateOptTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleBuildHisRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleBuildHisRecord.java deleted file mode 100644 index 725b447f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleBuildHisRecord.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityRuleBuildHisRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="控制点位置") - private String rulePos; - @Schema(description="规则名称") - private String ruleName; - @Schema(description="规则描述") - private String ruleDesc; - @Schema(description="红线匹配的id") - private String gatewayId; - @Schema(description="生效的流水线id集合") - private String pipelineRange; - @Schema(description="生效的流水线模板id集合") - private String templateRange; - @Schema(description="指标类型") - private String indicatorIds; - @Schema(description="指标操作") - private String indicatorOperations; - @Schema(description="指标阈值") - private String indicatorThresholds; - @Schema(description="操作清单") - private String operationList; - @Schema(description="质量规则构建历史哈希ID") - private String qualityRuleHisHashId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="创建人") - private String createUser; - @Schema(description="stage_id") - private String stageId; - @Schema(description="红线状态") - private String status; - @Schema(description="红线把关人") - private String gateKeepers; - @Schema(description="红线指定的任务节点") - private String taskSteps; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleMapRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleMapRecord.java deleted file mode 100644 index 17d37ceb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleMapRecord.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityRuleMapRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="规则ID") - private Long ruleId; - @Schema(description="指标类型") - private String indicatorIds; - @Schema(description="指标操作") - private String indicatorOperations; - @Schema(description="指标阈值") - private String indicatorThresholds; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleOperationRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleOperationRecord.java deleted file mode 100644 index 6f5320d9..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleOperationRecord.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityRuleOperationRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="规则ID") - private Long ruleId; - @Schema(description="类型") - private String type; - @Schema(description="通知人员") - private String notifyUser; - @Schema(description="用户组ID") - private String notifyGroupId; - @Schema(description="通知类型") - private String notifyTypes; - @Schema(description="审核人员") - private String auditUser; - @Schema(description="审核超时时间") - private Integer auditTimeout; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleRecord.java deleted file mode 100644 index 12f96f22..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleRecord.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityRuleRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="规则名称") - private String name; - @Schema(description="规则描述") - private String desc; - @Schema(description="指标范围") - private String indicatorRange; - @Schema(description="控制点原子类型") - private String controlPoint; - @Schema(description="控制点红线位置") - private String controlPointPosition; - @Schema(description="创建用户") - private String createUser; - @Schema(description="更新用户") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="是否启用") - private Boolean enable; - @Schema(description="项目id") - private String projectId; - @Schema(description="拦截次数") - private Integer interceptTimes; - @Schema(description="生效流水线执行数") - private Integer executeCount; - @Schema(description="流水线模板生效范围") - private String pipelineTemplateRange; - @Schema(description="质量规则哈希ID") - private String qualityRuleHashId; - @Schema(description="红线匹配的id") - private String gatewayId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleReviewerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleReviewerRecord.java deleted file mode 100644 index d06bde70..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleReviewerRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityRuleReviewerRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="规则ID") - private Long ruleId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="实际审核人") - private String reviewer; - @Schema(description="审核时间") - private Date reviewTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleTemplateRecord.java deleted file mode 100644 index d46b2adf..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityRuleTemplateRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityRuleTemplateRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="名称") - private String name; - @Schema(description="类型") - private String type; - @Schema(description="描述") - private String desc; - @Schema(description="阶段") - private String stage; - @Schema(description="控制点原子类型") - private String controlPoint; - @Schema(description="控制点红线位置") - private String controlPointPosition; - @Schema(description="创建者") - private String createUser; - @Schema(description="修改人") - private String updateUser; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="是否启用") - private Boolean enable; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityTemplateIndicatorMapRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityTemplateIndicatorMapRecord.java deleted file mode 100644 index da6a1e7f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TQualityTemplateIndicatorMapRecord.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TQualityTemplateIndicatorMapRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="模板ID") - private Long templateId; - @Schema(description="指标ID") - private Long indicatorId; - @Schema(description="可选操作") - private String operation; - @Schema(description="默认阈值") - private String threshold; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReasonRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReasonRecord.java deleted file mode 100644 index 5e1ea6eb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReasonRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TReasonRecord { - @Schema(description="主键") - private String id; - @Schema(description="类型") - private String type; - @Schema(description="日志内容") - private String content; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="是否启用") - private Boolean enable; - @Schema(description="显示顺序") - private Integer order; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReasonRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReasonRelRecord.java deleted file mode 100644 index 2b6e8913..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReasonRelRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TReasonRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="类型") - private String type; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="原因ID") - private String reasonId; - @Schema(description="原因说明") - private String note; - @Schema(description="创建人") - private String creator; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReportRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReportRecord.java deleted file mode 100644 index dc4b85ae..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TReportRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TReportRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="原子ID") - private String elementId; - @Schema(description="类型") - private String type; - @Schema(description="入口文件") - private String indexFile; - @Schema(description="名称") - private String name; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="任务名称") - private String taskName; - @Schema(description="插件的唯一标识") - private String atomCode; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeGitRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeGitRecord.java deleted file mode 100644 index ea91e24f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeGitRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryCodeGitRecord { - @Schema(description="仓库ID") - private Long repositoryId; - @Schema(description="项目名称") - private String projectName; - @Schema(description="用户名称") - private String userName; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="凭据 ID") - private String credentialId; - @Schema(description="认证方式") - private String authType; - @Schema(description="GIT项目ID") - private Long gitProjectId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeGitlabRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeGitlabRecord.java deleted file mode 100644 index b2ff21ab..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeGitlabRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryCodeGitlabRecord { - @Schema(description="仓库ID") - private Long repositoryId; - @Schema(description="项目名称") - private String projectName; - @Schema(description="凭据 ID") - private String credentialId; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="用户名称") - private String userName; - @Schema(description="凭证类型") - private String authType; - @Schema(description="GIT项目ID") - private Long gitProjectId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeP4Record.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeP4Record.java deleted file mode 100644 index 3fc25908..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeP4Record.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryCodeP4Record { - @Schema(description="") - private Long repositoryId; - @Schema(description="") - private String projectName; - @Schema(description="") - private String userName; - @Schema(description="") - private String credentialId; - @Schema(description="") - private Date createdTime; - @Schema(description="") - private Date updatedTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeSvnRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeSvnRecord.java deleted file mode 100644 index f72e098a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCodeSvnRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryCodeSvnRecord { - @Schema(description="仓库ID") - private Long repositoryId; - @Schema(description="地区") - private String region; - @Schema(description="项目名称") - private String projectName; - @Schema(description="用户名称") - private String userName; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="凭据 ID") - private String credentialId; - @Schema(description="仓库类型") - private String svnType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCommitRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCommitRecord.java deleted file mode 100644 index 1a38a1e2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryCommitRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryCommitRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="构建ID") - private String buildId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="代码库ID") - private Long repoId; - @Schema(description="1-svn, 2-git, 3-gitlab") - private Integer type; - @Schema(description="提交") - private String commit; - @Schema(description="提交者") - private String committer; - @Schema(description="提交时间") - private Date commitTime; - @Schema(description="评论") - private String comment; - @Schema(description="原子ID") - private String elementId; - @Schema(description="代码库别名") - private String repoName; - @Schema(description="代码库URL") - private String url; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGitCheckRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGitCheckRecord.java deleted file mode 100644 index dabf2566..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGitCheckRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryGitCheckRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建编号") - private Integer buildNumber; - @Schema(description="代码库ID") - private String repoId; - @Schema(description="代码提交ID") - private String commitId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="代码库别名") - private String repoName; - @Schema(description="内容") - private String context; - @Schema(description="事件来源") - private String source; - @Schema(description="目标分支") - private String targetBranch; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGitTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGitTokenRecord.java deleted file mode 100644 index de85971c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGitTokenRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryGitTokenRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="用户ID") - private String userId; - @Schema(description="权限Token") - private String accessToken; - @Schema(description="刷新token") - private String refreshToken; - @Schema(description="token类型") - private String tokenType; - @Schema(description="过期时间") - private Long expiresIn; - @Schema(description="token的创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="操作人") - private String operator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGithubRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGithubRecord.java deleted file mode 100644 index 3eb979b0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGithubRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryGithubRecord { - @Schema(description="仓库ID") - private Long repositoryId; - @Schema(description="凭据 ID") - private String credentialId; - @Schema(description="项目名称") - private String projectName; - @Schema(description="用户名称") - private String userName; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="GIT项目ID") - private Long gitProjectId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGithubTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGithubTokenRecord.java deleted file mode 100644 index da2bc060..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryGithubTokenRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryGithubTokenRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="用户ID") - private String userId; - @Schema(description="权限Token") - private String accessToken; - @Schema(description="token类型") - private String tokenType; - @Schema(description="生效范围") - private String scope; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="GitHub token类型(GITHUB_APP、OAUTH_APP)") - private String type; - @Schema(description="操作人") - private String operator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryPipelineRefRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryPipelineRefRecord.java deleted file mode 100644 index a15a4b83..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryPipelineRefRecord.java +++ /dev/null @@ -1,50 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryPipelineRefRecord { - @Schema(description="") - private Long id; - @Schema(description="蓝盾项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="代码库ID") - private Long repositoryId; - @Schema(description="任务ID") - private String taskId; - @Schema(description="原子名称,用户是可以修改") - private String taskName; - @Schema(description="插件的唯一标识") - private String atomCode; - @Schema(description="插件类别") - private String atomCategory; - @Schema(description="插件参数") - private String taskParams; - @Schema(description="插件代码库类型配置") - private String taskRepoType; - @Schema(description="插件代码库hashId配置") - private String taskRepoHashId; - @Schema(description="插件代码库别名配置") - private String taskRepoName; - @Schema(description="触发类型") - private String triggerType; - @Schema(description="事件类型") - private String eventType; - @Schema(description="触发条件") - private String triggerCondition; - @Schema(description="触发条件md5") - private String triggerConditionMd5; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="流水线渠道") - private String channel; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryRecord.java deleted file mode 100644 index d8b3774f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryRecord { - @Schema(description="主键ID") - private Long repositoryId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="用户ID") - private String userId; - @Schema(description="别名") - private String aliasName; - @Schema(description="url地址") - private String url; - @Schema(description="类型") - private String type; - @Schema(description="哈希ID") - private String repositoryHashId; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="是否删除 0 可用 1删除") - private Boolean isDeleted; - @Schema(description="代码库最近修改人 ") - private String updatedUser; - @Schema(description="是否为插件库(插件库不得修改和删除)") - private Boolean atom; - @Schema(description="是否开启pac") - private Boolean enablePac; - @Schema(description="pac同步状态") - private String yamlSyncStatus; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryScmTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryScmTokenRecord.java deleted file mode 100644 index 45f56bd6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryScmTokenRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryScmTokenRecord { - @Schema(description="") - private Long id; - @Schema(description="用户名") - private String userId; - @Schema(description="代码库类型") - private String scmCode; - @Schema(description="app类型") - private String appType; - @Schema(description="access token 密文") - private String accessToken; - @Schema(description="access refresh token") - private String refreshToken; - @Schema(description="过期时间") - private Long expiresIn; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="操作人") - private String operator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryTgitTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryTgitTokenRecord.java deleted file mode 100644 index 902c54e8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryTgitTokenRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryTgitTokenRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="用户ID") - private String userId; - @Schema(description="权限Token") - private String accessToken; - @Schema(description="刷新token") - private String refreshToken; - @Schema(description="token类型") - private String tokenType; - @Schema(description="过期时间") - private Long expiresIn; - @Schema(description="token的创建时间") - private Date createTime; - @Schema(description="账户实际名称") - private String oauthUserId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryWebhookRequestRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryWebhookRequestRecord.java deleted file mode 100644 index b14f88e1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRepositoryWebhookRequestRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRepositoryWebhookRequestRecord { - @Schema(description="请求ID") - private String requestId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="代码库平台ID") - private String externalId; - @Schema(description="触发类型") - private String repositoryType; - @Schema(description="事件类型") - private String eventType; - @Schema(description="触发用户") - private String triggerUser; - @Schema(description="事件信息") - private String eventMessage; - @Schema(description="事件请求头") - private String requestHeader; - @Schema(description="事件请求参数") - private String requestParam; - @Schema(description="事件请求体") - private String requestBody; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRtxNotifyMessageTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRtxNotifyMessageTemplateRecord.java deleted file mode 100644 index da0e4419..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRtxNotifyMessageTemplateRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRtxNotifyMessageTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板ID") - private String commonTemplateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifior; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="邮件标题") - private String title; - @Schema(description="邮件内容") - private String body; - @Schema(description="markdown格式内容") - private String bodyMd; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRuleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRuleRecord.java deleted file mode 100644 index c0b41c80..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TRuleRecord.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TRuleRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="名称") - private String name; - @Schema(description="评论") - private String remark; - @Schema(description="类型") - private String type; - @Schema(description="控制点原子类型") - private String controlPoint; - @Schema(description="任务ID") - private String taskId; - @Schema(description="默认阈值") - private String threshold; - @Schema(description="指标范围") - private String indicatorRange; - @Schema(description="ANY-项目ID集合, PART_BY_NAME-空集合") - private String rangeIdentification; - @Schema(description="可选操作") - private String operation; - @Schema(description="操作结束通知类型") - private String operationEndNotifyType; - @Schema(description="操作结束通知用户组") - private String operationEndNotifyGroup; - @Schema(description="操作结束通知用户") - private String operationEndNotifyUser; - @Schema(description="操作审核通知用户") - private String operationAuditNotifyUser; - @Schema(description="拦截次数") - private Integer interceptTimes; - @Schema(description="是否启用") - private Boolean enable; - @Schema(description="创建者") - private String creator; - @Schema(description="更新人") - private String updator; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="是否删除 0 可用 1删除") - private Boolean isDeleted; - @Schema(description="审核超时时间") - private Integer operationAuditTimeoutMinutes; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TSeniorUserRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TSeniorUserRecord.java deleted file mode 100644 index b80c7970..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TSeniorUserRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TSeniorUserRecord { - @Schema(description="") - private String userId; - @Schema(description="") - private String name; - @Schema(description="") - private String bgName; - @Schema(description="") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TServiceRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TServiceRecord.java deleted file mode 100644 index 6549d4a6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TServiceRecord.java +++ /dev/null @@ -1,68 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TServiceRecord { - @Schema(description="id") - private Long id; - @Schema(description="名称") - private String name; - @Schema(description="英文名称") - private String englishName; - @Schema(description="服务类型ID") - private Long serviceTypeId; - @Schema(description="跳转链接") - private String link; - @Schema(description="新跳转链接") - private String linkNew; - @Schema(description="注入类型") - private String injectType; - @Schema(description="iframe Url地址") - private String iframeUrl; - @Schema(description="css Url地址") - private String cssUrl; - @Schema(description="js Url地址") - private String jsUrl; - @Schema(description="是否在页面显示") - private Boolean showProjectList; - @Schema(description="show Nav") - private Boolean showNav; - @Schema(description="项目ID类型") - private String projectIdType; - @Schema(description="状态") - private String status; - @Schema(description="创建者") - private String createdUser; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改者") - private String updatedUser; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="是否删除") - private Boolean deleted; - @Schema(description="灰度css Url地址") - private String grayCssUrl; - @Schema(description="灰度js Url地址") - private String grayJsUrl; - @Schema(description="logo地址") - private String logoUrl; - @Schema(description="支持webSocket的页面") - private String webSocket; - @Schema(description="权值") - private Integer weight; - @Schema(description="灰度iframe Url地址") - private String grayIframeUrl; - @Schema(description="是否打开新标签页") - private Boolean newWindow; - @Schema(description="新标签页地址") - private String newWindowurl; - @Schema(description="集群类型") - private String clusterType; - @Schema(description="文档链接") - private String docUrl; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TServiceTypeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TServiceTypeRecord.java deleted file mode 100644 index f11b8008..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TServiceTypeRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TServiceTypeRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="邮件标题") - private String title; - @Schema(description="英文邮件标题") - private String englishTitle; - @Schema(description="创建者") - private String createdUser; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改者") - private String updatedUser; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="是否删除") - private Boolean deleted; - @Schema(description="权值") - private Integer weight; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TShardingRoutingRuleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TShardingRoutingRuleRecord.java deleted file mode 100644 index a1c7e469..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TShardingRoutingRuleRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TShardingRoutingRuleRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="路由名称") - private String routingName; - @Schema(description="路由规则") - private String routingRule; - @Schema(description="集群名称") - private String clusterName; - @Schema(description="模块标识") - private String moduleCode; - @Schema(description="路由类型,DB:数据库,TABLE:数据库表") - private String type; - @Schema(description="数据源名称") - private String dataSourceName; - @Schema(description="数据库表名称") - private String tableName; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreApproveRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreApproveRecord.java deleted file mode 100644 index 8d1fc516..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreApproveRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreApproveRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="日志内容") - private String content; - @Schema(description="申请人") - private String applicant; - @Schema(description="类型") - private String type; - @Schema(description="状态") - private String status; - @Schema(description="批准人") - private String approver; - @Schema(description="批准信息") - private String approveMsg; - @Schema(description="创建者") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="") - private String token; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseEnvExtRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseEnvExtRecord.java deleted file mode 100644 index bfc3303a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseEnvExtRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBaseEnvExtRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件执行环境信息表ID") - private String envId; - @Schema(description="组件基本信息表ID") - private String storeId; - @Schema(description="字段名称") - private String fieldName; - @Schema(description="字段值") - private String fieldValue; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseEnvRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseEnvRecord.java deleted file mode 100644 index c9c19641..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseEnvRecord.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBaseEnvRecord { - @Schema(description="主键") - private String id; - @Schema(description="组件基本信息表ID") - private String storeId; - @Schema(description="开发语言") - private String language; - @Schema(description="支持开发语言的最低版本") - private String minVersion; - @Schema(description="包名称") - private String pkgName; - @Schema(description="包路径") - private String pkgPath; - @Schema(description="执行入口") - private String target; - @Schema(description="SHA签名串") - private String shaContent; - @Schema(description="执行前置命令") - private String preCmd; - @Schema(description="支持的操作系统名称") - private String osName; - @Schema(description="支持的操作系统架构") - private String osArch; - @Schema(description="运行时版本") - private String runtimeVersion; - @Schema(description="是否为默认环境信息") - private Boolean defaultFlag; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseExtRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseExtRecord.java deleted file mode 100644 index 2d1dd06d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseExtRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBaseExtRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件基本信息表ID") - private String storeId; - @Schema(description="组件唯一标识") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="字段名称") - private String fieldName; - @Schema(description="字段值") - private String fieldValue; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseFeatureExtRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseFeatureExtRecord.java deleted file mode 100644 index 80ed1024..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseFeatureExtRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBaseFeatureExtRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件特性信息表ID") - private String featureId; - @Schema(description="组件唯一标识") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="字段名称") - private String fieldName; - @Schema(description="字段值") - private String fieldValue; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseFeatureRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseFeatureRecord.java deleted file mode 100644 index 9078bcb4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseFeatureRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBaseFeatureRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件唯一标识") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="是否为公共组件, TRUE:是 FALSE:不是") - private Boolean publicFlag; - @Schema(description="是否推荐, TRUE:是 FALSE:不是") - private Boolean recommendFlag; - @Schema(description="是否官方认证, TRUE:是 FALSE:不是") - private Boolean certificationFlag; - @Schema(description="类型") - private String type; - @Schema(description="研发类型") - private String rdType; - @Schema(description="权重(数值越大代表权重越高)") - private Integer weight; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseRecord.java deleted file mode 100644 index 54e3d77e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBaseRecord.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBaseRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件唯一标识") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="组件名称") - private String name; - @Schema(description="版本号") - private String version; - @Schema(description="状态") - private String status; - @Schema(description="状态对应的描述,如上架失败原因") - private String statusMsg; - @Schema(description="说明文档链接") - private String docsLink; - @Schema(description="logo地址") - private String logoUrl; - @Schema(description="组件简介") - private String summary; - @Schema(description="组件描述") - private String description; - @Schema(description="是否为最新版本, TRUE:最新 FALSE:非最新") - private Boolean latestFlag; - @Schema(description="发布者,对应T_STORE_PUBLISHER_INFO表的PUBLISHER_NAME字段") - private String publisher; - @Schema(description="发布时间") - private Date pubTime; - @Schema(description="所属分类ID") - private String classifyId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBuildAppRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBuildAppRelRecord.java deleted file mode 100644 index 50c737ea..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBuildAppRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBuildAppRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="构建信息Id(对应T_STORE_BUILD_INFO主键)") - private String buildInfoId; - @Schema(description="编译环境版本Id(对应T_APP_VERSION主键)") - private Integer appVersionId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBuildInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBuildInfoRecord.java deleted file mode 100644 index edfc6ce4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreBuildInfoRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreBuildInfoRecord { - @Schema(description="主键") - private String id; - @Schema(description="开发语言") - private String language; - @Schema(description="打包脚本") - private String script; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="代码存放路径") - private String repositoryPath; - @Schema(description="是否启用 1 启用 0 禁用") - private Boolean enable; - @Schema(description="样例工程路径") - private String sampleProjectPath; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCategoryRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCategoryRelRecord.java deleted file mode 100644 index 6c83a51f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCategoryRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreCategoryRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="范畴ID") - private String categoryId; - @Schema(description="组件ID") - private String storeId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentPraiseRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentPraiseRecord.java deleted file mode 100644 index 6ed27a42..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentPraiseRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreCommentPraiseRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="评论ID") - private String commentId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentRecord.java deleted file mode 100644 index 23d1fee3..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreCommentRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="商店组件ID") - private String storeId; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="评论内容") - private String commentContent; - @Schema(description="评论者组织架构信息") - private String commenterDept; - @Schema(description="评分") - private Integer score; - @Schema(description="点赞个数") - private Integer praiseCount; - @Schema(description="评论者头像url地址") - private String profileUrl; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentReplyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentReplyRecord.java deleted file mode 100644 index dcfe173b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreCommentReplyRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreCommentReplyRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="评论ID") - private String commentId; - @Schema(description="回复内容") - private String replyContent; - @Schema(description="评论者头像url地址") - private String profileUrl; - @Schema(description="被回复者") - private String replyToUser; - @Schema(description="回复者组织架构信息") - private String replyerDept; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDeptRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDeptRelRecord.java deleted file mode 100644 index f38a8626..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDeptRelRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreDeptRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="项目所属二级机构ID") - private Integer deptId; - @Schema(description="项目所属二级机构名称") - private String deptName; - @Schema(description="状态") - private Integer status; - @Schema(description="评论") - private String comment; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="store组件类型") - private Integer storeType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformErrorCodeRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformErrorCodeRecord.java deleted file mode 100644 index cb4f73ff..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformErrorCodeRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreDockingPlatformErrorCodeRecord { - @Schema(description="主键") - private String id; - @Schema(description="code码") - private Integer errorCode; - @Schema(description="中文简体描述信息") - private String errorMsgZhCn; - @Schema(description="中文繁体描述信息") - private String errorMsgZhTw; - @Schema(description="英文描述信息") - private String errorMsgEn; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="错误码所属平台代码") - private String platformCode; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformRecord.java deleted file mode 100644 index 4704bc9c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreDockingPlatformRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="平台代码") - private String platformCode; - @Schema(description="平台名称") - private String platformName; - @Schema(description="网址") - private String website; - @Schema(description="简介") - private String summary; - @Schema(description="负责人") - private String principal; - @Schema(description="平台logo地址") - private String logoUrl; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="所属机构名称") - private String ownerDeptName; - @Schema(description="标签") - private String labels; - @Schema(description="平台所属错误码前缀") - private Integer errorCodePrefix; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformRelRecord.java deleted file mode 100644 index 27865621..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreDockingPlatformRelRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreDockingPlatformRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件编码") - private String storeCode; - @Schema(description="组件类型") - private Integer storeType; - @Schema(description="平台代码") - private String platformCode; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreEnvVarRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreEnvVarRecord.java deleted file mode 100644 index 8a4caef2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreEnvVarRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreEnvVarRecord { - @Schema(description="主键") - private String id; - @Schema(description="组件编码") - private String storeCode; - @Schema(description="组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; - @Schema(description="变量名") - private String varName; - @Schema(description="变量值") - private String varValue; - @Schema(description="描述") - private String varDesc; - @Schema(description="生效范围 TEST:测试 PRD:正式 ALL:所有") - private String scope; - @Schema(description="是否加密, TRUE:是 FALSE:否") - private Boolean encryptFlag; - @Schema(description="版本号") - private Integer version; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreErrorCodeInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreErrorCodeInfoRecord.java deleted file mode 100644 index 2815c4ab..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreErrorCodeInfoRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreErrorCodeInfoRecord { - @Schema(description="主键") - private String id; - @Schema(description="组件代码,为空则表示属于通用错误码") - private String storeCode; - @Schema(description="错误码") - private Integer errorCode; - @Schema(description="组件类型") - private Integer storeType; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreHonorInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreHonorInfoRecord.java deleted file mode 100644 index bd9648d5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreHonorInfoRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreHonorInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="头衔") - private String honorTitle; - @Schema(description="荣誉名称") - private String honorName; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreHonorRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreHonorRelRecord.java deleted file mode 100644 index 5b2056c2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreHonorRelRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreHonorRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件代码") - private String storeCode; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; - @Schema(description="荣誉ID") - private String honorId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="组件名称") - private String storeName; - @Schema(description="是否佩戴") - private Boolean mountFlag; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexBaseInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexBaseInfoRecord.java deleted file mode 100644 index 67057933..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexBaseInfoRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreIndexBaseInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="指标标识") - private String indexCode; - @Schema(description="指标名称") - private String indexName; - @Schema(description="描述") - private String description; - @Schema(description="运算类型 ATOM:插件 PLATFORM:平台") - private String operationType; - @Schema(description="指标对应的插件件代码") - private String atomCode; - @Schema(description="指标对应的插件版本") - private String atomVersion; - @Schema(description="完成执行任务数量") - private Integer finishTaskNum; - @Schema(description="执行任务总数") - private Integer totalTaskNum; - @Schema(description="执行时间类型 INDEX_CHANGE:指标变动 COMPONENT_UPGRADE:组件升级 CRON:定时") - private String executeTimeType; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="指标展示权重") - private Integer weight; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexElementDetailRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexElementDetailRecord.java deleted file mode 100644 index 6d0d0496..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexElementDetailRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreIndexElementDetailRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件代码") - private String storeCode; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; - @Schema(description="指标ID") - private String indexId; - @Schema(description="指标标识") - private String indexCode; - @Schema(description="指标要素名称") - private String elementName; - @Schema(description="指标要素值") - private String elementValue; - @Schema(description="备注") - private String remark; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="指标要素标识") - private String elementCode; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexLevelInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexLevelInfoRecord.java deleted file mode 100644 index 4fb4b66f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexLevelInfoRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreIndexLevelInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="等级名称") - private String levelName; - @Schema(description="指标ID") - private String indexId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="icon地址") - private String iconUrl; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexResultRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexResultRecord.java deleted file mode 100644 index c8dadc8a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreIndexResultRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreIndexResultRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件代码") - private String storeCode; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; - @Schema(description="指标ID") - private String indexId; - @Schema(description="指标标识") - private String indexCode; - @Schema(description="图标提示信息") - private String iconTips; - @Schema(description="等级ID") - private String levelId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreLabelRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreLabelRelRecord.java deleted file mode 100644 index dcd02c70..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreLabelRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreLabelRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="标签ID") - private String labelId; - @Schema(description="组件ID") - private String storeId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreMediaInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreMediaInfoRecord.java deleted file mode 100644 index c933453d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreMediaInfoRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreMediaInfoRecord { - @Schema(description="主键") - private String id; - @Schema(description="store组件标识") - private String storeCode; - @Schema(description="媒体资源链接") - private String mediaUrl; - @Schema(description="媒体资源类型 PICTURE:图片 VIDEO:视频") - private String mediaType; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件 4:微扩展") - private Integer storeType; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreMemberRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreMemberRecord.java deleted file mode 100644 index 7a34e195..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreMemberRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreMemberRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="用户名称") - private String username; - @Schema(description="类型") - private Integer type; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="store组件类型") - private Integer storeType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreOptLogRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreOptLogRecord.java deleted file mode 100644 index c793cc0a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreOptLogRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreOptLogRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="操作类型") - private String optType; - @Schema(description="操作内容") - private String optDesc; - @Schema(description="操作用户") - private String optUser; - @Schema(description="操作时间") - private Date optTime; - @Schema(description="创建者") - private String creator; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePipelineBuildRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePipelineBuildRelRecord.java deleted file mode 100644 index 807d534a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePipelineBuildRelRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStorePipelineBuildRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="商店组件ID") - private String storeId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="构建ID") - private String buildId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePipelineRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePipelineRelRecord.java deleted file mode 100644 index adfea922..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePipelineRelRecord.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStorePipelineRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="商店组件编码") - private String storeCode; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="商店组件类型 0:插件 1:模板 2:镜像 3:IDE插件") - private Integer storeType; - @Schema(description="业务类型 BUILD:构建 INDEX:研发商店指标") - private String busType; - @Schema(description="项目代码") - private String projectCode; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePkgRunEnvInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePkgRunEnvInfoRecord.java deleted file mode 100644 index fb4c8b26..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePkgRunEnvInfoRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStorePkgRunEnvInfoRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="组件类型") - private Integer storeType; - @Schema(description="开发语言") - private String language; - @Schema(description="支持的操作系统名称") - private String osName; - @Schema(description="支持的操作系统架构") - private String osArch; - @Schema(description="运行时版本") - private String runtimeVersion; - @Schema(description="安装包名称") - private String pkgName; - @Schema(description="安装包下载路径") - private String pkgDownloadPath; - @Schema(description="是否为默认安装包") - private Boolean defaultFlag; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreProjectRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreProjectRelRecord.java deleted file mode 100644 index f78b4b46..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreProjectRelRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreProjectRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="所属项目") - private String projectCode; - @Schema(description="类型") - private Integer type; - @Schema(description="版本号") - private String version; - @Schema(description="实例ID") - private String instanceId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="store组件类型") - private Integer storeType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePublisherInfoRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePublisherInfoRecord.java deleted file mode 100644 index d847c2f5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePublisherInfoRecord.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStorePublisherInfoRecord { - @Schema(description="主键") - private String id; - @Schema(description="发布者标识") - private String publisherCode; - @Schema(description="发布者名称") - private String publisherName; - @Schema(description="发布者类型 PERSON:个人,ORGANIZATION:组织") - private String publisherType; - @Schema(description="主体负责人") - private String owners; - @Schema(description="技术支持") - private String helper; - @Schema(description="一级部门ID") - private Long firstLevelDeptId; - @Schema(description="一级部门名称") - private String firstLevelDeptName; - @Schema(description="二级部门ID") - private Long secondLevelDeptId; - @Schema(description="二级部门名称") - private String secondLevelDeptName; - @Schema(description="三级部门ID") - private Long thirdLevelDeptId; - @Schema(description="三级部门名称") - private String thirdLevelDeptName; - @Schema(description="四级部门ID") - private Long fourthLevelDeptId; - @Schema(description="四级部门名称") - private String fourthLevelDeptName; - @Schema(description="组织架构名称") - private String organizationName; - @Schema(description="所属机构名称") - private String bgName; - @Schema(description="是否认证标识 true:是,false:否") - private Boolean certificationFlag; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePublisherMemberRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePublisherMemberRelRecord.java deleted file mode 100644 index 3ee5ec0e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStorePublisherMemberRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStorePublisherMemberRelRecord { - @Schema(description="主键") - private String id; - @Schema(description="发布者ID") - private String publisherId; - @Schema(description="成员ID") - private String memberId; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreReleaseRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreReleaseRecord.java deleted file mode 100644 index 6f32579d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreReleaseRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreReleaseRecord { - @Schema(description="主键") - private String id; - @Schema(description="store组件代码") - private String storeCode; - @Schema(description="首次发布人") - private String firstPubCreator; - @Schema(description="首次发布时间") - private Date firstPubTime; - @Schema(description="最近升级人") - private String latestUpgrader; - @Schema(description="最近升级时间") - private Date latestUpgradeTime; - @Schema(description="store组件类型 0:插件 1:模板 2:镜像 3:IDE插件") - private Integer storeType; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreSensitiveApiRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreSensitiveApiRecord.java deleted file mode 100644 index 0cc3e216..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreSensitiveApiRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreSensitiveApiRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="API名称") - private String apiName; - @Schema(description="别名") - private String aliasName; - @Schema(description="API状态") - private String apiStatus; - @Schema(description="API等级") - private String apiLevel; - @Schema(description="申请说明") - private String applyDesc; - @Schema(description="批准信息") - private String approveMsg; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreSensitiveConfRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreSensitiveConfRecord.java deleted file mode 100644 index 143d1fdb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreSensitiveConfRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreSensitiveConfRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="字段名称") - private String fieldName; - @Schema(description="字段值") - private String fieldValue; - @Schema(description="字段描述") - private String fieldDesc; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="字段类型") - private String fieldType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsDailyRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsDailyRecord.java deleted file mode 100644 index 9e609016..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsDailyRecord.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.math.BigDecimal; -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreStatisticsDailyRecord { - @Schema(description="主键") - private String id; - @Schema(description="组件编码") - private String storeCode; - @Schema(description="组件类型") - private Integer storeType; - @Schema(description="总下载量") - private Integer totalDownloads; - @Schema(description="每日下载量") - private Integer dailyDownloads; - @Schema(description="每日执行成功数") - private Integer dailySuccessNum; - @Schema(description="每日执行失败总数") - private Integer dailyFailNum; - @Schema(description="每日执行失败详情") - private String dailyFailDetail; - @Schema(description="每日活跃时长,单位:小时") - private BigDecimal dailyActiveDuration; - @Schema(description="统计时间") - private Date statisticsTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsRecord.java deleted file mode 100644 index 12b7a86a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreStatisticsRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="商店组件ID") - private String storeId; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="下载量") - private Integer downloads; - @Schema(description="评论数量") - private Integer commits; - @Schema(description="评分") - private Integer score; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="store组件类型") - private Integer storeType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsTotalRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsTotalRecord.java deleted file mode 100644 index 4b9e6389..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreStatisticsTotalRecord.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.math.BigDecimal; -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreStatisticsTotalRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="store组件编码") - private String storeCode; - @Schema(description="store组件类型") - private Integer storeType; - @Schema(description="下载量") - private Integer downloads; - @Schema(description="评论数量") - private Integer commits; - @Schema(description="评分") - private Integer score; - @Schema(description="评论均分") - private BigDecimal scoreAverage; - @Schema(description="流水线数量") - private Integer pipelineNum; - @Schema(description="最近执行次数") - private Integer recentExecuteNum; - @Schema(description="总活跃时长,单位:小时") - private BigDecimal recentActiveDuration; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="是否为受欢迎组件") - private Boolean hotFlag; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreVersionLogRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreVersionLogRecord.java deleted file mode 100644 index a9440e7f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStoreVersionLogRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStoreVersionLogRecord { - @Schema(description="主键") - private String id; - @Schema(description="组件ID") - private String storeId; - @Schema(description="发布类型,0:新上架 1:非兼容性升级 2:兼容性功能更新 3:兼容性问题修正") - private Integer releaseType; - @Schema(description="版本日志内容") - private String content; - @Schema(description="创建人") - private String creator; - @Schema(description="最近修改人") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamDeleteEventRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamDeleteEventRecord.java deleted file mode 100644 index b863f0e6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamDeleteEventRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStreamDeleteEventRecord { - @Schema(description="") - private String pipelineId; - @Schema(description="") - private Long gitProjectId; - @Schema(description="EVENT_ID") - private Long eventId; - @Schema(description="初始yaml") - private String originYaml; - @Schema(description="") - private Date createTime; - @Schema(description="") - private String creator; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamPipelineBranchRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamPipelineBranchRecord.java deleted file mode 100644 index 37c1a004..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamPipelineBranchRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStreamPipelineBranchRecord { - @Schema(description="GIT项目ID") - private Long gitProjectId; - @Schema(description="蓝盾流水线ID") - private String pipelineId; - @Schema(description="GIT分支") - private String branch; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamPipelineTriggerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamPipelineTriggerRecord.java deleted file mode 100644 index c94e4cb2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamPipelineTriggerRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStreamPipelineTriggerRecord { - @Schema(description="蓝盾项目ID") - private String projectId; - @Schema(description="蓝盾流水线ID") - private String pipelineId; - @Schema(description="GIT分支") - private String branch; - @Schema(description="当前流水线ci文件的blobid") - private String ciFileBlobId; - @Schema(description="缓存的触发器") - private String trigger; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamServicesConfRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamServicesConfRecord.java deleted file mode 100644 index 19102802..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamServicesConfRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStreamServicesConfRecord { - @Schema(description="ID") - private Long id; - @Schema(description="镜像名称") - private String imageName; - @Schema(description="镜像tag") - private String imageTag; - @Schema(description="镜像仓库地址") - private String repoUrl; - @Schema(description="镜像仓库用户名") - private String repoUsername; - @Schema(description="镜像仓库密码") - private String repoPwd; - @Schema(description="是否可以使用") - private Boolean enable; - @Schema(description="需要的环境变量") - private String env; - @Schema(description="创建人") - private String createUser; - @Schema(description="修改人") - private String updateUser; - @Schema(description="创建时间") - private Date gmtCreate; - @Schema(description="修改时间") - private Date gmtModified; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamTimerBranchRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamTimerBranchRecord.java deleted file mode 100644 index a8faabfe..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamTimerBranchRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStreamTimerBranchRecord { - @Schema(description="") - private String pipelineId; - @Schema(description="") - private Long gitProjectId; - @Schema(description="") - private String branch; - @Schema(description="") - private String projectId; - @Schema(description="") - private String revision; - @Schema(description="") - private Date createTime; - @Schema(description="") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamTimerRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamTimerRecord.java deleted file mode 100644 index 199ea324..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TStreamTimerRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TStreamTimerRecord { - @Schema(description="") - private String projectId; - @Schema(description="") - private String pipelineId; - @Schema(description="") - private String crontab; - @Schema(description="") - private Long gitProjectId; - @Schema(description="触发分支") - private String branchs; - @Schema(description="") - private Boolean always; - @Schema(description="") - private String creator; - @Schema(description="") - private Date createTime; - @Schema(description="") - private String channel; - @Schema(description="EVENT_ID") - private Long eventId; - @Schema(description="初始yaml") - private String originYaml; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTableShardingConfigRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTableShardingConfigRecord.java deleted file mode 100644 index 9314b0a0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTableShardingConfigRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTableShardingConfigRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="集群名称") - private String clusterName; - @Schema(description="模块标识") - private String moduleCode; - @Schema(description="数据库表名称") - private String tableName; - @Schema(description="分表数量") - private Integer shardingNum; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTaskRecord.java deleted file mode 100644 index ac1715a0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTaskRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTaskRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="名称") - private String name; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateCategoryRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateCategoryRelRecord.java deleted file mode 100644 index d9d275fa..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateCategoryRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTemplateCategoryRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="镜像范畴ID") - private String categoryId; - @Schema(description="模板ID") - private String templateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateInstanceBaseRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateInstanceBaseRecord.java deleted file mode 100644 index 28358f02..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateInstanceBaseRecord.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTemplateInstanceBaseRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板ID") - private String templateId; - @Schema(description="模板版本") - private String templateVersion; - @Schema(description="是否使用模板配置") - private Boolean useTemplateSettingsFlag; - @Schema(description="项目ID") - private String projectId; - @Schema(description="总实例化数量") - private Integer totalItemNum; - @Schema(description="实例化成功数量") - private Integer successItemNum; - @Schema(description="实例化失败数量") - private Integer failItemNum; - @Schema(description="状态") - private String status; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateInstanceItemRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateInstanceItemRecord.java deleted file mode 100644 index 57ce0aad..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateInstanceItemRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTemplateInstanceItemRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="项目ID") - private String projectId; - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="流水线名称") - private String pipelineName; - @Schema(description="构建号信息") - private String buildNoInfo; - @Schema(description="状态") - private String status; - @Schema(description="实列化基本信息ID") - private String baseId; - @Schema(description="参数") - private String param; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateLabelRelRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateLabelRelRecord.java deleted file mode 100644 index f8e9bdaf..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateLabelRelRecord.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTemplateLabelRelRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="标签ID") - private String labelId; - @Schema(description="模板ID") - private String templateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplatePipelineRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplatePipelineRecord.java deleted file mode 100644 index 2268946f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplatePipelineRecord.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTemplatePipelineRecord { - @Schema(description="流水线ID") - private String pipelineId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="实例化类型:FREEDOM 自由模式 CONSTRAINT 约束模式") - private String instanceType; - @Schema(description="源模板ID") - private String rootTemplateId; - @Schema(description="版本号") - private Long version; - @Schema(description="版本名称") - private String versionName; - @Schema(description="模板ID") - private String templateId; - @Schema(description="创建者") - private String creator; - @Schema(description="更新人") - private String updator; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="更新时间") - private Date updatedTime; - @Schema(description="构建号") - private String buildNo; - @Schema(description="参数") - private String param; - @Schema(description="流水线已被软删除") - private Boolean deleted; - @Schema(description="实例化错误信息") - private String instanceErrorInfo; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateRecord.java deleted file mode 100644 index 9fbabaef..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTemplateRecord.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板名称") - private String templateName; - @Schema(description="模板代码") - private String templateCode; - @Schema(description="所属分类ID") - private String classifyId; - @Schema(description="版本号") - private String version; - @Schema(description="模板类型") - private Integer templateType; - @Schema(description="模板研发类型") - private Integer templateRdType; - @Schema(description="模板状态") - private Integer templateStatus; - @Schema(description="模板状态信息") - private String templateStatusMsg; - @Schema(description="LOGO URL地址") - private String logoUrl; - @Schema(description="简介") - private String summary; - @Schema(description="描述") - private String description; - @Schema(description="原子发布者") - private String publisher; - @Schema(description="发布描述") - private String pubDescription; - @Schema(description="是否为公共镜像") - private Boolean publicFlag; - @Schema(description="是否为最新版本原子") - private Boolean latestFlag; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifier; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="发布时间") - private Date pubTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTokenRecord.java deleted file mode 100644 index f455fe62..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TTokenRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TTokenRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="用户ID") - private String userId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="归档仓库类型") - private String artifactoryType; - @Schema(description="路径") - private String path; - @Schema(description="TOKEN") - private String token; - @Schema(description="过期时间") - private Date expireTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUploadImageTaskRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUploadImageTaskRecord.java deleted file mode 100644 index 18f7b09b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUploadImageTaskRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TUploadImageTaskRecord { - @Schema(description="任务ID") - private String taskId; - @Schema(description="项目ID") - private String projectId; - @Schema(description="操作员") - private String operator; - @Schema(description="创建时间") - private Date createdTime; - @Schema(description="修改时间") - private Date updatedTime; - @Schema(description="任务状态") - private String taskStatus; - @Schema(description="任务消息") - private String taskMessage; - @Schema(description="镜像列表") - private String imageData; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserDailyFirstAndLastLoginRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserDailyFirstAndLastLoginRecord.java deleted file mode 100644 index 188dc083..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserDailyFirstAndLastLoginRecord.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TUserDailyFirstAndLastLoginRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="用户ID") - private String userId; - @Schema(description="日期") - private Date date; - @Schema(description="首次登录时间") - private Date firstLoginTime; - @Schema(description="最近登录时间") - private Date lastLoginTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserDailyLoginRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserDailyLoginRecord.java deleted file mode 100644 index 2ea8bf60..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserDailyLoginRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TUserDailyLoginRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="用户ID") - private String userId; - @Schema(description="日期") - private Date date; - @Schema(description="登录时间") - private Date loginTime; - @Schema(description="操作系统") - private String os; - @Schema(description="ip地址") - private String ip; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserLocaleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserLocaleRecord.java deleted file mode 100644 index 5d2b4c0c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserLocaleRecord.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TUserLocaleRecord { - @Schema(description="用户ID") - private String userId; - @Schema(description="国际化语言信息") - private String language; - @Schema(description="修改时间") - private Date updateTime; - @Schema(description="创建时间") - private Date createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserRecord.java deleted file mode 100644 index b8c62a18..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserRecord.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TUserRecord { - @Schema(description="用户ID") - private String userId; - @Schema(description="名称") - private String name; - @Schema(description="事业群ID") - private Integer bgId; - @Schema(description="事业群名称") - private String bgName; - @Schema(description="项目所属二级机构ID") - private Integer deptId; - @Schema(description="项目所属二级机构名称") - private String deptName; - @Schema(description="中心ID") - private Integer centerId; - @Schema(description="中心名字") - private String centerName; - @Schema(description="用户组ID") - private Integer groypId; - @Schema(description="用户组名称") - private String groupName; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; - @Schema(description="用户类型0普通用户 1公共账号") - private Boolean userType; - @Schema(description="业务线ID") - private Long businessLineId; - @Schema(description="业务线名称") - private String businessLineName; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserTokenRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserTokenRecord.java deleted file mode 100644 index b07c71b6..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TUserTokenRecord.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TUserTokenRecord { - @Schema(description="用户ID") - private String userId; - @Schema(description="权限Token") - private String accessToken; - @Schema(description="过期时间") - private Long expireTimeMills; - @Schema(description="最近鉴权时间") - private Long lastAccessTimeMills; - @Schema(description="刷新token") - private String refreshToken; - @Schema(description="用户类型") - private String userType; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TVoiceNotifyMessageTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TVoiceNotifyMessageTemplateRecord.java deleted file mode 100644 index 7ff47b82..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TVoiceNotifyMessageTemplateRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TVoiceNotifyMessageTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板ID") - private String commonTemplateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifior; - @Schema(description="任务名称") - private String taskName; - @Schema(description="语音内容") - private String content; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWechatNotifyMessageTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWechatNotifyMessageTemplateRecord.java deleted file mode 100644 index 92052e84..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWechatNotifyMessageTemplateRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TWechatNotifyMessageTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板ID") - private String commonTemplateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifior; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="邮件标题") - private String title; - @Schema(description="邮件内容") - private String body; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWeworkGroupNotifyMessageTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWeworkGroupNotifyMessageTemplateRecord.java deleted file mode 100644 index 3705dd17..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWeworkGroupNotifyMessageTemplateRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TWeworkGroupNotifyMessageTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板ID") - private String commonTemplateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifior; - @Schema(description="邮件标题") - private String title; - @Schema(description="内容") - private String body; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWeworkNotifyMessageTemplateRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWeworkNotifyMessageTemplateRecord.java deleted file mode 100644 index 21968156..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/TWeworkNotifyMessageTemplateRecord.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TWeworkNotifyMessageTemplateRecord { - @Schema(description="主键ID") - private String id; - @Schema(description="模板ID") - private String commonTemplateId; - @Schema(description="创建者") - private String creator; - @Schema(description="修改者") - private String modifior; - @Schema(description="邮件发送者") - private String sender; - @Schema(description="邮件标题") - private String title; - @Schema(description="邮件内容") - private String body; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="更新时间") - private Date updateTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UrlActionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UrlActionRecord.java deleted file mode 100644 index 035ec6fc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UrlActionRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class UrlActionRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="操作") - private String action; - @Schema(description="描述") - private String description; - @Schema(description="url地址") - private String url; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date modifyTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserPermissionRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserPermissionRecord.java deleted file mode 100644 index ee103722..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserPermissionRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class UserPermissionRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="过期时间") - private Date expireTime; - @Schema(description="") - private Integer urlActionId; - @Schema(description="用户ID") - private Integer userId; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date modifyTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserRecord.java deleted file mode 100644 index 5d5d651f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class UserRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="") - private String chname; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="email") - private String email; - @Schema(description="语言") - private String lang; - @Schema(description="最近登录时间") - private Date lastLoginTime; - @Schema(description="电话") - private String phone; - @Schema(description="用户名称") - private String username; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserRoleRecord.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserRoleRecord.java deleted file mode 100644 index c8c813ed..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/UserRoleRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.dataObject; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class UserRoleRecord { - @Schema(description="主键ID") - private Integer id; - @Schema(description="角色ID") - private Integer roleId; - @Schema(description="用户ID") - private Integer userId; - @Schema(description="过期时间") - private Date expireTime; - @Schema(description="创建时间") - private Date createTime; - @Schema(description="修改时间") - private Date modifyTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/control/CallBackControl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/control/CallBackControl.java deleted file mode 100644 index bcdb9e24..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/control/CallBackControl.java +++ /dev/null @@ -1,591 +0,0 @@ -package cd.casic.ci.process.process.engine.control; - - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.CallBackEvent; - - -import cd.casic.ci.common.pipeline.enums.ProjectPipelineCallbackStatus; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.event.ProjectPipelineCallBack; - - -import cd.casic.ci.common.pipeline.service.utils.LogUtils; -import cd.casic.ci.process.api.engine.pojo.PipelineInfo; -import cd.casic.ci.process.api.process.pojo.ProjectPipelineCallBackHistory; -import cd.casic.ci.process.api.process.pojo.pipeline.ModelDetail; -import cd.casic.ci.process.process.constant.AllocIdGenerateConstant; -import cd.casic.ci.process.process.engine.pojo.event.PipelineStreamEnabledEvent; -import cd.casic.ci.process.process.service.base.PipelineBuildDetailServiceImpl; -import cd.casic.ci.process.process.service.base.engin.service.PipelineRepositoryService; -import cd.casic.ci.process.process.service.base.engin.service.ProjectPipelineCallBackService; -import cd.casic.ci.process.process.service.base.engin.service.ProjectPipelineCallBackUrlGenerator; -import cd.casic.ci.process.process.service.base.pojo.*; -import cd.casic.ci.process.process.service.base.pojo.constant.CallbackConstants; -import cd.casic.ci.project.service.ServiceAllocIdResource; -import cd.casic.framework.commons.util.watcher.Watcher; - - -import io.github.resilience4j.circuitbreaker.CallNotPermittedException; -import io.github.resilience4j.circuitbreaker.CircuitBreaker; -import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry; -import io.micrometer.core.instrument.Counter; -import io.micrometer.core.instrument.MeterRegistry; -import io.micrometer.core.instrument.Tags; -import okhttp3.*; -import org.apache.commons.lang3.tuple.ImmutableTriple; -import org.apache.commons.lang3.tuple.Triple; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import java.net.MalformedURLException; -import java.net.URL; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.time.LocalDateTime; -import java.time.ZoneOffset; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.TimeUnit; - - -@Service -public class CallBackControl { - private static final Logger logger = LoggerFactory.getLogger(CallBackControl.class); - private static final MediaType JSON = MediaType.parse("application/json;charset=utf-8"); - private static final int MAX_RETRY_COUNT = 3; - private static final long DEFAULT_FAILURE_DISABLE_TIME_PERIOD = 12 * 60 * 60 * 1000L; - private static final String PIPELINE_CALLBACK_COUNT = "pipeline_callback_count"; - private static final long connectTimeout = 3L; - private static final long readTimeout = 3L; - private static final long writeTimeout = 3L; - - private final PipelineBuildDetailServiceImpl pipelineBuildDetailService; - private final PipelineRepositoryService pipelineRepositoryService; - private final ProjectPipelineCallBackService projectPipelineCallBackService; - private final CircuitBreakerRegistry callbackCircuitBreakerRegistry; - private final MeterRegistry meterRegistry; - private final ProjectPipelineCallBackUrlGenerator projectPipelineCallBackUrlGenerator; - private ServiceAllocIdResource serviceAllocIdResource; - - @Value("${callback.failureDisableTimePeriod:#{43200000}}") - private long failureDisableTimePeriod = DEFAULT_FAILURE_DISABLE_TIME_PERIOD; - - @Autowired - public CallBackControl( - PipelineBuildDetailServiceImpl pipelineBuildDetailService, - PipelineRepositoryService pipelineRepositoryService, - ProjectPipelineCallBackService projectPipelineCallBackService, - CircuitBreakerRegistry callbackCircuitBreakerRegistry, - MeterRegistry meterRegistry, - ProjectPipelineCallBackUrlGenerator projectPipelineCallBackUrlGenerator, - ServiceAllocIdResource serviceAllocIdResource - ) { - this.pipelineBuildDetailService = pipelineBuildDetailService; - this.pipelineRepositoryService = pipelineRepositoryService; - this.projectPipelineCallBackService = projectPipelineCallBackService; - this.callbackCircuitBreakerRegistry = callbackCircuitBreakerRegistry; - this.meterRegistry = meterRegistry; - this.projectPipelineCallBackUrlGenerator = projectPipelineCallBackUrlGenerator; - this.serviceAllocIdResource = serviceAllocIdResource; - } - - // 静态初始化块 - private static final SSLSocketFactory anySslSocketFactory; - private static final TrustManager[] trustAnyCerts; - private static final OkHttpClient callbackClient; - - static { - trustAnyCerts = new TrustManager[]{ - new X509TrustManager() { - @Override - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { - } - - @Override - public X509Certificate[] getAcceptedIssuers() { - return new X509Certificate[0]; - } - } - }; - - try { - SSLContext sslContext = SSLContext.getInstance("SSL"); - sslContext.init(null, trustAnyCerts, new java.security.SecureRandom()); - anySslSocketFactory = sslContext.getSocketFactory(); - } catch (Exception e) { -// throw new RemoteServiceException(e.getMessage()); TODO 添加项目报错 - throw new RuntimeException(e.getMessage()); - } - - callbackClient = new OkHttpClient.Builder() - .connectTimeout(connectTimeout, TimeUnit.SECONDS) - .readTimeout(readTimeout, TimeUnit.SECONDS) - .writeTimeout(writeTimeout, TimeUnit.SECONDS) - .sslSocketFactory(anySslSocketFactory, (X509TrustManager) trustAnyCerts[0]) - .hostnameVerifier((hostname, session) -> true) - .build(); - } - - public void pipelineCreateEvent(String projectId, String pipelineId) { - callBackPipelineEvent(projectId, pipelineId, CallBackEvent.CREATE_PIPELINE); - } - - public void pipelineDeleteEvent(String projectId, String pipelineId) { - callBackPipelineEvent(projectId, pipelineId, CallBackEvent.DELETE_PIPELINE); - } - - public void pipelineUpdateEvent(String projectId, String pipelineId) { - callBackPipelineEvent(projectId, pipelineId, CallBackEvent.UPDATE_PIPELINE); - } - - public void pipelineRestoreEvent(String projectId, String pipelineId) { - callBackPipelineEvent(projectId, pipelineId, CallBackEvent.RESTORE_PIPELINE); - } - - public void projectCreate(String projectId, String projectName, String userId) { - callBackProjectEvent(projectId, projectName, userId, true, CallBackEvent.PROJECT_CREATE); - } - - public void projectUpdate(String projectId, String projectName, String userId) { - callBackProjectEvent(projectId, projectName, userId, true, CallBackEvent.PROJECT_UPDATE); - } - - public void projectEnable(String projectId, String projectName, String userId) { - callBackProjectEvent(projectId, projectName, userId, true, CallBackEvent.PROJECT_ENABLE); - } - - public void projectDisable(String projectId, String projectName, String userId) { - callBackProjectEvent(projectId, projectName, userId, false, CallBackEvent.PROJECT_DISABLE); - } - - public void pipelineStreamEnabledEvent(PipelineStreamEnabledEvent event) { - logger.info(event.getProjectId() + "|STREAM_ENABLED|callback stream enable event"); - List list = projectPipelineCallBackService.listProjectCallBack( - event.getProjectId(), - CallBackEvent.STREAM_ENABLED.name() - ); - StreamEnabledEvent streamEnabledEvent = new StreamEnabledEvent( - event.getUserId(), - event.getGitProjectId(), - event.getGitProjectUrl(), - event.getEnable() - ); - sendToCallBack(new CallBackData(CallBackEvent.STREAM_ENABLED, streamEnabledEvent), list); - } - - private void callBackPipelineEvent(String projectId, String pipelineId, CallBackEvent callBackEvent) { - logger.info(projectId + "|" + pipelineId + "|" + callBackEvent + "|callback pipeline event"); - List list = projectPipelineCallBackService.listProjectCallBack( - projectId, - callBackEvent.name() - ); - if (list.isEmpty()) { - logger.info("[" + pipelineId + "]|[" + callBackEvent + "]| no callback"); - return; - } - - PipelineInfo pipelineInfo = pipelineRepositoryService.getPipelineInfo( - projectId, - pipelineId, - null, - false - ); - if (pipelineInfo == null) { - return; - } - - PipelineEvent pipelineEvent = new PipelineEvent( - pipelineInfo.getPipelineId(), - pipelineInfo.getPipelineName(), - pipelineInfo.getLastModifyUser(), - pipelineInfo.getUpdateTime(), - pipelineInfo.getProjectId() - ); - - sendToCallBack(new CallBackData<>(callBackEvent, pipelineEvent), list); - } - - private void callBackProjectEvent( - String projectId, - String projectName, - String userId, - boolean enable, - CallBackEvent callBackEvent - ) { - logger.info(projectId + "|" + projectName + "|" + callBackEvent + "|callback project event"); - List list = projectPipelineCallBackService.listProjectCallBack( - CallbackConstants.DEVOPS_ALL_PROJECT, - callBackEvent.name() - ); - if (list.isEmpty()) { - logger.info("no [" + callBackEvent + "] project callback"); - return; - } - - ProjectCallbackEvent projectEvent = new ProjectCallbackEvent( - projectId, - projectName, - enable, - userId - ); - - sendToCallBack(new CallBackData<>(callBackEvent, projectEvent), list); - } - - public void callBackBuildEvent(PipelineBuildStatusBroadCastEvent event) { - String projectId = event.getProjectId(); - String pipelineId = event.getPipelineId(); - String buildId = event.getBuildId(); - if (event.getAtomCode() != null && VmOperateTaskGenerator.isVmAtom(event.getAtomCode())) { - return; - } - CallBackEvent callBackEvent = EventUtils.toEventType(event); - if (callBackEvent == null) { - return; - } - - logger.info(projectId + "|" + pipelineId + "|" + buildId + "|" + callBackEvent.name() + "|" + - event.getStageId() + "|" + event.getTaskId() + "|callback"); - - List list = new ArrayList<>(); - list.addAll(projectPipelineCallBackService.listProjectCallBack( - projectId, - callBackEvent.name() - )); - - List pipelineCallback = projectPipelineCallBackService.getPipelineCallback( - projectId, - pipelineId, - callBackEvent.name() - ); - if (pipelineCallback.isEmpty()) { - pipelineCallback = pipelineRepositoryService.getPipelineResourceVersion( - projectId, - pipelineId, - null, - false - ).getModel().getPipelineCallBack( - projectId, - callBackEvent - ); - if (pipelineCallback == null) { - pipelineCallback = Collections.emptyList(); - } - } - if (!pipelineCallback.isEmpty()) { - list.addAll(pipelineCallback); - } - - if (list.isEmpty()) { - return; - } - - ModelDetail modelDetail = pipelineBuildDetailService.get( - projectId, - event.getBuildId(), - false - ); - if (modelDetail == null) { - return; - } - - BuildEvent buildEvent = new BuildEvent( - event.getBuildId(), - modelDetail.getPipelineId(), - modelDetail.getPipelineName(), - modelDetail.getUserId(), - modelDetail.getTriggerUser(), - modelDetail.getCancelUserId(), - modelDetail.getStatus(), - modelDetail.getStartTime(), - modelDetail.getEndTime() != null ? modelDetail.getEndTime() : 0, - new SimpleModel(parseModel(modelDetail.getModel())), - event.getProjectId(), - modelDetail.getTrigger(), - event.getStageId(), - event.getTaskId(), - modelDetail.getBuildNum(), - modelDetail.getDebug() - ); - sendToCallBack(new CallBackData<>(callBackEvent, buildEvent), list); - } - - private void sendToCallBack(CallBackData callBackData, List list){ - String requestBody = com.alibaba.fastjson.JSON.toJSONString(callBackData); - - list.forEach(callBack -> { - String uniqueId = ""; - if (callBackData.getData() instanceof PipelineEvent) { - uniqueId = ((PipelineEvent) callBackData.getData()).getPipelineId(); - } else if (callBackData.getData() instanceof BuildEvent) { - uniqueId = ((BuildEvent) callBackData.getData()).getBuildId(); - } - - Watcher watcher = new Watcher(callBack.getProjectId() + "|" + callBack.getCallBackUrl() + - "|" + callBack.getEvents() + "|" + uniqueId); - try { - logger.info(callBack.getProjectId() + "|" + callBack.getCallBackUrl() + "|" + - uniqueId + "|" + callBack.getEvents() + "|send to callback"); - if (callBack.getCallBackUrl().isBlank()) { - logger.warn("[" + callBack.getProjectId() + "]| call back url is empty!"); - return; - } - send(uniqueId, callBack, requestBody); - } catch (Exception e) { - logger.error("BKSystemErrorMonitor|" + callBack.getProjectId() + "|" + - callBack.getCallBackUrl() + "|" + callBack.getEvents() + "|" + e.getMessage(), e); - } finally { - watcher.stop(); - LogUtils.printCostTimeWE(watcher, 2000,5000); - } - }); - } - - private void send(String uniqueId, ProjectPipelineCallBack callBack, String requestBody) { - long startTime = System.currentTimeMillis(); - Request.Builder builder = new Request.Builder() - .url(callBack.getCallBackUrl()) - .header("X-DEVOPS-WEBHOOK-TOKEN", callBack.getSecretToken() != null ? callBack.getSecretToken() : "NONE") -// TODO .header(TraceTag.TRACE_HEADER_DEVOPS_BIZID, TraceTag.buildBiz()) - .post(RequestBody.create(JSON, requestBody)); - - if (callBack.getSecretParam() != null) { - callBack.getSecretParam().secret(builder); - } - - Request request = builder.build(); - - String errorMsg = null; - ProjectPipelineCallbackStatus status = ProjectPipelineCallbackStatus.SUCCESS; - CircuitBreaker breaker = callbackCircuitBreakerRegistry.circuitBreaker(callBack.getCallBackUrl()); - try { - breaker.executeCallable(() -> { -// TODO HttpRetryUtils.retry(MAX_RETRY_COUNT, () -> { -// callbackClient.newCall(request).execute().closeQuietly(); -// }); - if (callBack.getFailureTime() != null) { - projectPipelineCallBackService.updateFailureTime( - callBack.getProjectId(), - callBack.getId(), - null - ); - } - return null; - }); - } catch (CallNotPermittedException e) { - logger.warn( - "[" + callBack.getProjectId() + "]|CALL_BACK|url=" + callBack.getCallBackUrl() + - "|" + callBack.getEvents() + "|failureRate=" + breaker.getMetrics().getFailureRate() + - "|" + e.getMessage() - ); - checkIfNeedDisable(breaker, callBack); - errorMsg = e.getMessage(); - status = ProjectPipelineCallbackStatus.FAILED; - } catch (Exception e) { - logger.warn( - "BKSystemErrorMonitor|[" + callBack.getProjectId() + "]|CALL_BACK|" + - "url=" + callBack.getCallBackUrl() + "|" + callBack.getEvents(), - e - ); - errorMsg = e.getMessage(); - status = ProjectPipelineCallbackStatus.FAILED; - } finally { - String originUrl = projectPipelineCallBackUrlGenerator.decodeCallbackUrl( - request.url().toString() - ); - String realUrl = originUrl.substring(originUrl.indexOf("?")); - try { - String host = new URL(realUrl).getHost(); - Counter.builder(PIPELINE_CALLBACK_COUNT) - .tags( - Tags.of("status", status.name()) - .and("host",host) - .and("event", callBack.getEvents()) - ) - .register(meterRegistry) - .increment(); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } - - saveHistory( - callBack, - Collections.singletonList(new ProjectPipelineCallBackHistory.CallBackHeader("X-DEVOPS-WEBHOOK-UNIQUE-ID", uniqueId)), - status.name(), - errorMsg, - startTime, - System.currentTimeMillis() - ); - } - } - - private void checkIfNeedDisable(CircuitBreaker breaker, ProjectPipelineCallBack callBack) { - if (breaker.getMetrics().getFailureRate() == 100.0F) { - long duration = 0; - if (callBack.getFailureTime() != null) { - duration = System.currentTimeMillis() - callBack.getFailureTime().atOffset(ZoneOffset.UTC).toInstant().toEpochMilli(); - } else { - projectPipelineCallBackService.updateFailureTime( - callBack.getProjectId(), - callBack.getId(), - LocalDateTime.now() - ); - } - if (duration >= failureDisableTimePeriod) { - logger.warn( - "disable callbacks because of 100% failure rate|" + - "[" + callBack.getProjectId() + "]|CALL_BACK|url=" + callBack.getCallBackUrl() + - "|" + callBack.getEvents() + "|duration=" + duration - ); - projectPipelineCallBackService.disable(callBack.getProjectId(), callBack.getId()); - } - } - } - - private void saveHistory( - ProjectPipelineCallBack callBack, - List requestHeaders, - String status, - String errorMsg, - long startTime, - long endTime - ) { - try { - projectPipelineCallBackService.createHistory( - new ProjectPipelineCallBackHistory( - serviceAllocIdResource.generateSegmentId(AllocIdGenerateConstant.PROJECT_PIPELINE_CALLBACK_HISTORY) - , - callBack.getProjectId(), - callBack.getCallBackUrl(), - callBack.getEvents(), - status, - requestHeaders, - "", - 0, - "", - errorMsg, - null, - startTime, - endTime -// client.get(ServiceAllocIdResource.class) -// .generateSegmentId("PROJECT_PIPELINE_CALLBACK_HISTORY").getData() - ) - ); - } catch (Throwable e) { - logger.error("[" + callBack.getProjectId() + "]|[" + callBack.getCallBackUrl() + - "]|[" + callBack.getEvents() + "]|save fail", e); - } - } - - List parseModel(Model model) { - List stages = new ArrayList<>(); - for (int pos = 0; pos < model.getStages().size(); pos++) { - Stage s = model.getStages().get(pos); - List jobs = new ArrayList<>(); - SimpleStage stage = new SimpleStage( - "Stage-" + (pos + 1), - s.getName() != null ? s.getName() : "", - jobs - ); - logger.info("parseModel " + model.getName() + "|" + stage.getStageName() + - "|" + stage.getName() + "|"); - stage.setStartTime(s.getStartEpoch() != null ? s.getStartEpoch() : 0); - stages.add(stage); - - Triple triple = parseJob(s, jobs); - long stageStartTimeMills = triple.getLeft(); - long stageEndTimeMills = triple.getMiddle(); - BuildStatus stageStatus = triple.getRight(); - - if (stage.getStartTime() == 0L && stageStartTimeMills > 0) { - stage.setStartTime(stageStartTimeMills); - } - - if (stageEndTimeMills > 0) { - stage.setEndTime(stageEndTimeMills); - } - - stage.setStatus(stageStatus.name()); - } - return stages; - } - - private Triple parseJob(Stage s, List jobs) { - long stageStartTimeMills = Long.MAX_VALUE; - long stageEndTimeMills = 1L; - BuildStatus stageStatus = BuildStatus.QUEUE; - for (Container c : s.getContainers()) { - BuildStatus jobStatus = BuildStatus.parse(c.getStatus()); - long jobStartTimeMills = c.getStartEpoch() != null ? c.getStartEpoch() : 0L; - long jobEndTimeMills = jobStatus.isFinish() ? - jobStartTimeMills + (c.getElementElapsed() != null ? c.getElementElapsed() : 0) + - (c.getSystemElapsed() != null ? c.getSystemElapsed() : 0) : 0; - - if (stageStartTimeMills > jobStartTimeMills) { - stageStartTimeMills = jobStartTimeMills; - } - - if (jobEndTimeMills == 0L) { - stageStatus = jobStatus; - stageEndTimeMills = jobEndTimeMills; - } else if (stageEndTimeMills >= 1 && stageEndTimeMills < jobEndTimeMills) { - stageEndTimeMills = jobEndTimeMills; - if (jobStatus.isFailure()) { - stageStatus = jobStatus; - } - } - - jobs.add( - new SimpleJob( - c.getName(), - jobStatus.name(), - jobStartTimeMills, - jobEndTimeMills, - parseTask(c) - ) - ); - } - - if (stageEndTimeMills > 0 && !stageStatus.isFinish()) { - stageStatus = BuildStatus.SUCCEED; - } - return new ImmutableTriple<>(stageStartTimeMills, stageEndTimeMills, stageStatus); - } - - private List parseTask(Container c) { - List tasks = new ArrayList<>(); - for (Element e : c.getElements()) { - long taskStartTimeMills = e.getStartEpoch() != null ? e.getStartEpoch() : 0; - BuildStatus taskStatus = BuildStatus.parse(e.getStatus()); - long taskEndTimeMills = taskStatus.isFinish() ? - taskStartTimeMills + (e.getElapsed() != null ? e.getElapsed() : 0) : 0; - tasks.add( - new SimpleTask( - e.getId(), - e.getName(), - e.getAtomCode(), - taskStatus.name(), - taskStartTimeMills, - taskEndTimeMills - ) - ); - } - return tasks; - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineCreateListener.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineCreateListener.java deleted file mode 100644 index 93e7a6f2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineCreateListener.java +++ /dev/null @@ -1,66 +0,0 @@ -package cd.casic.ci.process.process.engine.listener; - -import cd.casic.ci.common.pipeline.service.utils.LogUtils; -import cd.casic.ci.process.process.engine.control.CallBackControl; -import cd.casic.ci.process.process.engine.pojo.event.PipelineCreateEvent; -import cd.casic.ci.process.process.engine.service.AgentPipelineRefService; -import cd.casic.ci.process.process.engine.service.PipelineAtomStatisticsService; -import cd.casic.ci.process.process.engine.service.PipelineWebhookService; -import cd.casic.ci.process.process.engine.service.RepoPipelineRefService; -import cd.casic.framework.commons.util.watcher.Watcher; -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessageListener; -import com.github.fppt.jedismock.operations.transactions.Watch; -import org.springframework.stereotype.Service; -/** - * MQ实现的流水线创建事件 - * - * @version 1.0 - */ -@Service -public class MQPipelineCreateListener extends AbstractRedisStreamMessageListener { - private PipelineWebhookService pipelineWebhookService; - private PipelineAtomStatisticsService pipelineAtomStatisticsService; - private CallBackControl callBackControl; - private AgentPipelineRefService agentPipelineRefService; - private RepoPipelineRefService repoPipelineRefService; - @Override - public void onMessage(PipelineCreateEvent event) { - String id = String.format("%s|CreatePipeline#%s|%s", - event.getTraceId(),event.getPipelineId(),event.getUserId() - ); - Watcher watcher = new Watcher(id); - - watcher.safeAround("callback",()-> { - callBackControl.pipelineCreateEvent(event.getProjectId(), event.getPipelineId()); - }); - - watcher.safeAround("updateAtomPipelineNum",()->{ - pipelineAtomStatisticsService.updateAtomPipelineNum( - event.getProjectId(), - event.getPipelineId(), - event.getVersion()!=null ?event.getVersion(): 1, - false, - false - ); - }); - - watcher.safeAround("updateAgentPipelineRef",()->{ - agentPipelineRefService.updateAgentPipelineRef(event.getUserId(), "create_pipeline", event.getProjectId(), event.getPipelineId()); - }); - - watcher.safeAround("addWebhook",()-> { - pipelineWebhookService.addWebhook( - event.getProjectId(), - event.getPipelineId(), - event.getVersion(), - event.getUserId() - ); - }); - - watcher.safeAround("savePipelineRefRepository",()->{ - repoPipelineRefService.updateRepoPipelineRef(event.getUserId(), "create_pipeline", event.getProjectId(), event.getPipelineId()); - }) ; - - LogUtils.printCostTimeWE(watcher); - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineDeleteListener.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineDeleteListener.java deleted file mode 100644 index aaf3e95d..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineDeleteListener.java +++ /dev/null @@ -1,84 +0,0 @@ -package cd.casic.ci.process.process.engine.listener; - -import cd.casic.ci.common.pipeline.service.utils.LogUtils; -import cd.casic.ci.process.process.engine.control.CallBackControl; -import cd.casic.ci.process.process.engine.pojo.event.PipelineCreateEvent; -import cd.casic.ci.process.process.engine.pojo.event.PipelineDeleteEvent; -import cd.casic.ci.process.process.engine.service.*; -import cd.casic.framework.commons.util.watcher.Watcher; -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessageListener; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; -/** - * MQ实现的流水线删除事件 - * - * @version 1.0 - */ -@Service -public class MQPipelineDeleteListener extends AbstractRedisStreamMessageListener { - @Resource - private PipelineRuntimeService pipelineRuntimeService; - @Resource - private PipelineWebhookService pipelineWebhookService; - @Resource - private PipelineGroupService pipelineGroupService; - @Resource - private PipelineAtomStatisticsService pipelineAtomStatisticsService; - @Resource - private CallBackControl callBackControl; - @Resource - private AgentPipelineRefService agentPipelineRefService; - @Resource - private RepoPipelineRefService repoPipelineRefService; - @Override - public void onMessage(PipelineDeleteEvent event) { - String id = String.format("%s|DeletePipeline#%s|%s}", - event.getTraceId(), - event.getPipelineId(), - event.isClearUpModel()); - Watcher watcher = new Watcher(id); - final String projectId = event.getProjectId(); - final String pipelineId = event.getPipelineId(); - final String userId = event.getUserId(); - - watcher.safeAround("cancelPendingTask",()->{ - pipelineRuntimeService.cancelPendingTask(projectId, pipelineId, userId); - }); - - if (event.isClearUpModel()) { - watcher.safeAround("deleteExt",()-> { - pipelineGroupService.deleteAllUserFavorByPipeline(userId, projectId, pipelineId); // 删除收藏该流水线上所有记录 - pipelineGroupService.deletePipelineLabel(userId, projectId, pipelineId); - }); - } - - watcher.safeAround("deleteWebhook",()->{ - pipelineWebhookService.deleteWebhook(projectId, pipelineId, userId); - }); - - watcher.safeAround("updateAgentPipelineRef",()->{ - agentPipelineRefService.updateAgentPipelineRef(userId, "delete_pipeline", projectId, pipelineId); - }); - - watcher.safeAround("updateAtomPipelineNum",()->{ - pipelineAtomStatisticsService.updateAtomPipelineNum( - event.getProjectId(), - event.getPipelineId(), - null, - true, - false - ); - }); - - watcher.safeAround("updateAgentPipelineRef",()->{ - repoPipelineRefService.updateRepoPipelineRef(userId, "delete_pipeline", projectId, pipelineId); - }); - - watcher.safeAround("callback", - ()->{ - callBackControl.pipelineDeleteEvent(event.getProjectId(), event.getPipelineId()); - }); - - LogUtils.printCostTimeWE(watcher); - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineRestoreListener.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineRestoreListener.java deleted file mode 100644 index 0a80df5f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineRestoreListener.java +++ /dev/null @@ -1,66 +0,0 @@ -package cd.casic.ci.process.process.engine.listener; - -import cd.casic.ci.common.pipeline.service.utils.LogUtils; -import cd.casic.ci.process.process.engine.control.CallBackControl; -import cd.casic.ci.process.process.engine.pojo.event.PipelineDeleteEvent; -import cd.casic.ci.process.process.engine.pojo.event.PipelineRestoreEvent; -import cd.casic.ci.process.process.engine.service.AgentPipelineRefService; -import cd.casic.ci.process.process.engine.service.PipelineAtomStatisticsService; -import cd.casic.ci.process.process.engine.service.RepoPipelineRefService; -import cd.casic.framework.commons.util.watcher.Watcher; -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessageListener; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -/** - * MQ实现的流水线恢复事件 - * - * @version 1.0 - */ -@Service -public class MQPipelineRestoreListener extends AbstractRedisStreamMessageListener { - @Resource - private AgentPipelineRefService agentPipelineRefService; - @Resource - private PipelineAtomStatisticsService pipelineAtomStatisticsService; - @Resource - private CallBackControl callBackControl; - @Resource - private RepoPipelineRefService repoPipelineRefService; - - @Override - public void onMessage(PipelineRestoreEvent event) { - String id = String.format("%s|RestorePipeline#%s|%s}", - event.getTraceId(), - event.getPipelineId(), - event.getUserId() - ) ; - Watcher watcher = new Watcher(id); - try { - watcher.start("updateAgentPipelineRef"); - String userId = event.getUserId(); - String projectId = event.getProjectId(); - String pipelineId = event.getPipelineId(); - Integer version = event.getVersion(); - agentPipelineRefService.updateAgentPipelineRef(userId, "restore_pipeline", projectId, pipelineId); - - watcher.stop(); - watcher.start("updateAtomPipelineNum"); - pipelineAtomStatisticsService.updateAtomPipelineNum( - projectId, - pipelineId, - version, - false, - true - ); - watcher.stop(); - watcher.start("callback"); - callBackControl.pipelineRestoreEvent(projectId, pipelineId); - repoPipelineRefService.updateRepoPipelineRef(userId, "restore_pipeline", projectId, pipelineId); - - } finally { - watcher.stop(); - LogUtils.printCostTimeWE(watcher); - } - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineStreamEnabledListener.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineStreamEnabledListener.java deleted file mode 100644 index 2b7b32a8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineStreamEnabledListener.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.process.process.engine.listener; - -import cd.casic.ci.common.pipeline.service.utils.LogUtils; -import cd.casic.ci.process.process.engine.control.CallBackControl; -import cd.casic.ci.process.process.engine.pojo.event.PipelineRestoreEvent; -import cd.casic.ci.process.process.engine.pojo.event.PipelineStreamEnabledEvent; -import cd.casic.framework.commons.util.watcher.Watcher; -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessageListener; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - -/** - * MQ实现的流水线开启Stream事件 - * - * @version 1.0 - */ -@Service -public class MQPipelineStreamEnabledListener extends AbstractRedisStreamMessageListener { - @Resource - private CallBackControl callBackControl; - - @Override - public void onMessage(PipelineStreamEnabledEvent event) { - String id = String.format("%s|RestorePipeline#%s|%s}", - event.getTraceId(), - event.getPipelineId(), - event.getUserId() - ) ; - Watcher watcher =new Watcher(id); - try { - watcher.start("callback"); - callBackControl.pipelineStreamEnabledEvent( - event - ); - watcher.stop(); - } finally { - watcher.stop(); - LogUtils.printCostTimeWE(watcher); - } - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineUpdateListener.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineUpdateListener.java deleted file mode 100644 index 1f7ffa48..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/listener/MQPipelineUpdateListener.java +++ /dev/null @@ -1,69 +0,0 @@ -package cd.casic.ci.process.process.engine.listener; - -import cd.casic.ci.common.pipeline.service.utils.LogUtils; -import cd.casic.ci.process.process.engine.control.CallBackControl; -import cd.casic.ci.process.process.engine.pojo.event.PipelineUpdateEvent; -import cd.casic.ci.process.process.engine.service.AgentPipelineRefService; -import cd.casic.ci.process.process.engine.service.PipelineAtomStatisticsService; -import cd.casic.ci.process.process.engine.service.PipelineWebhookService; -import cd.casic.ci.process.process.engine.service.RepoPipelineRefService; -import cd.casic.framework.commons.util.watcher.Watcher; -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessageListener; -import org.springframework.stereotype.Service; - -/** - * MQ实现的流水线更新事件 - * - * @version 1.0 - */ -@Service -public class MQPipelineUpdateListener extends AbstractRedisStreamMessageListener { - private PipelineAtomStatisticsService pipelineAtomStatisticsService; - private CallBackControl callBackControl; - private AgentPipelineRefService agentPipelineRefService; - private PipelineWebhookService pipelineWebhookService; - private RepoPipelineRefService repoPipelineRefService; - - @Override - public void onMessage(PipelineUpdateEvent event) { - String id = String.format("%s|RestorePipeline#%s|%s}", - event.getTraceId(), - event.getPipelineId(), - event.getUserId() - ) ; - Watcher watcher = new Watcher(id); - final String projectId = event.getProjectId(); - final String pipelineId = event.getPipelineId(); - final String userId = event.getUserId(); - final Integer version = event.getVersion(); - - watcher.safeAround("callback",()->{ - callBackControl.pipelineUpdateEvent(projectId, pipelineId); - }); - - watcher.safeAround("updateAgentPipelineRef",()->{ - agentPipelineRefService.updateAgentPipelineRef(userId, "update_pipeline", projectId, pipelineId); - }); - - watcher.safeAround("updateAtomPipelineNum",()->{ - pipelineAtomStatisticsService.updateAtomPipelineNum(projectId,pipelineId, version,false,false); - }); - - watcher.safeAround("addWebhook",()->{ - pipelineWebhookService.addWebhook( - projectId , - pipelineId , - version , - userId - ); - }); - - watcher.safeAround("updateAgentPipelineRef",()->{ - - repoPipelineRefService.updateRepoPipelineRef(userId, "update_pipeline", projectId, pipelineId); - - }); - - LogUtils.printCostTimeWE(watcher); - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineCreateEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineCreateEvent.java deleted file mode 100644 index 6652b5f8..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineCreateEvent.java +++ /dev/null @@ -1,58 +0,0 @@ -package cd.casic.ci.process.process.engine.pojo.event; - - - - -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import lombok.Data; -import lombok.EqualsAndHashCode; -import java.util.Map; - -/** - * 创建流水线事件 - * - * @version 1.0 - */ -@Data -@EqualsAndHashCode(callSuper = true) -public class PipelineCreateEvent extends IPipelineEvent { - - private BuildNo buildNo; - private String pipelineName; - private Element element; - private Integer version; - private Map variables; - - public PipelineCreateEvent( - String source, - String projectId, - String pipelineId, - String userId, - BuildNo buildNo, - String pipelineName, - Element element, - Integer version, - Map variables, - ActionType actionType, - int delayMills - ) { - super(actionType, source, projectId, pipelineId, userId, delayMills); - this.buildNo = buildNo; - this.pipelineName = pipelineName; - this.element = element; - this.version = version; - this.variables = variables; - } - - public PipelineCreateEvent( - String source, - String projectId, - String pipelineId, - String userId - ) { - this(source, projectId, pipelineId, userId, null, null, null, 1, null, ActionType.START, 0); - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineDeleteEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineDeleteEvent.java deleted file mode 100644 index 6a38d41e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineDeleteEvent.java +++ /dev/null @@ -1,56 +0,0 @@ -package cd.casic.ci.process.process.engine.pojo.event; - - -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Map; - -/** - * 创建流水线事件 - * - * @version 1.0 - */ -import lombok.Getter; -import lombok.ToString; - -/** - * 删除流水线事件 - * - * @version 1.0 - */ -@Getter -@ToString(callSuper = true) -@EqualsAndHashCode(callSuper = true) -//@Event(StreamBinding.PIPELINE_DELETE) -public class PipelineDeleteEvent extends IPipelineEvent { - - private final boolean clearUpModel; - - public PipelineDeleteEvent( - String source, - String projectId, - String pipelineId, - String userId, - boolean clearUpModel - ) { - this(source, projectId, pipelineId, userId, clearUpModel, ActionType.START, 0); - } - - public PipelineDeleteEvent( - String source, - String projectId, - String pipelineId, - String userId, - boolean clearUpModel, - ActionType actionType, - int delayMills - ) { - super(actionType, source, projectId, pipelineId, userId, delayMills); - this.clearUpModel = clearUpModel; - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineRestoreEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineRestoreEvent.java deleted file mode 100644 index 7d8cd5dc..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineRestoreEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.process.process.engine.pojo.event; - -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class PipelineRestoreEvent extends IPipelineEvent { - private Integer version; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineStreamEnabledEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineStreamEnabledEvent.java deleted file mode 100644 index 9bbd63a7..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineStreamEnabledEvent.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.process.process.engine.pojo.event; - -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class PipelineStreamEnabledEvent extends IPipelineEvent { - private Long gitProjectId; - private String gitProjectUrl; - private Boolean enable; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineUpdateEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineUpdateEvent.java deleted file mode 100644 index 182b331a..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/pojo/event/PipelineUpdateEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.process.engine.pojo.event; - -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import lombok.Data; -import lombok.EqualsAndHashCode; -/** - * 更新流水线事件 - * - * @version 1.0 - */ -@EqualsAndHashCode(callSuper = true) -@Data -public class PipelineUpdateEvent extends IPipelineEvent { - private Integer version; - private BuildNo buildNo; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/AgentPipelineRefService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/AgentPipelineRefService.java deleted file mode 100644 index 5c157542..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/AgentPipelineRefService.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.process.process.engine.service; - - -import cd.casic.ci.common.pipeline.Model; - -/** - * 构建机流水线引用服务接口 - */ -public interface AgentPipelineRefService { - - /** - * 更新构建机流水线引用 - * - * @param userId 用户ID - * @param action 操作类型 - * @param projectId 项目ID - * @param pipelineId 流水线ID - */ - void updateAgentPipelineRef(String userId, String action, String projectId, String pipelineId); - - /** - * 分析流水线引用并保存 - * - * @param userId 用户ID - * @param action 操作类型 - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param pipelineModel 流水线模型 - */ - void analysisPipelineRefAndSave( - String userId, - String action, - String projectId, - String pipelineId, - Model pipelineModel - ); - - /** - * 更新流水线引用 - * - * @param userId 用户ID - * @param projectId 项目ID - * @param pipelineId 流水线ID - */ - void updatePipelineRef(String userId, String projectId, String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineAtomStatisticsService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineAtomStatisticsService.java deleted file mode 100644 index 6db3a393..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineAtomStatisticsService.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.process.process.engine.service; - -import java.util.Set; - -/** - * 流水线插件统计相关的服务 - * @version 1.0 - */ -public interface PipelineAtomStatisticsService { - - /** - * 更新插件对应的流水线数量 - */ - void updateAtomPipelineNum( - String projectId, - String pipelineId, - Integer version, - Boolean deleteFlag, - Boolean restoreFlag - ); - - /** - * 添加流水线数量更新 - */ - void addPipelineNumUpdate( - Set modelVersionAtomSet, -// List pipelineNumUpdateList, - Boolean incrementFlag - ); - - /** - * 获取版本模型字符串 - */ - String getVersionModelString( - String projectId, - String pipelineId, - Integer version - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineGroupService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineGroupService.java deleted file mode 100644 index 508d5a1f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineGroupService.java +++ /dev/null @@ -1,114 +0,0 @@ -package cd.casic.ci.process.process.engine.service; - -import cd.casic.ci.process.api.process.pojo.classify.*; -import cd.casic.ci.process.process.dataObject.TPipelineFavorRecord; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** - * 流水线分组服务接口 - */ -public interface PipelineGroupService { - - /** - * 获取分组列表 - */ - List getGroups(String userId, String projectId); - - /** - * 获取指定流水线的分组列表 - */ - List getGroups(String userId, String projectId, String pipelineId); - - /** - * 添加分组 - */ - Boolean addGroup(String userId, PipelineGroupCreate pipelineGroup); - - /** - * 更新分组 - */ - Boolean updateGroup(String userId, PipelineGroupUpdate pipelineGroup); - - /** - * 删除分组 - */ - Boolean deleteGroup(String userId, String projectId, String groupId); - - /** - * 添加标签 - */ - Boolean addLabel(String userId, String projectId, PipelineLabelCreate pipelineLabel); - - /** - * 删除标签 - */ - Boolean deleteLabel(String userId, String projectId, String labelId); - - /** - * 更新标签 - */ - Boolean updateLabel(String userId, String projectId, PipelineLabelUpdate pipelineLabel); - - /** - * 删除流水线标签 - */ - void deletePipelineLabel(String userId, String projectId, String pipelineId); - - /** - * 添加流水线标签 - */ - void addPipelineLabel(String userId, String projectId, String pipelineId, List labelIds); - - /** - * 更新流水线标签 - */ - void updatePipelineLabel(String userId, String projectId, String pipelineId, List labelIds); - - /** - * 获取视图标签到流水线的映射 - */ - Map> getViewLabelToPipelinesMap( - String projectId, - List labels - ); - - /** - * 获取分组到标签的映射 - */ - Map> getGroupToLabelsMap(String projectId, List labels); - - /** - * 收藏流水线 - */ - Boolean favorPipeline(String userId, String projectId, String pipelineId, Boolean favor); - - /** - * 删除流水线相关的所有收藏 - */ - Integer deleteAllUserFavorByPipeline(String userId, String projectId, String pipelineId); - - /** - * 获取收藏的流水线列表 - */ - List getFavorPipelines(String userId, String projectId); - - /** - * 获取流水线分组标签 - */ - Map> getPipelinesGroupLabel( - Collection pipelineIds, - String projectId - ); - - /** - * 分页获取收藏的流水线 - */ - TPipelineFavorRecord getFavorPipelinesPage( - String userId, - Integer page, - Integer pageSize - ); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineRuntimeService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineRuntimeService.java deleted file mode 100644 index 2ad42443..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineRuntimeService.java +++ /dev/null @@ -1,425 +0,0 @@ -package cd.casic.ci.process.process.engine.service; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.common.pipeline.pojo.time.BuildRecordTimeCost; -import cd.casic.ci.process.api.engine.pojo.BuildInfo; -import cd.casic.ci.process.api.process.enums.HistorySearchType; -import cd.casic.ci.process.api.process.pojo.*; -import cd.casic.ci.process.api.process.pojo.app.StartBuildContext; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineLatestBuild; -import cd.casic.ci.process.process.dataObject.TPipelineBuildSummaryRecord; -import cd.casic.ci.process.process.dataObject.TPipelineInfoRecord; -import cd.casic.ci.process.process.pojo.LatestRunningBuild; -import cd.casic.ci.process.process.pojo.PipelineFilterParam; -import org.apache.commons.lang3.tuple.Pair; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 流水线运行时相关的服务接口 - */ -public interface PipelineRuntimeService { - - /** - * 取消待处理的任务 - */ - void cancelPendingTask(String projectId, String pipelineId, String userId); - - /** - * 获取构建信息 - */ - BuildInfo getBuildInfo(String projectId, String buildId); - - /** - * 获取构建信息 - */ - BuildInfo getBuildInfo(String projectId, String pipelineId, String buildId); - - /** - * 获取运行中的构建数量 - */ - int getRunningBuildCount(String projectId, String pipelineId); - - /** - * 根据并发组获取构建列表 - */ - List> getBuildInfoListByConcurrencyGroup( - String projectId, - String concurrencyGroup, - List status - ); - - /** - * 获取构建号 - */ - Map getBuildNoByByPair(Set buildIds, String projectId); - - /** - * 获取构建摘要记录 - */ - TPipelineBuildSummaryRecord getBuildSummaryRecord(String projectId, String pipelineId); - - /** - * 获取流水线构建记录 - */ - TPipelineInfoRecord getBuildPipelineRecords( - String projectId, - ChannelCode channelCode, - Collection pipelineIds, - PipelineSortType sortType, - List favorPipelines, - List authPipelines, - String viewId, - List pipelineFilterParamList, - Boolean permissionFlag, - Integer page, - Integer pageSize - ); - - /** - * 获取最新构建 - */ - Map getLatestBuild(String projectId, List pipelineIds); - - /** - * 获取流水线构建历史 - */ - List listPipelineBuildHistory( - String projectId, - String pipelineId, - int offset, - int limit, - Boolean updateTimeDesc - ); - - /** - * 获取流水线构建历史 - */ - List listPipelineBuildHistory( - String projectId, - String pipelineId, - int offset, - int limit, - List materialAlias, - String materialUrl, - List materialBranch, - String materialCommitId, - String materialCommitMessage, - List status, - List trigger, - Long queueTimeStartTime, - Long queueTimeEndTime, - Long startTimeStartTime, - Long startTimeEndTime, - Long endTimeStartTime, - Long endTimeEndTime, - Long totalTimeMin, - Long totalTimeMax, - String remark, - Integer buildNoStart, - Integer buildNoEnd, - String buildMsg, - List startUser, - Boolean updateTimeDesc, - Boolean debug, - List triggerAlias, - List triggerBranch, - List triggerUser - ); - - /** - * 更新构建备注 - */ - void updateBuildRemark(String projectId, String pipelineId, String buildId, String remark); - - /** - * 获取历史条件仓库 - */ - List getHistoryConditionRepo( - String projectId, - String pipelineId, - Integer debugVersion, - String search, - HistorySearchType type - ); - - /** - * 获取历史条件分支 - */ - List getHistoryConditionBranch( - String projectId, - String pipelineId, - List aliasList, - Integer debugVersion, - String search, - HistorySearchType type - ); - - /** - * 获取构建历史 - */ - BuildHistory getBuildHistoryByBuildNum( - String projectId, - String pipelineId, - Integer buildNum, - Set statusSet, - Boolean debug - ); - - /** - * 获取构建基本信息 - */ - Map getBuildBasicInfoByIds(Set buildIds); - - /** - * 获取构建历史 - */ - BuildHistory getBuildHistoryById(String projectId, String buildId); - - /** - * 获取启动用户 - */ - String getStartUser(String projectId, String buildId); - - /** - * 获取构建历史 - */ - List getBuildHistoryByIds( - Set buildIds, - String startBeginTime, - String endBeginTime, - String projectId - ); - - /** - * 取消构建 - */ - Boolean cancelBuild( - String projectId, - String pipelineId, - String buildId, - String userId, - int executeCount, - BuildStatus buildStatus, - Boolean terminateFlag - ); - - /** - * 开始构建 - */ - BuildId startBuild(Model fullModel, StartBuildContext context); - - /** - * 更新构建号 - */ - void updateBuildNo(String projectId, String pipelineId, int buildNo, Boolean debug); - - /** - * 更新执行次数 - */ - void updateExecuteCount(String projectId, String buildId, int executeCount); - - /** - * 开始最新运行构建 - */ - void startLatestRunningBuild(LatestRunningBuild latestRunningBuild); - - /** - * 完成最新运行构建 - */ - void finishLatestRunningBuild( - LatestRunningBuild latestRunningBuild, - BuildStatus currentBuildStatus, - List errorInfoList, - BuildRecordTimeCost timeCost - ); - - /** - * 获取构建参数 - */ - List getBuildParametersFromStartup( - String projectId, - String buildId - ); - - /** - * 获取执行时间 - */ - Long getExecuteTime(String projectId, String buildId); - - /** - * 获取上次构建 - */ - BuildInfo getLastTimeBuild(String projectId, String pipelineId, Boolean debug); - - /** - * 获取流水线构建历史数量 - */ - int getPipelineBuildHistoryCount(String projectId, String pipelineId, Integer debugVersion); - - /** - * 获取构建 - */ - List getBuilds( - String projectId, - String pipelineId, - Set buildStatus, - Integer debugVersion - ); - - /** - * 获取流水线构建历史数量 - */ - int getPipelineBuildHistoryCount( - String projectId, - String pipelineId, - List materialAlias, - String materialUrl, - List materialBranch, - String materialCommitId, - String materialCommitMessage, - List status, - List trigger, - Long queueTimeStartTime, - Long queueTimeEndTime, - Long startTimeStartTime, - Long startTimeEndTime, - Long endTimeStartTime, - Long endTimeEndTime, - Long totalTimeMin, - Long totalTimeMax, - String remark, - Integer buildNoStart, - Integer buildNoEnd, - String buildMsg, - List startUser, - Boolean debug, - List triggerAlias, - List triggerBranch, - List triggerUser - ); - - /** - * 获取总构建历史数量 - */ - int getTotalBuildHistoryCount( - String projectId, - String pipelineId, - List status, - Long startTimeEndTime - ); - - /** - * 获取所有构建号 - */ - Collection getAllBuildNum(String projectId, String pipelineId, Integer debugVersion); - - /** - * 获取最新构建ID - */ - String getLatestBuildId(String projectId, String pipelineId); - - /** - * 获取最新完成构建ID - */ - String getLatestFinishedBuildId(String projectId, String pipelineId); - - /** - * 获取最新成功构建ID - */ - String getLatestSucceededBuildId(String projectId, String pipelineId); - - /** - * 获取最新失败构建ID - */ - String getLatestFailedBuildId(String projectId, String pipelineId); - - /** - * 根据构建号获取构建ID - */ - String getBuildIdByBuildNum( - String projectId, - String pipelineId, - int buildNum, - Integer debugVersion - ); - - /** - * 更新构建信息状态为排队 - */ - void updateBuildInfoStatus2Queue(String projectId, String buildId, BuildStatus oldStatus, String showMsg); - - /** - * 更新制品列表 - */ - Boolean updateArtifactList( - String projectId, - String pipelineId, - String buildId, - String artifactListJsonString - ); - - /** - * 更新构建历史阶段状态 - */ - void updateBuildHistoryStageState(String projectId, String buildId, List allStageStatus); - - /** - * 更新推荐版本 - */ - void updateRecommendVersion(String projectId, String buildId, String recommendVersion); - - /** - * 更新构建参数 - */ - Boolean updateBuildParameters( - String projectId, - String pipelineId, - String buildId, - Collection buildParameters, - Boolean debug - ); - - /** - * 并发取消构建流水线 - */ - void concurrencyCancelBuildPipeline( - String projectId, - String pipelineId, - String buildId, - String userId, - String groupName, - String detailUrl - ); - - /** - * 更新异步状态 - */ - void updateAsyncStatus( - String projectId, - String pipelineId, - String buildId, - String taskId, - int executeCount, - String asyncStatus - ); - - /** - * 获取构建变量服务 - */ - Map getBuildVariableService( - String projectId, - String pipelineId, - String buildId, - Set keys - ); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineWebhookService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineWebhookService.java deleted file mode 100644 index 566e051e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/PipelineWebhookService.java +++ /dev/null @@ -1,118 +0,0 @@ -package cd.casic.ci.process.process.engine.service; - - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.enums.RepositoryConfig; -import cd.casic.ci.common.pipeline.enums.ScmType; -import cd.casic.ci.common.pipeline.pojo.element.trigger.enums.CodeEventType; -import cd.casic.ci.log.scm.dal.pojo.Repository; -import cd.casic.ci.process.api.process.pojo.webhook.PipelineWebhook; -import cd.casic.ci.process.api.process.pojo.webhook.WebhookTriggerPipeline; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 流水线Webhook服务接口 - */ -public interface PipelineWebhookService { - - /** - * 添加Webhook - */ - void addWebhook( - String projectId, - String pipelineId, - Integer version, - String userId - ); - - /** - * 注册Webhook - */ - Repository registerWebhook( - String projectId, - ScmType scmType, - RepositoryConfig repositoryConfig, - CodeEventType codeEventType, - String elementVersion - ); - - /** - * 删除Webhook - */ - Boolean deleteWebhook( - String projectId, - String pipelineId, - String userId - ); - - /** - * 删除指定任务的Webhook - */ - Boolean deleteWebhook( - String projectId, - String pipelineId, - String taskId, - String userId - ); - - /** - * 获取模型 - */ - Model getModel( - String projectId, - String pipelineId, - Integer version - ); - - /** - * 获取触发流水线列表 - */ - List getTriggerPipelines( - String name, - ScmType repositoryType, - List yamlPipelineIds - ); - - /** - * 列出触发流水线 - */ - List listTriggerPipeline( - String projectId, - String repositoryHashId, - String eventType - ); - - /** - * 获取项目名称 - */ - String getProjectName(String projectName); - - /** - * 获取外部名称 - */ - String getExternalName(ScmType scmType, String projectName); - - /** - * 列出Webhook - */ - List listWebhook( - String userId, - String projectId, - String pipelineId, - Integer page, - Integer pageSize - ); - - /** - * 获取Webhook - */ - PipelineWebhook get( - String projectId, - String pipelineId, - String repositoryHashId, - String eventType - ); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/RepoPipelineRefService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/RepoPipelineRefService.java deleted file mode 100644 index 2c10cb66..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/engine/service/RepoPipelineRefService.java +++ /dev/null @@ -1,78 +0,0 @@ -package cd.casic.ci.process.process.engine.service; - - - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.enums.RepositoryConfig; -import cd.casic.ci.common.pipeline.pojo.element.Element; - -import java.util.Map; - -/** - * 流水线代码库使用服务接口 - * @version 1.0 - */ -public interface RepoPipelineRefService { - - /** - * 更新代码库流水线引用 - * - * @param userId 用户ID - * @param action 操作类型 - * @param projectId 项目ID - * @param pipelineId 流水线ID - */ - void updateRepoPipelineRef(String userId, String action, String projectId, String pipelineId); - - /** - * 更新流水线引用 - * - * @param userId 用户ID - * @param projectId 项目ID - * @param pipelineId 流水线ID - */ - void updatePipelineRef(String userId, String projectId, String pipelineId); - - /** - * 更新所有流水线引用 - * - * @param projectId 项目ID,可为空 - */ - void updateAllPipelineRef(String projectId); - - /** - * 分析流水线引用并保存 - * - * @param userId 用户ID - * @param action 操作类型 - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param model 流水线模型 - * @param channel 渠道 - */ - void analysisPipelineRefAndSave( - String userId, - String action, - String projectId, - String pipelineId, - Model model, - String channel - ); - - /** - * 获取任务参数 - * - * @param element 元素 - * @return 任务参数Map - */ - Map getTaskParams(Element element); - - /** - * 获取市场构建代码库配置 - * - * @param input 输入参数 - * @param variables 变量Map - * @return 代码库配置 - */ - RepositoryConfig getMarketBuildRepoConfig(Map input, Map variables); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/package-info.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/package-info.java deleted file mode 100644 index 2dfd2e1b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @Classname package-info - * @Description TODO - * @Date 2025/4/8 10:14 - * @author by mianbin - */ -package cd.casic.ci.process.process; \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/AtomParamReplaceInfo.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/AtomParamReplaceInfo.java deleted file mode 100644 index 586e4699..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/AtomParamReplaceInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.AllArgsConstructor; -import javax.annotation.Nullable; - -@Schema(title = "插件参数替换信息") -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class AtomParamReplaceInfo { - - @Schema(title = "被替换插件参数名称", required = true) - private String fromParamName; - - @Schema(title = "替换插件参数名称", required = true) - private String toParamName; - - @Nullable - @Schema(title = "替换插件参数值,不传默认用被替换插件参数值替换", required = false) - @Builder.Default - private Object toParamValue = null; - - @Nullable - @Schema(title = "替换插件默认参数值,如果没有指定替换插件参数值且被替换插件参数没有值则用该默认值作为替换插件参数值", required = false) - @Builder.Default - private Object toParamDefaultValue = null; - - @Nullable - @Schema(title = "参数自定义转换接口url地址,接口参数结构需统一", required = false) - @Builder.Default - private String paramConvertUrl = null; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/AtomVersionReplaceInfo.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/AtomVersionReplaceInfo.java deleted file mode 100644 index fbaa7ef4..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/AtomVersionReplaceInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.AllArgsConstructor; -import javax.annotation.Nullable; -import java.util.List; - -@Schema(title = "插件版本替换信息") -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class AtomVersionReplaceInfo { - - @Schema(title = "被替换插件版本", required = true) - private String fromAtomVersion; - - @Schema(title = "替换插件版本", required = true) - private String toAtomVersion; - - @Nullable - @Schema(title = "插件参数替换信息", required = false) - @Builder.Default - private List paramReplaceInfoList = null; -} - diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/LatestRunningBuild.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/LatestRunningBuild.java deleted file mode 100644 index 268ef6a2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/LatestRunningBuild.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import lombok.Data; - -import java.time.LocalDateTime; - -@Data -public class LatestRunningBuild { - private String projectId; - private String pipelineId; - private String buildId; - private int buildNum; - private String userId; - private BuildStatus status = BuildStatus.RUNNING; - private int taskCount = 0; - private LocalDateTime endTime; - private String currentTaskId; - private String currentTaskName; - private int executeCount; - private boolean debug; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineFilterByLabelInfo.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineFilterByLabelInfo.java deleted file mode 100644 index 3a580728..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineFilterByLabelInfo.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import cd.casic.ci.process.api.process.pojo.classify.PipelineViewFilterByLabel; -import lombok.Data; - -import java.util.List; -import java.util.Map; -@Data -public class PipelineFilterByLabelInfo { - List filterByLabels; - Map> labelToPipelineMap; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineFilterParam.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineFilterParam.java deleted file mode 100644 index 28dd5179..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineFilterParam.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import cd.casic.ci.process.api.process.pojo.classify.PipelineViewFilterByCreator; -import cd.casic.ci.process.api.process.pojo.classify.PipelineViewFilterByName; -import cd.casic.ci.process.api.process.pojo.classify.enums.Logic; -import lombok.Data; - -import java.util.List; - -@Data -public class PipelineFilterParam { - private Logic logic; - private List filterByPipelineNames; - private List filterByPipelineCreators; - private PipelineFilterByLabelInfo filterByLabelInfo; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineLabelRelateInfo.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineLabelRelateInfo.java deleted file mode 100644 index 00f103da..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineLabelRelateInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.time.LocalDateTime; - -@Schema(title = "流水线关联标签数据") -@Data -public class PipelineLabelRelateInfo{ - @Schema(title = "项目id") - private final String projectId; - - @Schema(title = "流水线id") - private final String pipelineId; - - @Schema(title = "标签id") - private final Long labelId; - - @Schema(title = "标签名称") - private final String name; - - @Schema(title = "创建者") - private final String createUser; - - @Schema(title = "创建时间") - private final LocalDateTime createTime; -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineWebHookQueue.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineWebHookQueue.java deleted file mode 100644 index c0e8b45e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/PipelineWebHookQueue.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import lombok.Data; - -@Data -public class PipelineWebHookQueue { - private Long id; - private String pipelineId; - private Long sourceProjectId; - private String sourceRepoName; - private String sourceBranch; - private Long targetProjectId; - private String targetRepoName; - private String targetBranch; - private String buildId; - private Long createTime; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/UpdateTaskInfo.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/UpdateTaskInfo.java deleted file mode 100644 index c1d05912..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/pojo/UpdateTaskInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.process.process.pojo; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.ErrorType; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.Map; -@Data -public class UpdateTaskInfo { - private String projectId; // 项目ID - private String buildId; // 构建ID - private String taskId; // 任务ID - private int executeCount; - private BuildStatus taskStatus; // 构建状态 - private String starter; // 启动人 - private String approver; // 审批人 - private LocalDateTime startTime; // 开始时间 - private LocalDateTime endTime; // 结束时间 - private Long totalTime; // 耗费时间 - private ElementAdditionalOptions additionalOptions; - private Map taskParams; - private ErrorType errorType; - private Integer errorCode; - private String errorMsg; - private String platformCode; // 对接平台代码 - private Integer platformErrorCode; // 对接平台错误码 -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/audit/AuditService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/audit/AuditService.java deleted file mode 100644 index 7d5050f5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/audit/AuditService.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.process.service.audit; - -import cd.casic.ci.common.pipeline.model.SQLPage; -import cd.casic.ci.process.api.process.pojo.audit.Audit; -import cd.casic.ci.process.api.process.pojo.audit.AuditInfo; -import cd.casic.ci.process.api.process.pojo.audit.QueryAudit; -import org.apache.commons.lang3.tuple.Pair; -import org.springframework.stereotype.Service; - - -public interface AuditService { - Long createAudit(Audit audit); - - Pair, Boolean> userList(QueryAudit queryAudit, Integer offset, Integer limit); - -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/audit/impl/AuditServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/audit/impl/AuditServiceImpl.java deleted file mode 100644 index 4f968f60..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/audit/impl/AuditServiceImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.ci.process.process.service.audit.impl; - -import cd.casic.ci.common.pipeline.constant.CommonConstants; -import cd.casic.ci.common.pipeline.model.SQLPage; -import cd.casic.ci.process.api.process.pojo.audit.Audit; -import cd.casic.ci.process.api.process.pojo.audit.AuditInfo; -import cd.casic.ci.process.api.process.pojo.audit.QueryAudit; -import cd.casic.ci.process.process.constant.AllocIdGenerateConstant; -import cd.casic.ci.process.process.dal.audit.AuditDao; -import cd.casic.ci.process.process.dataObject.TAuditResourceRecord; -import cd.casic.ci.process.process.service.audit.AuditService; -import cd.casic.ci.project.service.ServiceAllocIdResource; -import jakarta.annotation.Resource; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class AuditServiceImpl implements AuditService { - @Resource - private AuditDao auditDao; - @Resource - private ServiceAllocIdResource serviceAllocIdResource; - - @Override - public Long createAudit(Audit audit) { - Long id = serviceAllocIdResource.generateSegmentId(AllocIdGenerateConstant.AUDIT_RESOURCE); - return auditDao.create( - audit.getResourceType(), - audit.getResourceId(), - audit.getResourceName(), - audit.getUserId(), - audit.getAction(), - audit.getActionContent(), - audit.getProjectId(), - id - ); - } - - @Override - public Pair, Boolean> userList(QueryAudit queryAudit, Integer offset, Integer limit) { - Long count = auditDao.countByResourceTye(queryAudit); - List auditRecordList = auditDao.listByResourceTye(queryAudit, offset, limit); - List auditList = auditRecordList.stream().map(it -> { - String statusStr = "1".equals(it.getStatus()) ? CommonConstants.SUCCESS : CommonConstants.FAIL; - return new AuditInfo( - it.getStatus(), - it.getResourceType(), - it.getResourceId(), - it.getResourceName(), - it.getUserId(), - it.getCreatedTime().getTime(), - it.getAction(), - it.getActionContent() - ); - }).toList(); - - return new ImmutablePair<>(new SQLPage<>(count,auditList),true); - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/BaseBuildDetailServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/BaseBuildDetailServiceImpl.java deleted file mode 100644 index 88e8980c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/BaseBuildDetailServiceImpl.java +++ /dev/null @@ -1,304 +0,0 @@ -package cd.casic.ci.process.process.service.base; - - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.process.process.service.base.dispatcher.PipelineEventDispatcher; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.process.api.process.pojo.BuildStageStatus; -import cd.casic.ci.process.process.dal.pipeline.PipelineBuildDao; -import cd.casic.ci.process.process.dal.record.BuildDetailDao; -import cd.casic.ci.process.process.dataObject.TPipelineBuildDetailRecord; -import cd.casic.ci.process.process.service.base.pojo.PipelineBuildWebSocketPushEvent; -import cd.casic.ci.process.process.service.base.pojo.enums.RefreshType; -import cd.casic.framework.commons.util.watcher.LogUtils; -import cd.casic.framework.commons.util.watcher.Watcher; -import com.alibaba.fastjson.JSON; -import lombok.extern.slf4j.Slf4j; -import org.assertj.core.util.Preconditions; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.locks.ReentrantLock; -import java.util.stream.Collectors; - -import static cd.casic.ci.common.pipeline.constant.CommonConstants.*; - -@Slf4j -@Service -public class BaseBuildDetailServiceImpl { - - - protected static final String TRIGGER_STAGE = "stage-1"; - - protected PipelineBuildDao pipelineBuildDao; - protected BuildDetailDao buildDetailDao; - private StageTagServiceImpl stageTagServiceImpl; - private PipelineEventDispatcher pipelineEventDispatcher; - - // TODO 更改redis逻辑 -// protected RedisOperation redisOperation; - - public BaseBuildDetailServiceImpl( - PipelineBuildDao pipelineBuildDao, - BuildDetailDao buildDetailDao, - StageTagServiceImpl stageTagServiceImpl, - PipelineEventDispatcher pipelineEventDispatcher -// RedisOperation redisOperation - ) { - - this.pipelineBuildDao = pipelineBuildDao; - this.buildDetailDao = buildDetailDao; - this.stageTagServiceImpl = stageTagServiceImpl; - this.pipelineEventDispatcher = pipelineEventDispatcher; -// this.redisOperation = redisOperation; - } - - public Model getBuildModel(String projectId, String buildId) { - var record = buildDetailDao.get(projectId, buildId); - if (record == null) { - return null; - } - return JSON.parseObject(record.getModel(), Model.class); - } - - protected Model update( - String projectId, - String buildId, - ModelInterface modelInterface, - BuildStatus buildStatus, - String cancelUser, - String operation - ) { - Watcher watcher = new Watcher("updateDetail#" + buildId + "#" + operation); - String message = "nothing"; - TPipelineBuildDetailRecord record = null; -// var lock = new PipelineBuildDetailLock(redisOperation, buildId); - ReentrantLock lock = new ReentrantLock(); - try { - watcher.start("lock"); - lock.lock(); - - watcher.start("getDetail"); - record = buildDetailDao.get(projectId, buildId); - Preconditions.checkArgument(record != null, "The build detail is not exist"); - - watcher.start("model"); - var model = JSON.parseObject(record.getModel(), Model.class); - - watcher.start("traverseModel"); - traverseModel(model, modelInterface); - watcher.stop(); - - String modelStr = null; - if (modelInterface.needUpdate()) { - watcher.start("toJson"); - modelStr = JSON.toJSONString(model, false); - } - - var statusPair = takeBuildStatus(record, buildStatus); - if ((modelStr == null || modelStr.isBlank()) && !statusPair.getFirst()) { - message = "Will not update"; - return model; - } - - watcher.start("updateModel"); - buildDetailDao.update( - projectId, - buildId, - modelStr, - statusPair.getSecond(), - cancelUser != null ? cancelUser : - (buildStatus.isCancel() && record.getCancelUser() == null) ? "System" : null - ); - - message = "update done"; - return model; - } catch (Throwable ignored) { - message = ignored.getMessage() != null ? ignored.getMessage() : ""; - log.warn("[" + buildId + "]| Fail to update the build detail: " + ignored.getMessage(), ignored); - watcher.start("getDetail"); - Preconditions.checkArgument(record != null, "The build detail is not exist"); - watcher.start("model"); - return JSON.parseObject(record.getModel(), Model.class); - } finally { - lock.unlock(); - log.info("[" + buildId + "|" + buildStatus + "]|" + operation + "|update_detail_model| " + message); - if (message.equals("update done")) { - watcher.start("dispatchEvent"); - pipelineDetailChangeEvent(projectId, buildId); - } - LogUtils.printCostTimeWE(watcher); - } - } - - protected List fetchHistoryStageStatus( - Model model, - BuildStatus buildStatus, - List reviewers, - String errorMsg, - String cancelUser - ) { - Map stageTagMap = stageTagServiceImpl.getAllStageTag().stream() - .collect(Collectors.toMap(tag -> tag.getId(), tag -> tag.getStageTagName())); - - String statusMessage; - String reason; - if (buildStatus == BuildStatus.REVIEWING) { - statusMessage = BUILD_REVIEWING; - reason = reviewers != null ? String.join(",", reviewers) : null; - } else if (buildStatus == BuildStatus.STAGE_SUCCESS) { - statusMessage = BUILD_STAGE_SUCCESS; - reason = null; - } else if (buildStatus.isFailure()) { - statusMessage = BUILD_FAILED; - reason = errorMsg != null ? errorMsg : buildStatus.name(); - } else if (buildStatus.isCancel()) { - statusMessage = BUILD_CANCELED; - reason = cancelUser; - } else if (buildStatus.isSuccess()) { - statusMessage = BUILD_COMPLETED; - reason = null; - } else { - statusMessage = BUILD_RUNNING; - reason = null; - } - - return model.getStages().stream() - .map(stage -> new BuildStageStatus( - stage.getId(), - stage.getName() != null ? stage.getName() : stage.getId(), - stage.getStatus(), - stage.getTag() != null ? stage.getTag().stream() - .map(tag -> stageTagMap.getOrDefault(tag, "null")) - .collect(Collectors.toList()) : null, - stage.getStartEpoch(), - stage.getElapsed(), - null, - stage.getId().equals(TRIGGER_STAGE) ? - "" : null - )) - .collect(Collectors.toList()); - } - - private Pair takeBuildStatus( - TPipelineBuildDetailRecord record, - BuildStatus buildStatus - ) { - var oldStatus = BuildStatus.parse(record.getStatus()); - if (!oldStatus.isFinish()) { - return new Pair<>(true, buildStatus); - } else { - return new Pair<>(false, oldStatus); - } - } - - private void traverseModel(Model model, ModelInterface modelInterface) { - for (var stage : model.getStages()) { - var traverse = modelInterface.onFindStage(stage, model); - if (traverse == Traverse.BREAK) { - return; - } else if (traverse == Traverse.SKIP) { - continue; - } - - for (var container : stage.getContainers()) { - var cTraverse = modelInterface.onFindContainer(container, stage); - if (cTraverse == Traverse.BREAK) { - return; - } else if (cTraverse == Traverse.SKIP) { - continue; - } - - var elements = container.getElements(); - for (int i = 0; i < elements.size(); i++) { - if (modelInterface.onFindElement(i, elements.get(i), container) == Traverse.BREAK) { - return; - } - } - - if (Boolean.TRUE.equals(container.getMatrixGroupFlag())) { - var groupContainers = container.fetchGroupContainers(); - if (groupContainers != null) { - for (var groupContainer : groupContainers) { - var gTraverse = modelInterface.onFindContainer(groupContainer, stage); - if (gTraverse == Traverse.BREAK) { - return; - } else if (gTraverse == Traverse.SKIP) { - continue; - } - - var groupElements = groupContainer.getElements(); - for (int i = 0; i < groupElements.size(); i++) { - if (modelInterface.onFindElement(i, groupElements.get(i), groupContainer) == Traverse.BREAK) { - return; - } - } - } - } - } - } - } - } - - private void pipelineDetailChangeEvent(String projectId, String buildId) { - var pipelineBuildInfo = pipelineBuildDao.getUserBuildInfo( projectId, buildId); - if (pipelineBuildInfo != null && pipelineBuildInfo.getChannelCode() == ChannelCode.GIT) { - pipelineEventDispatcher.dispatch( - new PipelineBuildWebSocketPushEvent( - "recordDetail", - pipelineBuildInfo.getProjectId(), - pipelineBuildInfo.getPipelineId(), - pipelineBuildInfo.getStartUser(), - buildId, - RefreshType.DETAIL.getBinary() | RefreshType.RECORD.getBinary(), - pipelineBuildInfo.getExecuteCount() - ) - ); - } - } - - protected interface ModelInterface { - default Traverse onFindStage(Stage stage, Model model) { - return Traverse.CONTINUE; - } - - default Traverse onFindContainer(Container container, Stage stage) { - return Traverse.CONTINUE; - } - - default Traverse onFindElement(int index, Element e, Container c) { - return Traverse.CONTINUE; - } - - boolean needUpdate(); - } - - public enum Traverse { - BREAK, - CONTINUE, - SKIP - } - - public static class Pair { - private final A first; - private final B second; - - public Pair(A first, B second) { - this.first = first; - this.second = second; - } - - public A getFirst() { - return first; - } - - public B getSecond() { - return second; - } - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/PipelineBuildDetailServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/PipelineBuildDetailServiceImpl.java deleted file mode 100644 index 7a958688..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/PipelineBuildDetailServiceImpl.java +++ /dev/null @@ -1,375 +0,0 @@ -package cd.casic.ci.process.process.service.base; - - - - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.Stage; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.pojo.BuildFormProperty; -import cd.casic.ci.common.pipeline.pojo.element.Element; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import cd.casic.ci.process.api.engine.pojo.BuildInfo; -import cd.casic.ci.process.api.engine.pojo.PipelineInfo; -import cd.casic.ci.process.api.process.pojo.BuildStageStatus; -import cd.casic.ci.process.api.process.utils.PipelineVarUtil; -import cd.casic.ci.process.process.dal.engin.PipelineTriggerReviewDao; -import cd.casic.ci.process.process.dataObject.TPipelineBuildDetailRecord; -import cd.casic.ci.process.process.dataObject.TPipelineBuildSummaryRecord; -import cd.casic.ci.process.process.service.base.dispatcher.PipelineEventDispatcher; -import cd.casic.ci.common.pipeline.utils.ModelUtils; -import cd.casic.ci.process.api.process.pojo.pipeline.ModelDetail; -import cd.casic.ci.process.process.dal.pipeline.PipelineBuildDao; -import cd.casic.ci.process.process.dal.record.BuildDetailDao; -import cd.casic.ci.process.process.dal.record.PipelineBuildSummaryDao; -import cd.casic.ci.process.process.service.base.engin.service.PipelineRepositoryService; -import cd.casic.ci.process.process.service.base.engin.util.ContainerUtils; -import com.alibaba.fastjson.JSON; -import com.github.fppt.jedismock.operations.RedisOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.time.ZoneOffset; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -@Service -@Slf4j -public class PipelineBuildDetailServiceImpl extends BaseBuildDetailServiceImpl { - - @Value("${pipeline.build.retry.limit_days:21}") - private int retryLimitDays; - - private final PipelineRepositoryService pipelineRepositoryService; - private PipelineBuildSummaryDao pipelineBuildSummaryDao; - private final PipelineTriggerReviewDao pipelineTriggerReviewDao; - - @Autowired - public PipelineBuildDetailServiceImpl( - PipelineRepositoryService pipelineRepositoryService, - PipelineBuildSummaryDao pipelineBuildSummaryDao, - PipelineTriggerReviewDao pipelineTriggerReviewDao, - PipelineBuildDao pipelineBuildDao, - BuildDetailDao buildDetailDao, - RedisOperation redisOperation, - StageTagServiceImpl stageTagServiceImpl, - PipelineEventDispatcher pipelineEventDispatcher - ) { - super(pipelineBuildDao, buildDetailDao, stageTagServiceImpl, pipelineEventDispatcher); - this.pipelineRepositoryService = pipelineRepositoryService; - this.pipelineBuildSummaryDao = pipelineBuildSummaryDao; - this.pipelineTriggerReviewDao = pipelineTriggerReviewDao; - } - - private boolean checkPassDays(Long startTime) { - if (retryLimitDays < 0 || startTime == null) { - return true; - } - return (System.currentTimeMillis() - startTime) < TimeUnit.DAYS.toMillis(retryLimitDays); - } - - /** - * 查询ModelDetail - * @param projectId 项目Id - * @param buildId 构建Id - * @param refreshStatus 是否刷新状态 - */ - public ModelDetail get(String projectId, String buildId, boolean refreshStatus) { - TPipelineBuildDetailRecord record = buildDetailDao.get(projectId, buildId); - if (record == null) { - return null; - } - - BuildInfo buildInfo = pipelineBuildDao.getUserBuildInfo( - projectId, - buildId - ); - if (buildInfo == null) { - return null; - } - - PipelineInfo pipelineInfo = pipelineRepositoryService.getPipelineInfo(projectId, buildInfo.getPipelineId(),null,false); - if (pipelineInfo == null) { - return null; - } - - TPipelineBuildSummaryRecord buildSummaryRecord = pipelineBuildSummaryDao.get(projectId, buildInfo.getPipelineId()); - Model model = JSON.parseObject(record.getModel(), Model.class); - - if (refreshStatus) { - if (checkPassDays(buildInfo.getStartTime())) { - ModelUtils.refreshCanRetry(model); - } - } - - var triggerContainer = model.getTriggerContainer(); - if (triggerContainer.getBuildNo() != null) { - triggerContainer.getBuildNo().setCurrentBuildNo( - buildSummaryRecord != null ? buildSummaryRecord.getBuildNo() : triggerContainer.getBuildNo().getBuildNo() - ); - } - - List params = triggerContainer.getParams(); - List newParams = new ArrayList(params.size()); - params.forEach(it -> { - var newVarName = PipelineVarUtil.oldVarToNewVar(it.getId()); - if (newVarName != null && !newVarName.isBlank()) { - BuildFormProperty buildFormProperty = new BuildFormProperty(); - BeanUtils.copyProperties(it,buildFormProperty); - buildFormProperty.setId(newVarName); - newParams.add(buildFormProperty); - } else { - newParams.add(it); - } - }); - triggerContainer.setParams(newParams); - - model.getStages().forEach(stage -> { - stage.resetBuildOption(false); - stage.getContainers().forEach(container -> { - container.setContainerHashId(container.getContainerHashId() != null ? - container.getContainerHashId() : container.getContainerId()); - container.setContainerId(container.getId()); - }); - }); - - List triggerReviewers = pipelineTriggerReviewDao.getTriggerReviewers( - projectId, - pipelineInfo.getPipelineId(), - buildId - ); - - return new ModelDetail( - record.getBuildId(), - buildInfo.getPipelineId(), - model.getName(), - record.getStartUser() != null ? record.getStartUser() : "", - buildInfo.getTriggerUser(), - StartType.toReadableString( - buildInfo.getTrigger(), - buildInfo.getChannelCode(), - "" - ), - record.getStartTime() != null ? record.getStartTime().getTime() : - LocalDateTime.now().atOffset(ZoneOffset.UTC).toInstant().toEpochMilli(), - record.getEndTime() != null ? record.getEndTime().getTime() : null, - record.getStatus() != null ? record.getStatus() : "", - model, - System.currentTimeMillis(), - buildInfo.getBuildNum(), - record.getCancelUser() != null ? record.getCancelUser() : "", - buildInfo.getVersion(), - pipelineInfo.getVersion(), - buildSummaryRecord != null ? buildSummaryRecord.getBuildNum() : -1, - pipelineInfo.getLastModifyUser(), - buildInfo.getExecuteTime(), - triggerReviewers, - buildInfo.isDebug() - ); - } - - public void updateModel(String projectId, String buildId, Model model) { - buildDetailDao.update( - projectId, - buildId, - JSON.toJSONString(model, false), - BuildStatus.RUNNING, - null - ); - } - - public void buildCancel(String projectId, String buildId, BuildStatus buildStatus, String cancelUser) { - log.info("Cancel the build {} by {}", buildId, cancelUser); - update( - projectId, - buildId, - new ModelInterface() { - private boolean update = false; - - @Override - public Traverse onFindStage(Stage stage, Model model) { - if (BuildStatus.parse(stage.getStatus()).isRunning()) { - stage.setStatus(buildStatus.name()); - if (stage.getStartEpoch() == null) { - stage.setElapsed(0L); - } else { - stage.setElapsed(System.currentTimeMillis() - stage.getStartEpoch()); - } - update = true; - } - return Traverse.CONTINUE; - } - - @Override - public Traverse onFindContainer(Container container, Stage stage) { - var status = BuildStatus.parse(container.getStatus()); - if (status == BuildStatus.PREPARE_ENV) { - if (container.getStartEpoch() == null) { - container.setSystemElapsed(0L); - } else { - container.setSystemElapsed(System.currentTimeMillis() - container.getStartEpoch()); - } - update = true; - } - - var refreshFlag = status.isRunning() && - (container.getElements().get(0).getStatus() == null || - container.getElements().get(0).getStatus().isBlank()) && - container.getContainPostTaskFlag() != Boolean.TRUE; - - if (status == BuildStatus.PREPARE_ENV || refreshFlag) { - container.setName(ContainerUtils.getClearedQueueContainerName(container.getName())); - container.setStatus(buildStatus.name()); - } - return Traverse.CONTINUE; - } - - @Override - public Traverse onFindElement(int index, Element e, Container c) { - if (e.getStatus() != null && - (e.getStatus().equals(BuildStatus.RUNNING.name()) || - e.getStatus().equals(BuildStatus.REVIEWING.name()))) { - - String status; - if (e.getStatus().equals(BuildStatus.RUNNING.name())) { - var runCondition = e.getAdditionalOptions() != null ? - e.getAdditionalOptions().getRunCondition() : null; - if (runCondition == ElementAdditionalOptions.RunCondition.PRE_TASK_FAILED_EVEN_CANCEL) { - status = BuildStatus.RUNNING.name(); - } else { - status = BuildStatus.CANCELED.name(); - } - } else { - status = buildStatus.name(); - } - - e.setStatus(status); - if (c.getContainPostTaskFlag() != Boolean.TRUE) { - c.setStatus(status); - } - - if (BuildStatus.parse(status).isFinish()) { - if (e.getStartEpoch() != null) { - e.setElapsed(System.currentTimeMillis() - e.getStartEpoch()); - } - - long elementElapsed = 0L; - for (var element : c.getElements()) { - elementElapsed += element.getElapsed() != null ? element.getElapsed() : 0; - if (element == e) { - break; - } - } - c.setElementElapsed(elementElapsed); - } - update = true; - } - return Traverse.CONTINUE; - } - - @Override - public boolean needUpdate() { - return update; - } - }, - BuildStatus.RUNNING, - cancelUser, - "buildCancel" - ); - } - - public Pair> buildEnd( - String projectId, - String buildId, - BuildStatus buildStatus, - String errorMsg - ) { - log.info("[{}]|BUILD_END|buildStatus={}", buildId, buildStatus); - final List allStageStatus = new ArrayList<>(); - - var model = update( - projectId, - buildId, - new ModelInterface() { - private boolean update = false; - - @Override - public Traverse onFindContainer(Container container, Stage stage) { - if (BuildStatus.parse(container.getStatus()).isRunning()) { - container.setStatus(buildStatus.name()); - update = true; - if (container.getStartEpoch() == null) { - container.setElementElapsed(0L); - } else { - container.setElementElapsed(System.currentTimeMillis() - container.getStartEpoch()); - } - container.setName(ContainerUtils.getClearedQueueContainerName(container.getName())); - } - return Traverse.CONTINUE; - } - - @Override - public Traverse onFindStage(Stage stage, Model model) { - if (allStageStatus.isEmpty()) { - allStageStatus.addAll(fetchHistoryStageStatus(model, buildStatus,null, errorMsg,null)); - } - if (BuildStatus.parse(stage.getStatus()).isRunning()) { - stage.setStatus(buildStatus.name()); - update = true; - if (stage.getStartEpoch() == null) { - stage.setElapsed(0L); - } else { - stage.setElapsed(System.currentTimeMillis() - stage.getStartEpoch()); - } - } - return Traverse.CONTINUE; - } - - @Override - public Traverse onFindElement(int index, Element e, Container c) { - if (e.getStatus() != null && !e.getStatus().isBlank() && - BuildStatus.valueOf(e.getStatus()).isRunning()) { - e.setStatus(buildStatus.name()); - update = true; - if (e.getStartEpoch() != null) { - e.setElapsed(System.currentTimeMillis() - e.getStartEpoch()); - } - - long elementElapsed = 0L; - for (var element : c.getElements()) { - elementElapsed += element.getElapsed() != null ? element.getElapsed() : 0; - if (element == e) { - break; - } - } - c.setElementElapsed(elementElapsed); - } - return Traverse.CONTINUE; - } - - @Override - public boolean needUpdate() { - return update; - } - }, - buildStatus,null, - "buildEnd" - ); - return new Pair<>(model, allStageStatus); - } - - public void updateBuildCancelUser(String projectId, String buildId, String cancelUserId) { - buildDetailDao.updateBuildCancelUser( - projectId, - buildId, - cancelUserId - ); - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/StageTagServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/StageTagServiceImpl.java deleted file mode 100644 index 287b78b2..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/StageTagServiceImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -package cd.casic.ci.process.process.service.base; - -import cd.casic.ci.common.pipeline.UUIDUtil; -import cd.casic.ci.common.pipeline.constant.CommonMessageCode; -import cd.casic.ci.process.api.process.pojo.PipelineStageTag; -import cd.casic.ci.process.process.dal.pipeline.PipelineStageTagDao; -import cd.casic.ci.process.process.dataObject.TPipelineStageTagRecord; -import com.github.benmanes.caffeine.cache.Caffeine; - -import com.github.benmanes.caffeine.cache.LoadingCache; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - -/** - * StageTag为后台插入,更新由平台OP控制,基本不会更新,只需要缓存在内存即可。即使出错也不影响正常逻辑,暂不引入redis - */ -@Service -@Slf4j -public class StageTagServiceImpl { - - private static final String ALL = "ALL"; - private static final String DEFAULT = "DEFAULT"; - @Resource - private PipelineStageTagDao pipelineStageTagDao; - // TODO 不引入缓存 - // StageTag为后台插入,更新由平台OP控制,不会经常更新,所以只需要缓存在内存即可。即使出错也不影响正常逻辑,暂不引入redis -// private LoadingCache defaultTagCache = Caffeine.newBuilder() -// .expireAfterWrite(Duration.ofMinutes(1)) -// .maximumSize(1) -// .build(key -> pipelineStageTagDao.getDefaultStageTag()); - - // StageTag为后台插入,更新由平台OP控制,不会经常更新,所以只需要缓存在内存即可。即使出错也不影响正常逻辑,暂不引入redis - private final LoadingCache> allTagCache = Caffeine.newBuilder() - .expireAfterWrite(Duration.ofMinutes(1)) - .maximumSize(1) - .build(key -> { - List pipelineStageTagList = new ArrayList<>(); - List allStageTag = pipelineStageTagDao.getAllStageTag(); - for (int i = 0; i < allStageTag.size(); i++) { - pipelineStageTagList.add(PipelineStageTagDao.convert(allStageTag.get(i), i == 0)); - } - return pipelineStageTagList; - }); - - @Autowired - public StageTagServiceImpl( PipelineStageTagDao pipelineStageTagDao) { - - this.pipelineStageTagDao = pipelineStageTagDao; - } - - /** - * 获取所有阶段标签信息 - */ - public List getAllStageTag() { - return allTagCache.get(ALL); - } - -// /** -// * 获取默认标签 -// */ -// public PipelineStageTag getDefaultStageTag() { -// return defaultTagCache.get(DEFAULT); -// } - - /** - * 根据id获取阶段标签信息 - */ - public PipelineStageTag getStageTag(String id) { - List all = allTagCache.getIfPresent(ALL); - PipelineStageTag data; - if (all == null || all.isEmpty()) { - TPipelineStageTagRecord pipelineStageTagRecord = pipelineStageTagDao.getStageTag(id); - log.info("the pipelineStageTagRecord is :{}", pipelineStageTagRecord); - data = pipelineStageTagRecord != null ? - PipelineStageTagDao.convert(pipelineStageTagRecord, false) : null; - } else { - data = all.stream() - .filter(tag -> tag.getId().equals(id)) - .findFirst() - .orElse(null); - } - return data; - } - - /** - * 保存阶段标签信息 - */ - public Boolean saveStageTag(String stageTag, int weight) { - log.info("the save stageTagName is:{}", stageTag); - // 判断阶段标签名称是否存在 - int count = getCountByNameOrWeight(stageTag, weight); - if (count > 0) { - // 抛出错误提示 - return false; - } - String id = UUIDUtil.generate(); - pipelineStageTagDao.add(id, stageTag, weight); -// defaultTagCache.invalidateAll(); - allTagCache.invalidateAll(); - return true; - } - - /** - * 更新阶段标签信息 - */ - public Boolean updateStageTag(String id, String stageTagName, int weight) { - log.info("the update stageTagName is:{}", stageTagName); - // 判断阶段标签代码是否存在 - if (getCountByNameOrWeight(stageTagName, weight) > 0) { - // 判断更新的阶段标签代码是否属于自已 - TPipelineStageTagRecord pipelineStageTag = pipelineStageTagDao.getStageTag(id); - if (pipelineStageTag != null && !stageTagName.equals(pipelineStageTag.getStageTagName())) { - // 抛出错误提示 - return false; - } - } - pipelineStageTagDao.update(id, stageTagName, weight); -// defaultTagCache.invalidateAll(); -// allTagCache.invalidateAll(); - return true; - } - - /** - * 删除阶段标签信息 - */ - public Boolean deleteStageTag(String id) { - log.info("the delete id is :{}", id); - pipelineStageTagDao.delete( id); -// defaultTagCache.invalidateAll(); - allTagCache.invalidateAll(); - return true; - } - - /** - * 根据阶段标签名称和权重查询重复数据库记录数 - */ - private int getCountByNameOrWeight(String stageTagName, int weight) { - Integer count = pipelineStageTagDao.countByNameOrWeight(stageTagName, weight); - int result = 0; - if (count != null) { - result = count; - } - return result; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/dispatcher/EventDispatcher.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/dispatcher/EventDispatcher.java deleted file mode 100644 index 8ca756bb..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/dispatcher/EventDispatcher.java +++ /dev/null @@ -1,8 +0,0 @@ -package cd.casic.ci.process.process.service.base.dispatcher; - - -import cd.casic.ci.event.pojo.IEvent; - -public interface EventDispatcher { - void dispatch(T events); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/dispatcher/PipelineEventDispatcher.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/dispatcher/PipelineEventDispatcher.java deleted file mode 100644 index b30b438e..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/dispatcher/PipelineEventDispatcher.java +++ /dev/null @@ -1,6 +0,0 @@ -package cd.casic.ci.process.process.service.base.dispatcher; - -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; - -public interface PipelineEventDispatcher extends EventDispatcher{ -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/PipelineRepositoryService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/PipelineRepositoryService.java deleted file mode 100644 index aec92f34..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/PipelineRepositoryService.java +++ /dev/null @@ -1,232 +0,0 @@ -package cd.casic.ci.process.process.service.base.engin.service; - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.common.pipeline.dialect.IPipelineDialect; -import cd.casic.ci.common.pipeline.enums.BranchVersionAction; -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.common.pipeline.pojo.transfer.YamlWithVersion; -import cd.casic.ci.process.api.engine.pojo.PipelineInfo; -import cd.casic.ci.process.api.engine.pojo.PipelineModelTask; -import cd.casic.ci.process.api.process.pojo.PipelineCollation; -import cd.casic.ci.process.api.process.pojo.PipelineName; -import cd.casic.ci.process.api.process.pojo.PipelineSortType; -import cd.casic.ci.process.api.process.pojo.pipeline.DeletePipelineResult; -import cd.casic.ci.process.api.process.pojo.pipeline.DeployPipelineResult; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineResourceVersion; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineYamlVo; -import cd.casic.ci.process.api.process.pojo.setting.PipelineModelVersion; -import org.apache.commons.lang3.tuple.Triple; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -@Repository -public interface PipelineRepositoryService { - - DeployPipelineResult deployPipeline( - Model model, - String projectId, - String signPipelineId, - String userId, - ChannelCode channelCode, - boolean create, - YamlWithVersion yaml, - Integer baseVersion, - Boolean useSubscriptionSettings, - Boolean useConcurrencyGroup, - String templateId, - Boolean updateLastModifyUser, - PipelineSetting setting, - VersionStatus versionStatus, - String branchName, - String description, - PipelineYamlVo yamlInfo, - Boolean pipelineDisable - ); - - List initModel( - Model model, - String projectId, - String pipelineId, - String userId, - boolean create, - VersionStatus versionStatus, - ChannelCode channelCode, - PipelineYamlVo yamlInfo, - IPipelineDialect pipelineDialect - ); - - PipelineSetting createDefaultSetting( - String projectId, - String pipelineId, - String pipelineName, - ChannelCode channelCode - ); - - PipelineInfo getPipelineInfo( - String projectId, - String pipelineId, - ChannelCode channelCode, - Boolean delete - ); - - Map listModel(String projectId, Collection pipelineIds); - - Triple getBuildTriggerInfo( - String projectId, - String pipelineId, - Integer version - ); - - PipelineResourceVersion getPipelineResourceVersion( - String projectId, - String pipelineId, - Integer version, - Boolean includeDraft - ); - - PipelineResourceVersion getDraftVersionResource( - String projectId, - String pipelineId - ); - - PipelineResourceVersion getBranchVersionResource( - String projectId, - String pipelineId, - String branchName - ); - - int getActiveBranchVersionCount( - String projectId, - String pipelineId - ); - - PipelineResourceVersion rollbackDraftFromVersion( - String userId, - String projectId, - String pipelineId, - PipelineResourceVersion targetVersion, - Boolean ignoreBase - ); - - DeletePipelineResult deletePipeline( - String projectId, - String pipelineId, - String userId, - ChannelCode channelCode, - boolean delete - ); - - boolean isPipelineExist( - String projectId, - String pipelineName, - ChannelCode channelCode, - String excludePipelineId - ); - - int countByProjectIds(Set projectIds, ChannelCode channelCode); - - Map listPipelineNameByIds( - String projectId, - Set pipelineIds, - boolean filterDelete - ); - - Map listPipelineIdByName( - String projectId, - Set pipelineNames, - boolean filterDelete - ); - - Integer getBuildNo(String projectId, String pipelineId); - - PipelineSetting getSetting(String projectId, String pipelineId); - - PipelineSetting getSettingByPipelineVersion( - String projectId, - String pipelineId, - Integer pipelineVersion - ); - - PipelineName saveSetting( - String userId, - PipelineSetting setting, - int version, - VersionStatus versionStatus, - Boolean updateLastModifyUser, - boolean isTemplate - ); - - void batchUpdatePipelineModel( - String userId, - List pipelineModelVersionList - ); - - List listDeletePipelineIdByProject( - String projectId, - Long days, - Integer offset, - Integer limit, - PipelineSortType sortType, - PipelineCollation collation, - String filterByPipelineName - ); - - PipelineResourceVersion restorePipeline( - String projectId, - String pipelineId, - String userId, - ChannelCode channelCode, - Long days - ); - - int countByPipelineIds( - String projectId, - ChannelCode channelCode, - List pipelineIds - ); - - void updateModelName( - String pipelineId, - String projectId, - String modelName, - String userId - ); - - int updateMaxConRunningQueueSize( - String userId, - String projectId, - String pipelineId, - int maxConRunningQueueSize - ); - - DeployPipelineResult updateSettingVersion( - String userId, - String projectId, - String pipelineId, - PipelineSetting savedSetting, - Boolean updateLastModifyUser - ); - - void updatePipelineBranchVersion( - String userId, - String projectId, - String pipelineId, - String branchName, - BranchVersionAction branchVersionAction - ); - - boolean updateLocked( - String userId, - String projectId, - String pipelineId, - boolean locked - ); - - String getPipelineOauthUser(String projectId, String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/ProjectPipelineCallBackService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/ProjectPipelineCallBackService.java deleted file mode 100644 index 169cdd6f..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/ProjectPipelineCallBackService.java +++ /dev/null @@ -1,142 +0,0 @@ -package cd.casic.ci.process.process.service.base.engin.service; - - -import cd.casic.ci.common.pipeline.model.SQLPage; -import cd.casic.ci.common.pipeline.pojo.event.CallBackNetWorkRegionType; -import cd.casic.ci.common.pipeline.pojo.event.PipelineCallbackEvent; -import cd.casic.ci.common.pipeline.pojo.event.ProjectPipelineCallBack; -import cd.casic.ci.common.pipeline.pojo.secret.ISecretParam; -import cd.casic.ci.process.api.process.pojo.CreateCallBackResult; -import cd.casic.ci.process.api.process.pojo.ProjectPipelineCallBackHistory; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; - -@Repository -public interface ProjectPipelineCallBackService { - - CreateCallBackResult createCallBack( - String userId, - String projectId, - String url, - CallBackNetWorkRegionType region, - String event, - String secretToken, - ISecretParam secretParam, - boolean needCheckPermission - ); - - List listProjectCallBack( - String projectId, - String events - ); - - SQLPage listByPage( - String userId, - String projectId, - int offset, - int limit - ); - - void delete( - String userId, - String projectId, - long id, - boolean needCheckPermission - ); - - void disable( - String projectId, - long id - ); - - void batchDisable( - String projectId, - String callbackIds - ); - - void sendDisableNotifyMessage( - String projectId, - long id - ); - - void enable( - ProjectPipelineCallBack callBack - ); - - void enableByIds( - String projectId, - String callbackIds - ); - - void updateFailureTime( - String projectId, - long id, - LocalDateTime failureTime - ); - - List getDisableCallbackList( - int offset, - int limit, - String projectId, - String url - ); - - void createHistory( - ProjectPipelineCallBackHistory projectPipelineCallBackHistory - ); - - ProjectPipelineCallBackHistory getHistory( - String userId, - String projectId, - long id - ); - - SQLPage listHistory( - String userId, - String projectId, - String callBackUrl, - String events, - Long startTime, - Long endTime, - int offset, - int limit - ); - - void retry( - String userId, - String projectId, - long id - ); - - void bindPipelineCallBack( - String userId, - String projectId, - String pipelineId, - PipelineCallbackEvent callbackInfo - ); - - List getPipelineCallback( - String projectId, - String pipelineId, - String event - ); - - void checkParam( - String userId, - String projectId - ); - - void validAuth( - String userId, - String projectId - ); - - void validProjectManager( - String userId, - String projectId - ); - - String projectPipelineListUrl(String projectId); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/ProjectPipelineCallBackUrlGenerator.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/ProjectPipelineCallBackUrlGenerator.java deleted file mode 100644 index afcbe576..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/service/ProjectPipelineCallBackUrlGenerator.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.process.process.service.base.engin.service; - - -import cd.casic.ci.common.pipeline.pojo.event.CallBackNetWorkRegionType; -import org.jetbrains.annotations.Nullable; -import org.springframework.stereotype.Repository; - -@Repository -public interface ProjectPipelineCallBackUrlGenerator { - - String generateCallBackUrl( - @Nullable CallBackNetWorkRegionType region, - String url - ); - - String encodeCallbackUrl(String url); - - String decodeCallbackUrl(String url); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/util/ContainerUtils.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/util/ContainerUtils.java deleted file mode 100644 index f3003436..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/engin/util/ContainerUtils.java +++ /dev/null @@ -1,141 +0,0 @@ -package cd.casic.ci.process.process.service.base.engin.util; - -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.container.NormalContainer; -import cd.casic.ci.common.pipeline.container.VMBuildContainer; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.process.api.process.constant.ProcessMessageCode; - -public class ContainerUtils { - - private ContainerUtils() { - // 私有构造函数,防止实例化 - } - - /** - * 获取容器启动键 - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @return 容器启动键 - */ - public static String getContainerStartupKey(String pipelineId, String buildId, String containerId) { - return String.format("container:startup:%s:%s:%s", pipelineId, buildId, containerId); - } - - /** - * 获取容器运行事件取消任务键 - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @return 容器运行事件取消任务键 - */ - public static String getContainerRunEvenCancelTaskKey(String pipelineId, String buildId, String containerId) { - return String.format("container:taskEvenCancel:%s:%s:%s", pipelineId, buildId, containerId); - } - - /** - * 判断普通容器是否启用 - * @param normalContainer 普通容器 - * @return 是否启用 - */ - public static boolean isNormalContainerEnable(NormalContainer normalContainer) { - if (normalContainer.getJobControlOption() != null) { - return normalContainer.getJobControlOption().getEnable(); - } - return !normalContainer.getEnableSkip(); - } - - /** - * 判断VM构建容器是否启用 - * @param container VM构建容器 - * @return 是否启用 - */ - public static boolean isVMBuildContainerEnable(VMBuildContainer container) { - return container.getJobControlOption() == null || container.getJobControlOption().getEnable(); - } - - private static String getMutexPrefix() { - return ProcessMessageCode.BK_MUTEX_WAITING; - } - - /** - * 获取互斥固定容器名称 - * @param containerName 容器名称 - * @return 处理后的容器名称 - */ - public static String getMutexFixedContainerName(String containerName) { - String prefix = getMutexPrefix(); - if (containerName.startsWith(prefix)) { - return containerName.substring(prefix.length()); - } - return containerName; - } - - /** - * 获取互斥等待名称 - * @param containerName 容器名称 - * @return 处理后的容器名称 - */ - public static String getMutexWaitName(String containerName) { - String prefix = getMutexPrefix(); - if (containerName.startsWith(prefix)) { - return containerName; - } - return prefix + containerName; - } - - private static String getQueuePrefix() { - return ProcessMessageCode.BK_QUEUING; - } - - private static String getReviewPrefix() { - return ProcessMessageCode.BK_PENDING; - } - - /** - * 获取清除队列容器名称 - * @param containerName 容器名称 - * @return 处理后的容器名称 - */ - public static String getClearedQueueContainerName(String containerName) { - String queuePrefix = getQueuePrefix(); - String reviewPrefix = getReviewPrefix(); - - if (containerName.startsWith(queuePrefix)) { - return containerName.substring(queuePrefix.length()); - } else if (containerName.startsWith(reviewPrefix)) { - return containerName.substring(reviewPrefix.length()); - } - return containerName; - } - - /** - * 获取排队等待名称 - * @param containerName 容器名称 - * @param startBuildStatus 开始构建状态 - * @return 处理后的容器名称 - */ - public static String getQueuingWaitName(String containerName, BuildStatus startBuildStatus) { - String queuePrefix = getQueuePrefix(); - String reviewPrefix = getReviewPrefix(); - - if (containerName.startsWith(queuePrefix) || containerName.startsWith(reviewPrefix)) { - return containerName; - } - - if (startBuildStatus == BuildStatus.TRIGGER_REVIEWING) { - return reviewPrefix + containerName; - } - return queuePrefix + containerName; - } - - /** - * 判断是否为原始矩阵容器 - * @param container 容器 - * @return 是否为原始矩阵容器 - */ - public static boolean isOriginMatrixContainer(Container container) { - return container.fetchGroupContainers() != null; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/BuildEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/BuildEvent.java deleted file mode 100644 index eb7d6724..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/BuildEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import lombok.Data; - -@Data -public class BuildEvent { - private final String buildId; - private final String pipelineId; - private final String pipelineName; - private final String userId; - private final String triggerUser; - private final String cancelUserId; - private final String status; - private final long startTime; - private final long endTime; - private final SimpleModel model; - private final String projectId; - private final String trigger; - private final String stageId; - private final String taskId; - private final int buildNo; - private final Boolean debug; - - // 构造函数,使用了默认值的设置 - public BuildEvent(String buildId, String pipelineId, String pipelineName, String userId, String triggerUser, String cancelUserId, String status, long startTime, long endTime, SimpleModel model, String projectId, String trigger, String stageId, String taskId, int buildNo, Boolean debug) { - this.buildId = buildId; - this.pipelineId = pipelineId; - this.pipelineName = pipelineName; - this.userId = userId; - this.triggerUser = triggerUser; - this.cancelUserId = cancelUserId; - this.status = status; - this.startTime = startTime; - this.endTime = endTime; - this.model = model; - this.projectId = projectId; - this.trigger = trigger; - this.stageId = stageId; - this.taskId = taskId; - this.buildNo = buildNo; - this.debug = debug; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/CallBackData.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/CallBackData.java deleted file mode 100644 index bd3c315b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/CallBackData.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - -import cd.casic.ci.common.pipeline.enums.CallBackEvent; -import lombok.Data; - -@Data -public class CallBackData { - private final CallBackEvent event; - private final T data; - - // 构造函数 - public CallBackData(CallBackEvent event, T data) { - this.event = event; - this.data = data; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/EventUtils.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/EventUtils.java deleted file mode 100644 index 84fa05aa..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/EventUtils.java +++ /dev/null @@ -1,76 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import cd.casic.ci.common.pipeline.enums.CallBackEvent; -import cd.casic.ci.event.enums.ActionType; - -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * 事件工具类 - */ -public class EventUtils { - - private static final Map callBackEventMap = Stream.of(CallBackEvent.values()) - .collect(Collectors.toMap(Enum::name, event -> event)); - - private EventUtils() { - // 私有构造函数,防止实例化 - } - - /** - * 将PipelineBuildStatusBroadCastEvent转换为CallBackEvent - * @param event 构建状态广播事件 - * @return 回调事件类型 - */ - public static CallBackEvent toEventType(PipelineBuildStatusBroadCastEvent event) { - if (event.getType() != null && callBackEventMap.containsKey(event.getType().name())) { - return callBackEventMap.get(event.getType().name()); - } - - if (event.getTaskId() != null && !event.getTaskId().isBlank()) { - if (event.getActionType() == ActionType.START) { - return CallBackEvent.BUILD_TASK_START; - } - if (event.getActionType() == ActionType.REFRESH) { - return CallBackEvent.BUILD_TASK_PAUSE; - } - if (event.getActionType() == ActionType.END) { - return CallBackEvent.BUILD_TASK_END; - } - } - - if (event.getContainerHashId() != null && !event.getContainerHashId().isBlank()) { - if (event.getActionType() == ActionType.START) { - return CallBackEvent.BUILD_JOB_START; - } - if (event.getActionType() == ActionType.END) { - return CallBackEvent.BUILD_JOB_END; - } - } - - if (event.getStageId() != null && !event.getStageId().isBlank()) { - if (event.getActionType() == ActionType.START) { - return CallBackEvent.BUILD_STAGE_START; - } - if (event.getActionType() == ActionType.END) { - return CallBackEvent.BUILD_STAGE_END; - } - } - - if ((event.getTaskId() == null || event.getTaskId().isBlank()) && - (event.getContainerHashId() == null || event.getContainerHashId().isBlank()) && - (event.getStageId() == null || event.getStageId().isBlank())) { - if (event.getActionType() == ActionType.START) { - return CallBackEvent.BUILD_START; - } - if (event.getActionType() == ActionType.END) { - return CallBackEvent.BUILD_END; - } - } - - return null; - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineBuildStatusBroadCastEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineBuildStatusBroadCastEvent.java deleted file mode 100644 index c8b3b5f0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineBuildStatusBroadCastEvent.java +++ /dev/null @@ -1,213 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.enums.PipelineBuildStatusBroadCastEventType; - -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; -import org.jetbrains.annotations.Nullable; - -import java.time.LocalDateTime; -import java.util.Map; -import java.util.Objects; - -/** - * 构建状态的广播事件,用于通知等 - */ -//@Event(destination = StreamBinding.PIPELINE_BUILD_CALL_BACK_FANOUT) -public class PipelineBuildStatusBroadCastEvent extends IPipelineEvent { - private final String buildId; - @Nullable - private final String stageId; - @Nullable - private final String containerHashId; - @Nullable - private final String jobId; - @Nullable - private final String taskId; - @Nullable - private final String stepId; - @Nullable - private final Integer executeCount; - @Nullable - private final String buildStatus; - @Nullable - private final String atomCode; - @Nullable - private final LocalDateTime eventTime; - @Nullable - private final PipelineBuildStatusBroadCastEventType type; - @Nullable - private final Map labels; - - public PipelineBuildStatusBroadCastEvent( - String source, - String projectId, - String pipelineId, - String userId, - String buildId, - @Nullable String stageId, - @Nullable String containerHashId, - @Nullable String jobId, - @Nullable String taskId, - @Nullable String stepId, - @Nullable Integer executeCount, - @Nullable String buildStatus, - @Nullable String atomCode, - @Nullable LocalDateTime eventTime, - @Nullable PipelineBuildStatusBroadCastEventType type, - @Nullable Map labels, - ActionType actionType, - int delayMills - ) { - super(actionType, source, projectId, pipelineId, userId, delayMills); - this.buildId = buildId; - this.stageId = stageId; - this.containerHashId = containerHashId; - this.jobId = jobId; - this.taskId = taskId; - this.stepId = stepId; - this.executeCount = executeCount; - this.buildStatus = buildStatus; - this.atomCode = atomCode; - this.eventTime = eventTime; - this.type = type; - this.labels = labels; - } - - public PipelineBuildStatusBroadCastEvent( - String source, - String projectId, - String pipelineId, - String userId, - String buildId, - @Nullable Integer executeCount, - @Nullable String buildStatus, - ActionType actionType - ) { - this( - source, - projectId, - pipelineId, - userId, - buildId, - null, - null, - null, - null, - null, - executeCount, - buildStatus, - null, - LocalDateTime.now(), - null, - null, - actionType, - 0 - ); - } - - public String getBuildId() { - return buildId; - } - - @Nullable - public String getStageId() { - return stageId; - } - - @Nullable - public String getContainerHashId() { - return containerHashId; - } - - @Nullable - public String getJobId() { - return jobId; - } - - @Nullable - public String getTaskId() { - return taskId; - } - - @Nullable - public String getStepId() { - return stepId; - } - - @Nullable - public Integer getExecuteCount() { - return executeCount; - } - - @Nullable - public String getBuildStatus() { - return buildStatus; - } - - @Nullable - public String getAtomCode() { - return atomCode; - } - - @Nullable - public LocalDateTime getEventTime() { - return eventTime; - } - - @Nullable - public PipelineBuildStatusBroadCastEventType getType() { - return type; - } - - @Nullable - public Map getLabels() { - return labels; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - PipelineBuildStatusBroadCastEvent that = (PipelineBuildStatusBroadCastEvent) o; - return Objects.equals(buildId, that.buildId) && - Objects.equals(stageId, that.stageId) && - Objects.equals(containerHashId, that.containerHashId) && - Objects.equals(jobId, that.jobId) && - Objects.equals(taskId, that.taskId) && - Objects.equals(stepId, that.stepId) && - Objects.equals(executeCount, that.executeCount) && - Objects.equals(buildStatus, that.buildStatus) && - Objects.equals(atomCode, that.atomCode) && - Objects.equals(eventTime, that.eventTime) && - type == that.type && - Objects.equals(labels, that.labels); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), buildId, stageId, containerHashId, jobId, taskId, stepId, - executeCount, buildStatus, atomCode, eventTime, type, labels); - } - - @Override - public String toString() { - return "PipelineBuildStatusBroadCastEvent{" + - "buildId='" + buildId + '\'' + - ", stageId='" + stageId + '\'' + - ", containerHashId='" + containerHashId + '\'' + - ", jobId='" + jobId + '\'' + - ", taskId='" + taskId + '\'' + - ", stepId='" + stepId + '\'' + - ", executeCount=" + executeCount + - ", buildStatus='" + buildStatus + '\'' + - ", atomCode='" + atomCode + '\'' + - ", eventTime=" + eventTime + - ", type=" + type + - ", labels=" + labels + - '}'; - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineBuildWebSocketPushEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineBuildWebSocketPushEvent.java deleted file mode 100644 index 3b25f1f5..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineBuildWebSocketPushEvent.java +++ /dev/null @@ -1,97 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import cd.casic.ci.event.enums.ActionType; -import cd.casic.ci.event.pojo.pipeline.IPipelineEvent; - -//@Event(StreamBinding.PIPELINE_BUILD_WEBSOCKET) -public class PipelineBuildWebSocketPushEvent extends IPipelineEvent { - - private final String buildId; - private final long refreshTypes; // HISTORY or DETAIL or STATUS 位运算 - private final Integer executeCount; - - public PipelineBuildWebSocketPushEvent( - String source, - String projectId, - String pipelineId, - String userId, - String buildId, - long refreshTypes, - Integer executeCount, - ActionType actionType, - int delayMills - ) { - super(actionType, source, projectId, pipelineId, userId, delayMills); - this.buildId = buildId; - this.refreshTypes = refreshTypes; - this.executeCount = executeCount; - } - - public PipelineBuildWebSocketPushEvent( - String source, - String projectId, - String pipelineId, - String userId, - String buildId, - long refreshTypes - ) { - this(source, projectId, pipelineId, userId, buildId, refreshTypes, null, ActionType.REFRESH, 0); - } - - public PipelineBuildWebSocketPushEvent( String source, String projectId, String pipelineId, String userId, String buildId, long refreshTypes, Integer executeCount) { - super(ActionType.REFRESH, source, projectId, pipelineId, userId,0); - this.buildId = buildId; - this.refreshTypes = refreshTypes; - this.executeCount = executeCount; - } - - public String getBuildId() { - return buildId; - } - - public long getRefreshTypes() { - return refreshTypes; - } - - public Integer getExecuteCount() { - return executeCount; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - PipelineBuildWebSocketPushEvent that = (PipelineBuildWebSocketPushEvent) o; - - if (refreshTypes != that.refreshTypes) return false; - if (!buildId.equals(that.buildId)) return false; - return executeCount != null ? executeCount.equals(that.executeCount) : that.executeCount == null; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + buildId.hashCode(); - result = 31 * result + (int) (refreshTypes ^ (refreshTypes >>> 32)); - result = 31 * result + (executeCount != null ? executeCount.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "PipelineBuildWebSocketPushEvent{" + - "source='" + getSource() + '\'' + - ", projectId='" + getProjectId() + '\'' + - ", pipelineId='" + getPipelineId() + '\'' + - ", userId='" + getUserId() + '\'' + - ", buildId='" + buildId + '\'' + - ", refreshTypes=" + refreshTypes + - ", executeCount=" + executeCount + - ", actionType=" + getActionType() + - ", delayMills=" + getDelayMills() + - '}'; - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineEvent.java deleted file mode 100644 index 2b39b931..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/PipelineEvent.java +++ /dev/null @@ -1,74 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import java.util.Objects; - -public class PipelineEvent { - private final String pipelineId; - private final String pipelineName; - private final String userId; - private final long updateTime; - private final String projectId; - - public PipelineEvent( - String pipelineId, - String pipelineName, - String userId, - long updateTime, - String projectId - ) { - this.pipelineId = pipelineId; - this.pipelineName = pipelineName; - this.userId = userId; - this.updateTime = updateTime; - this.projectId = projectId; - } - - public String getPipelineId() { - return pipelineId; - } - - public String getPipelineName() { - return pipelineName; - } - - public String getUserId() { - return userId; - } - - public long getUpdateTime() { - return updateTime; - } - - public String getProjectId() { - return projectId; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - PipelineEvent that = (PipelineEvent) o; - return updateTime == that.updateTime && - Objects.equals(pipelineId, that.pipelineId) && - Objects.equals(pipelineName, that.pipelineName) && - Objects.equals(userId, that.userId) && - Objects.equals(projectId, that.projectId); - } - - @Override - public int hashCode() { - return Objects.hash(pipelineId, pipelineName, userId, updateTime, projectId); - } - - @Override - public String toString() { - return "PipelineEvent{" + - "pipelineId='" + pipelineId + '\'' + - ", pipelineName='" + pipelineName + '\'' + - ", userId='" + userId + '\'' + - ", updateTime=" + updateTime + - ", projectId='" + projectId + '\'' + - '}'; - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/ProjectCallbackEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/ProjectCallbackEvent.java deleted file mode 100644 index 5b242f54..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/ProjectCallbackEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - -import lombok.Data; - -@Data -public class ProjectCallbackEvent { - private final String projectId; - private final String projectName; - private final boolean enable; - private final String userId; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleJob.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleJob.java deleted file mode 100644 index 48f9b938..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleJob.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import lombok.Data; - -import java.util.List; - -@Data -public class SimpleJob { - private final String jobName; - private final String status; - private final long startTime; - private final long endTime; - private final List tasks; -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleModel.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleModel.java deleted file mode 100644 index 2f11be01..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleModel.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import lombok.Data; - -import java.util.List; - -@Data -public class SimpleModel { - private final List stages; -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleStage.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleStage.java deleted file mode 100644 index 4e44f837..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleStage.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import lombok.Data; - -import java.util.List; - -@Data -public class SimpleStage { - private final String stageName; - private final String name; - private String status; - private long startTime; - private long endTime; - private final List jobs; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleTask.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleTask.java deleted file mode 100644 index 96a1169b..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/SimpleTask.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import lombok.Data; - -@Data -public class SimpleTask { - private final String taskId; - private final String taskName; - private final String atomCode; - private final String status; - private final long startTime; - private final long endTime; -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/StreamEnabledEvent.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/StreamEnabledEvent.java deleted file mode 100644 index 9e80aca1..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/StreamEnabledEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - -import lombok.Data; - -@Data -public class StreamEnabledEvent { - private final String userId; - private final long gitProjectId; - private final String gitProjectUrl; - private final boolean enable; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/VmOperateTaskGenerator.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/VmOperateTaskGenerator.java deleted file mode 100644 index d9f7fa6c..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/VmOperateTaskGenerator.java +++ /dev/null @@ -1,94 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo; - - -import cd.casic.ci.common.pipeline.container.Container; -import cd.casic.ci.common.pipeline.pojo.element.ElementAdditionalOptions; -import cd.casic.ci.common.pipeline.pojo.element.ElementPostInfo; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildTask; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 生成运行环境操作的插件任务 - */ -@Repository -public interface VmOperateTaskGenerator { - - String START_VM_TASK_ATOM = "dispatchVMStartupTaskAtom"; - String SHUTDOWN_VM_TASK_ATOM = "dispatchVMShutdownTaskAtom"; - String START_NORMAL_TASK_ATOM = "dispatchBuildLessDockerStartupTaskAtom"; - String SHUTDOWN_NORMAL_TASK_ATOM = "dispatchBuildLessDockerShutdownTaskAtom"; - - static boolean isVmAtom(PipelineBuildTask task) { - return isStartVM(task) || isStopVM(task); - } - - static boolean isVmAtom(String atomCode) { - return isStartVM(atomCode) || isStopVM(atomCode); - } - - static boolean isStartVM(PipelineBuildTask task) { - return START_VM_TASK_ATOM.equals(task.getTaskAtom()) || - START_NORMAL_TASK_ATOM.equals(task.getTaskAtom()); - } - - static boolean isStopVM(PipelineBuildTask task) { - return SHUTDOWN_VM_TASK_ATOM.equals(task.getTaskAtom()) || - SHUTDOWN_NORMAL_TASK_ATOM.equals(task.getTaskAtom()); - } - - static boolean isStartVM(String atomCode) { - return atomCode.startsWith(START_VM_TASK_ATOM) || - atomCode.startsWith(START_NORMAL_TASK_ATOM); - } - - static boolean isStopVM(String atomCode) { - return atomCode.startsWith(SHUTDOWN_VM_TASK_ATOM) || - atomCode.startsWith(SHUTDOWN_NORMAL_TASK_ATOM); - } - - /** - * 生成编译环境的开机插件任务 - */ - PipelineBuildTask makeStartVMContainerTask( - String projectId, - String pipelineId, - String buildId, - String stageId, - Container container, - int taskSeq, - String userId, - int executeCount - ); - - /** - * 生成准备停机插件任务列表 - */ - List makeShutdownVMContainerTasks( - String projectId, - String pipelineId, - String buildId, - String stageId, - Container container, - int containerSeq, - int taskSeq, - String userId, - int executeCount - ); - - default ElementAdditionalOptions opts(Container container, String taskName, int taskSeq) { - return new ElementAdditionalOptions( - true, // continueWhenFailed - 1L, // timeout: 1分钟超时 - ElementAdditionalOptions.RunCondition.PARENT_TASK_FINISH, - new ElementPostInfo( - container.getId(), - "", - "", - taskName, - taskSeq - ) - ); - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/constant/CallbackConstants.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/constant/CallbackConstants.java deleted file mode 100644 index fb7d9313..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/constant/CallbackConstants.java +++ /dev/null @@ -1,6 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo.constant; - -public class CallbackConstants { - // 项目级回调标志位 - public static final String DEVOPS_ALL_PROJECT = "DEVOPS_ALL_PROJECT"; -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/enums/RefreshType.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/enums/RefreshType.java deleted file mode 100644 index 115683f0..00000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/base/pojo/enums/RefreshType.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.process.process.service.base.pojo.enums; - - -/** - * 2进制表示刷新控制位 - */ -public enum RefreshType { - HISTORY(2), - DETAIL(4), - STATUS(8), - RECORD(16); - - private final long binary; - - RefreshType(long binary) { - this.binary = binary; - } - - public long getBinary() { - return binary; - } -} diff --git a/modules/module-ci-project/pom.xml b/modules/module-ci-project/pom.xml deleted file mode 100644 index 5ec655c7..00000000 --- a/modules/module-ci-project/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-project - - ${revision} - - - - cd.casic.boot - module-ci-common-pipeline - - - - cd.casic.boot - spring-boot-starter-redis - - - - cd.casic.boot - spring-boot-starter-web - - - - cd.casic.boot - spring-boot-starter-monitor - - - cd.casic.boot - spring-boot-starter-mq - - - \ No newline at end of file diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/constant/ProjectConstants.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/constant/ProjectConstants.java deleted file mode 100644 index 3f8e2374..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/constant/ProjectConstants.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.project.constant; - -/** - * @author by mianbin - * @Classname ProjectConstants - * @Description TODO - * @Date 2025/3/21 17:10 - */ -public class ProjectConstants { - public static final String EXCHANGE_PROJECT_COUNT_LOGIN = "exchange_project_count_login"; - public static final String ROUTE_PROJECT_COUNT_LOGIN = "route_project_count_login"; - public static final String QUEUE_PROJECT_COUNT_LOGIN = "queue_project_count_login"; - public static final String SECRECY_PROJECT_REDIS_KEY = "SECRECY_PROJECT_REDIS_KEY"; // 保密项目Key - - public static final Integer NAME_MAX_LENGTH = 64; - public static final Integer NAME_MIN_LENGTH = 2; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/controller/UserProjectResourceController.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/controller/UserProjectResourceController.java deleted file mode 100644 index a2268764..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/controller/UserProjectResourceController.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.project.controller; - - -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.project.service.UserProjectResourceService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.*; - - - -@RestController -@Tag(name = "用户-项目列表接口") -@RequestMapping("/project") -public class UserProjectResourceController { - - @Resource - private UserProjectResourceService userProjectResourceService; - - @PostMapping - @Operation(summary = "创建项目") - public CommonResult create(@RequestBody ProjectCreateInfo projectCreateInfo, - @RequestHeader(name = "X-DEVOPS-ACCESS-TOKEN") String accessToken) { - return CommonResult.success(userProjectResourceService.create(getUserId(), projectCreateInfo, accessToken)); - } - - - private Long getUserId() { -// Long userId = SecurityFrameworkUtils.getLoginUserId(); -// if (userId == null) { -// throw new ServiceException("请登录!"); -// } -// return userId; - return 0L; - } - -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dao/ProjectMapper.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dao/ProjectMapper.java deleted file mode 100644 index e681b6eb..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dao/ProjectMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.project.dal.dao; - -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import cd.casic.ci.project.dal.pojo.ProjectVO; -import cd.casic.ci.project.enums.ProjectChannelCode; -import cd.casic.ci.project.enums.ProjectValidateType; -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; -import cd.casic.ci.project.dal.dto.Project; -import cd.casic.ci.project.dal.pojo.ProjectCreateExtInfo; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface ProjectMapper extends BaseMapperX { - - String create(Long userId, ProjectCreateInfo projectCreateInfo, String accessToken, - ProjectCreateExtInfo projectCreateExtInfo, String defaultProjectId, ProjectChannelCode projectChannelCode); - - void validate(ProjectValidateType validateType, String name, String projectId); - - ProjectVO getByProjectId(String projectId); -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dto/Project.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dto/Project.java deleted file mode 100644 index aa1b26d9..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dto/Project.java +++ /dev/null @@ -1,236 +0,0 @@ -package cd.casic.ci.project.dal.dto; - - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.*; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@Accessors(chain = true) -@AllArgsConstructor -@NoArgsConstructor -@TableName(value = "project", autoResultMap = true) -@EqualsAndHashCode(callSuper = true) -public class Project extends BaseDO { - - private static final long serialVersionUID = 1L; - - /** - * 主键ID - */ - - private Long id; - - /** - * 删除时间 - */ - private Date deletedAt; - - /** - * 容器类型 - */ - private Integer kind; - - /** - * 应用ID - */ - private Long ccAppId; - - /** - * 应用名称 - */ - private String ccAppName; - - /** - * 是否停用 - */ - private Boolean isOfflined; - - /** - * 项目ID - */ - private String projectId; - - /** - * 项目名称 - */ - private String projectName; - - /** - * 英文名称 - */ - private String englishName; - - /** - * 项目类型 - */ - private Integer projectType; - - /** - * 是否用蓝鲸 - */ - private Boolean useBk; - - /** - * 事业群ID - */ - private Long bgId; - - /** - * 事业群名称 - */ - private String bgName; - - /** - * 项目所属二级机构ID - */ - private Long deptId; - - /** - * 项目所属二级机构名称 - */ - private String deptName; - - /** - * 中心ID - */ - private Long centerId; - - /** - * 中心名字 - */ - private String centerName; - - /** - * 数据ID - */ - private Long dataId; - - /** - * 是否保密 - */ - private Boolean isSecrecy; - - /** - * 是否启用图表激活 - */ - private Boolean isHelmChartEnabled; - - /** - * 审核状态 - */ - private Integer approvalStatus; - - /** - * 批准人 - */ - private String approver; - - /** - * 批准时间 - */ - private Date approvalTime; - - /** - * 创建者事业群名称 - */ - private String creatorBgName; - - /** - * 创建者项目所属二级机构名称 - */ - private String creatorDeptName; - - /** - * 创建者中心名字 - */ - private String creatorCenterName; - - /** - * 应用ID - */ - private Long hybridCcAppId; - - /** - * 是否支持构建机访问外网 - */ - private Boolean enableExternal; - - /** - * 是否支持IDC构建机 - */ - private Boolean enableIdc; - - /** - * 是否启用 - */ - private Boolean enabled; - - /** - * 项目渠道 - */ - private String channel; - - /** - * 流水线数量上限 - */ - private Integer pipelineLimit; - - /** - * 网关路由tags - */ - private String routerTag; - - /** - * 扩展系统关联ID - */ - private String relationId; - - /** - * 其他系统网关路由tags - */ - private String otherRouterTags; - - /** - * 项目性质,0-公开,1-保密,2-机密 - */ - private Integer authSecrecy; - - /** - * 额外信息 - */ - private String extra; - - /** - * 描述 - */ - private String description; - - /** - * 部署类型 - */ - private String deployType; - - /** - * logo地址 - */ - private String logoAddr; - - /** - * 评论 - */ - private String remark; - - /** - * 项目其他配置 - */ - private String properties; - - /** - * 最大可授权人员范围 - */ - private String subjectScopes; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dto/TProjectRecord.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dto/TProjectRecord.java deleted file mode 100644 index 71c57645..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/dto/TProjectRecord.java +++ /dev/null @@ -1,110 +0,0 @@ -package cd.casic.ci.project.dal.dto; - - -import java.util.Date; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -public class TProjectRecord { - @Schema(description="主键ID") - private Long id; - @Schema(description="创建时间") - private Date createdAt; - @Schema(description="更新时间") - private Date updatedAt; - @Schema(description="删除时间") - private Date deletedAt; - @Schema(description="额外信息") - private String extra; - @Schema(description="创建者") - private String creator; - @Schema(description="描述") - private String description; - @Schema(description="容器类型") - private Integer kind; - @Schema(description="应用ID") - private Long ccAppId; - @Schema(description="应用名称") - private String ccAppName; - @Schema(description="是否停用") - private Boolean isOfflined; - @Schema(description="项目ID") - private String projectId; - @Schema(description="项目名称") - private String projectName; - @Schema(description="英文名称") - private String englishName; - @Schema(description="更新人") - private String updator; - @Schema(description="项目类型") - private Integer projectType; - @Schema(description="是否用蓝鲸") - private Boolean useBk; - @Schema(description="部署类型") - private String deployType; - @Schema(description="事业群ID") - private Long bgId; - @Schema(description="事业群名称") - private String bgName; - @Schema(description="业务线ID") - private Long businessLineId; - @Schema(description="业务线名称") - private String businessLineName; - @Schema(description="项目所属二级机构ID") - private Long deptId; - @Schema(description="项目所属二级机构名称") - private String deptName; - @Schema(description="中心ID") - private Long centerId; - @Schema(description="中心名字") - private String centerName; - @Schema(description="数据ID") - private Long dataId; - @Schema(description="是否保密") - private Boolean isSecrecy; - @Schema(description="是否启用图表激活") - private Boolean isHelmChartEnabled; - @Schema(description="审核状态") - private Integer approvalStatus; - @Schema(description="logo地址") - private String logoAddr; - @Schema(description="批准人") - private String approver; - @Schema(description="评论") - private String remark; - @Schema(description="批准时间") - private Date approvalTime; - @Schema(description="创建者事业群名称") - private String creatorBgName; - @Schema(description="创建者项目所属二级机构名称") - private String creatorDeptName; - @Schema(description="创建者中心名字") - private String creatorCenterName; - @Schema(description="应用ID") - private Long hybridCcAppId; - @Schema(description="是否支持构建机访问外网") - private Boolean enableExternal; - @Schema(description="是否支持IDC构建机") - private Boolean enableIdc; - @Schema(description="是否启用") - private Boolean enabled; - @Schema(description="项目渠道") - private String channel; - @Schema(description="流水线数量上限") - private Integer pipelineLimit; - @Schema(description="网关路由tags") - private String routerTag; - @Schema(description="扩展系统关联ID") - private String relationId; - @Schema(description="其他系统网关路由tags") - private String otherRouterTags; - @Schema(description="项目其他配置") - private String properties; - @Schema(description="最大可授权人员范围") - private String subjectScopes; - @Schema(description="项目性质,0-公开,1-保密,2-机密") - private Integer authSecrecy; - @Schema(description="运营产品ID") - private Integer productId; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/AuthProjectCreateInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/AuthProjectCreateInfo.java deleted file mode 100644 index 60f1e45a..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/AuthProjectCreateInfo.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - - -import cd.casic.ci.project.dal.pojo.user.UserDeptDetail; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Schema(description = "项目-资源创建模型") -@Data -@AllArgsConstructor -@NoArgsConstructor -public class AuthProjectCreateInfo { - - @Schema(description = "用户id") - private Long userId; - @Schema(description = "accessToken") - private String accessToken; - @Schema(description = "用户部门详细") - private UserDeptDetail userDeptDetail; - @Schema(description = "iamSubjectScopes") - private List subjectScopes; - @Schema(description = "projectCreateInfo") - private ProjectCreateInfo projectCreateInfo; - @Schema(description = "审批状态") - private Integer approvalStatus; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/PipelineAsCodeSettings.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/PipelineAsCodeSettings.java deleted file mode 100644 index 478694e8..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/PipelineAsCodeSettings.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - -import lombok.Data; - -/** - * 设置-YAML流水线功能设置 - */ -@Data -public class PipelineAsCodeSettings { - - /** - * 是否支持流水线功能 - */ - private Boolean enable = false; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectCreateExtInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectCreateExtInfo.java deleted file mode 100644 index 6b5f51d4..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectCreateExtInfo.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ProjectCreateExtInfo { - - private Boolean needValidate; - private Boolean needAuth; - private Boolean needApproval; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectCreateInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectCreateInfo.java deleted file mode 100644 index 086499eb..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectCreateInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - -import cd.casic.ci.project.enums.ProjectAuthSecrecyStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Collections; -import java.util.List; - -@Schema(description = "项目-新增模型") -@Data -public class ProjectCreateInfo { - @Schema(description = "项目名称") - private String projectName; - @Schema(description = "英文缩写") - private String englishName; - @Schema(description = "项目类型") - private int projectType = 0; - @Schema(description = "描述") - private String description; - @Schema(description = "一级部门ID") - private long bgId = 0; - @Schema(description = "一级部门名字") - private String bgName = ""; - @Schema(description = "二级部门ID") - private long deptId = 0; - @Schema(description = "二级部门名称") - private String deptName = ""; - @Schema(description = "三级部门ID") - private long centerId = 0; - @Schema(description = "三级部门名称") - private String centerName = ""; - @Schema(description = "是否保密") - private boolean secrecy = false; - @Schema(description = "kind") - private int kind = 0; - @Schema(description = "项目相关配置") - private ProjectProperties properties; - @Schema(description = "项目最大可授权人员范围") - private List subjectScopes = Collections.emptyList(); - @Schema(description = "logo地址") - private String logoAddress; - @Schema(description = "项目性质") - private Integer authSecrecy = ProjectAuthSecrecyStatus.PUBLIC.getValue(); -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectProperties.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectProperties.java deleted file mode 100644 index 115eec5e..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectProperties.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Schema(description = "项目其他配置") -@Data -public class ProjectProperties { - - @Schema(description = "YAML流水线功能设置") - private PipelineAsCodeSettings pipelineAsCodeSettings; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectVO.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectVO.java deleted file mode 100644 index d6a95350..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ProjectVO.java +++ /dev/null @@ -1,133 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -@Data -@Schema(description = "项目-显示模型") -public class ProjectVO { - - @Schema(description = "主键ID") - private Long id; - @Schema(description = "项目ID(很少使用)") - // @JsonProperty("project_id") - private String projectId; - @Schema(description = "项目名称") - // @JsonProperty("project_name") - private String projectName; - @Schema(description = "项目代码(蓝盾项目Id)") - // @JsonProperty("project_code") - private String projectCode; - @Schema(description = "项目类型") - // @JsonProperty("project_type") - private Integer projectType; - @Schema(description = "审批状态") - // @JsonProperty("approval_status") - private Integer approvalStatus; - @Schema(description = "审批时间") - // @JsonProperty("approval_time") - private String approvalTime; - @Schema(description = "审批人") - private String approver; - @Schema(description = "cc业务ID") - // @JsonProperty("cc_app_id") - private Long ccAppId; - @Schema(description = "cc业务名称") - // @JsonProperty("cc_app_name") - private String ccAppName; - @Schema(description = "创建时间") - // @JsonProperty("created_at") - private String createdAt; - @Schema(description = "创建人") - private Long creator; - @Schema(description = "数据ID") - // @JsonProperty("data_id") - private Long dataId; - @Schema(description = "部署类型") - // @JsonProperty("deploy_type") - private String deployType; - @Schema(description = "事业群ID") - // @JsonProperty("bg_id") - private String bgId; - @Schema(description = "事业群名字") - // @JsonProperty("bg_name") - private String bgName; - @Schema(description = "中心ID") - // @JsonProperty("center_id") - private String centerId; - @Schema(description = "中心名称") - // @JsonProperty("center_name") - private String centerName; - @Schema(description = "部门ID") - // @JsonProperty("dept_id") - private String deptId; - @Schema(description = "部门名称") - // @JsonProperty("dept_name") - private String deptName; - @Schema(description = "描述") - private String description; - @Schema(description = "英文缩写") - // @JsonProperty("english_name") - private String englishName; - @Schema(description = "extra") - private String extra; - @Schema(description = "是否离线") - // @get; - private Boolean offlined; - @Schema(description = "是否保密") - // @get; - private Boolean secrecy; - @Schema(description = "是否启用图表激活") - // @get; - private Boolean helmChartEnabled; - @Schema(description = "kind") - private Integer kind; - @Schema(description = "logo地址") - // @JsonProperty("logo_addr") - private String logoAddr; - @Schema(description = "评论") - private String remark; - @Schema(description = "修改时间") - // @JsonProperty("updated_at") - private String updatedAt; - @Schema(description = "修改人") - // @JsonProperty("updated_at") - private String updator; - @Schema(description = "useBK") - // @JsonProperty("use_bk") - private Boolean useBk; - @Schema(description = "启用") - private Boolean enabled; - @Schema(description = "是否灰度") - private Boolean gray; - @Schema(description = "混合云CC业务ID") - private Long hybridCcAppId; - @Schema(description = "支持构建机访问外网") - private Boolean enableExternal; - @Schema(description = "支持IDC构建机") - private Boolean enableIdc; - @Schema(description = "流水线数量上限") - private Integer pipelineLimit; - @Schema(description = "项目路由指向") - private String routerTag; - @Schema(description = "关联系统Id") - private String relationId; - @Schema(description = "项目其他配置") - private ProjectProperties properties; - @Schema(description = "项目最大可授权人员范围") - private List subjectScopes; - @Schema(description = "是否权限私密") - private Integer authSecrecy; - @Schema(description = "项目提示状态,0-不展示,1-展示创建成功,2-展示编辑成功") - private Integer tipsStatus; - @Schema(description = "项目审批message") - private String approvalMsg; - @Schema(description = "是否拥有新版权限中心项目管理权限") - private Boolean managePermission; - @Schema(description = "是否展示用户管理图标") - private Boolean showUserManageIcon; - @Schema(description = "渠道") - private String channelCode; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ResourceRegisterInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ResourceRegisterInfo.java deleted file mode 100644 index e4ba32ea..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/ResourceRegisterInfo.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ResourceRegisterInfo { - private String resourceCode; - private String resourceName; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/SubjectScopeInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/SubjectScopeInfo.java deleted file mode 100644 index 1566bf29..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/SubjectScopeInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.project.dal.pojo; - -import cd.casic.ci.common.pipeline.enums.SubjectScopeType; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Schema(description = "授权范围") -@Data -@AllArgsConstructor -@NoArgsConstructor -public class SubjectScopeInfo { - @Schema(description = "ID") - private String id; - @Schema(description = "name") - private String name; - @Schema(description = "类型") - private String type = SubjectScopeType.USER.getValue(); - @JsonProperty("full_name") - private String fullName; - @Schema(description = "用户名") - private String username; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/user/UserDeptDetail.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/user/UserDeptDetail.java deleted file mode 100644 index 22cad0a6..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/dal/pojo/user/UserDeptDetail.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.project.dal.pojo.user; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -@Schema(description = "用户部门信息") -public class UserDeptDetail { - @Schema(description = "bg名称") - private String bgName; - @Schema(description = "bgID") - private String bgId; - @Schema(description = "部门名称") - private String deptName; - @Schema(description = "部门ID") - private String deptId; - @Schema(description = "中心名称") - private String centerName; - @Schema(description = "中心ID") - private String centerId; - @Schema(description = "组ID") - private String groupId; - @Schema(description = "组名称") - private String groupName; - @Schema(description = "用户ID") - private Long userId; - @Schema(description = "用户名称") - private String name; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/PluginDetailsDisplayOrder.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/PluginDetailsDisplayOrder.java deleted file mode 100644 index 6d6d6b51..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/PluginDetailsDisplayOrder.java +++ /dev/null @@ -1,7 +0,0 @@ -package cd.casic.ci.project.enums; - -public enum PluginDetailsDisplayOrder { - LOG, - ARTIFACT, - CONFIG -} \ No newline at end of file diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectApproveStatus.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectApproveStatus.java deleted file mode 100644 index 870a8f20..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectApproveStatus.java +++ /dev/null @@ -1,45 +0,0 @@ -package cd.casic.ci.project.enums; - -public enum ProjectApproveStatus { - UNKNOWN(-1), - - // 创建审批中 - CREATE_PENDING(1), - - // 审批通过 - APPROVED(2), - - // 创建中审批拒绝 - CREATE_REJECT(3), - - // 修改审批中 - UPDATE_PENDING(4); - - private final Integer status; - - ProjectApproveStatus(Integer status) { - this.status = status; - } - - public Integer getStatus() { - return status; - } - - public boolean isSuccess() { - return this == APPROVED || this == UPDATE_PENDING; - } - - public boolean isCreatePending() { - return this == CREATE_PENDING || this == CREATE_REJECT; - } - - public static ProjectApproveStatus parse(int status) { - for (ProjectApproveStatus value : values()) { - if (value.getStatus() == status) { - return value; - } - } - - return null; - } -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectAuthSecrecyStatus.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectAuthSecrecyStatus.java deleted file mode 100644 index 667f6963..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectAuthSecrecyStatus.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.project.enums; - -public enum ProjectAuthSecrecyStatus { - PUBLIC(0, "私有项目"), - PRIVATE(1, "保密项目"), - CLASSIFIED(2, "机密项目"); - - private final Integer value; - private final String desc; - - ProjectAuthSecrecyStatus(Integer value, String desc) { - this.value = value; - this.desc = desc; - } - - public Integer getValue() { - return value; - } - - public String getDesc() { - return desc; - } - - public static ProjectAuthSecrecyStatus getStatus(int status) { - for (ProjectAuthSecrecyStatus secrecyStatus : values()) { - if (secrecyStatus.value == status) { - return secrecyStatus; - } - } - return null; - } -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectChannelCode.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectChannelCode.java deleted file mode 100644 index 124335a3..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectChannelCode.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.project.enums; - -import io.swagger.v3.oas.annotations.media.Schema; - - -@Schema(description = "项目道代码") -public enum ProjectChannelCode { - @Schema(description = "蓝盾") - BS, - @Schema(description = "PREBULD") - PREBUILD, - @Schema(description = "CODECC") - CODECC, - @Schema(description = "GITCI") - GITCI, - @Schema(description = "自动化集群项目,区分于CODECC项目") - AUTO -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectCollation.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectCollation.java deleted file mode 100644 index c3fb5d77..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectCollation.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.project.enums; - -public enum ProjectCollation { - DEFAULT, - - ASC, - - DESC; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectSortType.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectSortType.java deleted file mode 100644 index 51ff386b..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectSortType.java +++ /dev/null @@ -1,6 +0,0 @@ -package cd.casic.ci.project.enums; - -public enum ProjectSortType { - PROJECT_NAME, - ENGLISH_NAME -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectValidateType.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectValidateType.java deleted file mode 100644 index 49ce7c7b..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/enums/ProjectValidateType.java +++ /dev/null @@ -1,6 +0,0 @@ -package cd.casic.ci.project.enums; - -public enum ProjectValidateType { - PROJECT_NAME, - ENGLISH_NAME -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/OperationalProductVO.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/OperationalProductVO.java deleted file mode 100644 index c39552b8..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/OperationalProductVO.java +++ /dev/null @@ -1,46 +0,0 @@ -package cd.casic.ci.project.pojo; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "运营产品") -public class OperationalProductVO { - - @Schema(title = "运营产品ID") - @JsonProperty(value = "ProductId", required = false) - private Integer productId; - - @Schema(title = "运营产品ID") - @JsonProperty(value = "ProductName", required = false) - private String productName; - - @Schema(title = "运营产品ID") - @JsonProperty(value = "PlanProductId", required = false) - private Integer planProductId; - - @Schema(title = "规划产品名称") - @JsonProperty(value = "PlanProductName", required = false) - private String planProductName; - - @Schema(title = "部门ID") - @JsonProperty(value = "DeptId", required = false) - private String deptId; - - @Schema(title = "部门名称") - @JsonProperty(value = "DeptName", required = false) - private String deptName; - - @Schema(title = "BgId") - @JsonProperty(value = "BgId", required = false) - private String bgId; - - @Schema(title = "Bg名称") - @JsonProperty(value = "BgName", required = false) - private String bgName; -} \ No newline at end of file diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectBaseInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectBaseInfo.java deleted file mode 100644 index 6b32d609..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectBaseInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.project.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "项目基本信息") -public class ProjectBaseInfo { - - @Schema(title = "主键ID") - private Long id; - - @Schema(title = "英文缩写") - private String englishName; - - @Schema(title = "项目名称") - private String projectName; - - @Schema(title = "是否启用") - private Boolean enabled; -} \ No newline at end of file diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectByConditionDTO.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectByConditionDTO.java deleted file mode 100644 index ad0774a4..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectByConditionDTO.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.project.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "项目--权限") -public class ProjectByConditionDTO { - - @Schema(title = "项目名称") - private String projectName; - - @Schema(title = "项目英文名称") - private String englishName; - - @Schema(title = "权限") - private boolean permission; - - @Schema(title = "环境路由") - private String routerTag; - - @Schema(title = "bgId") - private Long bgId; - - @Schema(title = "remotedev管理员") - private String remotedevManager; -} \ No newline at end of file diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectCreateUserInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectCreateUserInfo.java deleted file mode 100644 index 31be476c..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectCreateUserInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.project.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema -public class ProjectCreateUserInfo { - - @Schema(title = "操作人") - private String createUserId; - - @Schema(title = "待分配的角色名称") - private String roleName; - - @Schema(title = "角色Id") - private Integer roleId; - - @Schema(title = "组ID") - private Integer groupId; - - @Schema(title = "目标用户") - private List userIds = new ArrayList<>(); - - @Schema(title = "目标部门") - private List deptIds = new ArrayList<>(); - - @Schema(title = "资源类型") - private String resourceType; - - @Schema(title = "资源ID") - private String resourceCode; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectLogo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectLogo.java deleted file mode 100644 index 0826272d..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectLogo.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.ci.project.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ProjectLogo { - private String logoAddr; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectOrganizationInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectOrganizationInfo.java deleted file mode 100644 index 500fb40d..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectOrganizationInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.project.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "项目组织") -public class ProjectOrganizationInfo { - - @Schema(title = "事业群ID") - private Long bgId; - - @Schema(title = "事业群名字") - private String bgName; - - @Schema(title = "业务线ID") - private Long businessLineId; - - @Schema(title = "业务线名称") - private String businessLineName; - - @Schema(title = "中心ID") - private Long centerId; - - @Schema(title = "中心名称") - private String centerName; - - @Schema(title = "部门ID") - private Long deptId; - - @Schema(title = "部门名称") - private String deptName; - - @Schema(title = "是否需要更正组织") - private boolean needFix = true; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectUpdateCreatorDTO.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectUpdateCreatorDTO.java deleted file mode 100644 index 2eb8ac2a..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectUpdateCreatorDTO.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.ci.project.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema(title = "修改项目创建人") -public class ProjectUpdateCreatorDTO { - @Schema(title = "项目code") - private String projectCode; - @Schema(title = "创建人") - private String creator; -} - diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectUpdateInfo.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectUpdateInfo.java deleted file mode 100644 index b5f8585c..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/ProjectUpdateInfo.java +++ /dev/null @@ -1,95 +0,0 @@ -package cd.casic.ci.project.pojo; - -import cd.casic.ci.project.dal.pojo.ProjectProperties; -import cd.casic.ci.project.dal.pojo.SubjectScopeInfo; -import cd.casic.ci.project.enums.ProjectAuthSecrecyStatus; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Collections; -import java.util.List; - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "项目-修改模型") -public class ProjectUpdateInfo { - @Schema(title = "项目名称") - private String projectName; - - @Builder.Default - @Schema(title = "项目类型") - private Integer projectType = 0; - - @Builder.Default - @Schema(title = "事业群ID") - private Long bgId = 0L; - - @Builder.Default - @Schema(title = "事业群名字") - private String bgName = ""; - - @Schema(title = "业务线ID") - private Long businessLineId; - - @Builder.Default - @Schema(title = "业务线名称") - private String businessLineName = ""; - - @Schema(title = "中心ID") - private Long centerId; - - @Schema(title = "中心名称") - private String centerName; - - @Schema(title = "部门ID") - private Long deptId; - - @Schema(title = "部门名称") - private String deptName; - - @Schema(title = "描述") - private String description; - - @Builder.Default - @Schema(title = "英文缩写") - private String englishName = ""; - - @Schema(title = "cc app id") - private Long ccAppId; - - @Schema(title = "cc app name") - private String ccAppName; - - @Schema(title = "容器选择,0 是不选,1 是k8s, 2 是mesos") - private Integer kind; - - @Builder.Default - @Schema(title = "是否保密") - private Boolean secrecy = false; - - @Schema(title = "项目相关配置") - private ProjectProperties properties; - - @Builder.Default - @Schema(title = "项目最大可授权人员范围") - private List subjectScopes = Collections.emptyList(); - - @Schema(title = "logo地址") - private String logoAddress; - - @Builder.Default - @Schema(title = "项目性质") - private Integer authSecrecy = ProjectAuthSecrecyStatus.PUBLIC.getValue(); - - @Schema(title = "运营产品ID") - private Integer productId; - - @Schema(title = "运营产品名称") - private String productName; -} - diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectBroadCastEvent.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectBroadCastEvent.java deleted file mode 100644 index 195bbb58..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectBroadCastEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.project.pojo.mq; - - -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessage; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class ProjectBroadCastEvent extends AbstractRedisStreamMessage { - private String userId; - private String projectId; - private Integer retryCount; - private Integer delayMills; - private Integer retryTime; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectCreateBroadCastEvent.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectCreateBroadCastEvent.java deleted file mode 100644 index 95dc0792..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectCreateBroadCastEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.project.pojo.mq; - -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class ProjectCreateBroadCastEvent extends ProjectBroadCastEvent{ - private ProjectCreateInfo projectInfo; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectEnableStatusBroadCastEvent.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectEnableStatusBroadCastEvent.java deleted file mode 100644 index 8cccf3af..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectEnableStatusBroadCastEvent.java +++ /dev/null @@ -1,10 +0,0 @@ -package cd.casic.ci.project.pojo.mq; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class ProjectEnableStatusBroadCastEvent extends ProjectBroadCastEvent{ - private Boolean enable; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectUpdateBroadCastEvent.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectUpdateBroadCastEvent.java deleted file mode 100644 index 4172c601..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/mq/ProjectUpdateBroadCastEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.project.pojo.mq; - -import cd.casic.ci.project.pojo.ProjectUpdateInfo; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@EqualsAndHashCode(callSuper = true) -@Data -public class ProjectUpdateBroadCastEvent extends ProjectBroadCastEvent{ - private ProjectUpdateInfo projectInfo; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/vo/ProjectDiffVO.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/vo/ProjectDiffVO.java deleted file mode 100644 index 678e7a76..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/pojo/vo/ProjectDiffVO.java +++ /dev/null @@ -1,173 +0,0 @@ -package cd.casic.ci.project.pojo.vo; - -import cd.casic.ci.project.dal.pojo.SubjectScopeInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(title = "项目-显示模型") -@SuppressWarnings("ALL") -public class ProjectDiffVO { - - @Schema(title = "主键ID") - private Long id; - - @Schema(title = "项目ID") - private String projectId; - - @Schema(title = "项目名称") - private String projectName; - - @Schema(title = "审批中项目名称") - private String afterProjectName; - - @Schema(title = "项目代码") - private String projectCode; - - @Schema(title = "审批状态") - private Integer approvalStatus; - - @Schema(title = "审批时间") - private String approvalTime; - - @Schema(title = "审批人") - private String approver; - - @Schema(title = "创建时间") - private String createdAt; - - @Schema(title = "创建人") - private String creator; - - @Schema(title = "事业群ID") - private String bgId; - - @Schema(title = "审批中事业群ID") - private String afterBgId; - - @Schema(title = "事业群名字") - private String bgName; - - @Schema(title = "审批中事业群名字") - private String afterBgName; - - @Schema(title = "事业线ID") - private String businessLineId; - - @Schema(title = "审批中事业线ID") - private Long afterBusinessLineId; - - @Schema(title = "事业线名称") - private String businessLineName; - - @Schema(title = "审批中事业线名称") - private String afterBusinessLineName; - - @Schema(title = "中心ID") - private String centerId; - - @Schema(title = "审批中中心ID") - private String afterCenterId; - - @Schema(title = "中心名称") - private String centerName; - - @Schema(title = "审批中中心名称") - private String afterCenterName; - - @Schema(title = "部门ID") - private String deptId; - - @Schema(title = "审批中部门ID") - private String afterDeptId; - - @Schema(title = "部门名称") - private String deptName; - - @Schema(title = "审批中部门名称") - private String afterDeptName; - - @Schema(title = "描述") - private String description; - - @Schema(title = "审批中描述") - private String afterDescription; - - @Schema(title = "英文缩写") - private String englishName; - - @Schema(title = "logo地址") - private String logoAddr; - - @Schema(title = "审批中logo地址") - private String afterLogoAddr; - - @Schema(title = "评论") - private String remark; - - @Schema(title = "修改时间") - private String updatedAt; - - @Schema(title = "修改人") - private String updator; - - @Schema(title = "项目最大可授权人员范围") - private List subjectScopes; - - @Schema(title = "审批中的项目最大可授权人员范围") - private List afterSubjectScopes; - - @Schema(title = "项目性质") - private Integer authSecrecy; - - @Schema(title = "审批中项目性质") - private Integer afterAuthSecrecy; - - @Schema(title = "项目类型") - private Integer projectType; - - @Schema(title = "审批中项目类型") - private Integer afterProjectType; - - @Schema(title = "运营产品ID") - private Integer productId; - - @Schema(title = "审批中运营产品ID") - private Integer afterProductId; - - @Schema(title = "运营产品名称") - private String productName; - - @Schema(title = "审批中运营产品名称") - private String afterProductName; - - @Schema(title = "流水线语言风格") - private String pipelineDialect; - - @Schema(title = "审批中流水线语言风格") - private String afterPipelineDialect; - - @Schema(title = "是否开启流水线命名提示") - private Boolean enablePipelineNameTips = false; - - @Schema(title = "审批中是否开启流水线命名提示") - private Boolean afterEnablePipelineNameTips = false; - - @Schema(title = "流水线命名格式") - private String pipelineNameFormat; - - @Schema(title = "审批中流水线命名格式") - private String afterPipelineNameFormat; - - @Schema(title = "构建日志归档阈值(单位:万)") - private Integer loggingLineLimit; - - @Schema(title = "审批中构建日志归档阈值(单位:万)") - private Integer afterLoggingLineLimit; -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectExtService.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectExtService.java deleted file mode 100644 index 8cc77548..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectExtService.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.project.service; - - -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import cd.casic.ci.project.dal.pojo.ProjectCreateExtInfo; - -public interface ProjectExtService { - void createExtProjectInfo(Long userId, String projectId, String accessToken, ProjectCreateInfo projectCreateInfo, ProjectCreateExtInfo createExtInfo, String logoAddress); -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectPermissionService.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectPermissionService.java deleted file mode 100644 index 9d1bc2ed..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectPermissionService.java +++ /dev/null @@ -1,8 +0,0 @@ -package cd.casic.ci.project.service; - -import cd.casic.ci.project.dal.pojo.AuthProjectCreateInfo; -import cd.casic.ci.project.dal.pojo.ResourceRegisterInfo; - -public interface ProjectPermissionService { - String createResources(ResourceRegisterInfo resourceRegisterInfo, AuthProjectCreateInfo authProjectCreateInfo); -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectService.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectService.java deleted file mode 100644 index bf7a7fd4..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ProjectService.java +++ /dev/null @@ -1,259 +0,0 @@ -package cd.casic.ci.project.service; - - - - -import cd.casic.ci.common.pipeline.pojo.Pagination; -import cd.casic.ci.common.pipeline.pojo.auth.ProjectConditionDTO; -import cd.casic.ci.project.dal.dto.TProjectRecord; -import cd.casic.ci.project.dal.pojo.*; -import cd.casic.ci.project.enums.*; -import cd.casic.ci.project.pojo.*; -import cd.casic.ci.project.pojo.vo.ProjectDiffVO; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -import javax.annotation.Nullable; -import javax.security.auth.AuthPermission; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Set; - -@SuppressWarnings("ALL") -public interface ProjectService { - - /** - * 校验项目名称/英文名称是否合法 - */ - void validate(ProjectValidateType validateType, String name, @Nullable String projectId); - - /** - * 创建项目信息 - */ - String create( - String userId, - ProjectCreateInfo projectCreateInfo, - @Nullable String accessToken, - ProjectCreateExtInfo createExtInfo, - @Nullable String defaultProjectId, - ProjectChannelCode projectChannel - ); - - ProjectVO createExtProject( - String userId, - String projectCode, - ProjectCreateInfo projectCreateInfo, - boolean needAuth, - boolean needValidate, - ProjectChannelCode channel - ); - - /** - * 根据项目ID/英文ID获取项目信息对象 - * @param englishName projectCode 英文ID - * @return ProjectVO 如果没有则为null - */ - ProjectVO getByEnglishName( - String userId, - String englishName, - @Nullable String accessToken - ); - - /** - * 根据项目ID/英文ID获取项目信息对象 - * @param englishName projectCode 英文ID - * @return ProjectVO 如果没有则为null - */ - ProjectVO show( - String userId, - String englishName, - @Nullable String accessToken - ); - - /** - * 根据项目ID/英文ID获取项目审批中对比信息 - * @param englishName projectCode 英文ID - * @return ProjectDiffVO 如果没有则为null - */ - ProjectDiffVO diff(String userId, String englishName, @Nullable String accessToken); - - /** - * 根据项目ID/英文ID获取项目信息对象 - * @param englishName projectCode 英文ID - * @return ProjectVO 如果没有则为null - */ - ProjectVO getByEnglishName(String englishName); - - /** - * 修改项目信息 englishName是项目英文名,目前平台在api接口上会把他命名成projectId,实际上与t_project表中的project_id字段不同 - * 后续会统一 - */ - boolean update( - String userId, - String englishName, - ProjectUpdateInfo projectUpdateInfo, - @Nullable String accessToken, - @Nullable Boolean needApproval - ); - -// /** -// * 更新Logo TODO FormDataContentDisposition类是 org.glassfish库的, -// 涉及文件上传模块相关内容先空着后续在看具体解决方案 -// */ -// ProjectLogo updateLogo( -// String userId, -// String englishName, -// InputStream inputStream, -// FormDataContentDisposition disposition, -// @Nullable String accessToken -// ); - - /** - * 上传Logo - */ - String uploadLogo( - String userId, - InputStream inputStream, - @Nullable String accessToken - ); - - boolean updateProjectName(String userId, String projectId, String projectName); - - /** - * 获取所有项目信息 - */ - List list( - String userId, - @Nullable String accessToken, - @Nullable Boolean enabled, - boolean unApproved, - @Nullable ProjectSortType sortType, - @Nullable ProjectCollation collation - ); - - Pagination listProjectsForApply( - String userId, - @Nullable String accessToken, - @Nullable String projectName, - @Nullable String projectId, - int page, - int pageSize - ); - - List list(String userId); - - List list(Set projectCodes, @Nullable Boolean enabled); - - List listOnlyByProjectCode(Set projectCodes); - - List list(List projectCodes); - - Page list(int limit, int offset); - - Page listByChannel(int limit, int offset, List projectChannelCode); - - List getAllProject(); - - List listProjectsByCondition( - ProjectConditionDTO projectConditionDTO, - int limit, - int offset - ); - - /** - * 获取用户已的可访问项目列表 - */ - List getProjectByUser(String userName); - - HashMap getNameByCode(String projectCodes); - - void updateUsableStatus( - @Nullable String userId, - String englishName, - boolean enabled, - boolean checkPermission - ); - - Page searchProjectByProjectName(String projectName, int limit, int offset); - - boolean hasCreatePermission(String userId); - - long getMinId(); - - long getMaxId(); - - List getProjectListById(long minId, long maxId); - - boolean verifyUserProjectPermission( - String userId, - String projectId, - AuthPermission permission, - @Nullable String accessToken - ); - - Set listSecrecyProject(); - - boolean createProjectUser(String projectId, ProjectCreateUserInfo createInfo); - - boolean relationIamProject(String projectCode, String relationId); - - ProjectVO getProjectByName(String projectName); - - boolean updateProjectProperties(@Nullable String userId, String projectCode, ProjectProperties properties); - - boolean setDisableWhenInactiveFlag(List projectCodes); - - boolean cancelCreateProject(String userId, String projectId); - - boolean cancelUpdateProject(String userId, String projectId); - - boolean isRbacPermission(String projectId); - - boolean updateProjectSubjectScopes( - String projectId, - List subjectScopes - ); - - boolean updateProjectCreator(List projectUpdateCreatorDtoList); - - List getOperationalProducts(); - - OperationalProductVO getProductByProductId(int productId); - - List getOperationalProductsByBgName(String bgName); - - void updateProjectProductId( - String englishName, - @Nullable String productName, - @Nullable Integer productId - ); - - void updateOrganizationByEnglishName( - String englishName, - ProjectOrganizationInfo projectOrganizationInfo - ); - - ProjectOrganizationInfo fixProjectOrganization( - TProjectRecord tProjectRecord - ); - - List getProjectListByProductId( - int productId - ); - - List getExistedEnglishName( - List englishNameList - ); - - boolean remindUserOfRelatedProduct( - String userId, - String englishName - ); - - boolean updatePluginDetailsDisplay( - String englishName, - List pluginDetailsDisplayOrder - ); - - String getPipelineDialect(String projectId); -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ServiceAllocIdResource.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ServiceAllocIdResource.java deleted file mode 100644 index 91772741..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/ServiceAllocIdResource.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.project.service; - -import io.swagger.v3.oas.annotations.Operation; - -import java.util.List; - -public interface ServiceAllocIdResource { - -// @GET -// @Path("/types/segment/tags/{bizTag}/generate") - @Operation(summary = "按号段模式生成Id") - Long generateSegmentId(String bizTag); - - @Operation(summary = "按号段模式批量生成Id(本质是for循环实现,减少远程调用)") - public List batchGenerateSegmentId(String bizTag,Integer number); -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/UserProjectResourceService.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/UserProjectResourceService.java deleted file mode 100644 index 3f7d1411..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/UserProjectResourceService.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.project.service; - - -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; - -public interface UserProjectResourceService { - - boolean create(Long userId, ProjectCreateInfo projectCreateInfo, String accessToken); -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/BluekingProjectPermissionServiceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/BluekingProjectPermissionServiceImpl.java deleted file mode 100644 index 15094efa..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/BluekingProjectPermissionServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.project.service.impl; - -import cd.casic.ci.project.dal.pojo.AuthProjectCreateInfo; -import cd.casic.ci.project.dal.pojo.ResourceRegisterInfo; -import cd.casic.ci.project.service.ProjectPermissionService; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -@Service -public class BluekingProjectPermissionServiceImpl implements ProjectPermissionService { - @Override - public String createResources(ResourceRegisterInfo resourceRegisterInfo, AuthProjectCreateInfo authProjectCreateInfo) { - List projectList = new ArrayList<>(); - return ""; - } -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectExtServiceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectExtServiceImpl.java deleted file mode 100644 index c3f9da2f..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectExtServiceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.project.service.impl; - - -import cd.casic.ci.project.dal.pojo.ProjectCreateExtInfo; -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import cd.casic.ci.project.service.ProjectExtService; -import org.springframework.stereotype.Service; - -@Service("projectExtService") -public class ProjectExtServiceImpl implements ProjectExtService { - @Override - public void createExtProjectInfo(Long userId, String projectId, String accessToken, ProjectCreateInfo projectCreateInfo, ProjectCreateExtInfo createExtInfo, String logoAddress) { - //TODO 调用另一个服务 - //client.get(ServiceBkRepoResource::class).createProjectResource(userId, projectCreateInfo.englishName) - } -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectServiceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectServiceImpl.java deleted file mode 100644 index 83993789..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectServiceImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -package cd.casic.ci.project.service.impl; - - -import cd.casic.ci.common.pipeline.constant.BaseConstant; -import cd.casic.ci.project.constant.ProjectConstants; -import cd.casic.ci.project.dal.dao.ProjectMapper; -import cd.casic.ci.project.dal.dto.Project; -import cd.casic.ci.project.dal.pojo.*; -import cd.casic.ci.project.dal.pojo.user.UserDeptDetail; -import cd.casic.ci.project.enums.ProjectApproveStatus; -import cd.casic.ci.project.enums.ProjectAuthSecrecyStatus; -import cd.casic.ci.project.enums.ProjectChannelCode; -import cd.casic.ci.project.enums.ProjectValidateType; -import cd.casic.ci.project.service.ProjectExtService; -import cd.casic.framework.commons.exception.ServiceException; -import cd.casic.framework.commons.util.json.JsonUtils; -import cd.casic.framework.redis.core.RedisTemplateUtils; -import cn.hutool.core.convert.Convert; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import java.util.Collections; -import java.util.List; - - -@Service("projectService") -@Slf4j -public class ProjectServiceImpl { - - private final String ENGLISH_NAME_PATTERN = "[a-z][a-zA-Z0-9-]+"; - private final String ALL_MEMBERS = "*"; - private final String ALL_MEMBERS_NAME = "allMembersName"; - private final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; - - @Resource - private ProjectExtService projectExtService; - @Resource - private ProjectMapper projectMapper; - @Resource - private RedisTemplateUtils redisTemplateUtils; - - public String create(Long userId, ProjectCreateInfo projectCreateInfo, String accessToken, - ProjectCreateExtInfo createExtInfo, String defaultProjectId, ProjectChannelCode projectChannelCode) { - - log.info("create project| {} | {} | {} | {}", userId, accessToken, createExtInfo, projectCreateInfo); - if (createExtInfo.getNeedValidate()) { - validate(ProjectValidateType.PROJECT_NAME, projectCreateInfo.getProjectName(), null); - validate(ProjectValidateType.ENGLISH_NAME, projectCreateInfo.getEnglishName(), null); - } - UserDeptDetail userDeptDetail = getDeptInfo(userId); - String projectId = defaultProjectId; - List subjectScopes = projectCreateInfo.getSubjectScopes(); - if (subjectScopes == null || subjectScopes.isEmpty()) { - subjectScopes = Collections.singletonList(new SubjectScopeInfo(ALL_MEMBERS, getAllMembersName(), ALL_MEMBERS, null, null)); - } - //TODO 待完善 先直接得到结果 -// boolean needApproval = projectPermissionService.needApproval(createExtInfo.getNeedApproval()); - boolean needApproval = false; - int approvalStatus = needApproval ? ProjectApproveStatus.CREATE_PENDING.getStatus() : - ProjectApproveStatus.APPROVED.getStatus(); - - //这一块bk-ci未具体实现 -// try { -// if (createExtInfo.getNeedAuth()) { -// AuthProjectCreateInfo authProjectCreateInfo = new AuthProjectCreateInfo(userId, accessToken, -// userDeptDetail, subjectScopes, projectCreateInfo, approvalStatus); -// // 注册项目到权限中心(bk-ci未具体实现,只是一个空方法) -// projectId = projectPermissionService.createResources( -// new ResourceRegisterInfo(projectCreateInfo.getEnglishName(), -// projectCreateInfo.getProjectName()), authProjectCreateInfo); -// } -// } catch (PermissionForbiddenException e) { -// throw e; -// } catch (Exception e) { -// logger.warn("Failed to create project in permission center: {} | {}", projectCreateInfo, e.getMessage()); -// throw new OperationException(I18nUtil.getCodeLanMessage(ProjectMessageCode.PEM_CREATE_FAIL)); -// } - if (StringUtils.isEmpty(projectId)) { - projectId = IdUtil.simpleUUID(); - } - try { - String subjectScopesStr = JsonUtils.toJsonString(subjectScopes); - String logoAddress = projectCreateInfo.getLogoAddress(); - - create(userId, logoAddress, projectCreateInfo, userDeptDetail, projectId, - projectChannelCode, approvalStatus, subjectScopesStr); - if (!needApproval) { - projectExtService.createExtProjectInfo(userId, projectId, accessToken, projectCreateInfo, - createExtInfo, logoAddress); - } - // 为项目分配数据源 -// shardingRoutingRuleAssignService.assignShardingRoutingRule(projectChannelCode, -// projectCreateInfo.getEnglishName(), Arrays.asList(SystemModuleEnum.PROCESS, SystemModuleEnum.METRICS)); - if (projectCreateInfo.isSecrecy()) { - redisTemplateUtils.set(ProjectConstants.SECRECY_PROJECT_REDIS_KEY, projectCreateInfo.getEnglishName()); - } - updateProjectRouterTag(projectCreateInfo.getEnglishName()); - } catch (Exception e) { - log.warn("Duplicate project: {}", projectCreateInfo, e); - if (createExtInfo.getNeedAuth()) { - // todo 待确定,切换v3-RBAC后,是否需要做其他操作 - -// deleteAuth(projectId, accessToken); - } - throw new ServiceException(-1000, "项目名或英文名重复"); - } catch (Throwable e) { - log.warn("Fail to create the project: {}", projectCreateInfo, e); - if (createExtInfo.getNeedAuth()) { -// deleteAuth(projectId, accessToken); - } - throw e; - } - return projectId; - } - - private void updateProjectRouterTag(String englishName) { - } - - private String getAllMembersName() { - //TODO -// return I18nUtil.getCodeLanMessage(ALL_MEMBERS_NAME); - return "allMembersName"; - } - - private UserDeptDetail getDeptInfo(Long userId) { - UserDeptDetail detail = new UserDeptDetail(); - detail.setUserId(userId); - detail.setBgId("1"); - detail.setCenterId("1"); - detail.setDeptId("1"); - - return detail; - } - - - public void validate(ProjectValidateType validateType, String name, String projectId) { -// if (StringUtils.isBlank(name)) { -// throw new ServiceException(-1000, "项目名称不能为空"); -// } -// if (validateType == ProjectValidateType.PROJECT_NAME) { -// if (name.isEmpty() || name.length() > ProjectConstants.NAME_MAX_LENGTH) { -// throw new ServiceException(-1000, "项目名至多1-64个字符"); -// } -// LambdaQueryWrapper wrapper = Wrappers.lambdaQuery() -// .eq(Project::getProjectName, name); -// if (StringUtils.isNotBlank(projectId)) { -// wrapper.ne(Project::getProjectId, projectId); -// } -// -// if (this.exist(wrapper)) { -// throw new ServiceException(-1000, "项目名或英文名重复"); -// } -// } else if (validateType == ProjectValidateType.ENGLISH_NAME) { -// if (name.length() < ProjectConstants.NAME_MIN_LENGTH || name.length() > ProjectConstants.NAME_MAX_LENGTH) { -// throw new ServiceException(-1000, "英文名长度在3-64个字符"); -// } -// if (!Pattern.matches(ENGLISH_NAME_PATTERN, name)) { -// log.warn("Project English Name({}) is not match", name); -// throw new ServiceException(-1000, "英文名是字符+数字组成,并以小写字母开头"); -// } -// -// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() -// .eq(Project::getEnglishName, name); -// if (StringUtils.isNotBlank(projectId)) { -// queryWrapper.ne(Project::getProjectId, projectId); -// } -// if (this.exist(queryWrapper)) { -// throw new ServiceException(-1000, "英文名已经存在"); -// } -// } - } - - public ProjectVO getByProjectId(String projectId) { - Project one = projectMapper.selectOne(Project::getProjectId, projectId, Project::getDeleted, BaseConstant.NOT_DELETED); - ProjectVO convert = Convert.convert(ProjectVO.class, one); - convert.setProjectCode(one.getEnglishName() == null ? "" : one.getEnglishName()); - convert.setGray("gray".equals(one.getRouterTag())); - convert.setChannelCode(one.getChannel()); - convert.setUpdator(one.getUpdater()); - convert.setCreatedAt(DateUtil.format(one.getCreateTime(), YYYY_MM_DD_HH_MM_SS)); - convert.setUpdatedAt(DateUtil.format(one.getUpdateTime(), YYYY_MM_DD_HH_MM_SS)); - convert.setApprovalTime(DateUtil.format(one.getApprovalTime(), YYYY_MM_DD_HH_MM_SS)); - convert.setProperties(JsonUtils.parseObject(one.getProperties(), ProjectProperties.class)); - convert.setSubjectScopes(JsonUtils.parseArray(one.getSubjectScopes(), SubjectScopeInfo.class)); - return convert; - } - - private void create(Long userId, String logoAddress, ProjectCreateInfo projectCreateInfo, UserDeptDetail userDeptDetail, - String projectId, ProjectChannelCode channelCode, Integer approvalStatus, String subjectScopesStr) { - Project project = Convert.convert(Project.class, projectCreateInfo); - project.setProjectId(projectId); - project.setCreator(userId.toString()); - project.setApprovalStatus(approvalStatus); - project.setLogoAddr(logoAddress == null ? "" : logoAddress); - project.setCreatorBgName(projectCreateInfo.getBgName()); - project.setCreatorDeptName(projectCreateInfo.getBgName()); - project.setCreatorCenterName(projectCreateInfo.getCenterName()); - project.setChannel(channelCode != null ? channelCode.name() : null); - project.setEnabled(true); - project.setProperties(projectCreateInfo.getProperties() != null ? JsonUtils.toJsonString(projectCreateInfo.getProperties()) : null); - project.setSubjectScopes(subjectScopesStr); - project.setAuthSecrecy(projectCreateInfo.getAuthSecrecy() == null ? ProjectAuthSecrecyStatus.PUBLIC.getValue() : projectCreateInfo.getAuthSecrecy()); - projectMapper.insert(project); - } -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ServiceAllocIdResourceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ServiceAllocIdResourceImpl.java deleted file mode 100644 index df9a8905..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ServiceAllocIdResourceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.project.service.impl; - - - -import cd.casic.ci.project.service.ServiceAllocIdResource; -import cd.casic.framework.redis.core.RedisTemplateUtils; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -@Service -public class ServiceAllocIdResourceImpl implements ServiceAllocIdResource { - RedisTemplateUtils redisTemplateUtils; - - @Override - public Long generateSegmentId(String bizTag) { - return redisTemplateUtils.incr(bizTag,1); - } - - @Override - public List batchGenerateSegmentId(String bizTag, Integer number) { - List idList = new ArrayList<>(number); - // 可以改成批处理 - for (int i = 0; i < number; i++) { - long incr = redisTemplateUtils.incr(bizTag, 1); - idList.add(incr); - } - return idList; - } -} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/UserProjectResourceServiceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/UserProjectResourceServiceImpl.java deleted file mode 100644 index 410c725f..00000000 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/UserProjectResourceServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.project.service.impl; - - -import cd.casic.ci.project.dal.dao.ProjectMapper; -import cd.casic.ci.project.dal.pojo.ProjectCreateExtInfo; -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import cd.casic.ci.project.enums.ProjectChannelCode; -import cd.casic.ci.project.service.UserProjectResourceService; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - - -@Service("userProjectResourceService") -public class UserProjectResourceServiceImpl implements UserProjectResourceService { - - @Resource - private ProjectMapper projectService; - - @Override - @Transactional(rollbackFor = Throwable.class) - public boolean create(Long userId, ProjectCreateInfo projectCreateInfo, String accessToken) { - - ProjectCreateExtInfo projectCreateExtInfo = new ProjectCreateExtInfo(true, true, true); - projectService.create(userId, projectCreateInfo, accessToken, projectCreateExtInfo, - null, ProjectChannelCode.BS); - - return true; - } -} diff --git a/modules/module-ci-quality/pom.xml b/modules/module-ci-quality/pom.xml deleted file mode 100644 index 192a30a3..00000000 --- a/modules/module-ci-quality/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-quality - - ${revision} - - - - cd.casic.boot - module-ci-common-pipeline - - - - \ No newline at end of file diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/api/ServiceQualityRuleResource.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/api/ServiceQualityRuleResource.java deleted file mode 100644 index ab7d85b1..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/api/ServiceQualityRuleResource.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.api; - -import cd.casic.ci.dal.pojo.RuleCheckResult; -import cd.casic.ci.dal.v3.request.BuildCheckParamsV3; -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author by mianbin - * @Classname ServiceQualityRuleResource - * @Date 2025/3/20 20:01 - */ -@RestController -@Tag(name = "质量红线-规则v3") -@RequestMapping("/service/rules/v3") -public class ServiceQualityRuleResource { - // TODO 待完善 - @Operation(summary = "检查是否通过控制点") - @PostMapping("/check") - public CommonResult check(@Parameter(description = "构建检查参数", required = true) - @RequestParam - BuildCheckParamsV3 buildCheckParams) { - return null; - } -} diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/constants/QualityConstants.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/constants/QualityConstants.java deleted file mode 100644 index 1c8908f7..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/constants/QualityConstants.java +++ /dev/null @@ -1,67 +0,0 @@ -package cd.casic.ci.constants; - -/** - * @author by mianbin - * @Classname QualityConstants - * @Date 2025/3/20 19:58 - */ -public class QualityConstants { - public static final String QUALITY_RULE_TEMPLATE_NAME_KEY = "quality.ruleTemplate.%s.name"; // $s == ID - public static final String QUALITY_RULE_TEMPLATE_DESC_KEY = "quality.ruleTemplate.%s.desc"; // $s == ID - public static final String QUALITY_RULE_TEMPLATE_STAGE_KEY = "quality.ruleTemplate.%s.stage"; // $s == ID - public static final String QUALITY_CONTROL_POINT_NAME_KEY = "quality.controlPoint.%s.name"; // $s == elementType - public static final String QUALITY_CONTROL_POINT_STAGE_KEY = "quality.controlPoint.%s.stage"; // $s == elementType - public static final String QUALITY_METADATA_DATA_NAME_KEY = "quality.metadata.%s.dataName"; // $s == ID - public static final String QUALITY_METADATA_DATA_ELEMENT_NAME_KEY = "quality.metadata.%s.elementName"; // $s == ID - public static final String QUALITY_METADATA_DATA_DESC_KEY = "quality.metadata.%s.desc"; // $s == ID - public static final String QUALITY_INDICATOR_ELEMENT_NAME_KEY = "quality.indicator.%s.elementName"; // $s == ID - public static final String QUALITY_INDICATOR_NAME_KEY = "quality.indicator.%s.name"; // $s == ID - public static final String QUALITY_INDICATOR_DESC_KEY = "quality.indicator.%s.desc"; // $s == ID - public static final String BK_BEFORE_POSITION = "bkBeforePosition"; // 准入-满足条件才能执行控制点 - public static final String BK_AFTER_POSITION = "bkAfterPosition"; // 准出-满足条件才能执行后续插件 - public static final String BK_PROJECT_UNDER_NO_QUALITY_USER_GROUP = "bkProjectUnderNoQualityUserGroup"; // 项目下无Quality用户组 - public static final String BK_PASSED = "bkPassed"; // 已通过: - public static final String BK_BLOCKED = "bkBlocked"; // 已拦截: - public static final String BK_CURRENT_VALUE = "bkCurrentValue"; // {0}当前值({1}),期望{2} - public static final String BK_VALIDATION_PASSED = "bkValidationPassed"; // {0}(#{1})在{2}验证通过 - public static final String BK_VALIDATION_INTERCEPTED = "bkValidationIntercepted"; // {0}(#{1})在{2}验证被拦截 - public static final String BK_INTERCEPTION_RULES = "bkInterceptionRules"; // 拦截规则 - public static final String BK_INTERCEPTION_METRICS = "bkInterceptionMetrics"; // 拦截指标 - public static final String BK_BUILD_INTERCEPTED_TO_BE_REVIEWED = "bkBuildInterceptedToBeReviewed"; // {0}({1})被拦截,待审核(审核人{2}) - public static final String BK_BUILD_INTERCEPTED_TERMINATED = "bkBuildInterceptedTerminated"; // {0}(#{1})被拦截,已终止 - public static final String BK_NO_TOOL_OR_RULE_ENABLED = "bkNoToolOrRuleEnabled"; // 你可能并未添加工具或打开相应规则。 - // 用户没有拦截规则{0}权限 - public static final String BK_USER_NO_OPERATE_INTERCEPT_RULE_PERMISSION = "bkUserNoOperateInterceptRulePermission"; - public static final String BK_CREATE_SUCCESS = "bkCreateSuccess"; // 创建成功 - public static final String BK_CREATE_FAIL = "bkCreateFail"; // 未知的异常,创建失败 - public static final String BK_UPDATE_FAIL = "bkUpdateFail"; // 未知的异常,更新失败 - public static final String BK_METRIC_DATA_UPDATE_SUCCESS = "bkMetricDataUpdateSuccess"; // 更新指标数据成功 - public static final String BK_TOOL_DESC_STANDARD = "bkToolDescStandard"; // 代码规范 - public static final String BK_TOOL_DESC_DEFECT = "bkToolDescDefect"; // 代码缺陷 - public static final String BK_TOOL_DESC_SECURITY = "bkToolDescSecurity"; // 安全漏洞 - public static final String BK_TOOL_DESC_RIPS = "bkToolDescRips"; // 啄木鸟漏洞扫描 - public static final String BK_TOOL_DESC_SENSITIVE = "bkToolDescSensitive"; // 敏感信息 - public static final String BK_TOOL_DESC_WOODPECKER_SENSITIVE = "bkToolDescWoodpeckerSensitive"; // 啄木鸟敏感信息 - public static final String BK_TOOL_DESC_CCN = "bkToolDescCcn"; // 圈复杂度 - public static final String BK_TOOL_DESC_DUPC = "bkToolDescDupc"; // 重复率 - public static final String BK_TOOL_NAME_STANDARD = "bkToolNameStandard"; // 按维度(推荐) - public static final String BK_TOOL_NAME_DEFECT = "bkToolNameDefect"; // 按维度(推荐) - public static final String BK_TOOL_NAME_SECURITY = "bkToolNameSecurity"; // 按维度(推荐) - public static final String BK_TOOL_NAME_CCN = "bkToolNameCcn"; // 通过计算函数的节点个数来衡量代码复杂性 - public static final String BK_TOOL_NAME_DUPC = "bkToolNameDupc"; // 可以检测项目中复制粘贴和重复开发相同功能等问题 - public static final String BK_TOOL_NAME_COVERITY = "bkToolNameCoverity"; // 斯坦福大学科学家研究成果,静态源代码分析领域的领导者 - public static final String BK_TOOL_NAME_KLOCWORK = "bkToolNameKlocwork"; // 业界广泛使用的商用代码检查工具,与Coverity互补 - public static final String BK_TOOL_NAME_CPPLINT = "bkToolNameCpplint"; // 谷歌开源的C++代码风格检查工具 - public static final String BK_TOOL_NAME_ESLINT = "bkToolNameEslint"; // JavaScript代码检查工具 - public static final String BK_TOOL_NAME_PYLINT = "bkToolNamePylint"; // Python代码风格检查工具 - public static final String BK_TOOL_NAME_GOML = "bkToolNameGoml"; // Golang静态代码分析工具 - public static final String BK_TOOL_NAME_CHECKSTYLE = "bkToolNameCheckstyle"; // Java代码风格检查工具 - public static final String BK_TOOL_NAME_STYLECOP = "bkToolNameStylecop"; // 微软开源的C#静态代码分析工具 - public static final String BK_TOOL_NAME_DETEKT = "bkToolNameDetekt"; // Kotlin静态代码分析工具 - public static final String BK_TOOL_NAME_PHPCS = "bkToolNamePhpcs"; // PHP代码风格检查工具 - public static final String BK_TOOL_NAME_SENSITIVE = "bkToolNameSensitive"; // 可扫描代码中有安全风险的敏感信息 - public static final String BK_TOOL_NAME_OCCHECK = "bkToolNameOccheck"; // OC代码风格检查工具 - public static final String BK_TOOL_NAME_WOODPECKER_SENSITIVE = "bkToolNameWoodpeckerSensitive"; // 敏感信息检查工具 - public static final String BK_TOOL_NAME_BKCHECK_CPP = "bkToolNameBkcheckCpp"; // C++代码风格检查工具 - public static final String BK_TOOL_NAME_BKCHECK_OC = "bkToolNameBkcheckOc"; // OC代码风格检查工具 -} diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/package-info.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/package-info.java deleted file mode 100644 index 04542bc0..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @Classname package-info - * @Description TODO - * @Date 2025/3/20 19:59 - * @author by mianbin - */ -package cd.casic.ci.dal; \ No newline at end of file diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/pojo/RuleCheckResult.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/pojo/RuleCheckResult.java deleted file mode 100644 index 329b8a99..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/pojo/RuleCheckResult.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.dal.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - - -@Data -@Schema(description = "质量红线-拦截检测结果") -public class RuleCheckResult { - - @Schema(description = "是否通过", requiredMode = Schema.RequiredMode.REQUIRED) - private Boolean success; - @Schema(description = "失败后是否结束", requiredMode = Schema.RequiredMode.REQUIRED) - private Boolean failEnd; - @Schema(description = "审核超时时间", requiredMode = Schema.RequiredMode.REQUIRED) - private Long auditTimeoutSeconds; - @Schema(description = "第几次检查", requiredMode = Schema.RequiredMode.REQUIRED) - private Integer checkTimes; - @Schema(description = "失败信息", requiredMode = Schema.RequiredMode.REQUIRED) - private List resultList; -} diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/pojo/RuleCheckSingleResult.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/pojo/RuleCheckSingleResult.java deleted file mode 100644 index 48864812..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/pojo/RuleCheckSingleResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.dal.pojo; - -import io.swagger.v3.oas.annotations.media.Schema; -import org.apache.commons.lang3.tuple.Triple; - -import java.util.List; - -@Schema(description = "质量红线-单条规则拦截结果") -public class RuleCheckSingleResult { - - private String name; - - private List> messagePairs; -} diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v2/ControlPointPosition.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v2/ControlPointPosition.java deleted file mode 100644 index e8b7a64a..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v2/ControlPointPosition.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.dal.v2; - -import cd.casic.ci.constants.QualityConstants; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author by mianbin - * @Classname ControlPointPosition - * @Date 2025/3/20 19:59 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class ControlPointPosition { - private String name; - private String code; - - public static final String BEFORE_POSITION = "BEFORE"; - public static final String AFTER_POSITION = "AFTER"; - - private static Map POSITION_NAME_MAP = new HashMap<>(); - - static { - POSITION_NAME_MAP.put(BEFORE_POSITION, QualityConstants.BK_BEFORE_POSITION); - POSITION_NAME_MAP.put(AFTER_POSITION, QualityConstants.BK_AFTER_POSITION); - } - - public static ControlPointPosition create(String code) { - String name = POSITION_NAME_MAP.get(code); - return new ControlPointPosition(code, name); - } -} diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v3/package-info.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v3/package-info.java deleted file mode 100644 index d068a13d..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v3/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @Classname package-info - * @Description TODO - * @Date 2025/3/20 20:00 - * @author by mianbin - */ -package cd.casic.ci.dal.v3; \ No newline at end of file diff --git a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v3/request/BuildCheckParamsV3.java b/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v3/request/BuildCheckParamsV3.java deleted file mode 100644 index 7d1a3a8e..00000000 --- a/modules/module-ci-quality/src/main/java/cd/casic/ci/dal/v3/request/BuildCheckParamsV3.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.dal.v3.request; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Map; -import java.util.Set; - -/** - * @author by mianbin - * @Classname BuildCheckParamsV3 - * @Date 2025/3/20 20:00 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Schema(description = "构建参数检查") -public class BuildCheckParamsV3 { - - private String projectId; - - private String pipelineId; - - private String buildId; - - private String position; - - private String templateId; - - private String interceptName; - - private Set ruleBuildIds; - - private String stageId; - - private Map runtimeVariable; -} diff --git a/modules/module-ci-repository/pom.xml b/modules/module-ci-repository/pom.xml deleted file mode 100644 index 7989288c..00000000 --- a/modules/module-ci-repository/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-repository - - ${revision} - - - - cd.casic.boot - module-ci-common-pipeline - - - - cd.casic.boot - spring-boot-starter-mybatis - - - - cd.casic.boot - spring-boot-starter-redis - - - - org.hashids - hashids - 1.0.3 - - - - \ No newline at end of file diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceGithubResource.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceGithubResource.java deleted file mode 100644 index e0970d15..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceGithubResource.java +++ /dev/null @@ -1,59 +0,0 @@ -package cd.casic.ci.log.scm.api; - - -import cd.casic.ci.log.scm.dal.pojo.github.GithubBranch; -import cd.casic.ci.log.scm.dal.pojo.github.GithubTag; -import cd.casic.ci.log.scm.dal.pojo.github.GithubToken; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.enums.GitHubTokenType; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@Tag(name = "服务-github相关") -@RequestMapping("/service/github") -public interface ServiceGithubResource { - - @Operation(summary = "获取github代码库accessToken") - @GetMapping("/accessToken") - CommonResult getAccessToken( - @Parameter(name = "userId", description = "用户ID", required = true) - @RequestParam(name = "userId") - String userId, - @Parameter(description = "token 类型", required = false) - @RequestParam(name = "tokenType",defaultValue = "GITHUB_APP") - GitHubTokenType gitHubTokenType - ); - - @Operation(summary = "获取github指定分支") - @GetMapping("/getGithubBranch") - CommonResult getGithubBranch( - @Parameter(name = "accessToken", required = true) - @RequestParam(name = "accessToken") - String accessToken, - @Parameter(name = "projectName", required = true) - @RequestParam(name = "projectName") - String projectName, - @Parameter(name = "branch", required = false) - @RequestParam(name = "branch") - String branch); - - @Operation(summary = "获取github指定tag") - @GetMapping("/getGithubTag") - CommonResult getGithubTag( - @Parameter(name = "accessToken", required = true) - @RequestParam(name = "accessToken") - String accessToken, - @Parameter(name = "projectName", required = true) - @RequestParam(name = "projectName") - String projectName, - @Parameter(name = "tag", required = true) - @RequestParam(name = "tag") - String tag - ); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceGithubResourceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceGithubResourceImpl.java deleted file mode 100644 index 4522c986..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceGithubResourceImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -package cd.casic.ci.log.scm.api; - - -import cd.casic.ci.log.scm.dal.pojo.github.GithubBranch; -import cd.casic.ci.log.scm.dal.pojo.github.GithubTag; -import cd.casic.ci.log.scm.dal.pojo.github.GithubToken; -import cd.casic.ci.log.scm.service.github.GithubTokenService; -import cd.casic.ci.log.scm.service.github.IGithubService; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.enums.GitHubTokenType; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.RestController; - - -/** - * @author liubin - * @date 2023/10/13 15:48 - * @description - */ -@RestController -public class ServiceGithubResourceImpl implements ServiceGithubResource{ - - @Resource - private GithubTokenService githubTokenService; - - @Resource - private IGithubService githubService; - - @Override - public CommonResult getAccessToken(String userId, GitHubTokenType tokenType) { - return CommonResult.success(githubTokenService.getAccessToken(userId, tokenType != null ? tokenType : GitHubTokenType.GITHUB_APP)); - } - - @Override - public CommonResult getGithubBranch(String accessToken, String projectName, String branch) { - return CommonResult.success(githubService.getBranch(accessToken, projectName, branch)); - } - - @Override - public CommonResult getGithubTag(String accessToken, String projectName, String tag) { - return CommonResult.success(githubService.getTag(accessToken, projectName, tag)); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceOauthResource.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceOauthResource.java deleted file mode 100644 index 423c9402..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceOauthResource.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.ci.log.scm.api; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -@Tag(name = "服务-oauth相关") -@RequestMapping("/service/oauth") -public interface ServiceOauthResource { - - @Operation(summary = "获取git代码库accessToken信息") - @GetMapping("/git/{userId}") - CommonResult gitGet( - @Parameter(description = "用户ID", required = true) - @PathVariable String userId); - - @Operation(summary = "获取tgit代码库accessToken信息") - @GetMapping("/tgit/{userId}") - CommonResult tGitGet( - @Parameter(description = "用户ID", required = true) - @PathVariable String userId); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceOauthResourceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceOauthResourceImpl.java deleted file mode 100644 index 765c2a5f..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceOauthResourceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.log.scm.api; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import cd.casic.ci.log.scm.service.IGitOauthService; -import cd.casic.ci.log.scm.service.tgit.TGitOauthService; -import cd.casic.framework.commons.pojo.CommonResult; -import jakarta.annotation.Resource; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ServiceOauthResourceImpl implements ServiceOauthResource { - - @Resource - private IGitOauthService gitOauthService; - - @Resource - private TGitOauthService tGitOauthService; - - @Override - public CommonResult gitGet(String userId) { - return CommonResult.success(gitOauthService.getAccessToken(userId)); - } - - @Override - public CommonResult tGitGet(String userId) { - return CommonResult.success(tGitOauthService.getAccessToken(userId)); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceRepositoryResource.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceRepositoryResource.java deleted file mode 100644 index ac122e2c..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceRepositoryResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.log.scm.api; - - -import cd.casic.ci.log.scm.dal.pojo.Repository; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.enums.RepositoryType; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@Tag(name = "服务-代码库资源") -@RequestMapping("/service/repositories") -public interface ServiceRepositoryResource { - - @Operation(summary = "获取git代码库详情") - @GetMapping("/{projectId}/{repositoryId}") - CommonResult get( - @Parameter(description = "用户ID", required = true) - @PathVariable - String projectId, - @Parameter(description = "代码库哈希ID或代码库名称", required = true) - @PathVariable - String repositoryId, - @Parameter(description = "代码库请求类型", required = true) - RepositoryType repositoryType - ); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceRepositoryResourceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceRepositoryResourceImpl.java deleted file mode 100644 index 6e9fbcba..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/ServiceRepositoryResourceImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.log.scm.api; - - -import cd.casic.ci.log.scm.dal.pojo.Repository; -import cd.casic.ci.log.scm.enums.RepositoryType; -import cd.casic.ci.log.scm.service.impl.RepositoryServiceImpl; -import cd.casic.framework.commons.exception.ServiceException; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.utils.RepositoryConfigUtils; -import jakarta.annotation.Resource; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.RestController; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - - -@RestController -public class ServiceRepositoryResourceImpl implements ServiceRepositoryResource { - - @Resource - private RepositoryServiceImpl repositoryService; - - @Override - public CommonResult get(String projectId, String repositoryId, RepositoryType repositoryType) { - if (StringUtils.isBlank(projectId)) { - throw new ServiceException(-1000, "Invalid projectId"); - } - if (StringUtils.isBlank(repositoryId)) { - throw new ServiceException(-1000, "Invalid repositoryHashId"); - } - try { - return CommonResult.success(repositoryService.serviceGet(projectId, RepositoryConfigUtils.buildConfig(URLDecoder.decode(repositoryId, "UTF-8"), repositoryType))); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - return CommonResult.error(-1000, "not found"); - } - -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmOauthResource.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmOauthResource.java deleted file mode 100644 index eeb1b2d0..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmOauthResource.java +++ /dev/null @@ -1,92 +0,0 @@ -package cd.casic.ci.log.scm.api.scm; - - -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.enums.ScmType; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@Tag(name = "Service Code Svn resource") -@RequestMapping("/service/scm/oauth") -public interface ServiceScmOauthResource { - - - @Operation(description = "Get the repo latest revision") - @PostMapping("/latestRevision") - @Parameters({ - @Parameter(name = "projectName", description = "项目名称", required = true), - @Parameter(name = "url", description = "仓库地址", required = true), - @Parameter(name = "type", description = "仓库类型", required = true), - @Parameter(name = "branchName", description = "branch name", required = false), - @Parameter(name = "additionalPath", description = "SVN additional path", required = false), - @Parameter(name = "privateKey", description = "privateKey", required = false), - @Parameter(name = "passPhrase", description = "passPhrase", required = false), - @Parameter(name = "token", description = "token", required = false), - @Parameter(name = "region", description = "仓库区域前缀(只有svn用到)", required = false), - @Parameter(name = "userName", description = "仓库对应的用户名", required = false) - }) - CommonResult getLatestRevision( - @RequestParam - String projectName, - @RequestParam - String url, - @RequestParam - ScmType type, - @RequestParam - String branchName, - @RequestParam - String additionalPath, - @RequestParam - String privateKey, - @RequestParam - String passPhrase, - @RequestParam - String token, - @RequestParam - CodeSvnRegion region, - @RequestParam - String userName - ); - - @PostMapping("/addWebhook") - @Parameters({ - @Parameter(name = "projectName", description = "项目名称", required = true), - @Parameter(name = "url", description = "仓库地址", required = true), - @Parameter(name = "type", description = "仓库类型", required = true), - @Parameter(name = "privateKey", description = "privateKey", required = true), - @Parameter(name = "passPhrase", description = "passPhrase", required = false), - @Parameter(name = "token", description = "token", required = false), - @Parameter(name = "region", description = "仓库区域前缀(只有svn用到)", required = false), - @Parameter(name = "userName", description = "仓库对应的用户名", required = true), - @Parameter(name = "event", description = "事件类型", required = false) - }) - CommonResult addWebhook( - @RequestParam - String projectName, - @RequestParam - String url, - @RequestParam - ScmType type, - @RequestParam - String privateKey, - @RequestParam - String passPhrase, - @RequestParam - String token, - @RequestParam - CodeSvnRegion region, - @RequestParam - String userName, - @RequestParam - String event - ); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmOauthResourceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmOauthResourceImpl.java deleted file mode 100644 index c12334ac..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmOauthResourceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.log.scm.api.scm; - - -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.enums.ScmType; -import cd.casic.ci.log.scm.service.scm.IScmOauthService; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -@Slf4j -public class ServiceScmOauthResourceImpl implements ServiceScmOauthResource{ - - @Resource - private IScmOauthService scmOauthService; - - @Override - public CommonResult getLatestRevision(String projectName, String url, ScmType type, String branchName, String additionalPath, String privateKey, String passPhrase, String token, CodeSvnRegion region, String userName) { - log.info("getLatestRevision|(projectName={}, url={}, type={}, branch={}, " + - "additionalPath={}, region={}, username={}", projectName, url, type, branchName, additionalPath, region, userName); - return CommonResult.success(scmOauthService.getLatestRevision( - projectName, url, type, branchName, privateKey, - passPhrase, token, region, userName)); - } - - @Override - public CommonResult addWebhook(String projectName, String url, ScmType type, String privateKey, String passPhrase, String token, CodeSvnRegion region, String userName, String event) { - log.info("addWebHook|(projectName={}, url={}, type={}, username={}, event={})", projectName, url, type, userName, event); - scmOauthService.addWebhook(projectName, url, type, privateKey, passPhrase, token, region, userName, event); - return CommonResult.success(true); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmResource.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmResource.java deleted file mode 100644 index 79700a9d..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmResource.java +++ /dev/null @@ -1,92 +0,0 @@ -package cd.casic.ci.log.scm.api.scm; - -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.enums.ScmType; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - - -@RestController -@Tag(name = "仓库分支、tag、hook相关") -@RequestMapping("/service/scm") -public interface ServiceScmResource { - - @Operation(summary = "Get the repo latest revision") - @GetMapping("/latestRevision") - @Parameters({ - @Parameter(name = "projectName", description = "项目名称", required = true), - @Parameter(name = "url", description = "仓库地址", required = true), - @Parameter(name = "type", description = "仓库类型", required = true), - @Parameter(name = "branchName", description = "branch name", required = false), - @Parameter(name = "additionalPath", description = "SVN additional path", required = false), - @Parameter(name = "privateKey", description = "privateKey", required = false), - @Parameter(name = "passPhrase", description = "passPhrase", required = false), - @Parameter(name = "token", description = "token", required = false), - @Parameter(name = "region", description = "仓库区域前缀(只有svn用到)", required = false), - @Parameter(name = "userName", description = "仓库对应的用户名", required = true) - }) - CommonResult getLatestRevision( - @RequestParam - String projectName, - @RequestParam - String url, - @RequestParam - ScmType type, - @RequestParam - String branchName, - @RequestParam - String additionalPath, - @RequestParam - String privateKey, - @RequestParam - String passPhrase, - @RequestParam - String token, - @RequestParam - CodeSvnRegion region, - @RequestParam - String userName - ); - - @Operation(summary = "添加Git或者Gitlab WEB hook") - @PostMapping("/addWebhook") - @Parameters({ - @Parameter(name = "projectName", description = "项目名称", required = true), - @Parameter(name = "url", description = "仓库地址", required = true), - @Parameter(name = "type", description = "仓库类型", required = true), - @Parameter(name = "privateKey", description = "privateKey", required = true), - @Parameter(name = "passPhrase", description = "passPhrase", required = false), - @Parameter(name = "token", description = "token", required = true), - @Parameter(name = "region", description = "仓库区域前缀(只有svn用到)", required = false), - @Parameter(name = "userName", description = "仓库对应的用户名", required = true), - @Parameter(name = "event", description = "事件类型", required = false), - @Parameter(name = "hookUrl", description = "回调Url", required = false) - }) - CommonResult addWebhook( - @RequestParam - String projectName, - @RequestParam - String url, - @RequestParam - ScmType type, - @RequestParam - String privateKey, - @RequestParam - String passPhrase, - @RequestParam - String token, - @RequestParam - CodeSvnRegion region, - @RequestParam - String userName, - @RequestParam - String event, - @RequestParam - String hookUrl - ); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmResourceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmResourceImpl.java deleted file mode 100644 index 76001c15..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/api/scm/ServiceScmResourceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.log.scm.api.scm; - - -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.enums.ScmType; -import cd.casic.ci.log.scm.service.scm.IScmService; -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -@Slf4j -public class ServiceScmResourceImpl implements ServiceScmResource{ - - @Resource - private IScmService scmService; - - @Override - public CommonResult getLatestRevision(String projectName, String url, ScmType type, String branchName, String additionalPath, String privateKey, String passPhrase, String token, CodeSvnRegion region, String userName) { - log.info("getLatestRevision|{}|{}|{}|{}|{}|{}|username={}", projectName, url, type, branchName, additionalPath, region, userName); - return CommonResult.success(scmService.getLatestRevision(projectName, url, type, branchName, privateKey, passPhrase, token, region, userName)); - } - - @Override - public CommonResult addWebhook(String projectName, String url, ScmType type, String privateKey, String passPhrase, String token, CodeSvnRegion region, String userName, String event, String hookUrl) { - log.info("addWebhook|{}|{}|{}|{}|{}|{}|{}", projectName, url, type, userName, region, event, hookUrl); - scmService.addWebhook(projectName, url, type, privateKey, passPhrase, token, region, userName, event, hookUrl); - return CommonResult.success(true); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/GitConfig.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/GitConfig.java deleted file mode 100644 index 251fe28d..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/GitConfig.java +++ /dev/null @@ -1,73 +0,0 @@ -package cd.casic.ci.log.scm.config; - -import org.springframework.boot.autoconfigure.AutoConfigureOrder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; - -/** - * @author mianbin - * @description Git通用配置 - * @date 2024/10/18 14:45 - */ -@Configuration -@ConditionalOnWebApplication -@AutoConfigureOrder(value = Ordered.LOWEST_PRECEDENCE) -public class GitConfig { - - public final String gitlabUrl = ""; - - public final String gitlabApiUrl = ""; - - public final String gitlabHookUrl = ""; - - public final String gitUrl = ""; - - public final String gitApiUrl = ""; - - public final String clientId = ""; - - public final String clientSecret = ""; - - public final String redirectUrl = ""; - - public final String gitHookUrl = ""; - - public final String callbackUrl = ""; - - public final String hookLockToken = ""; - - public final String signSecret = ""; - - public final String githubClientId = ""; - - public final String oauthAppClientId = ""; - - public final String githubClientSecret = ""; - - public final String oauthAppClientSecret = ""; - - public final String githubWebhookUrl = ""; - - public final String githubCallbackUrl = ""; - - public final String githubRedirectUrl = ""; - - public final String githubAppUrl = ""; - - public final String tGitUrl = ""; - - public final String tGitApiUrl = ""; - - public final String tGitClientId = ""; - - public final String tGitClientSecret = ""; - - public final String tGitWebhookUrl = ""; - - public final String frontendSampleProjectUrl = ""; - - public final String tGitHookUrl = ""; - - public final String tGitHookSecret = ""; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/P4Config.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/P4Config.java deleted file mode 100644 index 4a80ac88..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/P4Config.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.log.scm.config; - -import org.springframework.boot.autoconfigure.AutoConfigureOrder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; - -/** - * @author mianbin - * @description P4配置 - * @date 2023/1/16 10:56 - */ -@Configuration -@ConditionalOnWebApplication -@AutoConfigureOrder(value = Ordered.LOWEST_PRECEDENCE) -public class P4Config { - - public String p4HookUrl = ""; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/SVNConfig.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/SVNConfig.java deleted file mode 100644 index 6c685cbb..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/config/SVNConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.ci.log.scm.config; - -import org.springframework.boot.autoconfigure.AutoConfigureOrder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; - -/** - * @author mianbin - * @description SVN通用配置 - * @date 2022/10/18 14:45 - */ -@Configuration -@ConditionalOnWebApplication -@AutoConfigureOrder(value = Ordered.LOWEST_PRECEDENCE) -public class SVNConfig { - - public final String apiUrl = ""; - - public final String apiKey = ""; - - public final String webhookApiUrl = ""; - - public final String svnHookUrl = ""; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryGitTokenMapper.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryGitTokenMapper.java deleted file mode 100644 index ca6f37be..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryGitTokenMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.log.scm.dal.dao; - -import cd.casic.ci.log.scm.dal.dto.RepositoryGitToken; -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; -import org.apache.ibatis.annotations.Mapper; - -/** - * @author by mianbin - * @Classname RepositoryGitTokenMapper - * @Date 2025/3/21 15:19 - */ -@Mapper -public interface RepositoryGitTokenMapper extends BaseMapperX { -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryGitlabTokenMapper.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryGitlabTokenMapper.java deleted file mode 100644 index a07937c6..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryGitlabTokenMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.log.scm.dal.dao; - -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; -import cd.casic.ci.log.scm.dal.dto.RepositoryGitlabToken; -import org.apache.ibatis.annotations.Mapper; - -/** - * @author by mianbin - * @Classname RepositoryGitlabTokenmapper - * @Description TODO - * @Date 2025/3/21 15:18 - */ -@Mapper -public interface RepositoryGitlabTokenMapper extends BaseMapperX { -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryRecordMapper.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryRecordMapper.java deleted file mode 100644 index 112b77bd..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryRecordMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.log.scm.dal.dao; - -import cd.casic.ci.log.scm.dal.dto.RepositoryRecord; -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; -import org.apache.ibatis.annotations.Mapper; - -/** - * @author by mianbin - * @Classname RepositoryRecordMapper - * @Date 2025/3/21 15:20 - */ -@Mapper -public interface RepositoryRecordMapper extends BaseMapperX { -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryTGitTokenMapper.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryTGitTokenMapper.java deleted file mode 100644 index ce210919..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dao/RepositoryTGitTokenMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.log.scm.dal.dao; - -import cd.casic.ci.log.scm.dal.dto.RepositoryTGitToken; -import cd.casic.framework.mybatis.core.mapper.BaseMapperX; - -/** - * @author by mianbin - * @Classname RepositoryTGitToken - * @Description TODO - * @Date 2025/3/21 15:20 - */ -public interface RepositoryTGitTokenMapper extends BaseMapperX { -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryGitToken.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryGitToken.java deleted file mode 100644 index f3ce602d..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryGitToken.java +++ /dev/null @@ -1,52 +0,0 @@ -package cd.casic.ci.log.scm.dal.dto; - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -/** - * @author mianbin - */ -@Data -@Accessors(chain = true) -@AllArgsConstructor -@NoArgsConstructor -@TableName(value = "repository_git_token", autoResultMap = true) -@EqualsAndHashCode(callSuper = true) -public class RepositoryGitToken extends BaseDO { - - /** - * 主键ID - */ - private Long id; - - /** - * 用户ID - */ - private String userId; - - /** - * 权限Token - */ - private String accessToken; - - /** - * 刷新Token - */ - private String refreshToken; - - /** - * token类型 - */ - private String tokenType; - - /** - * 过期时间 - */ - private Long expiresIn; - -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryGitlabToken.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryGitlabToken.java deleted file mode 100644 index 125bc848..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryGitlabToken.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.log.scm.dal.dto; - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - - -/** - * @author mianbin - */ -@Data -@Accessors(chain = true) -@AllArgsConstructor -@NoArgsConstructor -@TableName(value = "repository_git_token", autoResultMap = true) -@EqualsAndHashCode(callSuper = true) -public class RepositoryGitlabToken extends BaseDO { - private Long id; - - private String userId; - - private String accessToken; - - private String tokenType; - - private String scope; - - private String type; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryRecord.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryRecord.java deleted file mode 100644 index de867320..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryRecord.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.log.scm.dal.dto; - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - - -/** - * @author mianbin - */ -@Data -@Accessors(chain = true) -@AllArgsConstructor -@NoArgsConstructor -@TableName(value = "repository_record", autoResultMap = true) -@EqualsAndHashCode(callSuper = true) -public class RepositoryRecord extends BaseDO { - private Long id; - - private String projectId; - - private String userId; - - private String aliasName; - - private String url; - - private String type; - - private String repositoryHashId; - - public RepositoryRecord(String projectId, String userId, String aliasName, String url, String type, String repositoryHashId) { - this.projectId = projectId; - this.userId = userId; - this.aliasName = aliasName; - this.url = url; - this.type = type; - this.repositoryHashId = repositoryHashId; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryTGitToken.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryTGitToken.java deleted file mode 100644 index 8eccc9b8..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/dto/RepositoryTGitToken.java +++ /dev/null @@ -1,40 +0,0 @@ -package cd.casic.ci.log.scm.dal.dto; - -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author mianbin - */ -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class RepositoryTGitToken extends BaseDO { - - private Long id; - - private String userId; - - private String accessToken; - - private String refreshToken; - - private String tokenType; - - private Long expiresIn; - - private String oauthUserId; - - public RepositoryTGitToken(String userId, String accessToken, String refreshToken, String tokenType, Long expiresIn, String oauthUserId) { - this.userId = userId; - this.accessToken = accessToken; - this.refreshToken = refreshToken; - this.tokenType = tokenType; - this.expiresIn = expiresIn; - this.oauthUserId = oauthUserId; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeGitRepository.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeGitRepository.java deleted file mode 100644 index c75f8aaf..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeGitRepository.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - -import cd.casic.ci.log.scm.enums.RepoAuthType; -import cd.casic.ci.log.scm.utils.GitUtils; -import lombok.Data; - -@Data -public class CodeGitRepository extends Repository { - private RepoAuthType authType; - - private Long gitProjectId; - - public static final String CLASS_TYPE = "codeGit"; - - @Override - public String getStartPrefix() { - if (authType == RepoAuthType.SSH) { - return "git@"; - } else if (authType == RepoAuthType.OAUTH) { - return "http://"; - } else if (authType == RepoAuthType.HTTP) { - return "http://"; - } else if (authType == RepoAuthType.HTTPS) { - return "https://"; - } else { - return "git@"; - } - } - - @Override - public Boolean isLegal() { - if (authType == RepoAuthType.HTTP || authType == RepoAuthType.OAUTH || authType == RepoAuthType.HTTPS) { - return GitUtils.isLegalHttpUrl(url); - } else { - return GitUtils.isLegalSshUrl(url); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeGitlabRepository.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeGitlabRepository.java deleted file mode 100644 index 359dd5f7..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeGitlabRepository.java +++ /dev/null @@ -1,39 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - -import cd.casic.ci.log.scm.enums.RepoAuthType; -import cd.casic.ci.log.scm.utils.GitUtils; -import lombok.Data; - -@Data -public class CodeGitlabRepository extends Repository { - - private RepoAuthType authType; - - private Long gitProjectId; - - public static final String CLASS_TYPE = "codeGitLab"; - - @Override - public String getStartPrefix() { - if (authType == RepoAuthType.SSH) { - return "git@"; - } else if (authType == RepoAuthType.OAUTH) { - return "http://"; - } else if (authType == RepoAuthType.HTTP) { - return "http://"; - } else if (authType == RepoAuthType.HTTPS) { - return "https://"; - } else { - return "git@"; - } - } - - @Override - public Boolean isLegal() { - if (authType == RepoAuthType.HTTP || authType == RepoAuthType.OAUTH || authType == RepoAuthType.HTTPS) { - return GitUtils.isLegalHttpUrl(url); - } else { - return GitUtils.isLegalSshUrl(url); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeP4Repository.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeP4Repository.java deleted file mode 100644 index eb0d44c0..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeP4Repository.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - - -public class CodeP4Repository extends Repository { - - public static final String CLASS_TYPE = "codeP4"; - - @Override - public String getStartPrefix() { - return ""; - } - - @Override - public Boolean isLegal() { - return true; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeSvnRepository.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeSvnRepository.java deleted file mode 100644 index 044b7b7a..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeSvnRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import lombok.Data; - - -@Data -public class CodeSvnRepository extends Repository { - private CodeSvnRegion region; - - private String svnType; - - public static final String CLASS_TYPE = "codeSvn"; - public static final String SVN_TYPE_HTTP = "http"; - public static final String SVN_TYPE_SSH = "ssh"; - - @Override - public String getStartPrefix() { - return "svn+ssh://"; - } - - @Override - public Boolean isLegal() { - if (svnType.equals(SVN_TYPE_HTTP)) { - return url.startsWith("http://") || url.startsWith("https://") || url.startsWith("svn://"); - } - return url.startsWith(getStartPrefix()); - } - - @Override - public String getFormatURL() { - String fixUrl = url; - if (fixUrl.startsWith("svn+ssh://")) { - String[] split = fixUrl.split("://"); - if (split.length == 2) { - int index = split[1].indexOf("@"); - String suffix; - if (index >= 0) { - suffix = split[1].substring(index + 1); - } else { - suffix = split[1]; - } - fixUrl = split[0] + "://" + suffix; - } - } - return fixUrl; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeTGitRepository.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeTGitRepository.java deleted file mode 100644 index cbb2b4f3..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/CodeTGitRepository.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - - -import cd.casic.ci.log.scm.enums.RepoAuthType; -import cd.casic.ci.log.scm.utils.GitUtils; -import lombok.Data; - - -@Data -public class CodeTGitRepository extends Repository { - - private RepoAuthType authType; - - private Long gitProjectId; - - public static final String CLASS_TYPE = "codeTGit"; - - @Override - public String getStartPrefix() { - if (authType == RepoAuthType.SSH) { - return "git@"; - } else if (authType == RepoAuthType.OAUTH) { - return "http://"; - } else if (authType == RepoAuthType.HTTP) { - return "http://"; - } else if (authType == RepoAuthType.HTTPS) { - return "https://"; - } else { - return "git@"; - } - } - - @Override - public Boolean isLegal() { - if (authType == RepoAuthType.HTTP || authType == RepoAuthType.OAUTH || authType == RepoAuthType.HTTPS) { - return GitUtils.isLegalHttpUrl(url); - } else { - return GitUtils.isLegalSshUrl(url); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/Credential.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/Credential.java deleted file mode 100644 index 932314f6..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/Credential.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class Credential { - - private String username; - - private String privateKey; // password or private key - - private String passPhrase; // passphrase for ssh private key -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/GithubRepository.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/GithubRepository.java deleted file mode 100644 index 7f3b6623..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/GithubRepository.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - - -/** - * @author mianbin - * @Classname GithubRepository - * @Description github 在线测试 - * @Date 2022/10/18 14:45 - */ -public class GithubRepository extends Repository { - - public static final String CLASS_TYPE = "github"; - - @Override - public String getStartPrefix() { - return "https://github.com/"; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/IScm.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/IScm.java deleted file mode 100644 index f88057ec..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/IScm.java +++ /dev/null @@ -1,10 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - - - -public interface IScm { - - RevisionInfo getLatestRevision(); - - void addWebhook(String hookUrl); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/Repository.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/Repository.java deleted file mode 100644 index ef445cf1..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/Repository.java +++ /dev/null @@ -1,43 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = CodeSvnRepository.class, name = CodeSvnRepository.CLASS_TYPE), - @JsonSubTypes.Type(value = CodeGitRepository.class, name = CodeGitRepository.CLASS_TYPE), - @JsonSubTypes.Type(value = CodeGitlabRepository.class, name = CodeGitlabRepository.CLASS_TYPE), - @JsonSubTypes.Type(value = GithubRepository.class, name = GithubRepository.CLASS_TYPE), - @JsonSubTypes.Type(value = CodeTGitRepository.class, name = CodeTGitRepository.CLASS_TYPE), - @JsonSubTypes.Type(value = CodeP4Repository.class, name = CodeP4Repository.CLASS_TYPE) -}) -@Schema(description = "代码库模型-多态基类") -public abstract class Repository { - protected String aliasName; - - protected String url; - - protected String credentialId; - - protected String projectName; - - protected String userName; - - protected String projectId; - - protected String repoHashId; - - public abstract String getStartPrefix(); - - public Boolean isLegal() { - return url.startsWith(getStartPrefix()); - } - - public String getFormatURL() { - return url; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/RevisionInfo.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/RevisionInfo.java deleted file mode 100644 index 5dbb4bf1..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/RevisionInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author mianbin - * @ClassName RevisionInfo - * @date 2023/1/16 10:56 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class RevisionInfo { - private String revision; - - private String updatedMessage; - - private String branchName; - - private String authorName; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/ScmFactory.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/ScmFactory.java deleted file mode 100644 index 4a686464..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/ScmFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - - -import cd.casic.ci.log.scm.dal.pojo.svn.*; -import cd.casic.framework.commons.util.spring.SpringUtils; -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.config.SVNConfig; -import cd.casic.ci.log.scm.dal.pojo.git.GitApi; -import cd.casic.ci.log.scm.enums.CodeGitWebhookEvent; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import cd.casic.ci.log.scm.enums.ScmType; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class ScmFactory { - - private static final GitApi gitApi = new GitApi(); - - public static IScm getScm(String projectName, String url, ScmType type, String branchName, String privateKey, String passPhrase, - String token, CodeSvnRegion region, String userName, String event) { - if (type == ScmType.CODE_SVN) { - if (userName == null) { - log.error("the svn username is null"); - //throw new ServiceException("the svn username is null"); - } - if (privateKey == null) { - log.error("The svn private key is null"); - //throw new ServiceException("The svn private key is null"); - } - SVNConfig svnConfig = SpringUtils.getBean(SVNConfig.class); - return new CodeSvnScmImpl(projectName, branchName, url, userName, privateKey, passPhrase, svnConfig); - } else if (type == ScmType.CODE_GIT) { - if (token == null) { - log.error("The git token is null"); - //throw new ServiceException("The git token is null"); - } - if (event != null && CodeGitWebhookEvent.find(event) == null) { - log.error("The git event is invalid"); - //throw new ServiceException("The git event is invalid"); - } - GitConfig gitConfig = SpringUtils.getBean(GitConfig.class); - return new CodeGitScmImpl(projectName, branchName, url, privateKey, passPhrase, token, gitConfig, gitApi, event); - } else if (type == ScmType.CODE_TGIT) { - if (token == null) { - log.error("The git token is null"); - //throw new ServiceException("The git token is null"); - } - if (event != null && CodeGitWebhookEvent.find(event) == null) { - log.error("The git event is invalid"); - //throw new ServiceException("The git event is invalid"); - } - GitConfig gitConfig = SpringUtils.getBean(GitConfig.class); - return new CodeTGitScmImpl(projectName, branchName, url, privateKey, passPhrase, token, gitConfig, gitApi, event); - } else if (type == ScmType.CODE_GITLAB) { - if (token == null) { - log.error("The gitlab access token is null"); - //throw new ServiceException("The gitlab access token is null"); - } - GitConfig gitConfig = SpringUtils.getBean(GitConfig.class); - return new CodeGitlabScmImpl(projectName, branchName, url, privateKey, passPhrase, token, gitConfig, event); - } else if (type == ScmType.CODE_P4) { - if (passPhrase == null) { - log.error("用户密码为空"); - //throw new ServiceException("用户密码为空"); - } - if (userName == null) { - log.error("用户名为空"); - //throw new ServiceException("用户名为空"); - } - return new CodeP4ScmImpl(projectName, branchName, url, userName, passPhrase, event); - } else { - log.error("Unknown repo(" + type + ")"); - //throw new ServiceException("Unknown repo(" + type + ")"); - } - return null; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/ScmOauthFactory.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/ScmOauthFactory.java deleted file mode 100644 index 9985d13a..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/ScmOauthFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo; - - -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.config.SVNConfig; -import cd.casic.ci.log.scm.dal.pojo.git.GitOauthApi; -import cd.casic.ci.log.scm.dal.pojo.svn.CodeGitScmImpl; -import cd.casic.ci.log.scm.dal.pojo.svn.CodeGitlabScmImpl; -import cd.casic.ci.log.scm.dal.pojo.svn.CodeSvnScmImpl; -import cd.casic.ci.log.scm.dal.pojo.svn.CodeTGitScmImpl; -import cd.casic.framework.commons.util.spring.SpringUtils; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import cd.casic.ci.log.scm.enums.ScmType; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -public class ScmOauthFactory { - - - private static final GitOauthApi gitOauthApi = new GitOauthApi(); - - public static IScm getScm(String projectName, String url, ScmType type, String branchName, String privateKey, - String passPhrase, String token, CodeSvnRegion region, String userName, String event) { - if (type == ScmType.CODE_SVN) { - if (userName == null) { - log.error("the svn username is null"); - //throw new ServiceException("the svn username is null"); - } - if (privateKey == null) { - log.error("The svn private key is null"); - //throw new ServiceException("The svn private key is null"); - } - SVNConfig svnConfig = SpringUtils.getBean(SVNConfig.class); - return new CodeSvnScmImpl(projectName, branchName, url, userName, privateKey, passPhrase, svnConfig); - } else if (type == ScmType.CODE_GIT) { - if (token == null) { - log.error("The git token is null"); - //throw new ServiceException("The git token is null"); - } - GitConfig gitConfig = SpringUtils.getBean(GitConfig.class); - return new CodeGitScmImpl(projectName, branchName, url, privateKey, passPhrase, token, gitConfig, gitOauthApi, event); - } else if (type == ScmType.CODE_TGIT) { - if (token == null) { - log.error("The git token is null"); - //throw new ServiceException("The git token is null"); - } - GitConfig gitConfig = SpringUtils.getBean(GitConfig.class); - return new CodeTGitScmImpl(projectName, branchName, url, privateKey, passPhrase, token, gitConfig, gitOauthApi, event); - } else if (type == ScmType.CODE_GITLAB) { - if (token == null) { - log.error("The gitlab access token is null"); - //throw new ServiceException("The gitlab access token is null"); - } - GitConfig gitConfig = SpringUtils.getBean(GitConfig.class); - return new CodeGitlabScmImpl(projectName, branchName, url, privateKey, passPhrase, token, gitConfig, event); - } else { - log.error("Unknown repo(" + type + ")"); - //throw new ServiceException("Unknown repo(" + type + ")"); - } - return null; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/enums/VisibilityLevelEnum.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/enums/VisibilityLevelEnum.java deleted file mode 100644 index d0c6e112..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/enums/VisibilityLevelEnum.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.enums; - -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public enum VisibilityLevelEnum { - PRIVATE(0), // 私有 - LOGIN_PUBLIC(10); // 登录用户开源 - private Integer level; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitApi.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitApi.java deleted file mode 100644 index 83739ad8..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitApi.java +++ /dev/null @@ -1,10 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.git; - -/** - * @author mianbin - * @Classname GitApi - * @Description TODO - * @Date 2023/1/16 10:56 - */ -public class GitApi { -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitOauthApi.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitOauthApi.java deleted file mode 100644 index 906eac4a..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitOauthApi.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.git; - -/** - * @author mianbin - * @date 2023/12/13 14:49 - * @Classname GitOauthApi - */ -public class GitOauthApi extends GitApi{ -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitUserInfo.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitUserInfo.java deleted file mode 100644 index da9bbac2..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/git/GitUserInfo.java +++ /dev/null @@ -1,29 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.git; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * @author mianbin - * @ClassName GitUserInfo - * @date 2023/1/16 10:56 - */ -@Schema(description = "git用户信息") -@Data -public class GitUserInfo { - - private Integer id; - - private String email; - - private String username; - - private String webUrl; - - private String name; - - private String state; - - private String avatarUrl; -} - diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubBranch.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubBranch.java deleted file mode 100644 index 9ec00805..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubBranch.java +++ /dev/null @@ -1,14 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.github; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - - -@Data -@Schema(description = "分支模型") -public class GithubBranch { - @Schema(description = "名称") - private String name; - @Schema(description = "提交") - private GithubCommit commit; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommit.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommit.java deleted file mode 100644 index c76160f6..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommit.java +++ /dev/null @@ -1,17 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.github; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -@Schema(description = "提交模型") -public class GithubCommit { - @Schema(description = "sha值") - private String sha; - - @Schema(description = "节点id", name = "node_id") - private String nodeId; - - @Schema(description = "提交内容") - private GithubCommitData commit; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommitAuthor.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommitAuthor.java deleted file mode 100644 index 5c916307..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommitAuthor.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.github; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -@Schema(description = "提交者模型") -public class GithubCommitAuthor { - - @Schema(description = "提交者名称") - private String name; - - @Schema(description = "提交时间") - private String date; - - @Schema(description = "提交者email") - private String email; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommitData.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommitData.java deleted file mode 100644 index 6702b539..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubCommitData.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.github; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -@Data -@Schema(description = "提交内容模型") -public class GithubCommitData { - - @Schema(description = "提交信息") - private String message; - - @Schema(description = "提交者信息") - private GithubCommitAuthor author; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubObject.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubObject.java deleted file mode 100644 index 6caa668e..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubObject.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.github; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - - -@Schema(description = "") -@Data -public class GithubObject { - - @Schema(description = "sha值") - private String sha; - - @Schema(description = "类型") - private String type; - - @Schema(description = "url地址") - private String url; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubTag.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubTag.java deleted file mode 100644 index f1a10ee8..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubTag.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.github; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - - -@Data -@Schema(description = "获取tag返回模型") -public class GithubTag { - - @Schema(description = "远程调用") - private String ref; - - @Schema(description = "节点id") - private String nodeId; - - @Schema(description = "url地址") - private String url; - - @Schema(description = "tag数据") - private GithubObject tagObject; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubToken.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubToken.java deleted file mode 100644 index cbb15ef1..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/github/GithubToken.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.github; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class GithubToken { - - @Schema(name = "access_token", description = "鉴权token") - private String accessToken; - - @Schema(name = "token_type", description = "token类型") - private String tokenType; - - @Schema(description = "范围") - private String scope; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/oauth/GitToken.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/oauth/GitToken.java deleted file mode 100644 index 9a9c721b..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/oauth/GitToken.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.oauth; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@Schema(description = "Token模型") -@NoArgsConstructor -@AllArgsConstructor -public class GitToken { - - @Schema(description = "鉴权token", name = "access_token") - @JsonProperty("access_token") - private String accessToken = ""; - - @Schema(description = "刷新token", name = "refresh_token") - @JsonProperty("refresh_token") - private String refreshToken = ""; - - @Schema(description = "token类型", name = "token_type") - @JsonProperty("token_type") - private String tokenType = ""; - - @Schema(description = "过期时间", name = "expires_in") - @JsonProperty("expires_in") - private Long expiresIn = 0L; - - @Schema(description = "创建时间") - private Long createTime = 0L; -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeGitScmImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeGitScmImpl.java deleted file mode 100644 index a7ae70cc..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeGitScmImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.svn; - - -import cd.casic.ci.log.scm.dal.pojo.IScm; -import cd.casic.ci.log.scm.dal.pojo.git.GitApi; -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CodeGitScmImpl implements IScm { - private String projectName; - - private String branchName; - - private String url; - - private String privateKey; - - private String passPhrase; - - private String token; - - private GitConfig gitConfig; - - private GitApi gitApi; - - private String event; - - @Override - public RevisionInfo getLatestRevision() { - return null; - } - - @Override - public void addWebhook(String hookUrl) { - - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeGitlabScmImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeGitlabScmImpl.java deleted file mode 100644 index 0b6ad0d3..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeGitlabScmImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.svn; - - -import cd.casic.ci.log.scm.dal.pojo.IScm; -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CodeGitlabScmImpl implements IScm { - private String projectName; - - private String branchName; - - private String url; - - private String privateKey; - - private String passPhrase; - - private String token; - - private GitConfig gitConfig; - - private String event; - - @Override - public RevisionInfo getLatestRevision() { - return null; - } - - @Override - public void addWebhook(String hookUrl) { - - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeP4ScmImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeP4ScmImpl.java deleted file mode 100644 index eb76e636..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeP4ScmImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.svn; - - -import cd.casic.ci.log.scm.dal.pojo.IScm; -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CodeP4ScmImpl implements IScm { - private String projectName; - - private String branchName; - - private String url; - - private String username; - - private String password; - - private String event; - - @Override - public RevisionInfo getLatestRevision() { - return null; - } - - @Override - public void addWebhook(String hookUrl) { - - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeSvnScmImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeSvnScmImpl.java deleted file mode 100644 index fa09e22e..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeSvnScmImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.svn; - -import cd.casic.ci.log.scm.dal.pojo.IScm; -import cd.casic.ci.log.scm.config.SVNConfig; -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CodeSvnScmImpl implements IScm { - private String projectName; - - private String branchName; - - private String url; - - private String username; - - private String privateKey; - - private String passPhrase; - - private SVNConfig svnConfig; - - @Override - public RevisionInfo getLatestRevision() { - return null; - } - - @Override - public void addWebhook(String hookUrl) { - - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeTGitScmImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeTGitScmImpl.java deleted file mode 100644 index dbfe3d36..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/dal/pojo/svn/CodeTGitScmImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package cd.casic.ci.log.scm.dal.pojo.svn; - - -import cd.casic.ci.log.scm.dal.pojo.IScm; -import cd.casic.ci.log.scm.dal.pojo.git.GitApi; -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class CodeTGitScmImpl implements IScm { - private String projectName; - - private String branchName; - - private String url; - - private String privateKey; - - private String passPhrase; - - private String token; - - private GitConfig gitConfig; - - private GitApi gitApi; - - private String event; - - @Override - public RevisionInfo getLatestRevision() { - return null; - } - - @Override - public void addWebhook(String hookUrl) { - - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/CodeGitWebhookEvent.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/CodeGitWebhookEvent.java deleted file mode 100644 index d47716d8..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/CodeGitWebhookEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -package cd.casic.ci.log.scm.enums; - - -/** - * @author mianbin - * @Classname CodeGitWebhookEvent - * @date 2025/3/18 14:45 - */ - -public enum CodeGitWebhookEvent { - PUSH_EVENTS("push_events"), - TAG_PUSH_EVENTS("tag_push_events"), - ISSUES_EVENTS("issues_events"), - MERGE_REQUESTS_EVENTS("merge_requests_events"), - NOTE_EVENTS("note_events"), - ENABLE_SSL_VERIFICATION("enable_ssl_verification"), - REVIEW_EVENTS("review_events"); - - private String value; - - CodeGitWebhookEvent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static CodeGitWebhookEvent find(String event) { - for (CodeGitWebhookEvent it : CodeGitWebhookEvent.values()) { - if (it.value.equals(event)) { - return it; - } - } - return null; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/CodeSvnRegion.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/CodeSvnRegion.java deleted file mode 100644 index 4a9e579e..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/CodeSvnRegion.java +++ /dev/null @@ -1,36 +0,0 @@ -package cd.casic.ci.log.scm.enums; - -import java.util.Arrays; -import java.util.Map; -import java.util.stream.Collectors; - - -public enum CodeSvnRegion { - TC("tc-svn"), - SH("sh-svn"), - BJ("bj-svn"), - GZ("gz-svn"), - CD("svn-cd1"), - GROUP("group-svn1.group"); - - private String prefix; - - CodeSvnRegion(String prefix){ - this.prefix = prefix; - } - - public String getPrefix() { - return prefix; - } - - private static final Map map = Arrays.stream(values()).collect(Collectors.toMap(CodeSvnRegion::getPrefix, Enum::toString)); - - public CodeSvnRegion getRegion(String value){ - for (CodeSvnRegion region : values()) { - if (value.startsWith(region.prefix)){ - return region; - } - } - return TC; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/GitHubTokenType.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/GitHubTokenType.java deleted file mode 100644 index a14eec0a..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/GitHubTokenType.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.log.scm.enums; - -import io.swagger.v3.oas.annotations.media.Schema; - -@Schema(description = "github token 类型") -public enum GitHubTokenType { - GITHUB_APP("ghu_"), - OAUTH_APP("gho_"); - - private String prefix; - - GitHubTokenType(String prefix){ - this.prefix = prefix; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepoAuthType.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepoAuthType.java deleted file mode 100644 index 74ff48ac..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepoAuthType.java +++ /dev/null @@ -1,22 +0,0 @@ -package cd.casic.ci.log.scm.enums; - - -public enum RepoAuthType { - SSH, - HTTP, - HTTPS, - OAUTH; - - public RepoAuthType parse(String type){ - switch (type){ - case "HTTP": - return HTTP; - case "HTTPS": - return HTTPS; - case "OAUTH": - return OAUTH; - default: - return SSH; - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryConfig.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryConfig.java deleted file mode 100644 index 7912a86b..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryConfig.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.ci.log.scm.enums; - -import cd.casic.framework.commons.exception.ErrorCode; -import cd.casic.framework.commons.exception.ServiceException; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.StringUtils; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; - -@AllArgsConstructor -@NoArgsConstructor -@Data -public class RepositoryConfig { - - private String repositoryHashId; - - private String repositoryName; - - private RepositoryType repositoryType; - - public String getRepositoryId() { - if (repositoryType == RepositoryType.ID) { - if (StringUtils.isEmpty(repositoryHashId)) { - throw new ServiceException(new ErrorCode(-1000, "代码库HashId为空")); - } else { - return repositoryHashId; - } - } else if (repositoryType == RepositoryType.NAME) { - if (StringUtils.isEmpty(repositoryName)) { - throw new ServiceException(new ErrorCode(-1000, "代码库名为空")); - } else { - return repositoryName; - } - } - return null; - } - - public String getURLEncodeRepositoryId() { - try { - return URLEncoder.encode(getRepositoryId(), "UTF-8"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - return null; - } - - @Override - public String toString() { - return "[repositoryHashId=" + repositoryHashId + ", repositoryName=" + repositoryName + ", repositoryType=" + repositoryType + "]"; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryType.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryType.java deleted file mode 100644 index 8749201f..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryType.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.log.scm.enums; - -import org.apache.commons.lang3.StringUtils; - - -public enum RepositoryType { - ID, - NAME; - - public static RepositoryType parseType(String type) { - if (StringUtils.isBlank(type) || StringUtils.isEmpty(type)) { - return ID; - } - return RepositoryType.valueOf(type); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryTypeNew.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryTypeNew.java deleted file mode 100644 index b99e1629..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RepositoryTypeNew.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.log.scm.enums; - -import org.apache.commons.lang3.StringUtils; - - -public enum RepositoryTypeNew { - ID, - NAME, - URL; - - public static RepositoryTypeNew parseType(String type) { - if (StringUtils.isBlank(type)) { - return ID; - } - - return valueOf(type); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RequestChannelTypeEnum.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RequestChannelTypeEnum.java deleted file mode 100644 index 13c0ac40..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/RequestChannelTypeEnum.java +++ /dev/null @@ -1,10 +0,0 @@ -package cd.casic.ci.log.scm.enums; - - -public enum RequestChannelTypeEnum { - USER, - SERVICE, - BUILD, - OP, - OPEN -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/ScmType.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/ScmType.java deleted file mode 100644 index 66d601ec..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/ScmType.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.ci.log.scm.enums; - - -public enum ScmType { - CODE_SVN, - CODE_GIT, - CODE_GITLAB, - GITHUB, - CODE_TGIT, - CODE_P4; - - public static Short parse(ScmType type) { - switch (type) { - case CODE_SVN: - return 1; - case CODE_GIT: - return 2; - case CODE_GITLAB: - return 3; - case GITHUB: - return 4; - case CODE_TGIT: - return 5; - case CODE_P4: - return 6; - default: - return 0; - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/TokenTypeEnum.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/TokenTypeEnum.java deleted file mode 100644 index 3b8de551..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/enums/TokenTypeEnum.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.log.scm.enums; - - -public enum TokenTypeEnum { - OAUTH(0), - PRIVATE_KEY(1); - - private Integer type; - - TokenTypeEnum(Integer type) { - this.type = type; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/CodeRepositoryServiceRegistrar.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/CodeRepositoryServiceRegistrar.java deleted file mode 100644 index d864e7e0..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/CodeRepositoryServiceRegistrar.java +++ /dev/null @@ -1,60 +0,0 @@ -package cd.casic.ci.log.scm.service; - - -import cd.casic.ci.log.scm.dal.pojo.*; -import cd.casic.ci.log.scm.service.code.CodeRepositoryService; -import cd.casic.ci.log.scm.enums.ScmType; - -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author by mianbin - * @Classname CodeRepositoryServiceRegistrar - * @Description TODO - * @Date 2025/3/21 10:22 - */ -public class CodeRepositoryServiceRegistrar { - private static ConcurrentHashMap> repositoryServiceMap = new ConcurrentHashMap<>(); - - public static CodeRepositoryService getServiceByScmType(String scmType) { - CodeRepositoryService repositoryService; - ScmType type = ScmType.valueOf(scmType); - if (type == ScmType.CODE_SVN) { - repositoryService = getService(CodeSvnRepository.class); - } - else if (type == ScmType.CODE_GIT) { - repositoryService = getService(CodeGitRepository.class); - } - else if (type == ScmType.CODE_TGIT) { - repositoryService = getService(CodeTGitRepository.class); - } - else if (type == ScmType.CODE_GITLAB) { - repositoryService = getService(CodeGitlabRepository.class); - } - else if (type == ScmType.GITHUB) { - repositoryService = getService(GithubRepository.class); - } - else if (type == ScmType.CODE_P4) { - repositoryService = getService(CodeP4Repository.class); - } - else { - throw new IllegalArgumentException("Unknown repository type"); - } - return repositoryService; - } - - /** - * 根据类型读取指定[CodeRepositoryService]代码库业务处理器 - */ - private static CodeRepositoryService getService(Class type) { - if (type != null) { - CodeRepositoryService repositoryService = repositoryServiceMap.get(type.getName()); - if (repositoryService == null) { - throw new IllegalArgumentException(type.getName() + "handler is not found"); - } - return (CodeRepositoryService) repositoryService; - } else { - throw new IllegalArgumentException("Unknown repository type"); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/IGitOauthService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/IGitOauthService.java deleted file mode 100644 index b27ddfb6..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/IGitOauthService.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.log.scm.service; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; - -public interface IGitOauthService { - - GitToken getAccessToken(String userId); - - int saveAccessToken(String userId, GitToken token); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/code/CodeRepositoryService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/code/CodeRepositoryService.java deleted file mode 100644 index d1650b59..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/code/CodeRepositoryService.java +++ /dev/null @@ -1,10 +0,0 @@ -package cd.casic.ci.log.scm.service.code; - - -import cd.casic.ci.log.scm.dal.pojo.Repository; -import cd.casic.ci.log.scm.dal.dto.RepositoryRecord; - -public interface CodeRepositoryService { - - Repository compose(RepositoryRecord repository); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubService.java deleted file mode 100644 index 0c5b8d73..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubService.java +++ /dev/null @@ -1,157 +0,0 @@ -package cd.casic.ci.log.scm.service.github; - -import cd.casic.ci.common.pipeline.constant.CommonMessageCode; -import cd.casic.ci.log.scm.dal.pojo.github.GithubBranch; -import cd.casic.ci.log.scm.dal.pojo.github.GithubTag; -import cd.casic.framework.commons.exception.ServiceException; -import cd.casic.framework.commons.util.http.OkhttpUtils; -import cd.casic.framework.commons.util.retry.RetryUtils; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import jakarta.annotation.Resource; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import okhttp3.Request; -import okhttp3.Response; -import org.springframework.stereotype.Service; - -import java.util.Objects; - - -@Service -@Slf4j -public class GithubService implements IGithubService { - - private static final int HTTP_200 = 200; - private static final int HTTP_400 = 400; - private static final int HTTP_401 = 401; - private static final int HTTP_402 = 402; - private static final int HTTP_403 = 403; - private static final int HTTP_404 = 404; - private static final int HTTP_405 = 405; - private static final int HTTP_422 = 422; - private static final int HTTP_500 = 500; - - private static final Long SLEEP_MILLS_FOR_RETRY_500 = 500L; - - private static final String GITHUB_API_URL = "https://api.github.com"; - - private static final String OPERATION_GET_BRANCH = "OperationGetBranch"; - - private static final String OPERATION_GET_TAG = "OperationGetTag"; - - @Resource - private ObjectMapper objectMapper; - - @Override - public GithubBranch getBranch(String token, String projectName, String branch) { - log.info("getBranch| {} - {}", projectName, branch); - - return RetryUtils.execute(new RetryUtils.Action() { - @Override - public GithubBranch execute() { - String sBranch = branch != null ? branch : "master"; - String path = "repos/" + projectName + "/branches/" + sBranch; - Request request = buildGet(token, path); - String operation = getMessageByLocale(OPERATION_GET_BRANCH, null); - String body = getBody(operation, request); - try { - return objectMapper.readValue(body, new TypeReference() { - }); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - return null; - } - - @Override - public GithubBranch fail(Throwable e) throws Throwable { - log.warn("BKSystemMonitor|getBranch fail| e=" + e.getMessage(), e); - throw e; - } - - } , 1, SLEEP_MILLS_FOR_RETRY_500); - } - - @Override - public GithubTag getTag(String token, String projectName, String tag) { - log.info("getTag| {} - {}", projectName, tag); - return RetryUtils.execute(new RetryUtils.Action() { - @Override - public GithubTag execute() { - String path = "repos/" + projectName + "/git/refs/tags/" + tag; - Request request = buildGet(token, path); - String operation = getMessageByLocale(OPERATION_GET_TAG, null); - String body = getBody(operation, request); - try { - return objectMapper.readValue(body, new TypeReference() { - }); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - return null; - } - - @Override - public GithubTag fail(Throwable e) throws Throwable { - log.warn("BKSystemMonitor|getTag fail| e=" + e.getMessage(), e); - throw e; - } - }, 1, SLEEP_MILLS_FOR_RETRY_500); - } - - private Request buildGet(String token, String path) { - return request(token, path) - .get() - .build(); - } - - private Request.Builder request(String token, String path) { - return new Request.Builder() - .url(GITHUB_API_URL + "/" + path) - .header("Authorization", "token " + token) - .header("Accept", " application/vnd.github.antiope-preview+json"); - } - - - @SneakyThrows - private String getBody(String operation, Request request) { - Response response = OkhttpUtils.doHttp(request); - int code = response.code(); - String message = response.message(); - String body = Objects.requireNonNull(response.body()).string(); - if (log.isDebugEnabled()) { - log.debug("getBody operation({}). response code({}) message({}) body({})", operation, code, message, body); - } - if (!response.isSuccessful()) { - handException(operation, code); - } - return body; - } - - private void handException(String operation, int code) { - String msg; - switch (code) { - case HTTP_400: - msg = getMessageByLocale(CommonMessageCode.PARAM_ERROR, null); - break; - case HTTP_401: - msg = getMessageByLocale(CommonMessageCode.AUTH_FAIL, new String[]{"GitHub token"}); - break; - case HTTP_403: - msg = getMessageByLocale(CommonMessageCode.ACCOUNT_NO_OPERATION_PERMISSIONS, new String[]{operation}); - break; - case HTTP_404: - msg = getMessageByLocale(CommonMessageCode.REPO_NOT_EXIST_OR_NO_OPERATION_PERMISSION, new String[]{"GitHub", operation}); - default: - msg = "GitHub platform" + operation + "fail"; - break; - } - throw new ServiceException(-1000 , msg); - } - - private String getMessageByLocale(String messageCode, String[] params) { - return ""; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubTokenService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubTokenService.java deleted file mode 100644 index 511308ed..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubTokenService.java +++ /dev/null @@ -1,10 +0,0 @@ -package cd.casic.ci.log.scm.service.github; - - -import cd.casic.ci.log.scm.dal.pojo.github.GithubToken; -import cd.casic.ci.log.scm.enums.GitHubTokenType; - -public interface GithubTokenService { - - GithubToken getAccessToken(String userId, GitHubTokenType tokenType); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubTokenServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubTokenServiceImpl.java deleted file mode 100644 index 7249556f..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/GithubTokenServiceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -package cd.casic.ci.log.scm.service.github; - - -import cd.casic.ci.log.scm.dal.pojo.github.GithubToken; -import cd.casic.framework.commons.util.encrypt.AESUtil; -import cd.casic.ci.log.scm.dal.dao.RepositoryGitlabTokenMapper; -import cd.casic.ci.log.scm.dal.dto.RepositoryGitlabToken; -import cd.casic.ci.log.scm.enums.GitHubTokenType; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - - -@Service -@Slf4j -public class GithubTokenServiceImpl implements GithubTokenService { - - private final String aesKey = ""; - - @Resource - private RepositoryGitlabTokenMapper repositoryGitlabTokenMapper; - - @Override - public GithubToken getAccessToken(String userId, GitHubTokenType tokenType) { - RepositoryGitlabToken gitlabToken = repositoryGitlabTokenMapper.selectOne(RepositoryGitlabToken::getUserId, userId, RepositoryGitlabToken::getType, tokenType.name()); - if (gitlabToken == null) { - return null; - } - log.info("github aesKey:" + aesKey); - return new GithubToken(AESUtil.decrypt(aesKey, gitlabToken.getAccessToken()), gitlabToken.getTokenType(), gitlabToken.getScope()); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/IGithubService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/IGithubService.java deleted file mode 100644 index c1a21a87..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/github/IGithubService.java +++ /dev/null @@ -1,12 +0,0 @@ -package cd.casic.ci.log.scm.service.github; - - -import cd.casic.ci.log.scm.dal.pojo.github.GithubBranch; -import cd.casic.ci.log.scm.dal.pojo.github.GithubTag; - -public interface IGithubService { - - GithubBranch getBranch(String token, String projectName, String branch); - - GithubTag getTag(String token, String projectName, String tag); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/impl/GitOauthServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/impl/GitOauthServiceImpl.java deleted file mode 100644 index bf406e61..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/impl/GitOauthServiceImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -package cd.casic.ci.log.scm.service.impl; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import cd.casic.ci.log.scm.service.scm.IGitService; -import cd.casic.framework.commons.util.encrypt.AESUtil; -import cd.casic.ci.log.scm.dal.dao.RepositoryGitTokenMapper; -import cd.casic.ci.log.scm.dal.dto.RepositoryGitToken; -import cd.casic.ci.log.scm.service.IGitOauthService; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.redisson.RedissonRedLock; -import org.redisson.api.RLock; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import java.time.ZoneId; - -@Service -@Slf4j -public class GitOauthServiceImpl implements IGitOauthService { - - private static final String aesKey = ""; - - @Resource - private IGitService gitService; - - @Resource - private RepositoryGitTokenMapper repositoryGitTokenMapper; - - @Resource - private RedissonClient redissonClient; - - @Override - public GitToken getAccessToken(String userId) { - GitToken accessToken = doGetAccessToken(userId); - if (accessToken == null) { - return null; - } - - if (isTokenExpire(accessToken)) { - log.info("try to refresh the git token of user({})", userId); - RLock rLock = redissonClient.getLock("OAUTH_REFRESH_TOKEN_" + userId); - RedissonRedLock redisLock = new RedissonRedLock(rLock); - try { - redisLock.lock(); - GitToken newAccessToken = doGetAccessToken(userId); - if (newAccessToken.getExpiresIn() * 1000 <= System.currentTimeMillis() - 1800 * 1000) { - return refreshToken(userId, newAccessToken); - } else { - return newAccessToken; - } - } finally { - redisLock.unlock(); - } - } else { - return accessToken; - } - } - - private GitToken refreshToken(String userId, GitToken gitToken) { - GitToken token = gitService.refreshToken(userId, gitToken); - saveAccessToken(userId, token); - token.setAccessToken(AESUtil.decrypt(aesKey, token.getAccessToken())); - token.setAccessToken(AESUtil.decrypt(aesKey, token.getRefreshToken())); - return token; - } - - @Override - public int saveAccessToken(String userId, GitToken tGitToken) { - tGitToken.setAccessToken(AESUtil.encrypt(aesKey, tGitToken.getAccessToken())); - tGitToken.setRefreshToken(AESUtil.encrypt(aesKey, tGitToken.getRefreshToken())); - RepositoryGitToken repositoryGitToken = new RepositoryGitToken(); - repositoryGitToken.setUserId(userId); - repositoryGitToken.setAccessToken(tGitToken.getAccessToken()); - repositoryGitToken.setRefreshToken(tGitToken.getRefreshToken()); - repositoryGitToken.setTokenType(tGitToken.getTokenType()); - repositoryGitToken.setExpiresIn(tGitToken.getExpiresIn()); - return repositoryGitTokenMapper.insert(repositoryGitToken); - } - - private Boolean isTokenExpire(GitToken accessToken) { - // 提前半个小时刷新token - return (accessToken.getCreateTime() != null ? accessToken.getCreateTime() : 0) + accessToken.getExpiresIn() * 1000 - 1800 * 1000 <= System.currentTimeMillis(); - } - - private GitToken doGetAccessToken(String userId) { - RepositoryGitToken token = repositoryGitTokenMapper.selectOne(RepositoryGitToken::getUserId, userId); - if (token == null) { - return null; - } else { - return new GitToken( - AESUtil.decrypt(aesKey, token.getAccessToken()), - AESUtil.decrypt(aesKey, token.getRefreshToken()), - token.getTokenType(), token.getExpiresIn(), - token.getCreateTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() - ); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/impl/RepositoryServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/impl/RepositoryServiceImpl.java deleted file mode 100644 index 093b67cc..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/impl/RepositoryServiceImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package cd.casic.ci.log.scm.service.impl; - - -import cd.casic.ci.log.scm.dal.pojo.Repository; -import cd.casic.framework.commons.exception.ServiceException; -import cd.casic.framework.mybatis.core.dataobject.BaseDO; -import cd.casic.ci.log.scm.dal.dao.RepositoryRecordMapper; -import cd.casic.ci.log.scm.dal.dto.RepositoryRecord; -import cd.casic.ci.log.scm.enums.RepositoryConfig; -import cd.casic.ci.log.scm.enums.RepositoryType; -import cd.casic.ci.log.scm.service.CodeRepositoryServiceRegistrar; -import cd.casic.ci.log.scm.service.code.CodeRepositoryService; -import cd.casic.ci.log.scm.utils.HashUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -@Service -@Slf4j -public class RepositoryServiceImpl { - - @Resource - private RepositoryRecordMapper repositoryRecordMapper; - - - public Repository serviceGet(String projectId, RepositoryConfig repositoryConfig) { - return compose(getRepository(projectId, repositoryConfig)); - } - - private Repository compose(RepositoryRecord repository) { - CodeRepositoryService codeRepositoryService = CodeRepositoryServiceRegistrar.getServiceByScmType(repository.getType()); - return codeRepositoryService.compose(repository); - } - - private RepositoryRecord getRepository(String projectId, RepositoryConfig repositoryConfig) { - log.info("[{}Start to get the repository - ({})]", projectId, repositoryConfig); - if (repositoryConfig.getRepositoryType() == RepositoryType.ID) { - long repositoryId = HashUtil.decodeOtherIdToLong(repositoryConfig.getRepositoryId()); - LambdaQueryWrapper eq = Wrappers.lambdaQuery() - .eq(RepositoryRecord::getId, repositoryId) - .eq(StringUtils.isNoneBlank(projectId), RepositoryRecord::getProjectId, projectId) - .eq(BaseDO::getDeleted, false); - RepositoryRecord repositoryRecord = repositoryRecordMapper.selectOne(eq); - if (repositoryRecord == null) { - throw new ServiceException(-1000, "not found"); - } - return repositoryRecord; - } else if (repositoryConfig.getRepositoryType() == RepositoryType.NAME) { - LambdaQueryWrapper eq = Wrappers.lambdaQuery() - .eq(RepositoryRecord::getAliasName, repositoryConfig.getRepositoryId()) - .eq(RepositoryRecord::getProjectId, projectId) - .eq(BaseDO::getDeleted, false); - RepositoryRecord repositoryRecord = repositoryRecordMapper.selectOne(eq); - if (repositoryRecord == null) { - throw new ServiceException(-1000, "not found"); - } - return repositoryRecord; - } - return null; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/GitServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/GitServiceImpl.java deleted file mode 100644 index c562a83f..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/GitServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.ci.log.scm.service.scm; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import cd.casic.framework.commons.util.http.OkhttpUtils; -import cd.casic.ci.log.scm.config.GitConfig; -import com.fasterxml.jackson.databind.ObjectMapper; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import okhttp3.*; -import org.springframework.stereotype.Service; - -import java.io.IOException; - -@Service -@Slf4j -public class GitServiceImpl implements IGitService { - - @Resource - private GitConfig gitConfig; - - @Resource - private ObjectMapper objectMapper; - - @Override - public GitToken refreshToken(String userId, GitToken accessToken) { - log.info("Start to refresh the token of user {}", userId); - long startEpoch = System.currentTimeMillis(); - try { - String url = gitConfig.gitUrl + "/oauth/token" + - "?client_id=" + gitConfig.clientId + - "&client_secret=" + gitConfig.clientSecret + - "&grant_type=refresh_token" + - "&refresh_token=" + accessToken.getRefreshToken() + - "&redirect_uri=" + gitConfig.gitHookUrl; - Request request = new Request.Builder() - .url(url) - .post(RequestBody.create(MediaType.parse("application/x-www-form-urlencoded;charset=utf-8"), "")) - .build(); - Response response = OkhttpUtils.doHttp(request); - ResponseBody body = response.body(); - assert body != null; - return objectMapper.readValue(body.string(), GitToken.class); - } catch (IOException e) { - e.printStackTrace(); - } finally { - log.info("It took {}ms to refresh the token", System.currentTimeMillis() - startEpoch); - } - return null; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IGitService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IGitService.java deleted file mode 100644 index c659c5a8..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IGitService.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.log.scm.service.scm; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; - -public interface IGitService { - - GitToken refreshToken(String userId, GitToken accessToken); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IScmOauthService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IScmOauthService.java deleted file mode 100644 index 135d7228..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IScmOauthService.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.log.scm.service.scm; - - -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import cd.casic.ci.log.scm.enums.ScmType; - -public interface IScmOauthService { - - RevisionInfo getLatestRevision(String projectName, String url, ScmType type, String branchName, String privateKey, - String passPhrase, String token, CodeSvnRegion region, String userName); - - void addWebhook(String projectName, String url, ScmType type, String privateKey, String passPhrase, - String token, CodeSvnRegion region, String userName, String event); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IScmService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IScmService.java deleted file mode 100644 index c9dbb448..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/IScmService.java +++ /dev/null @@ -1,15 +0,0 @@ -package cd.casic.ci.log.scm.service.scm; - - -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import cd.casic.ci.log.scm.enums.ScmType; - -public interface IScmService { - - RevisionInfo getLatestRevision(String projectName, String url, ScmType type, String branchName, String privateKey, - String paaPhrase, String token, CodeSvnRegion region, String userName); - - void addWebhook(String projectName, String url, ScmType type, String privateKey, String passPhrase, - String token, CodeSvnRegion region, String userName, String event, String hookUrl); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/ScmOauthServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/ScmOauthServiceImpl.java deleted file mode 100644 index a1b9732f..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/ScmOauthServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package cd.casic.ci.log.scm.service.scm; - - -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.config.SVNConfig; -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.dal.pojo.ScmOauthFactory; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import cd.casic.ci.log.scm.enums.ScmType; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - - -@Service -@Slf4j -public class ScmOauthServiceImpl implements IScmOauthService { - - @Resource - private GitConfig gitConfig; - - @Resource - private SVNConfig svnConfig; - - @Override - public RevisionInfo getLatestRevision(String projectName, String url, ScmType type, String branchName, String privateKey, String passPhrase, String token, CodeSvnRegion region, String userName) { - log.info("[{}|{}|{}|{}|{}] Start to get the latest oauth revision", projectName, url, type, branchName, userName); - long startEpoch = System.currentTimeMillis(); - try { - return ScmOauthFactory.getScm(projectName, url, type, branchName, privateKey, passPhrase, token, region, userName, null).getLatestRevision(); - } finally { - log.info("It took {}ms to get the latest revision", System.currentTimeMillis() - startEpoch); - } - } - - @Override - public void addWebhook(String projectName, String url, ScmType type, String privateKey, String passPhrase, String token, CodeSvnRegion region, String userName, String event) { - log.info("[{}|{}|{}|{}] Start to add web hook", projectName, url, type, userName); - long startEpoch = System.currentTimeMillis(); - try { - String hookUrl; - if (type == ScmType.CODE_GIT) { - hookUrl = gitConfig.gitHookUrl; - } else if (type == ScmType.CODE_GITLAB) { - hookUrl = gitConfig.gitlabHookUrl; - } else if (type == ScmType.CODE_SVN) { - hookUrl = svnConfig.svnHookUrl; - } else if (type == ScmType.CODE_TGIT) { - hookUrl = gitConfig.tGitHookUrl; - } else { - throw new IllegalArgumentException("Unknown repository type (" + type + ") when add webhook"); - } - ScmOauthFactory.getScm(projectName, url, type, null, privateKey, passPhrase, token, region, userName, event) - .addWebhook(hookUrl); - } finally { - log.info("It took {}ms to add web hook", System.currentTimeMillis() - startEpoch); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/ScmServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/ScmServiceImpl.java deleted file mode 100644 index ed775f24..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/scm/ScmServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package cd.casic.ci.log.scm.service.scm; - - -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.config.P4Config; -import cd.casic.ci.log.scm.config.SVNConfig; -import cd.casic.ci.log.scm.dal.pojo.RevisionInfo; -import cd.casic.ci.log.scm.dal.pojo.ScmFactory; -import cd.casic.ci.log.scm.enums.CodeSvnRegion; -import cd.casic.ci.log.scm.enums.ScmType; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - - -@Service -@Slf4j -public class ScmServiceImpl implements IScmService { - - @Resource - private GitConfig gitConfig; - - @Resource - private SVNConfig svnConfig; - - @Resource - private P4Config p4Config; - - @Override - public RevisionInfo getLatestRevision(String projectName, String url, ScmType type, String branchName, String privateKey, String paaPhrase, String token, CodeSvnRegion region, String userName) { - log.info("[{}|{}|{}|{}] Start to get latest revision", projectName, url, type, userName); - long startEpoch = System.currentTimeMillis(); - try { - return ScmFactory.getScm(projectName, url, type, branchName, privateKey, paaPhrase, token, region, userName, null).getLatestRevision(); - } finally { - log.info("It took {}ms to get the latest revision", System.currentTimeMillis() - startEpoch); - } - } - - @Override - public void addWebhook(String projectName, String url, ScmType type, String privateKey, String passPhrase, - String token, CodeSvnRegion region, String userName, String event, String hookUrl) { - log.info("[{}|{}|{}|{}|{}|{}|{}] Start to add web hook", projectName, url, type, region, userName, event, hookUrl); - if (type == ScmType.CODE_SVN) { - log.info("svn webhook api does not support, ignore"); - return; - } - long startEpoch = System.currentTimeMillis(); - try { - String realHookUrl; - if (StringUtils.isNoneBlank(hookUrl)) { - realHookUrl = hookUrl; - } else { - if (type == ScmType.CODE_GIT) { - realHookUrl = gitConfig.gitHookUrl; - } else if (type == ScmType.CODE_GITLAB) { - realHookUrl = gitConfig.gitlabHookUrl; - } else if (type == ScmType.CODE_TGIT) { - realHookUrl = gitConfig.tGitHookUrl; - } else if (type == ScmType.CODE_P4) { - realHookUrl = p4Config.p4HookUrl; - } else { - throw new IllegalArgumentException("Unknown repository type (" + type + ") when add webhook"); - } - } - ScmFactory.getScm(projectName, url, type, null, privateKey, passPhrase, token, region, userName, event) - .addWebhook(realHookUrl); - } finally { - log.info("It took {}ms to add web hook", System.currentTimeMillis() - startEpoch); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/ITGitService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/ITGitService.java deleted file mode 100644 index 772eb602..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/ITGitService.java +++ /dev/null @@ -1,13 +0,0 @@ -package cd.casic.ci.log.scm.service.tgit; - - -import cd.casic.ci.log.scm.dal.pojo.git.GitUserInfo; -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import cd.casic.ci.log.scm.enums.TokenTypeEnum; - -public interface ITGitService { - - GitToken refreshToken(String userId, GitToken accessToken); - - GitUserInfo getUserInfoByToken(String token, TokenTypeEnum tokenType); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitOauthService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitOauthService.java deleted file mode 100644 index 23676cd8..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitOauthService.java +++ /dev/null @@ -1,9 +0,0 @@ -package cd.casic.ci.log.scm.service.tgit; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; - -public interface TGitOauthService { - - GitToken getAccessToken(String userId); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitOauthServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitOauthServiceImpl.java deleted file mode 100644 index b186e8f4..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitOauthServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.log.scm.service.tgit; - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Service; - - -@Service -public class TGitOauthServiceImpl implements TGitOauthService { - - @Resource - private TGitTokenService tGitTokenService; - - @Override - public GitToken getAccessToken(String userId) { - return tGitTokenService.getAccessToken(userId); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitServiceImpl.java deleted file mode 100644 index 5da06edb..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitServiceImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -package cd.casic.ci.log.scm.service.tgit; - - -import cd.casic.framework.commons.util.http.OkhttpUtils; -import cd.casic.ci.log.scm.config.GitConfig; -import cd.casic.ci.log.scm.dal.pojo.git.GitUserInfo; -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import cd.casic.ci.log.scm.enums.TokenTypeEnum; -import com.fasterxml.jackson.databind.ObjectMapper; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import okhttp3.*; -import org.springframework.stereotype.Service; - -import java.io.IOException; - -@Service -@Slf4j -public class TGitServiceImpl implements ITGitService { - - @Resource - private GitConfig gitConfig; - - @Resource - private ObjectMapper objectMapper; - - @Override - public GitToken refreshToken(String userId, GitToken accessToken) { - log.info("Start to refresh the token of user {}", userId); - long startEpoch = System.currentTimeMillis(); - try { - String url = gitConfig.tGitUrl + "/oauth/token" + - "?client_id=" + gitConfig.tGitClientId + - "&client_secret=" + gitConfig.tGitClientSecret + - "&grant_type=refresh_token" + - "&refresh_token=" + accessToken.getRefreshToken() + - "&redirect_uri=" + gitConfig.tGitWebhookUrl; - Request request = new Request.Builder() - .url(url) - .post(RequestBody.create(MediaType.parse("application/x-www-form-urlencoded;charset=utf-8"), "")) - .build(); - Response response = OkhttpUtils.doHttp(request); - okhttp3.ResponseBody body = response.body(); - assert body != null; - String data = body.string(); - return objectMapper.readValue(data, GitToken.class); - } catch (IOException e) { - e.printStackTrace(); - } finally { - log.info("It took {}ms to refresh the token", System.currentTimeMillis() - startEpoch); - } - return null; - } - - @Override - public GitUserInfo getUserInfoByToken(String token, TokenTypeEnum tokenType) { - log.info("Start to get the user info by token[{}]", token); - long startEpoch = System.currentTimeMillis(); - try { - StringBuilder url = new StringBuilder(gitConfig.tGitApiUrl + "/user"); - setToken(tokenType, url, token); - log.info("getToken url>> {}", url); - Request request = new Request.Builder() - .url(url.toString()) - .get() - .build(); - Response response = OkhttpUtils.doHttp(request); - ResponseBody body = response.body(); - assert body != null; - String data = body.string(); - return objectMapper.readValue(data, GitUserInfo.class); - } catch (IOException e) { - e.printStackTrace(); - } finally { - log.info("It took {}ms to get the token", System.currentTimeMillis() - startEpoch); - } - return null; - } - - private void setToken(TokenTypeEnum tokenType, StringBuilder url, String token) { - if (TokenTypeEnum.OAUTH == tokenType) { - url.append("?access_token=").append(token); - } else { - url.append("?private_token=").append(token); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitTokenService.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitTokenService.java deleted file mode 100644 index 7d740b84..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitTokenService.java +++ /dev/null @@ -1,11 +0,0 @@ -package cd.casic.ci.log.scm.service.tgit; - - -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; - -public interface TGitTokenService { - - GitToken getAccessToken(String userId); - - Integer saveAccessToken(String userId, String oauthUserId, GitToken tGitToken); -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitTokenServiceImpl.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitTokenServiceImpl.java deleted file mode 100644 index bbb731a1..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/service/tgit/TGitTokenServiceImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package cd.casic.ci.log.scm.service.tgit; - -import cd.casic.framework.commons.util.encrypt.AESUtil; -import cd.casic.ci.log.scm.dal.dao.RepositoryTGitTokenMapper; -import cd.casic.ci.log.scm.dal.dto.RepositoryTGitToken; -import cd.casic.ci.log.scm.dal.pojo.oauth.GitToken; -import cd.casic.ci.log.scm.enums.TokenTypeEnum; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.redisson.RedissonRedLock; -import org.redisson.api.RLock; -import org.redisson.api.RedissonClient; -import org.springframework.stereotype.Service; - -import java.time.ZoneId; - - -@Service -@Slf4j -public class TGitTokenServiceImpl implements TGitTokenService { - - private final String aesKey = ""; - - @Resource - private RedissonClient redissonClient; - - @Resource - private ITGitService tGitService; - - @Resource - private RepositoryTGitTokenMapper repositoryTGitTokenMapper; - - @Override - public GitToken getAccessToken(String userId) { - GitToken accessToken = doGetAccessToken(userId); - if (accessToken == null) { - return null; - } - if (isTokenExpire(accessToken)) { - log.info("try to refresh the git token of user({})", userId); - RLock rLock = redissonClient.getLock("OAUTH_REFRESH_TOKEN_" + userId); - RedissonRedLock lock = new RedissonRedLock(rLock); - - try { - lock.lock(); - GitToken newAccessToken = doGetAccessToken(userId); - assert newAccessToken != null; - if (newAccessToken.getExpiresIn() * 1000 <= System.currentTimeMillis() - 1800 * 1000) { - return refreshToken(userId, newAccessToken); - } else { - return newAccessToken; - } - } finally { - lock.unlock(); - } - } else { - return accessToken; - } - } - - @Override - public Integer saveAccessToken(String userId, String oauthUserId, GitToken tGitToken) { - tGitToken.setAccessToken(AESUtil.encrypt(aesKey, tGitToken.getAccessToken())); - tGitToken.setRefreshToken(AESUtil.encrypt(aesKey, tGitToken.getRefreshToken())); - RepositoryTGitToken repositoryTGitToken = new RepositoryTGitToken(); - repositoryTGitToken.setUserId(userId); - repositoryTGitToken.setOauthUserId(oauthUserId); - repositoryTGitToken.setAccessToken(tGitToken.getAccessToken()); - repositoryTGitToken.setRefreshToken(tGitToken.getRefreshToken()); - repositoryTGitToken.setTokenType(tGitToken.getTokenType()); - repositoryTGitToken.setExpiresIn(tGitToken.getExpiresIn()); - return repositoryTGitTokenMapper.insert(repositoryTGitToken); - } - - private GitToken doGetAccessToken(String userId) { - RepositoryTGitToken token = repositoryTGitTokenMapper.selectOne(RepositoryTGitToken::getUserId, userId); - if (token == null) { - return null; - } - return new GitToken(AESUtil.decrypt(aesKey, token.getAccessToken()), - AESUtil.decrypt(aesKey, token.getRefreshToken()), - token.getTokenType(), token.getExpiresIn(), token.getCreateTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); - } - - private GitToken refreshToken(String userId, GitToken gitToken) { - GitToken token = tGitService.refreshToken(userId, gitToken); - String username = tGitService.getUserInfoByToken(token.getAccessToken(), TokenTypeEnum.OAUTH).getUsername(); - String oauthUserId = username != null ? username : userId; - saveAccessToken(userId, oauthUserId, token); - token.setAccessToken(AESUtil.decrypt(aesKey, token.getAccessToken())); - token.setRefreshToken(AESUtil.decrypt(aesKey, token.getRefreshToken())); - return token; - } - - private Boolean isTokenExpire(GitToken accessToken) { - // 提前半个小时刷新token - return (accessToken.getCreateTime() != null ? accessToken.getCreateTime() : 0) + accessToken.getExpiresIn() * 1000 - 1800 * 1000 <= System.currentTimeMillis(); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/GitUtils.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/GitUtils.java deleted file mode 100644 index c646abce..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/GitUtils.java +++ /dev/null @@ -1,18 +0,0 @@ -package cd.casic.ci.log.scm.utils; - -import java.util.regex.Pattern; - -/** - * @author by mianbin - * @Classname GitUtils - * @Date 2025/3/20 20:11 - */ -public class GitUtils { - public static Boolean isLegalHttpUrl(String url) { - return Pattern.matches("http[s]?://([-.a-z0-9A-Z]+)(:[0-9]+)?/(.*).git", url); - } - - public static Boolean isLegalSshUrl(String url) { - return Pattern.matches("git@([-.a-z0-9A-Z]+):(.*).git", url); - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/HashUtil.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/HashUtil.java deleted file mode 100644 index 5acc8a96..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/HashUtil.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.ci.log.scm.utils; - -import org.hashids.Hashids; - -public class HashUtil { - - private static final String HASH_SALT = "jhy^3(@So0"; - private static final Hashids HASHIDS = new Hashids(HASH_SALT, 8, "abcdefghijklmnopqrstuvwxyz"); - - private static final String OTHER_HASH_SALT = "xlm&gst@Fami1y"; - private static final Hashids OTHER_HASH_IDS = new Hashids(OTHER_HASH_SALT, 4); - - public static String encodeLongId(long id) { - return HASHIDS.encode(id); - } - - public static String encodeIntId(int id) { - return HASHIDS.encode((long) id); - } - - public static long decodeIdToLong(String hash) { - long[] ids = HASHIDS.decode(hash); - return (ids == null || ids.length == 0) ? 0L : ids[0]; - } - - public static int decodeIdToInt(String hash) { - long[] ids = HASHIDS.decode(hash); - return (ids == null || ids.length == 0) ? 0 : (int) ids[0]; - } - - public static String encodeOtherLongId(long id) { - return OTHER_HASH_IDS.encode(id); - } - - public static String encodeOtherIntId(int id) { - return OTHER_HASH_IDS.encode((long) id); - } - - public static long decodeOtherIdToLong(String hash) { - long[] ids = OTHER_HASH_IDS.decode(hash); - return (ids == null || ids.length == 0) ? 0L : ids[0]; - } - - public static int decodeOtherIdToInt(String hash) { - long[] ids = OTHER_HASH_IDS.decode(hash); - return (ids == null || ids.length == 0) ? 0 : (int) ids[0]; - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/RepositoryConfigUtils.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/RepositoryConfigUtils.java deleted file mode 100644 index 37c8f2c1..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/RepositoryConfigUtils.java +++ /dev/null @@ -1,16 +0,0 @@ -package cd.casic.ci.log.scm.utils; - - -import cd.casic.ci.log.scm.enums.RepositoryConfig; -import cd.casic.ci.log.scm.enums.RepositoryType; - -public class RepositoryConfigUtils { - - public static RepositoryConfig buildConfig(String repositoryId, RepositoryType repositoryType) { - if (repositoryType == null || repositoryType == RepositoryType.ID) { - return new RepositoryConfig(repositoryId, null, RepositoryType.ID); - } else { - return new RepositoryConfig(null, repositoryId, RepositoryType.NAME); - } - } -} diff --git a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/WebhookUtils.java b/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/WebhookUtils.java deleted file mode 100644 index b0d8afc9..00000000 --- a/modules/module-ci-repository/src/main/java/cd/casic/ci/log/scm/utils/WebhookUtils.java +++ /dev/null @@ -1,20 +0,0 @@ -package cd.casic.ci.log.scm.utils; - -/** - * @author by mianbin - * @Classname WebhookUtils - * @Date 2025/3/21 10:09 - */ -public class WebhookUtils { - public static final Integer CUSTOM_P4_TRIGGER_VERSION = 2; - - public static Boolean isCustomP4TriggerVersion(String version) { - return getMajorVersion(version) >= CUSTOM_P4_TRIGGER_VERSION; - } - - private static Integer getMajorVersion(String version) { - assert version != null; - String[] strings = version.split("\\."); - return Integer.valueOf(strings[0]); - } -} diff --git a/modules/module-ci-store-api/pom.xml b/modules/module-ci-store-api/pom.xml deleted file mode 100644 index 62fdf741..00000000 --- a/modules/module-ci-store-api/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - - cd.casic.boot - modules - ${revision} - - - module-ci-store-api - - ${project.artifactId} - - ${revision} - - jar - - - - cd.casic.boot - module-ci-common-pipeline - - - - cd.casic.boot - module-ci-repository - - - - - org.springframework.boot - spring-boot-starter-validation - true - - - cd.casic.boot - module-ci-log - - - - - \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildAtomDevLanguageEnvVarResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildAtomDevLanguageEnvVarResource.java deleted file mode 100644 index b102313d..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildAtomDevLanguageEnvVarResource.java +++ /dev/null @@ -1,35 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.AtomDevLanguageEnvVar; -import cd.casic.pipeline.store.pojo.common.enums.BuildHostOsEnum; -import cd.casic.pipeline.store.pojo.common.enums.BuildHostTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@Tag(name = "BUILD_ATOM_DEV_LANGUAGE_ENV_VAR", description = "插件-开发语言环境变量") -@RestController -@RequestMapping("/build/market/atom/dev/language/env/var") -public interface BuildAtomDevLanguageEnvVarResource { - - @Operation(summary = "获取插件开发语言相关的环境变量") - @GetMapping("/languages/{language}/types/{buildHostType}/oss/{buildHostOs}") - CommonResult> getAtomDevLanguageEnvVars( - @Parameter(description = "开发语言", required = true) - @PathVariable("language") - String language, - @Parameter(description = "适用构建机类型", required = true) - @PathVariable("buildHostType") - BuildHostTypeEnum buildHostType, - @Parameter(description = "适用构建机操作系统", required = true) - @PathVariable("buildHostOs") - BuildHostOsEnum buildHostOs - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildAtomResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildAtomResource.java deleted file mode 100644 index bc78be91..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildAtomResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.Atom; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "BUILD_ATOM", description = "插件-构建") -@RestController -@RequestMapping("/build/market/atom") -public interface BuildAtomResource { - - @Operation(summary = "获取插件详情") - @GetMapping("/{atomCode}") - CommonResult getAtom( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildMarketAtomEnvResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildMarketAtomEnvResource.java deleted file mode 100644 index afafff4b..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/BuildMarketAtomEnvResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.AtomEnv; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "BUILD_MARKET_ATOM_ENV", description = "插件-构建市场环境变量") -@RestController -@RequestMapping("/build/market/atom/env") -public interface BuildMarketAtomEnvResource { - - @Operation(summary = "获取插件环境变量") - @GetMapping("/{atomCode}") - CommonResult getAtomEnv( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomReplaceResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomReplaceResource.java deleted file mode 100644 index 63d28c59..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomReplaceResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "OP_ATOM_REPLACE", description = "插件-运营替换") -@RestController -@RequestMapping("/op/market/atom/replace") -public interface OpAtomReplaceResource { - - @Operation(summary = "替换插件") - @PostMapping("/{atomCode}") - CommonResult replaceAtom( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomResource.java deleted file mode 100644 index ceeffcc4..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.Atom; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "OP_ATOM", description = "插件-运营") -@RestController -@RequestMapping("/op/market/atom") -public interface OpAtomResource { - - @Operation(summary = "获取插件详情") - @GetMapping("/{atomCode}") - CommonResult getAtom( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomStatisticResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomStatisticResource.java deleted file mode 100644 index c3675954..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/OpAtomStatisticResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "OP_ATOM_STATISTIC", description = "插件-运营统计") -@RestController -@RequestMapping("/op/market/atom/statistic") -public interface OpAtomStatisticResource { - - @Operation(summary = "获取插件统计信息") - @GetMapping("/{atomCode}") - CommonResult getAtomStatistic( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceAtomResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceAtomResource.java deleted file mode 100644 index a1d883c6..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceAtomResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.Atom; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "SERVICE_ATOM", description = "插件-服务") -@RestController -@RequestMapping("/service/market/atom") -public interface ServiceAtomResource { - - @Operation(summary = "获取插件详情") - @GetMapping("/{atomCode}") - CommonResult getAtom( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomArchiveResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomArchiveResource.java deleted file mode 100644 index 74ee3780..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomArchiveResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "SERVICE_MARKET_ATOM_ARCHIVE", description = "插件-服务市场归档") -@RestController -@RequestMapping("/service/market/atom/archive") -public interface ServiceMarketAtomArchiveResource { - - @Operation(summary = "获取插件归档信息") - @GetMapping("/{atomCode}") - CommonResult getAtomArchive( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomEnvResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomEnvResource.java deleted file mode 100644 index 7a1ff900..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomEnvResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.AtomEnv; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "SERVICE_MARKET_ATOM_ENV", description = "插件-服务市场环境变量") -@RestController -@RequestMapping("/service/market/atom/env") -public interface ServiceMarketAtomEnvResource { - - @Operation(summary = "获取插件环境变量") - @GetMapping("/{atomCode}") - CommonResult getAtomEnv( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomResource.java deleted file mode 100644 index 639aaba0..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/ServiceMarketAtomResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.Atom; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "SERVICE_MARKET_ATOM", description = "插件-服务市场") -@RestController -@RequestMapping("/service/market/atom") -public interface ServiceMarketAtomResource { - - @Operation(summary = "获取插件详情") - @GetMapping("/{atomCode}") - CommonResult getAtom( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomClassifyResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomClassifyResource.java deleted file mode 100644 index 4ad9608c..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomClassifyResource.java +++ /dev/null @@ -1,19 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - - -@Tag(name = "USER_ATOM_CLASSIFY", description = "插件-用户分类") -@RestController -@RequestMapping("/user/market/atom/classify") -public interface UserAtomClassifyResource { - - @Operation(summary = "获取插件分类信息") - @GetMapping("/") - CommonResult getAtomClassify(); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCommentReplyResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCommentReplyResource.java deleted file mode 100644 index e63a4b3d..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCommentReplyResource.java +++ /dev/null @@ -1,24 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Tag(name = "USER_ATOM_COMMENT_REPLY", description = "插件-用户评论回复") -@RestController -@RequestMapping("/user/market/atom/comment/reply") -public interface UserAtomCommentReplyResource { - - @Operation(summary = "回复插件评论") - @PostMapping("/{commentId}") - CommonResult replyAtomComment( - @Parameter(description = "评论ID", required = true) - @PathVariable("commentId") - Long commentId - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCommentResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCommentResource.java deleted file mode 100644 index 9dccddb4..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCommentResource.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - - -@Tag(name = "USER_ATOM_COMMENT", description = "插件-用户评论") -@RestController -@RequestMapping("/user/market/atom/comment") -public interface UserAtomCommentResource { - - @Operation(summary = "获取插件评论") - @GetMapping("/{atomCode}") - CommonResult getAtomComment( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); - - @Operation(summary = "添加插件评论") - @PostMapping("/{atomCode}") - CommonResult addAtomComment( - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCooperationResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCooperationResource.java deleted file mode 100644 index cf395b00..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomCooperationResource.java +++ /dev/null @@ -1,30 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.AtomCollaboratorCreateReq; -import cd.casic.pipeline.store.pojo.atom.AtomCollaboratorCreateResp; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_USER_ID; - -@Tag(name = "USER_MARKET_ATOM_COOPERATION", description = "插件-插件协作") -@RestController -@RequestMapping("/user/market/atom/cooperation") -public interface UserAtomCooperationResource { - - @Operation(summary = "为插件添加协作者") - @PostMapping("/collaborator") - CommonResult addAtomCollaborator( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "申请成为插件协作者请求报文体", required = true) - AtomCollaboratorCreateReq atomCollaboratorCreateReq - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomLabelResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomLabelResource.java deleted file mode 100644 index b9181f58..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomLabelResource.java +++ /dev/null @@ -1,31 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.label.Label; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@Tag(name = "USER_PIPELINE_ATOM_LABEL", description = "流水线-插件标签") -@RestController -@RequestMapping("/user/market/atom/label") -public interface UserAtomLabelResource { - - @Operation(summary = "获取所有插件标签信息") - @GetMapping("/labels") - CommonResult> getAllAtomLabels(); - - @Operation(summary = "根据插件ID获取插件标签信息") - @GetMapping("/atomIds/{atomId}/labels") - CommonResult> getAtomLabelsByAtomId( - @Parameter(description = "插件ID", required = true) - @PathVariable("atomId") - String atomId - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomReleaseResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomReleaseResource.java deleted file mode 100644 index d8e79946..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomReleaseResource.java +++ /dev/null @@ -1,53 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.MarketAtomCreateRequest; -import cd.casic.pipeline.store.pojo.atom.MarketAtomUpdateRequest; -import cd.casic.pipeline.store.pojo.common.publication.StoreProcessInfo; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.Valid; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_USER_ID; - - -@Tag(name = "USER_MARKET_ATOM", description = "插件市场-插件") -@RestController -@RequestMapping("/user/market/") -public interface UserAtomReleaseResource { - - @Operation(summary = "插件工作台-新增插件") - @PostMapping("/desk/atom/") - CommonResult addMarketAtom( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "插件市场工作台-新增插件请求报文体", required = true) - @Valid - MarketAtomCreateRequest marketAtomCreateRequest - ); - - @Operation(summary = "插件工作台-升级插件") - @PutMapping("/desk/atom/") - CommonResult updateMarketAtom( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目代码", required = true) - @RequestParam("projectCode") - String projectCode, - @Parameter(description = "插件市场工作台-新增插件请求报文体", required = true) - MarketAtomUpdateRequest marketAtomUpdateRequest - ); - - @Operation(summary = "根据插件版本ID获取插件版本进度") - @GetMapping("/desk/atom/release/process/{atomId}") - CommonResult getAtomReleaseProcess( - @Parameter(description = "插件版本ID", required = true) - @PathVariable("atomId") - String atomId - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomResource.java deleted file mode 100644 index 909d26b4..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserAtomResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.PageResult; -import cd.casic.pipeline.store.pojo.atom.AtomRespItem; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_USER_ID; - - -@Tag(name = "USER_PIPELINE_ATOM", description = "流水线-插件") -@RestController -@RequestMapping("/user/pipeline/atom") -public interface UserAtomResource { - - @Operation(summary = "获取所有流水线插件信息") - @GetMapping("/") - PageResult listAllPipelineAtoms( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "支持的服务范围(pipeline/quality/all 分别表示流水线/质量红线/全部)", required = false) - @RequestParam("serviceScope") - String serviceScope, - @Parameter(description = "job类型,AGENT: 编译环境,AGENT_LESS:无编译环境", required = false) - @RequestParam("jobType") - String jobType, - @Parameter(description = "操作系统(ALL/WINDOWS/LINUX/MACOS)", required = false) - @RequestParam("os") - String os - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomClassifyResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomClassifyResource.java deleted file mode 100644 index 62d59b24..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomClassifyResource.java +++ /dev/null @@ -1,21 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.atom.MarketAtomClassify; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -@Tag(name = "USER_MARKET_ATOM_CLASSIFY", description = "插件市场-插件分类") -@RestController -@RequestMapping("/user/market/atom/classifys") -public interface UserMarketAtomClassifyResource { - - @Operation(summary = "获取所有插件分类信息") - @GetMapping("/") - CommonResult> getAllAtomClassifys(); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomResource.java deleted file mode 100644 index 61339090..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomResource.java +++ /dev/null @@ -1,236 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.framework.commons.pojo.PageResult; -import cd.casic.pipeline.store.pojo.atom.*; -import cd.casic.pipeline.store.pojo.atom.enums.AtomTypeEnum; -import cd.casic.pipeline.store.pojo.atom.enums.MarketAtomSortTypeEnum; -import cd.casic.pipeline.store.pojo.common.InstalledProjRespItem; -import cd.casic.pipeline.store.pojo.common.MarketMainItem; -import cd.casic.pipeline.store.pojo.common.StoreErrorCodeInfo; -import cd.casic.pipeline.store.pojo.common.version.StoreShowVersionInfo; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_USER_ID; - - -@Tag(name = "USER_MARKET_ATOM", description = "插件市场-插件") -@RestController -@RequestMapping("/user/market/") -public interface UserMarketAtomResource { - - @Operation(summary = "获取插件市场首页的数据") - @GetMapping("/atom/list/main") - CommonResult> mainPageList( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "页码", required = false) - @RequestParam("page") - Integer page, - @Parameter(description = "每页数量", required = false) - @RequestParam("pageSize") - Integer pageSize - ); - - @Operation(summary = "插件市场搜索插件") - @GetMapping("/atom/list/") - CommonResult list( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "搜索关键字", required = false) - @RequestParam("keyword") - String keyword, - @Parameter(description = "插件分类", required = false) - @RequestParam("classifyCode") - String classifyCode, - @Parameter(description = "功能标签", required = false) - @RequestParam("labelCode") - String labelCode, - @Parameter(description = "评分", required = false) - @RequestParam("score") - Integer score, - @Parameter(description = "研发来源", required = false) - @RequestParam("rdType") - AtomTypeEnum rdType, - @Parameter(description = "yaml是否可用", required = false) - @RequestParam("yamlFlag") - Boolean yamlFlag, - @Parameter(description = "是否推荐标识 true:推荐,false:不推荐", required = false) - @RequestParam("recommendFlag") - Boolean recommendFlag, - @Parameter(description = "是否有红线指标", required = false) - @RequestParam("qualityFlag") - Boolean qualityFlag, - @Parameter(description = "排序", required = false) - @RequestParam("sortType") - MarketAtomSortTypeEnum sortType, - @Parameter(description = "页码", required = false) - @RequestParam("page") - Integer page, - @Parameter(description = "每页数量", required = false) - @RequestParam("pageSize") - Integer pageSize - ); - - @Operation(summary = "根据用户获取插件工作台插件列表") - @GetMapping("/desk/atom/list/") - CommonResult listMyAtoms( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "插件名称", required = false) - @RequestParam("atomName") - String atomName, - @Parameter(description = "页码", required = true) - @RequestParam("page") - Integer page, - @Parameter(description = "每页数量", required = true) - @RequestParam("pageSize") - Integer pageSize - ); - - @Operation(summary = "根据插件版本ID获取插件详情") - @GetMapping("/desk/atom/{atomId}") - CommonResult getAtomById( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomId", required = true) - @PathVariable("atomId") - String atomId - ); - - @Operation(summary = "根据插件标识获取插件正式版本详情") - @GetMapping("/atom/{atomCode}") - CommonResult getAtomByCode( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomCode", required = true) - @PathVariable("atomCode") - String atomCode - ); - - @Operation(summary = "根据插件标识获取插件版本列表") - @GetMapping("/atom/version/list/") - PageResult getAtomVersionsByCode( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomCode", required = true) - @RequestParam("atomCode") - String atomCode, - @Parameter(description = "页码", required = true) - @RequestParam("page") - Integer page, - @Parameter(description = "每页数量", required = true) - @RequestParam("pageSize") - Integer pageSize - ); - - @Operation(summary = "安装插件到项目") - @PostMapping("/atom/install") - CommonResult installAtom( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "安装插件到项目请求报文体", required = true) - InstallAtomReq installAtomReq - ); - - @Operation(summary = "根据插件标识获取已安装的项目列表") - @GetMapping("/atom/installedProjects/{atomCode}") - CommonResult> getInstalledProjects( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomCode", required = true) - @PathVariable("atomCode") - String atomCode - ); - - @Operation(summary = "获取插件支持的语言列表") - @GetMapping("/desk/atom/language") - CommonResult> listLanguage(); - - @Operation(summary = "删除工作台插件") - @DeleteMapping("/desk/atoms/{atomCode}") - CommonResult deleteAtom( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode - ); - - @Operation(summary = "根据插件标识获取插件回显版本信息") - @GetMapping("/atoms/{atomCode}/showVersionInfo") - CommonResult getAtomShowVersionInfo( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomCode", required = true) - @PathVariable("atomCode") - String atomCode - ); - - @Operation(summary = "查看插件的yml信息") - @GetMapping("/atoms/{atomCode}/yml/detail") - CommonResult getAtomYmlInfo( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomCode", required = true) - @PathVariable("atomCode") - String atomCode, - @Parameter(description = "是否展示系统自带的yml信息", required = false) - @RequestParam("defaultShowFlag") - Boolean defaultShowFlag - ); - - @Operation(summary = "查看插件的yml 2.0信息") - @GetMapping("/atoms/{atomCode}/yml/2.0/detail") - CommonResult getAtomYmlV2Info( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomCode", required = true) - @PathVariable("atomCode") - String atomCode, - @Parameter(description = "是否展示系统自带的yml信息", required = false) - @RequestParam("defaultShowFlag") - Boolean defaultShowFlag - ); - - @Operation(summary = "展示插件的outPut参数") - @GetMapping("/atoms/{atomCode}/output") - CommonResult> getAtomOutput( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "atomCode", required = true) - @PathVariable("atomCode") - String atomCode - ); - - @Operation(summary = "更新插件自定义错误码信息") - @PutMapping("/{projectCode}/atom/errorCodeInfo") - CommonResult updateAtomErrorCodeInfo( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "projectCode", required = true) - @PathVariable("projectCode") - String projectCode, - @Parameter(description = "插件自定义错误码信息", required = true) - StoreErrorCodeInfo storeErrorCodeInfo - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomStatisticResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomStatisticResource.java deleted file mode 100644 index bea0755d..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/atom/UserMarketAtomStatisticResource.java +++ /dev/null @@ -1,54 +0,0 @@ -package cd.casic.pipeline.store.api.atom; - -import cd.casic.framework.commons.pojo.PageResult; -import cd.casic.pipeline.store.pojo.atom.AtomPipeline; -import cd.casic.pipeline.store.pojo.atom.AtomPipelineExecInfo; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_USER_ID; - -@Tag(name = "USER_MARKET_ATOM_STATISTIC", description = "插件市场-插件-统计") -@RestController -@RequestMapping("/user/market/atom/statistic") -public interface UserMarketAtomStatisticResource { - - @Operation(summary = "根据插件代码获取使用的流水线详情 - 所有") - @GetMapping("/{atomCode}/pipelines") - PageResult getAtomPipelinesByCode( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "插件代码", required = true) - @PathVariable("atomCode") - String atomCode, - @Parameter(description = "第几页", required = false, example = "1") - @RequestParam("page") - Integer page, - @Parameter(description = "每页多少条", required = false, example = "20") - @RequestParam("pageSize") - Integer pageSize - ); - - @Operation(summary = "根据插件代码获取对应的流水线信息 - 项目下") - @GetMapping("/projectCodes/{projectCode}/atomCodes/{atomCode}/pipelines") - PageResult getAtomPipelines( - @Parameter(description = "userId", required = true) - @RequestHeader(AUTH_HEADER_USER_ID) - String userId, - @Parameter(description = "项目代码", required = true) - @PathVariable("projectCode") - String projectCode, - @Parameter(description = "原子代码", required = true) - @PathVariable("atomCode") - String atomCode, - @Parameter(description = "页码", required = false) - @RequestParam("page") - Integer page, - @Parameter(description = "每页数量", required = false) - @RequestParam("pageSize") - Integer pageSize - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildPublishersResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildPublishersResource.java deleted file mode 100644 index 1b0792cf..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildPublishersResource.java +++ /dev/null @@ -1,93 +0,0 @@ -package cd.casic.pipeline.store.api.common; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.platform.StoreDockingPlatformRequest; -import cd.casic.pipeline.store.pojo.common.publication.PublishersRequest; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*; - -@Tag(name = "BUILD_PUBLISHER", description = "build_publisher") -@RestController -@RequestMapping("/build/store/publisher/sync") -public interface BuildPublishersResource { - - @Operation(summary = "同步新增发布者信息") - @PostMapping("/add") - CommonResult synAddPublisherData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "发布者数据同步请求", required = true) - List publishers - ); - - @Operation(summary = "同步删除发布者信息") - @DeleteMapping("/delete") - CommonResult synDeletePublisherData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "发布者数据同步请求", required = true) - List publishers - ); - - @Operation(summary = "同步更新发布者信息") - @PostMapping("/update") - CommonResult synUpdatePublisherData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "发布者数据同步请求", required = true) - List publishers - ); - - @Operation(summary = "同步新增工具平台信息") - @PostMapping("/platforms/add") - CommonResult synAddPlatformsData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "store组件对接平台请求", required = true) - List storeDockingPlatformRequests - ); - - @Operation(summary = "同步删除工具平台信息") - @DeleteMapping("/platforms/delete") - CommonResult synDeletePlatformsData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "store组件对接平台请求", required = true) - List storeDockingPlatformRequests - ); - - @Operation(summary = "同步更新工具平台信息") - @PostMapping("/platforms/update") - CommonResult synUpdatePlatformsData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "store组件对接平台请求", required = true) - List storeDockingPlatformRequests - ); - - @Operation(summary = "同步更新工具平台logo信息") - @PostMapping("/platforms/logo/update") - CommonResult synUpdatePlatformsLogoInfo( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "平台代码", required = true) - @RequestParam("platformCode") - String platformCode, - @Parameter(description = "logoUrl", required = true) - @RequestParam("logoUrl") - String logoUrl - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreDockingPlatformResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreDockingPlatformResource.java deleted file mode 100644 index 2f5b995f..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreDockingPlatformResource.java +++ /dev/null @@ -1,48 +0,0 @@ -package cd.casic.pipeline.store.api.common; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.platform.StoreDockingPlatformRequest; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_DEVOPS_USER_ID; - -@Tag(name = "BUILD_STORE_DOCKING_PLATFORM", description = "build_store_docking_platform") -@RestController -@RequestMapping("/build/store/docking/platform/sync") -public interface BuildStoreDockingPlatformResource { - - @Operation(summary = "同步新增平台信息") - @PostMapping("/add") - CommonResult synAddPlatformData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "store组件对接平台请求", required = true) - List storeDockingPlatformRequests - ); - - @Operation(summary = "同步删除平台信息") - @DeleteMapping("/delete") - CommonResult synDeletePlatformData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "store组件对接平台请求", required = true) - List storeDockingPlatformRequests - ); - - @Operation(summary = "同步更新平台信息") - @PostMapping("/update") - CommonResult synUpdatePlatformData( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId, - @Parameter(description = "store组件对接平台请求", required = true) - List storeDockingPlatformRequests - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreIndexInfoResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreIndexInfoResource.java deleted file mode 100644 index fea46f20..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreIndexInfoResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.pipeline.store.api.common; - -import cd.casic.framework.commons.pojo.CommonResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.AUTH_HEADER_DEVOPS_USER_ID; - -@Tag(name = "BUILD_STORE_INDEX_INFO", description = "build_store_index_info") -@RestController -@RequestMapping("/build/store/index/info") -public interface BuildStoreIndexInfoResource { - - @Operation(summary = "获取store索引信息") - @GetMapping("/") - CommonResult getStoreIndexInfo( - @RequestHeader(AUTH_HEADER_DEVOPS_USER_ID) - @Parameter(description = "用户ID", required = true) - String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreResource.java deleted file mode 100644 index b09a085a..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/BuildStoreResource.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.pipeline.store.api.common; - - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.enums.StoreTypeEnum; -import cd.casic.pipeline.store.pojo.common.env.StorePkgRunEnvInfo; -import cd.casic.pipeline.store.pojo.common.sensitive.SensitiveConfResp; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -import static cd.casic.ci.common.pipeline.constant.OpsHeader.*; - - -@Tag(name = "BUILD_STORE", description = "build-store") -@RestController -@RequestMapping("/build/store/") -public interface BuildStoreResource { - - @Operation(summary = "获取敏感数据") - @GetMapping("/sensitiveConf/types/{storeType}/codes/{storeCode}") - CommonResult> getSensitiveConf( - @RequestHeader(AUTH_HEADER_DEVOPS_BUILD_ID) - @Parameter(description = "构建ID", required = true) - String buildId, - @RequestHeader(AUTH_HEADER_DEVOPS_VM_SEQ_ID) - @Parameter(description = "构建环境ID", required = true) - String vmSeqId, - @PathVariable("storeType") - @Parameter(description = "组件类型", required = true) - StoreTypeEnum storeType, - @PathVariable("storeCode") - @Parameter(description = "组件标识", required = true) - String storeCode - ); - - @Operation(summary = "获取组件安装包运行时环境信息") - @GetMapping("/pkg/envs/types/{storeType}/languages/{language}/versions/{runtimeVersion}/get") - CommonResult getStorePkgRunEnvInfo( - @RequestHeader(AUTH_HEADER_DEVOPS_ENV) - @Parameter(description = "环境信息", required = false) - String devopsEnv, - @PathVariable("storeType") - @Parameter(description = "组件类型", required = true) - StoreTypeEnum storeType, - @PathVariable("language") - @Parameter(description = "开发语言", required = true) - String language, - @PathVariable("runtimeVersion") - @Parameter(description = "运行时版本", required = true) - String runtimeVersion, - @RequestParam("osName") - @Parameter(description = "支持的操作系统名称", required = true) - String osName, - @RequestParam("osArch") - @Parameter(description = "支持的操作系统架构", required = true) - String osArch - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpBusinessConfigResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpBusinessConfigResource.java deleted file mode 100644 index d7b9d964..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpBusinessConfigResource.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.pipeline.store.api.common; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.config.BusinessConfigRequest; -import cd.casic.pipeline.store.pojo.common.config.BusinessConfigResponse; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - - -@Tag(name = "OP_STORE_BUSINESS_CONFIG", description = "OP-STORE-业务配置") -@RestController -@RequestMapping("/op/store/businessConfig") -public interface OpBusinessConfigResource { - - @Operation(summary = "添加业务配置(返回是否添加成功)") - @PostMapping("/") - CommonResult add( - @Parameter(description = "业务配置信息请求报文体", required = true) - BusinessConfigRequest businessConfigRequest - ); - - @Operation(summary = "更新业务配置信息(返回受影响的数据条数)") - @PutMapping("/ids/{id}") - CommonResult update( - @Parameter(description = "业务配置ID", required = true) - @PathVariable("id") - int id, - @Parameter(description = "业务配置信息请求报文体", required = true) - BusinessConfigRequest businessConfigRequest - ); - - @Operation(summary = "获取所有业务配置信息") - @GetMapping("/list") - CommonResult> listAllBusinessConfigs(); - - @Operation(summary = "根据ID获取业务配置信息") - @GetMapping("/{id}") - CommonResult getBusinessConfigById( - @Parameter(description = "业务配置ID", required = true) - @PathVariable("id") - int id - ); - - @Operation(summary = "根据ID删除业务配置信息(返回受影响的数据条数)") - @DeleteMapping("/{id}") - CommonResult deleteBusinessConfigById( - @Parameter(description = "业务配置ID", required = true) - @PathVariable("id") - int id - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpCategoryResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpCategoryResource.java deleted file mode 100644 index b616fceb..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpCategoryResource.java +++ /dev/null @@ -1,65 +0,0 @@ -package cd.casic.pipeline.store.api.common; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.category.Category; -import cd.casic.pipeline.store.pojo.common.category.CategoryRequest; -import cd.casic.pipeline.store.pojo.common.enums.StoreTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@Tag(name = "OP_STORE_CATEGORY", description = "OP-STORE-范畴") -@RestController -@RequestMapping("/op/store/category") -public interface OpCategoryResource { - - @Operation(summary = "添加范畴") - @PostMapping("/types/{categoryType}") - CommonResult add( - @Parameter(description = "类别", required = true) - @PathVariable("categoryType") - StoreTypeEnum categoryType, - @Parameter(description = "范畴信息请求报文体", required = true) - CategoryRequest categoryRequest - ); - - @Operation(summary = "更新范畴信息") - @PutMapping("/types/{categoryType}/ids/{id}") - CommonResult update( - @Parameter(description = "类别", required = true) - @PathVariable("categoryType") - StoreTypeEnum categoryType, - @Parameter(description = "范畴ID", required = true) - @PathVariable("id") - String id, - @Parameter(description = "范畴信息请求报文体", required = true) - CategoryRequest categoryRequest - ); - - @Operation(summary = "获取所有范畴信息") - @GetMapping("/types/{categoryType}") - CommonResult> listAllCategorys( - @Parameter(description = "类别", required = true) - @PathVariable("categoryType") - StoreTypeEnum categoryType - ); - - @Operation(summary = "根据ID获取范畴信息") - @GetMapping("/{id}") - CommonResult getCategoryById( - @Parameter(description = "范畴ID", required = true) - @RequestParam("id") - String id - ); - - @Operation(summary = "根据ID删除范畴信息") - @DeleteMapping("/{id}") - CommonResult deleteCategoryById( - @Parameter(description = "范畴ID", required = true) - @PathVariable("id") - String id - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpClassifyResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpClassifyResource.java deleted file mode 100644 index fcd39ef5..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpClassifyResource.java +++ /dev/null @@ -1,67 +0,0 @@ -package cd.casic.pipeline.store.api.common; - - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.classify.Classify; -import cd.casic.pipeline.store.pojo.common.classify.ClassifyRequest; -import cd.casic.pipeline.store.pojo.common.enums.StoreTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - - -@Tag(name = "OP_STORE_CLASSIFY", description = "OP-STORE-分类") -@RestController -@RequestMapping("/op/store/classify") -public interface OpClassifyResource { - - @Operation(summary = "添加分类") - @PostMapping("/types/{classifyType}") - CommonResult add( - @Parameter(description = "类别", required = true) - @PathVariable("classifyType") - StoreTypeEnum classifyType, - @Parameter(description = "分类信息请求报文体", required = true) - ClassifyRequest classifyRequest - ); - - @Operation(summary = "更新分类信息") - @PutMapping("/types/{classifyType}/ids/{id}") - CommonResult update( - @Parameter(description = "类别", required = true) - @PathVariable("classifyType") - StoreTypeEnum classifyType, - @Parameter(description = "分类ID", required = true) - @PathVariable("id") - String id, - @Parameter(description = "分类信息请求报文体", required = true) - ClassifyRequest classifyRequest - ); - - @Operation(summary = "获取所有分类信息") - @GetMapping("/types/{classifyType}") - CommonResult> listAllClassifys( - @Parameter(description = "类别", required = true) - @PathVariable("classifyType") - StoreTypeEnum classifyType - ); - - @Operation(summary = "根据ID获取分类信息") - @GetMapping("/{id}") - CommonResult getClassifyById( - @Parameter(description = "分类ID", required = true) - @RequestParam("id") - String id - ); - - @Operation(summary = "根据ID删除分类信息") - @DeleteMapping("/{id}") - CommonResult deleteClassifyById( - @Parameter(description = "分类ID", required = true) - @PathVariable("id") - String id - ); -} \ No newline at end of file diff --git a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpLabelResource.java b/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpLabelResource.java deleted file mode 100644 index 4561bfb7..00000000 --- a/modules/module-ci-store-api/src/main/java/cd/casic/pipeline/store/api/common/OpLabelResource.java +++ /dev/null @@ -1,65 +0,0 @@ -package cd.casic.pipeline.store.api.common; - -import cd.casic.framework.commons.pojo.CommonResult; -import cd.casic.pipeline.store.pojo.common.enums.StoreTypeEnum; -import cd.casic.pipeline.store.pojo.common.label.Label; -import cd.casic.pipeline.store.pojo.common.label.LabelRequest; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@Tag(name = "OP_STORE_LABEL", description = "OP-STORE-标签") -@RestController -@RequestMapping("/op/store/label") -public interface OpLabelResource { - - @Operation(summary = "添加标签") - @PostMapping("/types/{labelType}") - CommonResult add( - @Parameter(description = "类别", required = true) - @PathVariable("labelType") - StoreTypeEnum labelType, - @Parameter(description = "标签信息请求报文体", required = true) - LabelRequest labelRequest - ); - - @Operation(summary = "更新标签信息") - @PutMapping("/types/{labelType}/ids/{id}") - CommonResult update( - @Parameter(description = "类别", required = true) - @PathVariable("labelType") - StoreTypeEnum labelType, - @Parameter(description = "标签ID", required = true) - @PathVariable("id") - String id, - @Parameter(description = "标签信息请求报文体", required = true) - LabelRequest labelRequest - ); - - @Operation(summary = "获取所有标签信息") - @GetMapping("/types/{labelType}") - CommonResult> listAllLabels( - @Parameter(description = "类别", required = true) - @PathVariable("labelType") - StoreTypeEnum labelType - ); - - @Operation(summary = "根据ID获取标签信息") - @GetMapping("/{id}") - CommonResult