报错,提交
This commit is contained in:
parent
12b18d0651
commit
1c6d133f4b
6
.idea/CopilotChatHistory.xml
generated
6
.idea/CopilotChatHistory.xml
generated
@ -3,6 +3,12 @@
|
|||||||
<component name="CopilotChatHistory">
|
<component name="CopilotChatHistory">
|
||||||
<option name="conversations">
|
<option name="conversations">
|
||||||
<list>
|
<list>
|
||||||
|
<Conversation>
|
||||||
|
<option name="createTime" value="1745282575395" />
|
||||||
|
<option name="id" value="01965af2ac2378d890fe0ac269ec997c" />
|
||||||
|
<option name="title" value="新对话 2025年4月22日 08:42:55" />
|
||||||
|
<option name="updateTime" value="1745282575395" />
|
||||||
|
</Conversation>
|
||||||
<Conversation>
|
<Conversation>
|
||||||
<option name="createTime" value="1745238244591" />
|
<option name="createTime" value="1745238244591" />
|
||||||
<option name="id" value="0196584e3cef74dbaf973b7f37310765" />
|
<option name="id" value="0196584e3cef74dbaf973b7f37310765" />
|
||||||
|
6
dependencies/pom.xml
vendored
6
dependencies/pom.xml
vendored
@ -209,6 +209,12 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cd.casic.boot</groupId>
|
||||||
|
<artifactId>module-ci-commons</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cd.casic.boot</groupId>
|
<groupId>cd.casic.boot</groupId>
|
||||||
<artifactId>module-ci-process-api</artifactId>
|
<artifactId>module-ci-process-api</artifactId>
|
||||||
|
@ -19,7 +19,10 @@
|
|||||||
<groupId>cd.casic.boot</groupId>
|
<groupId>cd.casic.boot</groupId>
|
||||||
<artifactId>commons</artifactId>
|
<artifactId>commons</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cd.casic.boot</groupId>
|
||||||
|
<artifactId>module-system-api</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -0,0 +1,214 @@
|
|||||||
|
package cd.casic.ci.commons.bean.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";
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @Classname package-info
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/21 21:06
|
||||||
|
* @author by mianbin
|
||||||
|
*/
|
||||||
|
package cd.casic.ci.commons.bean.dispatch;
|
@ -0,0 +1,48 @@
|
|||||||
|
package cd.casic.ci.commons.bean.dispatch.trigger;
|
||||||
|
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.mapstruct.Mappings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname Test
|
||||||
|
* @Description 流水线触发器模型
|
||||||
|
* @Date 2025/4/22 8:45
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Trigger {
|
||||||
|
|
||||||
|
private String triggerId;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "类型 任务类型")
|
||||||
|
private int jobType;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
@Schema(description = "流水线id")
|
||||||
|
private Pipeline pipeline;
|
||||||
|
|
||||||
|
@Schema(description = "顺序")
|
||||||
|
private int jobSort;
|
||||||
|
|
||||||
|
@Schema(description = "更改的数据")
|
||||||
|
private Object values;
|
||||||
|
|
||||||
|
// 状态 1--未执行 2--已执行,后面枚举
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package cd.casic.ci.commons.bean.dispatch.trigger;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname Test
|
||||||
|
* @Description 流水线触发器模型
|
||||||
|
* @Date 2025/4/22 8:45
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TriggerQuery {
|
||||||
|
|
||||||
|
//名称
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
//定时任务
|
||||||
|
private int taskType;
|
||||||
|
/**
|
||||||
|
* 流水线ID
|
||||||
|
*/
|
||||||
|
private String pipelineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 1--未执行 2--已执行
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package cd.casic.ci.commons.bean.dispatch.trigger;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
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
|
||||||
|
public class TriggerTime {
|
||||||
|
|
||||||
|
private String timeId;
|
||||||
|
|
||||||
|
private int jobType;
|
||||||
|
|
||||||
|
private int date;
|
||||||
|
|
||||||
|
//具体时间
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
//配置id
|
||||||
|
private String triggerId;
|
||||||
|
|
||||||
|
//配置id
|
||||||
|
private String cron;
|
||||||
|
|
||||||
|
//具体执行时间
|
||||||
|
private String weekTime;
|
||||||
|
|
||||||
|
//执行时间
|
||||||
|
private String execTime;
|
||||||
|
|
||||||
|
//天数,周几 or 这里使用cron 表达式存储?
|
||||||
|
private List<Integer> timeList;
|
||||||
|
|
||||||
|
private Integer dayTime;
|
||||||
|
|
||||||
|
//类型
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
//名称
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
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.Agent;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
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
|
||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
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.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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @Classname package-info
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/21 21:06
|
||||||
|
* @author by mianbin
|
||||||
|
*/
|
||||||
|
package cd.casic.ci.commons.bean.engine;
|
@ -0,0 +1,54 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
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 ;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cd.casic.ci.commons.bean.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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package cd.casic.ci.commons.bean.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 +0,0 @@
|
|||||||
package cd.casic.ci.commons.bean;
|
|
@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
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 ExecVariable {
|
||||||
|
|
||||||
|
//类型 str.字符串 single.单选
|
||||||
|
private String varType;
|
||||||
|
|
||||||
|
//名称
|
||||||
|
private String varKey;
|
||||||
|
|
||||||
|
//默认值
|
||||||
|
private Object varValue;
|
||||||
|
|
||||||
|
//默认值
|
||||||
|
private String pipelineId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
public Pipeline(String pipelineId) {
|
||||||
|
this.id = pipelineId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package cd.casic.ci.commons.bean.process.definition;
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package cd.casic.ci.commons.bean.process.definition;
|
||||||
|
|
||||||
|
|
||||||
|
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 ;
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package cd.casic.ci.commons.bean.process.definition;
|
||||||
|
|
||||||
|
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 VariableQuery {
|
||||||
|
|
||||||
|
//类型 1.字符串 2.单选
|
||||||
|
private int taskType;
|
||||||
|
|
||||||
|
//类型 1.全局 2.项目
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
//任务id
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
//名称
|
||||||
|
private String varKey;
|
||||||
|
|
||||||
|
//默认值
|
||||||
|
private String varValue;
|
||||||
|
|
||||||
|
//值
|
||||||
|
private String varValues;
|
||||||
|
|
||||||
|
//流水线id
|
||||||
|
private String pipelineId;
|
||||||
|
|
||||||
|
//分页参数
|
||||||
|
private PageParam pageParam = new PageParam();
|
||||||
|
|
||||||
|
//排序参数
|
||||||
|
private Object orderParams;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cd.casic.ci.commons.bean.process.instance;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.definition.Pipeline;
|
||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @Classname package-info
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/21 21:05
|
||||||
|
* @author by mianbin
|
||||||
|
*/
|
||||||
|
package cd.casic.ci.commons.bean.process;
|
@ -0,0 +1,48 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,113 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,117 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
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 ;
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
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 ScmQuery {
|
||||||
|
|
||||||
|
//类型
|
||||||
|
private String scmType;
|
||||||
|
|
||||||
|
//分页参数
|
||||||
|
private PageParam pageParam = new PageParam();
|
||||||
|
|
||||||
|
//排序参数
|
||||||
|
private Object orderParams;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
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");
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cd.casic.ci.commons.bean.process.stage;
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
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";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @Classname package-info
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/21 21:06
|
||||||
|
* @author by mianbin
|
||||||
|
*/
|
||||||
|
package cd.casic.ci.commons.bean.support;
|
@ -0,0 +1,53 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,342 @@
|
|||||||
|
package cd.casic.ci.commons.bean.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.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.bean.commons.PipelineConstants.FILE_TEMP_PREFIX;
|
||||||
|
import static cd.casic.ci.commons.bean.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,470 @@
|
|||||||
|
package cd.casic.ci.commons.bean.utils;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
package cd.casic.ci.commons.bean.work.agent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname Agent
|
||||||
|
* @Description agent 信息,先放着
|
||||||
|
* @Date 2025/4/22 9:05
|
||||||
|
*/
|
||||||
|
public class Agent {
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @Classname package-info
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/22 9:05
|
||||||
|
* @author by mianbin
|
||||||
|
*/
|
||||||
|
package cd.casic.ci.commons.bean.work;
|
@ -1,7 +0,0 @@
|
|||||||
package cd.casic.module.process;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("Hello world!");
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,6 +20,24 @@
|
|||||||
<groupId>cd.casic.boot</groupId>
|
<groupId>cd.casic.boot</groupId>
|
||||||
<artifactId>module-ci-process-api</artifactId>
|
<artifactId>module-ci-process-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cd.casic.boot</groupId>
|
||||||
|
<artifactId>module-ci-commons</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cd.casic.boot</groupId>
|
||||||
|
<artifactId>module-system-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cd.casic.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mybatis</artifactId>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cd.casic.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -1,7 +0,0 @@
|
|||||||
package cd.casic.module.process;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("Hello world!");
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @Classname package-info
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 10:08
|
||||||
|
* @author by mianbin
|
||||||
|
*/
|
||||||
|
package cd.casic.module.process.convert;
|
@ -0,0 +1,27 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.Auth;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.AuthDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname AuthConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 16:37
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthConvert {
|
||||||
|
AuthConvert INSTANCE = Mappers.getMapper(AuthConvert.class);
|
||||||
|
|
||||||
|
Auth convert(AuthDo authDo);
|
||||||
|
|
||||||
|
AuthDo convertDo(Auth auth);
|
||||||
|
|
||||||
|
List<Auth> convertList(List<AuthDo> authDos);
|
||||||
|
|
||||||
|
List<AuthDo> convertDoList(List<Auth> auths);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.AuthHost;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.AuthHostDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname AuthHost
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 15:56
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthHostConvert {
|
||||||
|
AuthHostConvert INSTANCE = Mappers.getMapper(AuthHostConvert.class);
|
||||||
|
|
||||||
|
AuthHostDo convertDo(AuthHost authHost);
|
||||||
|
|
||||||
|
AuthHost convert(AuthHostDo authHostDo);
|
||||||
|
|
||||||
|
List<AuthHost> convertList(List<AuthHostDo> authHostGroupDos);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.AuthHostGroup;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.AuthHostGroupDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname AuthHostGroupConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 10:58
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthHostGroupConvert {
|
||||||
|
|
||||||
|
AuthHostGroupConvert INSTANCE = Mappers.getMapper(AuthHostGroupConvert.class);
|
||||||
|
|
||||||
|
AuthHostGroupDo convertDo(AuthHostGroup authHostGroup);
|
||||||
|
|
||||||
|
AuthHostGroup convert(AuthHostGroupDo authHostGroupDo);
|
||||||
|
|
||||||
|
List<AuthHostGroup> convertList(List<AuthHostGroupDo> authHostGroupDos);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.AuthHostGroupDetails;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.AuthHostGroupDetailsDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname AuthHostGroupDetailsConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 10:09
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthHostGroupDetailsConvert {
|
||||||
|
AuthHostGroupDetailsConvert INSTANCE = Mappers.getMapper(AuthHostGroupDetailsConvert.class);
|
||||||
|
|
||||||
|
AuthHostGroupDetailsDo convertDo(AuthHostGroupDetails authHostGroupDetails);
|
||||||
|
|
||||||
|
AuthHostGroupDetails convert(AuthHostGroupDetailsDo authHostGroupDetailsDo);
|
||||||
|
|
||||||
|
List<AuthHostGroupDetails> convertList(List<AuthHostGroupDetailsDo> list);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.AuthHostK8s;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.AuthHostK8sDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname AuthHostK8sConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 14:26
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthHostK8sConvert {
|
||||||
|
AuthHostK8sConvert INSTANCE = Mappers.getMapper(AuthHostK8sConvert.class);
|
||||||
|
|
||||||
|
AuthHostK8s convert(AuthHostK8sDo authHostK8sDo);
|
||||||
|
|
||||||
|
AuthHostK8sDo convertDo(AuthHostK8s authHostK8s);
|
||||||
|
|
||||||
|
List<AuthHostK8s> convertList(List<AuthHostK8sDo> list);
|
||||||
|
|
||||||
|
List<AuthHostK8sDo> convertDoList(List<AuthHostK8s> list);
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.AuthThird;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.AuthThirdDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname AuthThirdConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 16:38
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthThirdConvert {
|
||||||
|
|
||||||
|
AuthThirdConvert INSTANCE = Mappers.getMapper(AuthThirdConvert.class);
|
||||||
|
|
||||||
|
AuthThird convert(AuthThirdDo authThirdDo);
|
||||||
|
|
||||||
|
AuthThirdDo convertDo(AuthThird authThird);
|
||||||
|
|
||||||
|
List<AuthThird> convertList(List<AuthThirdDo> authThirdDos);
|
||||||
|
|
||||||
|
List<AuthThirdDo> convertDoList(List<AuthThird> authThirds);
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.Cache;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.CacheDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname CacheConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 16:39
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CacheConvert {
|
||||||
|
|
||||||
|
CacheConvert INSTANCE = Mappers.getMapper(CacheConvert.class);
|
||||||
|
|
||||||
|
Cache convert(CacheDo cacheDo);
|
||||||
|
|
||||||
|
CacheDo convert(Cache cache);
|
||||||
|
|
||||||
|
List<Cache> convert(List<CacheDo> cacheDos);
|
||||||
|
|
||||||
|
List<CacheDo> convertDoList(List<Cache> caches);
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.Env;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.EnvDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname EnvConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 16:40
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface EnvConvert {
|
||||||
|
|
||||||
|
EnvConvert INSTANCE = Mappers.getMapper(EnvConvert.class);
|
||||||
|
|
||||||
|
EnvDo convertDo(Env env);
|
||||||
|
|
||||||
|
Env convert(EnvDo envDo);
|
||||||
|
|
||||||
|
List<Env> convertList(List<EnvDo> envDos);
|
||||||
|
|
||||||
|
List<EnvDo> convertDoList(List<Env> envs);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.Group;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.GroupDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname Group
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 16:41
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface GroupConvert {
|
||||||
|
|
||||||
|
GroupConvert INSTANCE = Mappers.getMapper(GroupConvert.class);
|
||||||
|
|
||||||
|
Group convert(GroupDo groupDo);
|
||||||
|
|
||||||
|
GroupDo convertDo(Group group);
|
||||||
|
|
||||||
|
List<Group> convertList(List<GroupDo> groupDos);
|
||||||
|
|
||||||
|
List<GroupDo> convertDoList(List<Group> groups);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.process.setting.Resources;
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.ResourcesDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname ResourcesConvert
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 16:47
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ResourcesConvert {
|
||||||
|
|
||||||
|
ResourcesConvert INSTANCE = Mappers.getMapper(ResourcesConvert.class);
|
||||||
|
|
||||||
|
ResourcesDo convert(Resources resources);
|
||||||
|
|
||||||
|
Resources convert(ResourcesDo resourcesDo);
|
||||||
|
|
||||||
|
List<Resources> convertList(List<ResourcesDo> resourcesDos);
|
||||||
|
|
||||||
|
List<ResourcesDo> convertListDo(List<Resources> resources);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cd.casic.module.process.convert.setting;
|
||||||
|
|
||||||
|
import cd.casic.module.process.process.setting.dataobject.ScmDo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname Scm
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/24 16:49
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ScmConvert {
|
||||||
|
|
||||||
|
ScmConvert INSTANCE = Mappers.getMapper(ScmConvert.class);
|
||||||
|
|
||||||
|
ScmDo convert(ScmDo scmDo);
|
||||||
|
|
||||||
|
ScmDo convertDo(ScmDo scmDo);
|
||||||
|
|
||||||
|
List<ScmDo> convertList(List<ScmDo> scmDos);
|
||||||
|
|
||||||
|
List<ScmDo> convertDoList(List<ScmDo> scmDos);
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @Classname package-info
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/21 23:20
|
||||||
|
* @author by mianbin
|
||||||
|
*/
|
||||||
|
package cd.casic.module.process.dispatch;
|
@ -0,0 +1,128 @@
|
|||||||
|
package cd.casic.module.process.dispatch.trigger;
|
||||||
|
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.dispatch.trigger.Trigger;
|
||||||
|
import cd.casic.ci.commons.bean.dispatch.trigger.TriggerQuery;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流水线触发器服务接口
|
||||||
|
*/
|
||||||
|
public interface TriggerService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建配置及任务
|
||||||
|
*
|
||||||
|
* @param trigger 配置
|
||||||
|
* @return 配置id
|
||||||
|
*/
|
||||||
|
String createTrigger(Trigger trigger);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有配置
|
||||||
|
*
|
||||||
|
* @param triggerQuery 流水线id
|
||||||
|
* @return 配置列表
|
||||||
|
*/
|
||||||
|
List<Object> findAllTrigger(TriggerQuery triggerQuery);
|
||||||
|
|
||||||
|
|
||||||
|
void cloneTrigger(String pipelineId, String clonePipelineId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除流水线所有定时任务
|
||||||
|
*
|
||||||
|
* @param pipelineId 流水线id
|
||||||
|
*/
|
||||||
|
void deleteAllTrigger(String pipelineId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新单个定时任务
|
||||||
|
*
|
||||||
|
* @param triggerId 定时任务id
|
||||||
|
*/
|
||||||
|
void updateTrigger(String triggerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新配置信息
|
||||||
|
*
|
||||||
|
* @param trigger 配置
|
||||||
|
*/
|
||||||
|
void updateTrigger(Trigger trigger);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据流水线id查询触发器配置
|
||||||
|
*
|
||||||
|
* @param triggerQuery 流水线id
|
||||||
|
* @return 配置
|
||||||
|
*/
|
||||||
|
List<Trigger> findTriggerList(TriggerQuery triggerQuery);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单个定时任务
|
||||||
|
*
|
||||||
|
* @param triggerId 定时任务id
|
||||||
|
*/
|
||||||
|
void deleteTrigger(String triggerId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有配置
|
||||||
|
*
|
||||||
|
* @return 配置列表
|
||||||
|
*/
|
||||||
|
List<Trigger> findAllTrigger();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询配置
|
||||||
|
*
|
||||||
|
* @param triggerId 配置ID
|
||||||
|
* @return 配置
|
||||||
|
*/
|
||||||
|
Trigger findOneTriggerById(String triggerId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID列表查询配置
|
||||||
|
*
|
||||||
|
* @param idList 配置ID列表
|
||||||
|
* @return 配置列表
|
||||||
|
*/
|
||||||
|
List<Trigger> findAllTriggerConfigList(List<String> idList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
|||||||
|
package cd.casic.module.process.dispatch.trigger;
|
||||||
|
|
||||||
|
|
||||||
|
import cd.casic.ci.commons.bean.dispatch.trigger.TriggerTime;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流水线触发器时间服务接口
|
||||||
|
*/
|
||||||
|
public interface TriggerTimeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建所有关联时间信息
|
||||||
|
*
|
||||||
|
* @param triggerTime 信息
|
||||||
|
*/
|
||||||
|
String createTriggerTime(TriggerTime triggerTime, String pipelineId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据配置id查询消息类型
|
||||||
|
*
|
||||||
|
* @param triggerId 配置id
|
||||||
|
* @return 消息
|
||||||
|
*/
|
||||||
|
TriggerTime findTriggerTime(String triggerId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据配置查询所有任务
|
||||||
|
*
|
||||||
|
* @param triggerId 配置id
|
||||||
|
* @return 任务集合
|
||||||
|
*/
|
||||||
|
List<TriggerTime> findAllTriggerTime(String triggerId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询cron时间列表
|
||||||
|
*
|
||||||
|
* @param cron cron表达式
|
||||||
|
* @return 时间列表
|
||||||
|
*/
|
||||||
|
List<TriggerTime> fondCronTimeList(String cron);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据配置获取所有时间
|
||||||
|
*
|
||||||
|
* @param configId 配置id
|
||||||
|
* @return 时间集合
|
||||||
|
*/
|
||||||
|
List<Integer> findAllDataConfig(String configId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除当前配置下的的所有任务
|
||||||
|
*
|
||||||
|
* @param triggerId 配置id
|
||||||
|
*/
|
||||||
|
void deleteAllTime(String triggerId, String pipelineId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周期任务更新执行时间
|
||||||
|
*
|
||||||
|
* @param timeId 任务id
|
||||||
|
*/
|
||||||
|
Boolean deleteCronTime(String pipelineId, String timeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param timeId timeId
|
||||||
|
*/
|
||||||
|
void deleteTime(String timeId);
|
||||||
|
|
||||||
|
|
||||||
|
void updateTime(TriggerTime triggerTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单个信息
|
||||||
|
*
|
||||||
|
* @param timeId pipelineTimeId
|
||||||
|
* @return time信息
|
||||||
|
*/
|
||||||
|
TriggerTime findOneTime(String timeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有信息
|
||||||
|
*
|
||||||
|
* @return time信息集合
|
||||||
|
*/
|
||||||
|
List<TriggerTime> findAllTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID列表查询时间
|
||||||
|
*
|
||||||
|
* @param idList 时间ID列表
|
||||||
|
* @return 时间列表
|
||||||
|
*/
|
||||||
|
List<TriggerTime> findAllTimeList(List<String> idList);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cd.casic.module.process.dispatch.trigger.dao;
|
||||||
|
|
||||||
|
import cd.casic.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cd.casic.module.process.dispatch.trigger.dataobject.TriggerDo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author by mianbin
|
||||||
|
* @Classname TriggerDao
|
||||||
|
* @Description TODO
|
||||||
|
* @Date 2025/4/23 20:03
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TriggerDao extends BaseMapperX<TriggerDo> {
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user