0530 ljc 删除无用代码
This commit is contained in:
parent
a80a0a9dba
commit
c7223f3ff3
@ -1,18 +0,0 @@
|
|||||||
package cd.casic.ci.commons.annotation.join;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@ClassName FindAll
|
|
||||||
*@Author hopeli
|
|
||||||
*@Date 2025/4/28 15:15
|
|
||||||
*@Version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Target({ElementType.METHOD})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface FindAll {
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package cd.casic.ci.commons.annotation.join;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName FindList
|
|
||||||
* @Author hopeli
|
|
||||||
* @Date 2025/4/28 15:18
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Target({ElementType.METHOD})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface FindList {
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package cd.casic.ci.commons.annotation.join;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@ClassName FindOne
|
|
||||||
*@Author hopeli
|
|
||||||
*@Date 2025/4/28 15:19
|
|
||||||
*@Version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Target({ElementType.METHOD})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface FindOne {
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package cd.casic.ci.commons.annotation.join;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Join
|
|
||||||
* @Author hopeli
|
|
||||||
* @Date 2025/5/2 18:38
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
@Target({ElementType.TYPE})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface Join {
|
|
||||||
Class model() default Object.class;
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package cd.casic.ci.commons.annotation.join;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName JoinProvider
|
|
||||||
* @Author hopeli
|
|
||||||
* @Date 2025/4/28 15:12
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
@Target({ElementType.TYPE})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface JoinProvider {
|
|
||||||
Class model() default Object.class;
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
package cd.casic.ci.commons.annotation.rpc;
|
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Exporter
|
|
||||||
* @Author hopeli
|
|
||||||
* @Date 2025/4/28 17:11
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
@Target({ElementType.TYPE})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Documented
|
|
||||||
public @interface Exporter {
|
|
||||||
String name() default "";
|
|
||||||
|
|
||||||
String version() default "0.0.0";
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package cd.casic.ci.commons.commons;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Pagination
|
|
||||||
* @Author hopeli
|
|
||||||
* @Date 2025/5/2 21:32
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Pagination<T> implements Serializable {
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 5016662499561189494L;
|
|
||||||
private int pageSize = 10;
|
|
||||||
private int currentPage = 1;
|
|
||||||
private int totalRecord;
|
|
||||||
private int totalPage;
|
|
||||||
private int beginIndex;
|
|
||||||
private int endIndex;
|
|
||||||
private List<T> dataList;
|
|
||||||
}
|
|
@ -1,214 +0,0 @@
|
|||||||
package cd.casic.ci.commons.commons;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname PipelineConstants
|
|
||||||
* @Description TODO
|
|
||||||
* @Date 2025/4/23 20:11
|
|
||||||
*/
|
|
||||||
public class PipelineConstants {
|
|
||||||
/**
|
|
||||||
* 项目名称
|
|
||||||
*/
|
|
||||||
public static final String appName = "ops";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DEFAULT
|
|
||||||
*/
|
|
||||||
public static final String DEFAULT = "default";
|
|
||||||
|
|
||||||
// 流水线运行权限 Key
|
|
||||||
public static final String PIPELINE_RUN_KEY = "pipeline_task_run";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线文件系统
|
|
||||||
*/
|
|
||||||
public static final String MATFLOW_WORKSPACE = "/source";
|
|
||||||
|
|
||||||
public static final String MATFLOW_LOGS = "/artifact";
|
|
||||||
|
|
||||||
public static final String MATFLOW_INSTABCE = "/instance";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线运行状态
|
|
||||||
*/
|
|
||||||
public static final String RUN_SUCCESS = "success";
|
|
||||||
|
|
||||||
public static final String RUN_ERROR = "error";
|
|
||||||
|
|
||||||
public static final String RUN_WAIT = "wait";
|
|
||||||
|
|
||||||
public static final String RUN_HALT = "halt";
|
|
||||||
|
|
||||||
public static final String RUN_RUN = "run";
|
|
||||||
|
|
||||||
public static final String RUN_SUSPEND = "suspend";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统编码
|
|
||||||
*/
|
|
||||||
//字节编码
|
|
||||||
public static final String UTF_8 = "UTF-8";
|
|
||||||
|
|
||||||
public static final String GBK = "GBK";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息
|
|
||||||
*/
|
|
||||||
//消息发送类型
|
|
||||||
public static final String MES_PIPELINE_RUN = "PIPELINE_RUN";
|
|
||||||
|
|
||||||
//消息发送方式
|
|
||||||
public static final String MES_SEND_SITE = "site";
|
|
||||||
public static final String MES_SEND_EMAIL = "email";
|
|
||||||
public static final String MES_SEND_DINGDING = "dingding";
|
|
||||||
public static final String MES_SEND_WECHAT = "qywechat";
|
|
||||||
public static final String MES_SEND_SMS = "sms";
|
|
||||||
|
|
||||||
//消息通知方案
|
|
||||||
public static final String MES_UPDATE = "MF_MES_TYPE_UPDATE";
|
|
||||||
public static final String MES_DELETE = "MF_MES_TYPE_DELETE";
|
|
||||||
public static final String MES_CREATE = "MF_MES_TYPE_CREATE";
|
|
||||||
public static final String MES_RUN = "MF_MES_TYPE_RUN";
|
|
||||||
|
|
||||||
// 日志类型
|
|
||||||
public static final String LOG_TYPE_CREATE = "MF_LOG_TYPE_CREATE";
|
|
||||||
|
|
||||||
public static final String LOG_TYPE_DELETE = "MF_LOG_TYPE_DELETE";
|
|
||||||
|
|
||||||
public static final String LOG_TYPE_UPDATE = "MF_LOG_TYPE_UPDATE";
|
|
||||||
|
|
||||||
public static final String LOG_TYPE_RUN = "MF_LOG_TYPE_RUN";
|
|
||||||
|
|
||||||
public static final String CREATE_LINK = "/pipeline/${pipelineId}/config";
|
|
||||||
|
|
||||||
public static final String DELETE_LINK = "/pipeline/${pipelineId}/delete";
|
|
||||||
|
|
||||||
public static final String UPDATE_LINK = "/pipeline/${pipelineId}/set/info";
|
|
||||||
|
|
||||||
public static final String RUN_LINK = "/pipeline/${pipelineId}/history/${instanceId}";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建产物信息
|
|
||||||
*/
|
|
||||||
// 默认制品地址
|
|
||||||
public static final String PROJECT_DEFAULT_ADDRESS = "${PROJECT_DEFAULT_ADDRESS}";
|
|
||||||
|
|
||||||
public static final String DEFAULT_ARTIFACT_ADDRESS = "DEFAULT_ARTIFACT_ADDRESS";
|
|
||||||
|
|
||||||
// 默认制品
|
|
||||||
public static final String DEFAULT_ARTIFACT_NAME = "DEFAULT_ARTIFACT_NAME";
|
|
||||||
|
|
||||||
// Docker制品
|
|
||||||
public static final String DEFAULT_ARTIFACT_DOCKER = "DEFAULT_ARTIFACT_DOCKER";
|
|
||||||
|
|
||||||
// Docker名称
|
|
||||||
public static final String DEFAULT_ARTIFACT_DOCKER_NAME = "DEFAULT_ARTIFACT_DOCKER_NAME";
|
|
||||||
|
|
||||||
// 默认源码位置
|
|
||||||
public static final String DEFAULT_CODE_ADDRESS = "${DEFAULT_CODE_ADDRESS}";
|
|
||||||
|
|
||||||
public static final String DEFAULT_TYPE = "string";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认命令
|
|
||||||
*/
|
|
||||||
public static final String TEST_DEFAULT_ORDER = "mvn test";
|
|
||||||
public static final String MAVEN_DEFAULT_ORDER = "mvn clean package";
|
|
||||||
public static final String NODE_DEFAULT_ORDER = "npm install";
|
|
||||||
public static final String DOCKER_DEFAULT_ORDER = "docker image build -t default .";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件信息
|
|
||||||
*/
|
|
||||||
public static final String FILE_TEMP_PREFIX = "temp";
|
|
||||||
public static final String FILE_TYPE_TXT = ".txt";
|
|
||||||
public static final String FILE_TYPE_SH = ".sh";
|
|
||||||
public static final String FILE_TYPE_BAT = ".bat";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统任务类型
|
|
||||||
*/
|
|
||||||
public static final String TASK_TOOL_TYPE_JDK = "jdk";
|
|
||||||
public static final String TASK_TOOL_TYPE_MAVEN = "maven";
|
|
||||||
public static final String TASK_TOOL_TYPE_GIT = "git";
|
|
||||||
public static final String TASK_TOOL_TYPE_SVN = "svn";
|
|
||||||
public static final String TASK_TOOL_TYPE_NODEJS = "nodejs";
|
|
||||||
public static final String TASK_TOOL_TYPE_NPM = "npm";
|
|
||||||
|
|
||||||
// 源码应用类型
|
|
||||||
public static final String TASK_TYPE_CODE = "code";
|
|
||||||
public static final String TASK_CODE_GIT = "git";
|
|
||||||
public static final String TASK_CODE_GITLAB = "gitlab";
|
|
||||||
public static final String TASK_CODE_PRI_GITLAB = "pri_gitlab";
|
|
||||||
public static final String TASK_CODE_GITHUB = "github";
|
|
||||||
public static final String TASK_CODE_GITEE = "gitee";
|
|
||||||
public static final String TASK_CODE_SVN = "svn";
|
|
||||||
public static final String TASK_CODE_XCODE = "gitpuk";
|
|
||||||
public static final String TASK_CODE_DEFAULT_BRANCH = "master";
|
|
||||||
|
|
||||||
// 构建应用类型
|
|
||||||
public static final String TASK_TYPE_BUILD = "build";
|
|
||||||
public static final String TASK_BUILD_MAVEN = "maven";
|
|
||||||
public static final String TASK_BUILD_NODEJS = "nodejs";
|
|
||||||
|
|
||||||
public static final String TASK_BUILD_DOCKER = "build_docker";
|
|
||||||
|
|
||||||
// 测试应用类型
|
|
||||||
public static final String TASK_TYPE_TEST = "test";
|
|
||||||
public static final String TASK_TEST_MAVENTEST = "maventest";
|
|
||||||
public static final String TASK_TEST_TESTON = "testhubo";
|
|
||||||
|
|
||||||
// 部署应用类型
|
|
||||||
public static final String TASK_TYPE_DEPLOY = "deploy";
|
|
||||||
public static final String TASK_DEPLOY_LINUX = "liunx";
|
|
||||||
public static final String TASK_DEPLOY_DOCKER = "docker";
|
|
||||||
public static final String TASK_DEPLOY_K8S = "k8s";
|
|
||||||
|
|
||||||
// 上传类型
|
|
||||||
public static final String TASK_TYPE_UPLOAD = "upload";
|
|
||||||
public static final String TASK_UPLOAD_HADESS = "upload_hadess";
|
|
||||||
public static final String TASK_UPLOAD_SSH = "upload_ssh";
|
|
||||||
public static final String TASK_UPLOAD_NEXUS = "upload_nexus";
|
|
||||||
public static final String TASK_UPLOAD_DOCKER = "upload_docker";
|
|
||||||
|
|
||||||
// 下载类型
|
|
||||||
public static final String TASK_TYPE_DOWNLOAD = "download";
|
|
||||||
public static final String TASK_DOWNLOAD_HADESS = "download_hadess";
|
|
||||||
public static final String TASK_DOWNLOAD_SSH = "download_ssh";
|
|
||||||
public static final String TASK_DOWNLOAD_NEXUS = "download_nexus";
|
|
||||||
public static final String TASK_DOWNLOAD_DOCKER = "download_docker";
|
|
||||||
|
|
||||||
// 代码扫描应用类型
|
|
||||||
public static final String TASK_TYPE_CODESCAN = "codescan";
|
|
||||||
public static final String TASK_CODESCAN_SONAR = "sonar";
|
|
||||||
public static final String TASK_CODESCAN_SPOTBUGS = "spotbugs";
|
|
||||||
|
|
||||||
// 消息应用类型
|
|
||||||
public static final String TASK_TYPE_MESSAGE = "message";
|
|
||||||
public static final String TASK_MESSAGE_MSG = "message";
|
|
||||||
|
|
||||||
// 脚本应用类型
|
|
||||||
public static final String TASK_TYPE_SCRIPT = "script";
|
|
||||||
public static final String TASK_SCRIPT_SHELL = "shell";
|
|
||||||
public static final String TASK_SCRIPT_SH = "sh";
|
|
||||||
public static final String TASK_SCRIPT_BASH = "bash";
|
|
||||||
public static final String TASK_SCRIPT_CMD = "cmd";
|
|
||||||
public static final String TASK_SCRIPT_BAT = "bat";
|
|
||||||
|
|
||||||
//触发器
|
|
||||||
public static final String TRIGGER_SCHEDULED = "scheduled";
|
|
||||||
|
|
||||||
public static final String SIZE_TYPE_MB = "MB";
|
|
||||||
|
|
||||||
public static final int DEFAULT_SIZE = 2;
|
|
||||||
|
|
||||||
public static final String SIZE_TYPE_GB = "GB";
|
|
||||||
|
|
||||||
public static final Integer DEFAULT_CLEAN_CACHE_DAY = 7;
|
|
||||||
|
|
||||||
public static final String AUTH_NONE = "none";
|
|
||||||
public static final String AUTH_USER_PASS = "userPass";
|
|
||||||
public static final String AUTH_PRI_KEY = "prikey";
|
|
||||||
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.execute;
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.engine.job.TaskExecMessage;
|
|
||||||
import cd.casic.ci.commons.bean.engine.postprocess.Postprocess;
|
|
||||||
import cd.casic.ci.commons.bean.process.definition.Variable;
|
|
||||||
import cd.casic.ci.commons.bean.process.setting.Scm;
|
|
||||||
import cd.casic.ci.commons.bean.process.stage.Stage;
|
|
||||||
import cd.casic.ci.commons.bean.work.agent.model.Agent;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线详情类,包含流水线的详细信息和相关配置
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class PipelineDetails {
|
|
||||||
|
|
||||||
// 应用数据保存地址
|
|
||||||
private String dataHome;
|
|
||||||
|
|
||||||
// 应用数据保存地址
|
|
||||||
private String sourceDir;
|
|
||||||
|
|
||||||
// 日志保存位置
|
|
||||||
private String logDir;
|
|
||||||
|
|
||||||
// 应用地址
|
|
||||||
private String applyHome;
|
|
||||||
|
|
||||||
// 流水线ID
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
// 实例ID
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
// 用户ID
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
// 运行方式
|
|
||||||
private Integer runWay;
|
|
||||||
|
|
||||||
//考虑是那个agent 使用
|
|
||||||
private Agent agent;
|
|
||||||
|
|
||||||
// 阶段任务
|
|
||||||
private List<Stage> stageList;
|
|
||||||
|
|
||||||
// 环境
|
|
||||||
private List<Scm> scmList;
|
|
||||||
|
|
||||||
// 变量
|
|
||||||
private List<Variable> variableList;
|
|
||||||
|
|
||||||
// 后置处理
|
|
||||||
private List<Postprocess> postprocessList;
|
|
||||||
|
|
||||||
private TaskExecMessage taskExecMessage;
|
|
||||||
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.execute;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
|
||||||
import cd.casic.ci.commons.bean.work.agent.model.Agent;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线运行消息类,包含流水线运行所需的基本信息
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineRunMsg {
|
|
||||||
|
|
||||||
// 流水线ID
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
// 用户ID
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
// 运行方式
|
|
||||||
private Integer runWay;
|
|
||||||
|
|
||||||
// 流水线信息
|
|
||||||
private Pipeline pipeline;
|
|
||||||
|
|
||||||
// 默认执行器
|
|
||||||
private String agentId;
|
|
||||||
|
|
||||||
// 执行器信息
|
|
||||||
private Agent agent;
|
|
||||||
|
|
||||||
// 实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
public PipelineRunMsg(String pipelineId, String userId, Integer runWay) {
|
|
||||||
this.pipelineId = pipelineId;
|
|
||||||
this.userId = userId;
|
|
||||||
this.runWay = runWay;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.job;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 执行发送消息通知需要的信息
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TaskExecMessage {
|
|
||||||
|
|
||||||
//流水线信息
|
|
||||||
private Pipeline pipeline;
|
|
||||||
|
|
||||||
//任务信息
|
|
||||||
private Tasks tasks;
|
|
||||||
|
|
||||||
//需要执行任务的名称
|
|
||||||
private String taskName;
|
|
||||||
|
|
||||||
//需要执行任务的Id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//执行任务的状态
|
|
||||||
private boolean execState;
|
|
||||||
|
|
||||||
//是任务还是流水线
|
|
||||||
private boolean execPipeline;
|
|
||||||
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
public TaskExecMessage(Pipeline pipeline, boolean execState) {
|
|
||||||
this.pipeline = pipeline;
|
|
||||||
this.execState = execState;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TaskExecMessage(Pipeline pipeline, String taskName, String taskId, boolean execState) {
|
|
||||||
this.pipeline = pipeline;
|
|
||||||
this.taskName = taskName;
|
|
||||||
this.taskId = taskId;
|
|
||||||
this.execState = execState;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TaskExecMessage(Pipeline pipeline, Tasks tasks, String taskName, boolean execState, boolean execPipeline) {
|
|
||||||
this.pipeline = pipeline;
|
|
||||||
this.tasks = tasks;
|
|
||||||
this.taskName = taskName;
|
|
||||||
this.execState = execState;
|
|
||||||
this.execPipeline = execPipeline;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,67 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.job;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.support.deploy.TaskDeployInstance;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 任务实例模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TaskInstance {
|
|
||||||
|
|
||||||
//日志id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
//历史Id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
//运行类型
|
|
||||||
private String taskType;
|
|
||||||
|
|
||||||
//执行顺序
|
|
||||||
private int jobSort;
|
|
||||||
|
|
||||||
//任务名称
|
|
||||||
private String taskName;
|
|
||||||
|
|
||||||
//运行日志地址
|
|
||||||
private String logAddress;
|
|
||||||
|
|
||||||
//运行时间
|
|
||||||
private int runTime;
|
|
||||||
|
|
||||||
//运行时间
|
|
||||||
private String runTimeDate;
|
|
||||||
|
|
||||||
//运行状态 error.失败 success.成功 halt.停止 wait.等待,后面设置成枚举
|
|
||||||
private String runState;
|
|
||||||
|
|
||||||
//阶段id
|
|
||||||
private String stagesId;
|
|
||||||
|
|
||||||
//后置任务id
|
|
||||||
private String postprocessId;
|
|
||||||
|
|
||||||
//运行日志
|
|
||||||
private String runLog;
|
|
||||||
|
|
||||||
// 部署实例日志
|
|
||||||
private List<TaskDeployInstance> deployInstanceList;
|
|
||||||
// 执行顺序
|
|
||||||
private int taskSort ;
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.job;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 任务实例模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TaskInstanceQuery {
|
|
||||||
|
|
||||||
//历史Id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
//运行类型
|
|
||||||
private String jobType;
|
|
||||||
|
|
||||||
//运行状态 error.失败 success.成功 halt.停止 wait.等待
|
|
||||||
private String runState;
|
|
||||||
|
|
||||||
//阶段id
|
|
||||||
private String stagesId;
|
|
||||||
|
|
||||||
//后置任务id
|
|
||||||
private String postprocessId;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.job;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线配置顺序模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Tasks {
|
|
||||||
|
|
||||||
//配置id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//类型1-10:源码,10-20:测试,20-30:构建,30-40:部署,40-50:代码扫描,50-60:推送制品
|
|
||||||
private String taskType;
|
|
||||||
|
|
||||||
//顺序
|
|
||||||
private int taskSort;
|
|
||||||
|
|
||||||
//顺序
|
|
||||||
private String taskName;
|
|
||||||
|
|
||||||
//任务
|
|
||||||
private Object values;
|
|
||||||
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
private String postprocessId;
|
|
||||||
|
|
||||||
//阶段
|
|
||||||
private String stageId;
|
|
||||||
|
|
||||||
//任务
|
|
||||||
private Object task;
|
|
||||||
|
|
||||||
// 执行实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
public Tasks(String createTime, String taskType) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
this.taskType = taskType;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.job;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线配置顺序模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TasksQuery {
|
|
||||||
|
|
||||||
//配置id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//类型1-10:源码,10-20:测试,20-30:构建,30-40:部署,40-50:代码扫描,50-60:推送制品
|
|
||||||
private String taskType;
|
|
||||||
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
//后置处理id
|
|
||||||
private String postprocessId;
|
|
||||||
;
|
|
||||||
|
|
||||||
//阶段
|
|
||||||
private String stageId;
|
|
||||||
|
|
||||||
//阶段
|
|
||||||
private String taskSort;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.postprocess;
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.engine.job.Tasks;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线后置处理模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Postprocess {
|
|
||||||
|
|
||||||
private String postId;
|
|
||||||
|
|
||||||
//名称
|
|
||||||
private String postName;
|
|
||||||
|
|
||||||
//类型 61:消息通知 71:bat脚本 72:sh脚本")
|
|
||||||
private String taskType;
|
|
||||||
|
|
||||||
//创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//任务id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
//任务详情
|
|
||||||
private Object values;
|
|
||||||
|
|
||||||
//任务
|
|
||||||
private Tasks task;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实例ID
|
|
||||||
*/
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务排序
|
|
||||||
*/
|
|
||||||
private int taskSort;
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.postprocess;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线后置处理实例
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PostprocessInstance {
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
//实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
//任务实例id
|
|
||||||
private String taskInstanceId;
|
|
||||||
|
|
||||||
//日志地址
|
|
||||||
private String postAddress;
|
|
||||||
|
|
||||||
//运行时间
|
|
||||||
private Integer postTime;
|
|
||||||
|
|
||||||
//运行状态
|
|
||||||
private String postState;
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.engine.postprocess;
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线后置处理模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PostprocessQuery {
|
|
||||||
|
|
||||||
//任务id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//流水线id
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam= new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams ;
|
|
||||||
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
package cd.casic.ci.commons.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname ApplicationException
|
|
||||||
* @Description TODO
|
|
||||||
* @Date 2025/4/23 20:17
|
|
||||||
*/
|
|
||||||
public class ApplicationException extends RuntimeException {
|
|
||||||
|
|
||||||
private int errorCode;
|
|
||||||
|
|
||||||
public ApplicationException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplicationException(int errorCode, String message) {
|
|
||||||
super(message);
|
|
||||||
this.errorCode = errorCode;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
package cd.casic.ci.commons.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname SystemException
|
|
||||||
* @Description TODO
|
|
||||||
* @Date 2025/4/23 20:54
|
|
||||||
*/
|
|
||||||
public class SystemException extends RuntimeException {
|
|
||||||
public SystemException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
package cd.casic.ci.commons.order;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Order implements Serializable {
|
|
||||||
private String name;
|
|
||||||
private OrderTypeEnum orderType;
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package cd.casic.ci.commons.order;
|
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class OrderBuilder implements Serializable {
|
|
||||||
public OrderBuilder() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Order asc(String propertyName) {
|
|
||||||
return new Order(propertyName, OrderTypeEnum.asc);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Order desc(String propertyName) {
|
|
||||||
return new Order(propertyName, OrderTypeEnum.desc);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package cd.casic.ci.commons.order;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class OrderBuilders implements Serializable {
|
|
||||||
List<Order> orderParams = new ArrayList();
|
|
||||||
|
|
||||||
public OrderBuilders() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static OrderBuilders instance() {
|
|
||||||
return new OrderBuilders();
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrderBuilders asc(String name) {
|
|
||||||
this.orderParams.add(OrderBuilder.asc(name));
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrderBuilders desc(String name) {
|
|
||||||
this.orderParams.add(OrderBuilder.desc(name));
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Order> get() {
|
|
||||||
return this.orderParams;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
package cd.casic.ci.commons.order;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public enum OrderTypeEnum implements Serializable {
|
|
||||||
asc,
|
|
||||||
desc;
|
|
||||||
|
|
||||||
private OrderTypeEnum() {
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线变量模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Condition {
|
|
||||||
|
|
||||||
//条件id
|
|
||||||
private String condId;
|
|
||||||
|
|
||||||
//条件名称
|
|
||||||
private String condName;
|
|
||||||
|
|
||||||
//任务id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//条件类型 1.等于 2.不等于
|
|
||||||
private int condType;
|
|
||||||
|
|
||||||
//条件key
|
|
||||||
private String condKey;
|
|
||||||
|
|
||||||
//条件value
|
|
||||||
private String condValue;
|
|
||||||
|
|
||||||
}
|
|
@ -1,92 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.setting.Env;
|
|
||||||
import cd.casic.ci.commons.bean.process.setting.Group;
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Pipeline
|
|
||||||
* @Description 流水线模型
|
|
||||||
* @Date 2025/4/21 21:07
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Pipeline {
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
//流水线名称
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
//流水线用户
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
|
|
||||||
//流水线环境
|
|
||||||
private Env env;
|
|
||||||
|
|
||||||
//流水线组
|
|
||||||
private Group group;
|
|
||||||
|
|
||||||
//流水线创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//流水线类型 1.多任务 2.多阶段
|
|
||||||
private int type;
|
|
||||||
|
|
||||||
//运行状态 1.未运行 2.运行中
|
|
||||||
private int state;
|
|
||||||
|
|
||||||
//1.全局 2.项目
|
|
||||||
private int power;
|
|
||||||
|
|
||||||
//流水线模板
|
|
||||||
private String template;
|
|
||||||
|
|
||||||
//收藏 0.未收藏 1.收藏
|
|
||||||
private int collect;
|
|
||||||
|
|
||||||
//流水线成员
|
|
||||||
private List<AdminUserRespDTO> userList;
|
|
||||||
|
|
||||||
// 以下为统计信息
|
|
||||||
//用户(执行人)
|
|
||||||
private String executorName;
|
|
||||||
|
|
||||||
//执行次数
|
|
||||||
private Integer number;
|
|
||||||
|
|
||||||
//实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
//最近构建状态
|
|
||||||
private String buildStatus;
|
|
||||||
|
|
||||||
//最近构建时间
|
|
||||||
private String lastBuildTime;
|
|
||||||
|
|
||||||
//是否可以执行
|
|
||||||
private Boolean isExec;
|
|
||||||
/**
|
|
||||||
* @pi.name:color
|
|
||||||
* @pi.dataType:Integer
|
|
||||||
* @pi.desc:颜色 1~5随机生成
|
|
||||||
* @pi.value:2
|
|
||||||
*/
|
|
||||||
private int color;
|
|
||||||
|
|
||||||
public Pipeline(String pipelineId) {
|
|
||||||
this.id = pipelineId;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线收藏模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineFollow {
|
|
||||||
|
|
||||||
//日志id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
//用户id
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
//流水线信息
|
|
||||||
private Pipeline pipeline;
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import cn.hutool.db.Page;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线触发器模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineFollowQuery {
|
|
||||||
//用户
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
//@流水线状态
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
//@ApiProperty(name ="pageParam",desc = "分页参数")
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.support.count.PipelineOverview;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import org.mapstruct.Mappings;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线最近打开模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineOpen {
|
|
||||||
|
|
||||||
private String openId;
|
|
||||||
|
|
||||||
//用户id
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
private Pipeline pipeline;
|
|
||||||
|
|
||||||
private int number;
|
|
||||||
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//流水线执行统计信息
|
|
||||||
private PipelineOverview pipelineOverview;
|
|
||||||
public void setPipelineExecState(PipelineOverview pipelineOverview) {
|
|
||||||
this.pipelineOverview = pipelineOverview;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线最近打开模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineOpenQuery {
|
|
||||||
|
|
||||||
private String openId;
|
|
||||||
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
private Object orderParams;
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import cn.hutool.db.Page;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线查询模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineQuery {
|
|
||||||
|
|
||||||
//用户Id
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
// 创建人
|
|
||||||
private String createUserId;
|
|
||||||
|
|
||||||
//流水线名称
|
|
||||||
private String pipelineName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线状态 1.运行中 2.未运行,3.等待执行
|
|
||||||
*/
|
|
||||||
private Integer pipelineState;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线类型 1.多任务 2.多阶段
|
|
||||||
*/
|
|
||||||
private Integer pipelineType;
|
|
||||||
|
|
||||||
//流水线权限
|
|
||||||
private Integer pipelinePower;
|
|
||||||
|
|
||||||
//收藏, 1.收藏 0.未收藏
|
|
||||||
private Integer pipelineFollow;
|
|
||||||
|
|
||||||
//流水线id数组
|
|
||||||
private String[] idString;
|
|
||||||
|
|
||||||
private boolean eqName;
|
|
||||||
|
|
||||||
// 环境
|
|
||||||
private String envId;
|
|
||||||
|
|
||||||
// 分组
|
|
||||||
private String groupId;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams ;
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线运行状态
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineRecently {
|
|
||||||
|
|
||||||
// 流水线id
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
// 流水线实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
// 流水线名称
|
|
||||||
private String pipelineName;
|
|
||||||
|
|
||||||
// 状态 1.未运行 2.运行中
|
|
||||||
private String execTime;
|
|
||||||
|
|
||||||
// 上次运行时间
|
|
||||||
private String lastRunTime;
|
|
||||||
|
|
||||||
// 上次运行状态
|
|
||||||
private String lastRunState;
|
|
||||||
|
|
||||||
// 构建次数
|
|
||||||
private Integer number;
|
|
||||||
|
|
||||||
private Integer lastRunType;
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.definition;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线条件模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Variable {
|
|
||||||
|
|
||||||
|
|
||||||
//id
|
|
||||||
private String varId;
|
|
||||||
|
|
||||||
//创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//类型 str.字符串 single .单选
|
|
||||||
private String varType;
|
|
||||||
|
|
||||||
//类型 1.全局 2.项目
|
|
||||||
private int type;
|
|
||||||
|
|
||||||
//任务id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//流水线id
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
//名称
|
|
||||||
private String varKey;
|
|
||||||
|
|
||||||
//默认值
|
|
||||||
private String varValue;
|
|
||||||
|
|
||||||
//值
|
|
||||||
private String varValues;
|
|
||||||
|
|
||||||
private List<String> valueList;
|
|
||||||
|
|
||||||
public Variable(String varKey, String varValue) {
|
|
||||||
this.varKey = varKey;
|
|
||||||
this.varValue = varValue;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,74 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.instance;
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线实例模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineInstance {
|
|
||||||
|
|
||||||
//构建实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
//创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//运行方式(1.手动运行 2.触发器运行)
|
|
||||||
private int runWay;
|
|
||||||
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
//运行状态 1.失败 10.成功 20:停止
|
|
||||||
private String runStatus;
|
|
||||||
|
|
||||||
//运行时间
|
|
||||||
private int runTime;
|
|
||||||
|
|
||||||
private Pipeline pipeline;
|
|
||||||
|
|
||||||
//构建次数
|
|
||||||
private int findNumber;
|
|
||||||
|
|
||||||
//运行时间
|
|
||||||
private String runTimeDate;
|
|
||||||
|
|
||||||
//日志文件
|
|
||||||
private String logPath;
|
|
||||||
|
|
||||||
private Boolean exec;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化信息
|
|
||||||
*
|
|
||||||
* @param createTime 时间
|
|
||||||
* @param runWay 运行方式
|
|
||||||
* @param userId 用户id
|
|
||||||
* @param pipelineId 流水线id
|
|
||||||
*/
|
|
||||||
public PipelineInstance(String createTime, int runWay, Long userId, String pipelineId) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
this.runWay = runWay;
|
|
||||||
AdminUserRespDTO user = new AdminUserRespDTO();
|
|
||||||
user.setId(userId);
|
|
||||||
this.pipeline = new Pipeline(pipelineId);
|
|
||||||
}
|
|
||||||
|
|
||||||
//执行时间
|
|
||||||
private List<Integer> timeList;
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.instance;
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import cn.hutool.db.Page;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线实例分页筛选模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineInstanceQuery {
|
|
||||||
|
|
||||||
//流水线id
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
//状态
|
|
||||||
private String state;
|
|
||||||
|
|
||||||
//用户id
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
//类型
|
|
||||||
private int type;
|
|
||||||
|
|
||||||
//用户流水线
|
|
||||||
private List<Pipeline> pipelineList;
|
|
||||||
|
|
||||||
//用户流水线
|
|
||||||
private String[] ids;
|
|
||||||
|
|
||||||
private String number;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Classname package-info
|
|
||||||
* @Description TODO
|
|
||||||
* @Date 2025/4/21 21:05
|
|
||||||
* @author by mianbin
|
|
||||||
*/
|
|
||||||
package cd.casic.ci.commons.bean.process;
|
|
@ -1,48 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线基本认证模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Auth {
|
|
||||||
|
|
||||||
private String authId;
|
|
||||||
|
|
||||||
//类型 1.用户名密码 2.私钥
|
|
||||||
private int authType;
|
|
||||||
|
|
||||||
//名称
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
//用户名
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
//密码
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
//私钥
|
|
||||||
private String privateKey;
|
|
||||||
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
//是否公开1.公开,2.不公开
|
|
||||||
private Integer authPublic;
|
|
||||||
}
|
|
@ -1,113 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线主机认证模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthHost {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:hostId
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:id
|
|
||||||
* @pi.value:hostId
|
|
||||||
*/
|
|
||||||
private String hostId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:type
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:类型 common 普通 aliyun 阿里云; tencent. 腾讯云
|
|
||||||
* @pi.value:aliyun
|
|
||||||
*/
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:authType
|
|
||||||
* @pi.dataType:Integer
|
|
||||||
* @pi.desc:认证类型 1.用户名密码 2. 通用认证
|
|
||||||
* @pi.value: 1
|
|
||||||
*/
|
|
||||||
private Integer authType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:name
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:名称
|
|
||||||
* @pi.value:name
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:ip
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:ip地址
|
|
||||||
* @pi.value:ip
|
|
||||||
*/
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:port
|
|
||||||
* @pi.dataType:Integer
|
|
||||||
* @pi.desc:端口号
|
|
||||||
* @pi.value:8080
|
|
||||||
*/
|
|
||||||
private Integer port;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:createTime
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:创建时间
|
|
||||||
* @pi.value:createTime
|
|
||||||
*/
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:username
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:用户名
|
|
||||||
* @pi.value:username
|
|
||||||
*/
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:password
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:密码
|
|
||||||
* @pi.value:password
|
|
||||||
*/
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:privateKey
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:私钥
|
|
||||||
* @pi.value:privateKey
|
|
||||||
*/
|
|
||||||
private String privateKey;
|
|
||||||
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:authPublic
|
|
||||||
* @pi.dataType:Integer
|
|
||||||
* @pi.desc:是否公开 1.公开 3.不公开
|
|
||||||
* @pi.value:1
|
|
||||||
*/
|
|
||||||
private int authPublic;
|
|
||||||
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 主机组
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthHostGroup {
|
|
||||||
|
|
||||||
// ID
|
|
||||||
private String groupId;
|
|
||||||
|
|
||||||
// 名称
|
|
||||||
private String groupName;
|
|
||||||
|
|
||||||
//创建人
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
//是否公开 1:公开, 2:不公开
|
|
||||||
private int authPublic;
|
|
||||||
|
|
||||||
// 说明
|
|
||||||
private String details;
|
|
||||||
|
|
||||||
// 创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
// 主机组
|
|
||||||
private List<AuthHostGroupDetails> detailsList;
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 主机组与主机的关联关系
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthHostGroupDetails {
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
// 主机组ID
|
|
||||||
private String groupId;
|
|
||||||
|
|
||||||
// 主机ID
|
|
||||||
private AuthHost authHost;
|
|
||||||
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线触发器模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthHostGroupQuery {
|
|
||||||
|
|
||||||
private String groupName;
|
|
||||||
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
|
|
||||||
}
|
|
@ -1,117 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线主机认证模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthHostK8s {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:hostId
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:id
|
|
||||||
* @pi.value:hostId
|
|
||||||
*/
|
|
||||||
private String hostId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:type
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:类型 common 普通 aliyun 阿里云; tencent. 腾讯云
|
|
||||||
* @pi.value:aliyun
|
|
||||||
*/
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:authType
|
|
||||||
* @pi.dataType:Integer
|
|
||||||
* @pi.desc:认证类型 1.用户名密码 2. 通用认证
|
|
||||||
* @pi.value: 1
|
|
||||||
*/
|
|
||||||
private Integer authType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:name
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:名称
|
|
||||||
* @pi.value:name
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:ip
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:ip地址
|
|
||||||
* @pi.value:ip
|
|
||||||
*/
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:port
|
|
||||||
* @pi.dataType:Integer
|
|
||||||
* @pi.desc:端口号
|
|
||||||
* @pi.value:8080
|
|
||||||
*/
|
|
||||||
private Integer port;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:createTime
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:创建时间
|
|
||||||
* @pi.value:createTime
|
|
||||||
*/
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:username
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:用户名
|
|
||||||
* @pi.value:username
|
|
||||||
*/
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:password
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:密码
|
|
||||||
* @pi.value:password
|
|
||||||
*/
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:privateKey
|
|
||||||
* @pi.dataType:string
|
|
||||||
* @pi.desc:私钥
|
|
||||||
* @pi.value:privateKey
|
|
||||||
*/
|
|
||||||
private String privateKey;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.model:user
|
|
||||||
* @pi.desc:创建人
|
|
||||||
*/
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @pi.name:authPublic
|
|
||||||
* @pi.dataType:Integer
|
|
||||||
* @pi.desc:是否公开 1.公开 3.不公开
|
|
||||||
* @pi.value:1
|
|
||||||
*/
|
|
||||||
private int authPublic;
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthHostK8sQuery {
|
|
||||||
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthHostQuery {
|
|
||||||
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
private Object orderParams;
|
|
||||||
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线第三方模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthThird {
|
|
||||||
|
|
||||||
private String serverId;
|
|
||||||
|
|
||||||
//类型 gitee,github,gitlab,sonar,nexus
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
//认证类型 1.用户名密码 2. 通用认证
|
|
||||||
private int authType;
|
|
||||||
|
|
||||||
//服务名称
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
private String privateKey;
|
|
||||||
|
|
||||||
//服务地址
|
|
||||||
private String serverAddress;
|
|
||||||
|
|
||||||
//授权信息
|
|
||||||
private String accessToken;
|
|
||||||
|
|
||||||
//刷新授权
|
|
||||||
private String refreshToken;
|
|
||||||
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
//授权id
|
|
||||||
private String clientId;
|
|
||||||
|
|
||||||
//授权密码
|
|
||||||
private String clientSecret;
|
|
||||||
|
|
||||||
//回调地址
|
|
||||||
private String callbackUrl;
|
|
||||||
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
//是否公开
|
|
||||||
private int authPublic;
|
|
||||||
|
|
||||||
//授权信息
|
|
||||||
private String message;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线第三方模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AuthThirdQuery {
|
|
||||||
|
|
||||||
//类型 1. gitee 2. github 3.sonar 4.nexus"
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
//认证类型 1.用户名密码 2. 通用认证
|
|
||||||
private int authType;
|
|
||||||
|
|
||||||
//服务名称
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
//createTime
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
private String serverAddress;
|
|
||||||
|
|
||||||
private String usrId;
|
|
||||||
|
|
||||||
//是否公开
|
|
||||||
private int authPublic;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线触发器模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Cache {
|
|
||||||
|
|
||||||
// 主键ID
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
// 日志缓存
|
|
||||||
private int logCache;
|
|
||||||
|
|
||||||
// 制品缓存
|
|
||||||
private int artifactCache;
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线触发器模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Env {
|
|
||||||
|
|
||||||
// id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
// 环境名称
|
|
||||||
private String envName;
|
|
||||||
|
|
||||||
// 创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
// 说明
|
|
||||||
private String detail;
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EnvQuery {
|
|
||||||
|
|
||||||
// 环境名称
|
|
||||||
private String envName;
|
|
||||||
|
|
||||||
// 用户ID
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Group {
|
|
||||||
|
|
||||||
// id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
// 环境名称
|
|
||||||
private String groupName;
|
|
||||||
|
|
||||||
// 创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
// 说明
|
|
||||||
private String detail;
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import cn.hutool.db.Page;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class GroupQuery {
|
|
||||||
|
|
||||||
// 环境名称
|
|
||||||
private String groupName;
|
|
||||||
|
|
||||||
// 用户ID
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
//@ApiProperty(name ="pageParam",desc = "分页参数")
|
|
||||||
private Page pageParam= new Page();
|
|
||||||
|
|
||||||
//@ApiProperty(name ="orderParams",desc = "排序参数")
|
|
||||||
private Object orderParams ;
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 主机组
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class HostGroup {
|
|
||||||
|
|
||||||
private String taskInstanceId;
|
|
||||||
|
|
||||||
private List<AuthHostGroupDetails> authHostGroupDetailList;
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Resources {
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
private int version;
|
|
||||||
|
|
||||||
//月份
|
|
||||||
private String month;
|
|
||||||
|
|
||||||
//使用并发数
|
|
||||||
private int useCcyNumber;
|
|
||||||
|
|
||||||
//剩余并发数
|
|
||||||
private int residueCcyNumber;
|
|
||||||
|
|
||||||
//总并发数
|
|
||||||
private int ccyNumber;
|
|
||||||
|
|
||||||
//总构建时长
|
|
||||||
private int sceNumber;
|
|
||||||
|
|
||||||
//使用构建时长
|
|
||||||
private int useSceNumber;
|
|
||||||
|
|
||||||
//剩余构建时长
|
|
||||||
private int residueSceNumber;
|
|
||||||
|
|
||||||
//总缓存大小
|
|
||||||
private double cacheNumber;
|
|
||||||
|
|
||||||
//使用缓存大小
|
|
||||||
private double useCacheNumber;
|
|
||||||
|
|
||||||
//剩余缓存大小
|
|
||||||
private double residueCacheNumber;
|
|
||||||
|
|
||||||
private String beginTime;
|
|
||||||
|
|
||||||
private String endTime;
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线触发器模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ResourcesDetails {
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
private String sourceCache;
|
|
||||||
|
|
||||||
private String artifactCache;
|
|
||||||
|
|
||||||
private List<String> list;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线环境配置模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Scm {
|
|
||||||
|
|
||||||
private String scmId;
|
|
||||||
|
|
||||||
//类型
|
|
||||||
private String scmType;
|
|
||||||
|
|
||||||
//名称
|
|
||||||
private String scmName;
|
|
||||||
|
|
||||||
//创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//地址
|
|
||||||
private String scmAddress;
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import cn.hutool.db.Page;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线环境配置模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ScmQuery {
|
|
||||||
|
|
||||||
//类型
|
|
||||||
private String scmType;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.setting;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线系统信息模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class SystemMassage {
|
|
||||||
|
|
||||||
//系统版本
|
|
||||||
private String workspace;
|
|
||||||
|
|
||||||
//java版本
|
|
||||||
private String JavaVersion = System.getProperty("java.version");
|
|
||||||
|
|
||||||
//java安装路径
|
|
||||||
private String javaHome = System.getProperty("java.home");
|
|
||||||
|
|
||||||
//用户名
|
|
||||||
private String userName = System.getProperty("user.name");
|
|
||||||
|
|
||||||
//应用地址
|
|
||||||
private String osName = System.getProperty("os.name");
|
|
||||||
|
|
||||||
//ip地址
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
//系统版本
|
|
||||||
private String userDir = System.getProperty("user.dir");
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.stage;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.engine.job.Tasks;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线阶段模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class Stage {
|
|
||||||
|
|
||||||
//id
|
|
||||||
private String stageId;
|
|
||||||
|
|
||||||
//名称
|
|
||||||
private String stageName;
|
|
||||||
|
|
||||||
//创建时间
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
//流水线id
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
//阶段顺序
|
|
||||||
private int stageSort;
|
|
||||||
|
|
||||||
//主阶段
|
|
||||||
private String parentId;
|
|
||||||
|
|
||||||
//是否是源码
|
|
||||||
private boolean code = false;
|
|
||||||
|
|
||||||
//阶段任务
|
|
||||||
private List<Tasks> taskValues;
|
|
||||||
|
|
||||||
//阶段
|
|
||||||
private List<Stage> stageList;
|
|
||||||
|
|
||||||
//任务类型
|
|
||||||
private String taskType;
|
|
||||||
|
|
||||||
//任务id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//更新内容
|
|
||||||
private Object values;
|
|
||||||
|
|
||||||
//任务顺序
|
|
||||||
private int taskSort;
|
|
||||||
|
|
||||||
//并行阶段名称
|
|
||||||
private String parallelName;
|
|
||||||
|
|
||||||
// 执行实例id
|
|
||||||
private String instanceId;
|
|
||||||
}
|
|
@ -1,59 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.stage;
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.engine.job.TaskInstance;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 阶段运行实例模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class StageInstance {
|
|
||||||
|
|
||||||
//id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
//阶段名称
|
|
||||||
private String stageName;
|
|
||||||
|
|
||||||
//实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
//阶段顺序
|
|
||||||
private int stageSort;
|
|
||||||
|
|
||||||
//运行日志地址
|
|
||||||
private String stageAddress;
|
|
||||||
|
|
||||||
//运行时间
|
|
||||||
private int stageTime;
|
|
||||||
|
|
||||||
//运行状态
|
|
||||||
private String stageState;
|
|
||||||
|
|
||||||
//阶段id
|
|
||||||
private String parentId;
|
|
||||||
|
|
||||||
//阶段运行日志
|
|
||||||
private String runLog;
|
|
||||||
|
|
||||||
//阶段实例
|
|
||||||
private List<StageInstance> stageInstanceList;
|
|
||||||
|
|
||||||
//任务实例
|
|
||||||
private List<TaskInstance> taskInstanceList;
|
|
||||||
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.process.stage;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
import cn.hutool.db.Page;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 阶段运行实例模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class StageInstanceQuery {
|
|
||||||
|
|
||||||
//阶段名称
|
|
||||||
private String stageName;
|
|
||||||
|
|
||||||
//实例id
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
//阶段顺序
|
|
||||||
private int stageSort;
|
|
||||||
|
|
||||||
//运行状态
|
|
||||||
private String stageState;
|
|
||||||
|
|
||||||
//阶段id
|
|
||||||
private String parentId;
|
|
||||||
|
|
||||||
//分页参数
|
|
||||||
private PageParam pageParam = new PageParam();
|
|
||||||
|
|
||||||
//排序参数
|
|
||||||
private Object orderParams;
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线日统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineDayCount {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期
|
|
||||||
*/
|
|
||||||
private String time;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线时间统计
|
|
||||||
*/
|
|
||||||
private PipelineTimeCount timeCount;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线日成功率统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineDayRateCount {
|
|
||||||
|
|
||||||
// 流水线
|
|
||||||
private Pipeline pipeline;
|
|
||||||
|
|
||||||
// 总数
|
|
||||||
private Integer allNumber;
|
|
||||||
|
|
||||||
// 成功数
|
|
||||||
private Integer successNumber;
|
|
||||||
|
|
||||||
// 失败数
|
|
||||||
private Integer errorNumber;
|
|
||||||
|
|
||||||
// 成功率
|
|
||||||
private String successRate;
|
|
||||||
|
|
||||||
// 用户数
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
|
|
||||||
public PipelineDayRateCount(Pipeline pipeline, Integer allNumber) {
|
|
||||||
this.pipeline = pipeline;
|
|
||||||
this.allNumber = allNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PipelineDayRateCount(AdminUserRespDTO adminUserRespDTO, Integer allNumber) {
|
|
||||||
this.adminUserRespDTO = adminUserRespDTO;
|
|
||||||
this.allNumber = allNumber;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线概况统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineOverview {
|
|
||||||
|
|
||||||
//运行次数
|
|
||||||
private int allNumber;
|
|
||||||
|
|
||||||
//平均执行时长
|
|
||||||
private int execTime;
|
|
||||||
|
|
||||||
//成功次数
|
|
||||||
private int successNumber;
|
|
||||||
|
|
||||||
//失败次数
|
|
||||||
private int errorNumber;
|
|
||||||
|
|
||||||
//停止次数
|
|
||||||
private int haltNumber;
|
|
||||||
|
|
||||||
//平均执行时长(转换成时分秒)
|
|
||||||
private String time;
|
|
||||||
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线运行统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineRunCount {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期
|
|
||||||
*/
|
|
||||||
private String day;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数量
|
|
||||||
*/
|
|
||||||
private double number;
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线运行统计查询模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineRunCountQuery {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线ID
|
|
||||||
*/
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
// 查询时间
|
|
||||||
private String[] queryTime = new String[]{};
|
|
||||||
|
|
||||||
// 查询时间
|
|
||||||
private int countDay = 0;
|
|
||||||
|
|
||||||
// success(成功) error(失败) halt(停止) time(时间),rate(速率)
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线运行日统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineRunDayCount {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期
|
|
||||||
*/
|
|
||||||
private String day;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运行时间统计列表
|
|
||||||
*/
|
|
||||||
private List<PipelineRunTimeCount> runTimeCountList;
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线运行结果统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineRunResultCount {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期
|
|
||||||
*/
|
|
||||||
private String day;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总数
|
|
||||||
*/
|
|
||||||
private Integer allNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 成功次数
|
|
||||||
*/
|
|
||||||
private double successNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 成功率
|
|
||||||
*/
|
|
||||||
private String successRate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 失败次数
|
|
||||||
*/
|
|
||||||
private double errorNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 暂停次数
|
|
||||||
*/
|
|
||||||
private double haltNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行时间
|
|
||||||
*/
|
|
||||||
private String execTime;
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线运行时间统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineRunTimeCount {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 时间
|
|
||||||
*/
|
|
||||||
private String time;
|
|
||||||
|
|
||||||
private Integer number;
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
|
||||||
import cd.casic.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线调查统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineSurveyCount {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线
|
|
||||||
*/
|
|
||||||
private Pipeline pipeline;
|
|
||||||
|
|
||||||
// 负责人
|
|
||||||
private AdminUserRespDTO adminUserRespDTO;
|
|
||||||
|
|
||||||
// 所有运行数量
|
|
||||||
private Integer allInstanceNumber;
|
|
||||||
|
|
||||||
// 成功率
|
|
||||||
private String successRate;
|
|
||||||
|
|
||||||
// 成功数
|
|
||||||
private String successNumber;
|
|
||||||
|
|
||||||
// 失败率
|
|
||||||
private String errorRate;
|
|
||||||
|
|
||||||
// 失败数
|
|
||||||
private String errorNumber;
|
|
||||||
|
|
||||||
// 停止率
|
|
||||||
private String haltRate;
|
|
||||||
|
|
||||||
// 停止数
|
|
||||||
private String haltNumber;
|
|
||||||
|
|
||||||
// 最近运行时间
|
|
||||||
private String recentlyRunTime;
|
|
||||||
|
|
||||||
// 运行时长
|
|
||||||
private String runTime;
|
|
||||||
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线调查统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineSurveyResultCount {
|
|
||||||
|
|
||||||
// 成功数
|
|
||||||
private Long successNumber;
|
|
||||||
|
|
||||||
// 失败数
|
|
||||||
private Long errorNumber;
|
|
||||||
|
|
||||||
// 停止数
|
|
||||||
private Long haltNumber;
|
|
||||||
|
|
||||||
// 平均执行时长
|
|
||||||
private String runTime;
|
|
||||||
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.count;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线时间统计模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class PipelineTimeCount {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所有数量
|
|
||||||
*/
|
|
||||||
private Integer allNumber = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 错误数量
|
|
||||||
*/
|
|
||||||
private Integer errNumber = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 成功数量
|
|
||||||
*/
|
|
||||||
private Integer successNumber = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 停止数量
|
|
||||||
*/
|
|
||||||
private Integer haltNumber = 0;
|
|
||||||
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.deploy;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.setting.HostGroup;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务部署模型
|
|
||||||
*
|
|
||||||
* @author mianbin
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TaskDeploy {
|
|
||||||
|
|
||||||
//id
|
|
||||||
private String taskId;
|
|
||||||
|
|
||||||
//部署方式,自定义部署,结构化部署
|
|
||||||
private int authType;
|
|
||||||
|
|
||||||
//文件地址
|
|
||||||
private String localAddress;
|
|
||||||
|
|
||||||
//部署地址
|
|
||||||
private String deployAddress;
|
|
||||||
|
|
||||||
//认证id
|
|
||||||
private String authId;
|
|
||||||
|
|
||||||
//部署命令
|
|
||||||
private String deployOrder;
|
|
||||||
|
|
||||||
//启动文件地址
|
|
||||||
private String startAddress;
|
|
||||||
|
|
||||||
//启动命令
|
|
||||||
private String startOrder;
|
|
||||||
|
|
||||||
//规则
|
|
||||||
private String rule;
|
|
||||||
|
|
||||||
//规则
|
|
||||||
private String dockerImage;
|
|
||||||
|
|
||||||
// 主机类型 host--主机 hostGroup--主机组
|
|
||||||
private String hostType;
|
|
||||||
|
|
||||||
//授权信息
|
|
||||||
private Object auth;
|
|
||||||
|
|
||||||
private int sort;
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
// 命名空间
|
|
||||||
private String k8sNamespace;
|
|
||||||
|
|
||||||
// 配置文件
|
|
||||||
private String k8sJson;
|
|
||||||
|
|
||||||
// 策略类型
|
|
||||||
private String strategyType;
|
|
||||||
|
|
||||||
// 策略数量
|
|
||||||
private Integer strategyNumber;
|
|
||||||
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
private List<HostGroup> hostGroupList;
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.deploy;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TaskDeployInstance {
|
|
||||||
|
|
||||||
// id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
// 实例ID
|
|
||||||
private String taskInstanceId;
|
|
||||||
|
|
||||||
// 名称
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
// 时间
|
|
||||||
private String runTime;
|
|
||||||
|
|
||||||
// 状态
|
|
||||||
private String runStatus;
|
|
||||||
|
|
||||||
// 运行日志
|
|
||||||
private String runLog;
|
|
||||||
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
public TaskDeployInstance(String id, String taskInstanceId) {
|
|
||||||
this.id = id;
|
|
||||||
this.taskInstanceId = taskInstanceId;
|
|
||||||
this.runStatus = "wait";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.deploy;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TaskDeployInstanceQuery {
|
|
||||||
|
|
||||||
// 实例ID
|
|
||||||
private String taskInstanceId;
|
|
||||||
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.deploy;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.bean.process.setting.AuthHost;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class TaskDeployStrategy {
|
|
||||||
|
|
||||||
private String taskInstanceId;
|
|
||||||
|
|
||||||
private String strategyInstanceId;
|
|
||||||
|
|
||||||
private List<AuthHost> authHostList;
|
|
||||||
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
/**
|
|
||||||
* @Classname package-info
|
|
||||||
* @Description TODO
|
|
||||||
* @Date 2025/4/21 21:06
|
|
||||||
* @author by mianbin
|
|
||||||
*/
|
|
||||||
package cd.casic.ci.commons.bean.support;
|
|
@ -1,53 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.support.webhook;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Test
|
|
||||||
* @Description 流水线webhook模型
|
|
||||||
* @Date 2025/4/22 8:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class WebHook {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ID
|
|
||||||
*/
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型
|
|
||||||
*/
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水线ID
|
|
||||||
*/
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参数
|
|
||||||
*/
|
|
||||||
private String parameters;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package cd.casic.ci.commons.utils;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName JdbcTemplate
|
|
||||||
* @Author hopeli
|
|
||||||
* @Date 2025/5/2 21:29
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(JdbcTemplate.class);
|
|
||||||
|
|
||||||
public JdbcTemplate(DataSource dataSource) {
|
|
||||||
super(dataSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
public JdbcTemplate(DataSource dataSource, boolean lazyInit) {
|
|
||||||
super(dataSource, lazyInit);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,342 +0,0 @@
|
|||||||
package cd.casic.ci.commons.utils;
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.exception.ApplicationException;
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static cd.casic.ci.commons.commons.PipelineConstants.FILE_TEMP_PREFIX;
|
|
||||||
import static cd.casic.ci.commons.commons.PipelineConstants.SIZE_TYPE_MB;
|
|
||||||
|
|
||||||
|
|
||||||
public class PipelineFileUtil {
|
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(PipelineFileUtil.class);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文件夹下所有的文件
|
|
||||||
*
|
|
||||||
* @param path 目录地址
|
|
||||||
* @param list new ArrayList<>()
|
|
||||||
* @return 文件夹下的文件集合
|
|
||||||
*/
|
|
||||||
public static List<String> getFilePath(File path, List<String> list) {
|
|
||||||
File[] fa = path.listFiles();
|
|
||||||
if (fa != null) {
|
|
||||||
for (File file : fa) {
|
|
||||||
if (file.isDirectory()) {
|
|
||||||
getFilePath(file, list);
|
|
||||||
}
|
|
||||||
list.add(file.getPath());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 效验地址是否存在配置文件
|
|
||||||
*
|
|
||||||
* @param fileAddress 文件地址
|
|
||||||
* @param type 文件类型
|
|
||||||
* // * @return 匹配状态 1.不是个目录或不存在这个文件夹 2. 空目录找不到可执行文件 0. 匹配成功
|
|
||||||
*/
|
|
||||||
public static void validFile(String fileAddress, String type) throws ApplicationException {
|
|
||||||
File file = new File(fileAddress);
|
|
||||||
|
|
||||||
//不存在这个目录
|
|
||||||
if (!file.exists()) {
|
|
||||||
throw new ApplicationException("git可执行程序地址错误,找不到 " + fileAddress + " 这个目录。");
|
|
||||||
}
|
|
||||||
//不是个目录
|
|
||||||
if (!file.isDirectory()) {
|
|
||||||
throw new ApplicationException(fileAddress + "不是个目录。");
|
|
||||||
}
|
|
||||||
//不存在可执行文件
|
|
||||||
File[] files = file.listFiles();
|
|
||||||
if (files == null || files.length == 0) {
|
|
||||||
throw new ApplicationException("在" + fileAddress + "找不到可执行文件。");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (File listFile : Objects.requireNonNull(file.listFiles())) {
|
|
||||||
if (listFile.isDirectory()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String name = listFile.getName();
|
|
||||||
switch (type) {
|
|
||||||
case "1", "2", "3", "4", "git", "gitee", "github", "gitlab", "xcode" -> {
|
|
||||||
if (name.equals("git") || name.equals("git.exe")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "5", "svn" -> {
|
|
||||||
if (name.equals("svn") || name.equals("svn.exe")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "21", "maven" -> {
|
|
||||||
if (name.equals("mvn")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "22", "nodejs" -> {
|
|
||||||
if (name.equals("npm")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建临时文件写入信息
|
|
||||||
*
|
|
||||||
* @param key 私钥内容
|
|
||||||
* @param suffix 后缀
|
|
||||||
* @return 文件地址
|
|
||||||
*/
|
|
||||||
public static String createTempFile(String key, String suffix) {
|
|
||||||
FileWriter writer = null;
|
|
||||||
String path;
|
|
||||||
try {
|
|
||||||
try {
|
|
||||||
File tempFile = File.createTempFile(FILE_TEMP_PREFIX, suffix);
|
|
||||||
path = tempFile.getPath();
|
|
||||||
writer = new FileWriter(path);
|
|
||||||
writer.write(key);
|
|
||||||
writer.flush();
|
|
||||||
writer.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
return null;
|
|
||||||
} finally {
|
|
||||||
if (writer != null) {
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建目录
|
|
||||||
*
|
|
||||||
* @param address 文件地址
|
|
||||||
* @throws ApplicationException 文件创建失败
|
|
||||||
*/
|
|
||||||
public static void createDirectory(String address) throws ApplicationException {
|
|
||||||
File file = new File(address);
|
|
||||||
if (file.exists()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int i = 0;
|
|
||||||
boolean b = false;
|
|
||||||
if (!file.exists()) {
|
|
||||||
while (!b && i <= 10) {
|
|
||||||
b = file.mkdirs();
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (i >= 10) {
|
|
||||||
throw new ApplicationException("项目工作目录创建失败。");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建文件
|
|
||||||
*
|
|
||||||
* @param address 文件地址
|
|
||||||
* @throws ApplicationException 文件创建失败
|
|
||||||
*/
|
|
||||||
public static void createFile(String address) throws ApplicationException {
|
|
||||||
File file = new File(address);
|
|
||||||
String parent = file.getParent();
|
|
||||||
File parentFile = new File(parent);
|
|
||||||
try {
|
|
||||||
if (!parentFile.exists()) {
|
|
||||||
createDirectory(parent);
|
|
||||||
}
|
|
||||||
boolean newFile = file.createNewFile();
|
|
||||||
if (!newFile) {
|
|
||||||
throw new ApplicationException("文件创建失败!" + address);
|
|
||||||
}
|
|
||||||
} catch (IOException | ApplicationException e) {
|
|
||||||
throw new ApplicationException("文件创建失败。");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字符串写入文件
|
|
||||||
*
|
|
||||||
* @param str 字符串
|
|
||||||
* @param path 文件地址
|
|
||||||
* @throws ApplicationException 写入失败
|
|
||||||
*/
|
|
||||||
public static void logWriteFile(String str, String path) throws ApplicationException {
|
|
||||||
if (StringUtils.isEmpty(str)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try (FileWriter writer = new FileWriter(path, StandardCharsets.UTF_8, true)) {
|
|
||||||
writer.write(str);
|
|
||||||
writer.flush();
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new ApplicationException("文件写入失败," + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 读取文件后100行内容 0读取全部
|
|
||||||
*
|
|
||||||
* @param fileAddress 文件地址
|
|
||||||
* @return 内容
|
|
||||||
*/
|
|
||||||
public static String readFile(String fileAddress, int length) throws ApplicationException {
|
|
||||||
|
|
||||||
if (StringUtils.isEmpty(fileAddress) || !new File(fileAddress).exists()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder s = new StringBuilder();
|
|
||||||
try {
|
|
||||||
Path path = Paths.get(fileAddress);
|
|
||||||
List<String> lines;
|
|
||||||
if (length == 0) {
|
|
||||||
lines = Files.readAllLines(path, StandardCharsets.UTF_8);
|
|
||||||
for (String line : lines) {
|
|
||||||
s.append(line).append("\n");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
lines = Files.readAllLines(path, StandardCharsets.UTF_8);
|
|
||||||
for (int i = Math.max(0, lines.size() - length); i < lines.size(); i++) {
|
|
||||||
s.append(lines.get(i)).append("\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new ApplicationException("读取文件信息失败" + e.getMessage());
|
|
||||||
}
|
|
||||||
return s.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除文件
|
|
||||||
*
|
|
||||||
* @param file 文件地址
|
|
||||||
* @return 是否删除 true 删除成功,false 删除失败
|
|
||||||
*/
|
|
||||||
public static Boolean deleteFile(File file) {
|
|
||||||
|
|
||||||
if (!file.exists()) {
|
|
||||||
logger.warn("文件不存在!{}", file.getAbsolutePath());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
boolean b = FileUtil.del(file);
|
|
||||||
if (!b) {
|
|
||||||
logger.error("文件删除失败!{}", file.getAbsolutePath());
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
logger.warn("文件删除成功!{}", file.getAbsolutePath());
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取磁盘大小
|
|
||||||
*
|
|
||||||
* @param dir
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static float findDiskSize(String dir) {
|
|
||||||
File folder = new File(dir);
|
|
||||||
if (!folder.exists()) {
|
|
||||||
folder.mkdirs();
|
|
||||||
}
|
|
||||||
while (folder.getParentFile() != null) {
|
|
||||||
folder = folder.getParentFile();
|
|
||||||
}
|
|
||||||
String rootPath = folder.getPath();
|
|
||||||
File root = new File(rootPath);
|
|
||||||
long diskSpace = root.getTotalSpace();
|
|
||||||
float l = (float) diskSpace / (1024 * 1024 * 1024);
|
|
||||||
// 使用 BigDecimal 控制小数位数
|
|
||||||
BigDecimal decimalL = new BigDecimal(Float.toString(l));
|
|
||||||
decimalL = decimalL.setScale(2, RoundingMode.HALF_UP);
|
|
||||||
|
|
||||||
return decimalL.floatValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文件夹大小
|
|
||||||
*
|
|
||||||
* @param dir 文件夹
|
|
||||||
* @param type 返回指定类型 mb 或 gb
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static float findDirSize(String dir, String type) {
|
|
||||||
File folder = new File(dir);
|
|
||||||
|
|
||||||
if (!folder.exists()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
long diskSpace;
|
|
||||||
if (folder.isFile()) {
|
|
||||||
diskSpace = folder.length();
|
|
||||||
} else {
|
|
||||||
diskSpace = calculateDiskSpace(folder);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type.equals(SIZE_TYPE_MB)) {
|
|
||||||
// 转换成mb
|
|
||||||
float mbSize = (float) diskSpace / (1024 * 1024);
|
|
||||||
BigDecimal mbDecimalL = new BigDecimal(Float.toString(mbSize));
|
|
||||||
mbDecimalL = mbDecimalL.setScale(0, RoundingMode.HALF_UP);
|
|
||||||
mbSize = mbDecimalL.floatValue();
|
|
||||||
|
|
||||||
return mbSize;
|
|
||||||
} else {
|
|
||||||
// 转换成gb
|
|
||||||
float gbSize = (float) diskSpace / (1024 * 1024 * 1024);
|
|
||||||
BigDecimal decimalL = new BigDecimal(Float.toString(gbSize));
|
|
||||||
decimalL = decimalL.setScale(2, RoundingMode.HALF_UP);
|
|
||||||
gbSize = decimalL.floatValue();
|
|
||||||
return gbSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static long calculateDiskSpace(File file) {
|
|
||||||
long space = 0;
|
|
||||||
if (file.isFile()) {
|
|
||||||
space = file.length();
|
|
||||||
} else if (file.isDirectory()) {
|
|
||||||
File[] files = file.listFiles();
|
|
||||||
if (files != null) {
|
|
||||||
for (File subFile : files) {
|
|
||||||
space += calculateDiskSpace(subFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return space;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,470 +0,0 @@
|
|||||||
package cd.casic.ci.commons.utils;
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.exception.ApplicationException;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 效验地址,文件操作
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class PipelineUtil {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回系统时间
|
|
||||||
*
|
|
||||||
* @param type 时间类型 1.(yyyy-MM-dd HH:mm:ss) 2.(yyyy-MM-dd) 3.(HH:mm:ss) 4.([format]) 5.(HH:mm)
|
|
||||||
* @return 时间
|
|
||||||
*/
|
|
||||||
public static String date(int type) {
|
|
||||||
switch (type) {
|
|
||||||
case 2 -> {
|
|
||||||
return new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
|
||||||
}
|
|
||||||
case 3 -> {
|
|
||||||
return new SimpleDateFormat("HH:mm:ss").format(new Date());
|
|
||||||
}
|
|
||||||
case 4 -> {
|
|
||||||
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
|
||||||
return "[" + format + "]" + " ";
|
|
||||||
}
|
|
||||||
case 5 -> {
|
|
||||||
return new SimpleDateFormat("HH:mm").format(new Date());
|
|
||||||
}
|
|
||||||
case 6 -> {
|
|
||||||
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(new Date());
|
|
||||||
}
|
|
||||||
default -> {
|
|
||||||
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前时间的指定的时间 如:获取前一个月,一天,一年,或后一天,一年等
|
|
||||||
*
|
|
||||||
* @param field Calendar.MONTH 月 ;Calendar.DATE 天;Calendar.YEAR 年,等
|
|
||||||
* @param number 1 往后 ,-1 往前
|
|
||||||
* @return 时间
|
|
||||||
*/
|
|
||||||
public static Date findDate(int field, int number) {
|
|
||||||
//获取当前日期
|
|
||||||
Date date = new Date();
|
|
||||||
//创建Calendar实例
|
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
//设置当前时间
|
|
||||||
cal.setTime(date);
|
|
||||||
//在当前时间基础上减一月
|
|
||||||
// cal.add(Calendar.MONTH,-1);
|
|
||||||
// 同理增加一天的方法:
|
|
||||||
// cal.add(Calendar.DATE, 1);
|
|
||||||
cal.add(field, number);
|
|
||||||
return cal.getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字符串转换成时间
|
|
||||||
*
|
|
||||||
* @param time 时间字符串
|
|
||||||
* @return 时间
|
|
||||||
*/
|
|
||||||
public static Date StringChengeDate(String time) {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
Date targetTime;
|
|
||||||
try {
|
|
||||||
targetTime = sdf.parse(time);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
throw new ApplicationException("时间转换失败,不是yyyy-MM-dd HH:mm:ss格式:" + time);
|
|
||||||
}
|
|
||||||
return targetTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取指定指定时间与现在时间是否相差在指定天数内
|
|
||||||
*
|
|
||||||
* @param targetTime 指定时间
|
|
||||||
* @param dayNumber 天数
|
|
||||||
* @return 不为空则代表在相差时间内
|
|
||||||
*/
|
|
||||||
public static String findDateTime(Date targetTime, Integer dayNumber) {
|
|
||||||
|
|
||||||
Date currentDate = new Date();
|
|
||||||
|
|
||||||
// 将Date类型转换为Calendar类型
|
|
||||||
Calendar targetCalendar = Calendar.getInstance();
|
|
||||||
targetCalendar.setTime(targetTime);
|
|
||||||
|
|
||||||
// 计算时间差
|
|
||||||
long diffMillis = currentDate.getTime() - targetCalendar.getTimeInMillis();
|
|
||||||
long diffSeconds = diffMillis / 1000;
|
|
||||||
long diffMinutes = diffSeconds / 60;
|
|
||||||
long diffHours = diffMinutes / 60;
|
|
||||||
long diffDays = diffHours / 24;
|
|
||||||
|
|
||||||
int day = (int) diffDays;
|
|
||||||
int hours = (int) diffHours % 24;
|
|
||||||
int minutes = (int) diffMinutes % 60;
|
|
||||||
int seconds = (int) diffSeconds % 60;
|
|
||||||
|
|
||||||
String time = "";
|
|
||||||
|
|
||||||
if (day > dayNumber && dayNumber != 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (seconds != 0) {
|
|
||||||
time = seconds + " 秒";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (minutes != 0) {
|
|
||||||
time = minutes + " 分 " + time;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hours != 0) {
|
|
||||||
if (minutes != 0) {
|
|
||||||
time = hours + " 小时 " + minutes + " 分";
|
|
||||||
} else {
|
|
||||||
time = hours + " 小时";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (day != 0) {
|
|
||||||
if (day == 1 && hours == 0) {
|
|
||||||
return (hours + 24) + " 小时 " + minutes + " 分前 ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (day > 365) {
|
|
||||||
int year = day / 365;
|
|
||||||
int i = day - year * 365;
|
|
||||||
time = year + " 年 " + i + " 天 ";
|
|
||||||
} else {
|
|
||||||
time = day + " 天 ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hours != 0) {
|
|
||||||
time = time + hours + " 小时";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (time.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return time + "前";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//时间转换成时分秒
|
|
||||||
public static String formatDateTime(long time) {
|
|
||||||
String DateTimes;
|
|
||||||
long days = time / (60 * 60 * 24);
|
|
||||||
long hours = (time % (60 * 60 * 24)) / (60 * 60);
|
|
||||||
long minutes = (time % (60 * 60)) / 60;
|
|
||||||
long seconds = time % 60;
|
|
||||||
if (days > 0) {
|
|
||||||
DateTimes = days + " 天" + hours + " 时" + minutes + " 分" + seconds + " 秒";
|
|
||||||
} else if (hours > 0) {
|
|
||||||
DateTimes = hours + " 时" + minutes + " 分" + seconds + " 秒";
|
|
||||||
} else if (minutes > 0) {
|
|
||||||
DateTimes = minutes + " 分" + seconds + " 秒";
|
|
||||||
} else {
|
|
||||||
DateTimes = seconds + " 秒";
|
|
||||||
}
|
|
||||||
return DateTimes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回今天星期几
|
|
||||||
*
|
|
||||||
* @return 1: 周一 7:周天
|
|
||||||
*/
|
|
||||||
public static int week() {
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
int i = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
|
||||||
if (i == 0) {
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统类型
|
|
||||||
*
|
|
||||||
* @return 1.windows 2.其他
|
|
||||||
*/
|
|
||||||
public static int findSystemType() {
|
|
||||||
String property = System.getProperty("os.name");
|
|
||||||
if (property.contains("Windows")) {
|
|
||||||
return 1;
|
|
||||||
} else if (property.contains("mac")) {
|
|
||||||
return 3;
|
|
||||||
} else {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行cmd命令
|
|
||||||
*
|
|
||||||
* @param path 执行文件夹
|
|
||||||
* @param order 执行命令
|
|
||||||
* @return 执行信息
|
|
||||||
* @throws IOException 调取命令行失败
|
|
||||||
*/
|
|
||||||
public static Process process(String path, String order) throws IOException {
|
|
||||||
Runtime runtime = Runtime.getRuntime();
|
|
||||||
Process process;
|
|
||||||
String[] cmd;
|
|
||||||
if (findSystemType() == 1) {
|
|
||||||
if (!PipelineUtil.isNoNull(path)) {
|
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder("cmd.exe", "/c", order);
|
|
||||||
process = processBuilder.start();
|
|
||||||
} else {
|
|
||||||
cmd = new String[]{"cmd.exe", "/c", " " + order};
|
|
||||||
process = runtime.exec(cmd, null, new File(path));
|
|
||||||
}
|
|
||||||
} else if (findSystemType() == 2) {
|
|
||||||
if (!PipelineUtil.isNoNull(path)) {
|
|
||||||
cmd = new String[]{"/bin/sh", "-c", " source /etc/profile;" + order};
|
|
||||||
process = runtime.exec(cmd);
|
|
||||||
} else {
|
|
||||||
cmd = new String[]{"/bin/sh", "-c", "cd " + path + ";" + " source /etc/profile;" + order};
|
|
||||||
process = runtime.exec(cmd, null, new File(path));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!PipelineUtil.isNoNull(path)) {
|
|
||||||
cmd = new String[]{"/bin/zsh", "-c", order};
|
|
||||||
process = runtime.exec(cmd);
|
|
||||||
} else {
|
|
||||||
cmd = new String[]{"/bin/zsh", "-c", "cd " + path + ";" + " source /etc/profile;" + order};
|
|
||||||
process = runtime.exec(cmd, null, new File(path));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return process;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回命令集合
|
|
||||||
*
|
|
||||||
* @param order 命令
|
|
||||||
* @return 命令集合
|
|
||||||
*/
|
|
||||||
public static List<String> execOrder(String order) {
|
|
||||||
if (!isNoNull(order)) {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
String[] split = order.split("\n");
|
|
||||||
List<String> list = new ArrayList<>();
|
|
||||||
for (String s : split) {
|
|
||||||
if (!isNoNull(s)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (s.contains("#")) {
|
|
||||||
int i = s.indexOf("#");
|
|
||||||
if (i != -1 && i != 0) {
|
|
||||||
String[] strings = s.split("#");
|
|
||||||
String string = strings[0];
|
|
||||||
list.add(string);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
list.add(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断字符串是否为空
|
|
||||||
*
|
|
||||||
* @param s 字符串
|
|
||||||
* @return true:不为空 false:空
|
|
||||||
*/
|
|
||||||
public static boolean isNoNull(String s) {
|
|
||||||
if (s == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (s.equals(" ")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (s.equals("\n")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (s.equals("null")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return !s.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 格式化输出流
|
|
||||||
*
|
|
||||||
* @param inputStream 流
|
|
||||||
* @param encode GBK,US-ASCII,ISO-8859-1,ISO-8859-1,UTF-16BE ,UTF-16LE, UTF-16,UTF-8
|
|
||||||
* @return 输出流
|
|
||||||
*/
|
|
||||||
public static InputStreamReader encode(InputStream inputStream, String encode) {
|
|
||||||
if (inputStream == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (encode != null) {
|
|
||||||
return new InputStreamReader(inputStream, Charset.forName(encode));
|
|
||||||
}
|
|
||||||
if (findSystemType() == 1) {
|
|
||||||
return new InputStreamReader(inputStream, Charset.forName("GBK"));
|
|
||||||
} else {
|
|
||||||
return new InputStreamReader(inputStream, StandardCharsets.UTF_8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 效验地址是否存在配置文件
|
|
||||||
*
|
|
||||||
* @param fileAddress 文件地址
|
|
||||||
* @param type 文件类型
|
|
||||||
* // * @return 匹配状态 1.不是个目录或不存在这个文件夹 2. 空目录找不到可执行文件 0. 匹配成功
|
|
||||||
*/
|
|
||||||
public static void validFile(String fileAddress, String type) throws ApplicationException {
|
|
||||||
File file = new File(fileAddress);
|
|
||||||
|
|
||||||
//不存在这个目录
|
|
||||||
if (!file.exists()) {
|
|
||||||
throw new ApplicationException("git可执行程序地址错误,找不到 " + fileAddress + " 这个目录。");
|
|
||||||
}
|
|
||||||
//不是个目录
|
|
||||||
if (!file.isDirectory()) {
|
|
||||||
throw new ApplicationException(fileAddress + "不是个目录。");
|
|
||||||
}
|
|
||||||
//不存在可执行文件
|
|
||||||
File[] files = file.listFiles();
|
|
||||||
if (files == null || files.length == 0) {
|
|
||||||
throw new ApplicationException("在" + fileAddress + "找不到可执行文件。");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (File listFile : Objects.requireNonNull(file.listFiles())) {
|
|
||||||
if (listFile.isDirectory()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String name = listFile.getName();
|
|
||||||
switch (type) {
|
|
||||||
case "git", "gitee", "github", "gitlab", "xcode" -> {
|
|
||||||
if ("git".equals(name) || "git.exe".equals(name)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "svn" -> {
|
|
||||||
if ("svn".equals(name) || "svn.exe".equals(name)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "maven" -> {
|
|
||||||
if ("mvn".equals(name)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "nodejs" -> {
|
|
||||||
if ("npm".equals(name)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 效验字段是否为空
|
|
||||||
*
|
|
||||||
* @param args 字段
|
|
||||||
* @return true:不为空 false:空
|
|
||||||
*/
|
|
||||||
public static Boolean validNoNullFiled(Object... args) {
|
|
||||||
if (Objects.isNull(args)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Object> list = Arrays.stream(args).toList();
|
|
||||||
for (Object object : list) {
|
|
||||||
if (object instanceof String) {
|
|
||||||
if (StringUtils.isEmpty((String) object)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (object instanceof Integer) {
|
|
||||||
if ((Integer) object == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Objects.isNull(object)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成随机字符串(1~33位)
|
|
||||||
*
|
|
||||||
* @param length 字符串长度
|
|
||||||
* @return 随机字符串
|
|
||||||
*/
|
|
||||||
public static String randomString(Integer length) {
|
|
||||||
String chars = "abcdefghijklmnopqrstuvwxyz123456789";
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
Random random = new Random();
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
int index = random.nextInt(chars.length());
|
|
||||||
sb.append(chars.charAt(index));
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
|||||||
package cd.casic.ci.commons.utils;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Result
|
|
||||||
* @Author hopeli
|
|
||||||
* @Date 2025/4/28 10:51
|
|
||||||
* @Version 1.0
|
|
||||||
**/
|
|
||||||
@Data
|
|
||||||
public class Result<T> implements Serializable {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = -3654582015538398741L;
|
|
||||||
private int code;
|
|
||||||
private T data;
|
|
||||||
private String msg;
|
|
||||||
private String detailMsg;
|
|
||||||
|
|
||||||
public Result() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Result(T data) {
|
|
||||||
this.code = 0;
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Result(T data, String msg) {
|
|
||||||
this.code = 0;
|
|
||||||
this.data = data;
|
|
||||||
this.msg = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Result(int code, String msg) {
|
|
||||||
this.code = code;
|
|
||||||
this.msg = msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Result(int code, String msg, String detailMsg) {
|
|
||||||
this.code = code;
|
|
||||||
this.msg = msg;
|
|
||||||
this.detailMsg = detailMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Result ok() {
|
|
||||||
return new Result();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> Result ok(T data) {
|
|
||||||
return new Result(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> Result ok(T data, String msg) {
|
|
||||||
return new Result(data, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Result error(int code, String msg) {
|
|
||||||
return new Result(code, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Result error(int code, String msg, String detailMsg) {
|
|
||||||
return new Result(code, msg, detailMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
int var10000 = this.code;
|
|
||||||
return "Result{code=" + var10000 + ", data=" + String.valueOf(this.data) + ", msg='" + this.msg + "', detailMsg='" + this.detailMsg + "'}";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.work.agent;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class AgentMessage {
|
|
||||||
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
private Object message;
|
|
||||||
|
|
||||||
private String pipelineId;
|
|
||||||
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.work.agent;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import cd.casic.ci.commons.order.Order;
|
|
||||||
import cd.casic.ci.commons.order.OrderBuilders;
|
|
||||||
import cd.casic.framework.commons.pojo.PageParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AgentQuery{
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
private PageParam pageParam= new PageParam();
|
|
||||||
|
|
||||||
private List<Order> orderParams = OrderBuilders.instance().desc("createTime").get();
|
|
||||||
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean.work.agent.model;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by mianbin
|
|
||||||
* @Classname Agent
|
|
||||||
* @Description agent 信息,先放着
|
|
||||||
* @Date 2025/4/22 9:05
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Agent {
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
private String tenantId;
|
|
||||||
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
private Boolean isConnect;
|
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
package cd.casic.ci.process.engine.scheduler;
|
package cd.casic.ci.process.engine.scheduler;
|
||||||
|
|
||||||
import cd.casic.ci.process.engine.executor.PipelineExecutor;
|
|
||||||
import cd.casic.ci.process.engine.scheduler.config.QuartzSchedulerManager;
|
import cd.casic.ci.process.engine.scheduler.config.QuartzSchedulerManager;
|
||||||
import cd.casic.ci.process.engine.scheduler.dao.PipelineSchedulingPropertiesDao;
|
import cd.casic.ci.process.engine.scheduler.dao.PipelineSchedulingPropertiesDao;
|
||||||
import cd.casic.ci.process.engine.scheduler.dateObject.PipelineSchedulingProperties;
|
import cd.casic.ci.process.engine.scheduler.dateObject.PipelineSchedulingProperties;
|
||||||
@ -25,8 +24,6 @@ import java.util.List;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PipelineSchedulingBootstrapper {
|
public class PipelineSchedulingBootstrapper {
|
||||||
private final QuartzSchedulerManager quartzSchedulerManager;
|
private final QuartzSchedulerManager quartzSchedulerManager;
|
||||||
private final PipelineExecutor pipelineExecutor;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PipelineSchedulingPropertiesDao pipelineSchedulingPropertiesDao;
|
private PipelineSchedulingPropertiesDao pipelineSchedulingPropertiesDao;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user