diff --git a/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/annotation/Plugin.java b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/annotation/Plugin.java new file mode 100644 index 0000000..0d261c5 --- /dev/null +++ b/modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/annotation/Plugin.java @@ -0,0 +1,12 @@ +package cd.casic.ci.common.pipeline.annotation; + +import org.springframework.stereotype.Indexed; + +import java.lang.annotation.*; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Indexed +public @interface Plugin { +} diff --git a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogQueryService.java b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogQueryService.java index 4239b53..c618797 100644 --- a/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogQueryService.java +++ b/modules/module-ci-log/src/main/java/cd/casic/ci/log/service/BuildLogQueryService.java @@ -7,6 +7,7 @@ import cd.casic.ci.log.dal.pojo.enums.LogType; import cd.casic.ci.log.jmx.LogStorageBean; import jakarta.annotation.Resource; import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; /** * @author by mianbin @@ -14,6 +15,7 @@ import org.springframework.http.ResponseEntity; * @Description TODO * @Date 2025/3/20 14:59 */ +@Service public class BuildLogQueryService { @Resource diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/callback/listener/ProjectCallbackEventListener.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/callback/listener/ProjectCallbackEventListener.java deleted file mode 100644 index 4217511..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/callback/listener/ProjectCallbackEventListener.java +++ /dev/null @@ -1,93 +0,0 @@ -package cd.casic.ci.process.process.callback.listener; - - -import cd.casic.ci.process.process.engine.control.CallBackControl; -import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; -import cd.casic.ci.project.dal.pojo.ProjectVO; -import cd.casic.ci.project.pojo.ProjectUpdateInfo; -import cd.casic.ci.project.pojo.mq.ProjectBroadCastEvent; -import cd.casic.ci.project.pojo.mq.ProjectCreateBroadCastEvent; -import cd.casic.ci.project.pojo.mq.ProjectEnableStatusBroadCastEvent; -import cd.casic.ci.project.pojo.mq.ProjectUpdateBroadCastEvent; -import cd.casic.ci.project.service.ProjectService; -import cd.casic.framework.mq.redis.core.stream.AbstractRedisStreamMessageListener; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; -import jakarta.annotation.Resource; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -@Service -@Slf4j -public class ProjectCallbackEventListener extends AbstractRedisStreamMessageListener { - @Resource - private CallBackControl callBackControl; - private ProjectService projectService; - @Override - public void onMessage(ProjectBroadCastEvent event) { - log.info("Receive ProjectEvent from MQ [$event]"); - try { - if (event instanceof ProjectUpdateBroadCastEvent) { - onReceiveProjectUpdate((ProjectUpdateBroadCastEvent)event); - } else if (event instanceof ProjectEnableStatusBroadCastEvent) { - onReceiveProjectEnable((ProjectEnableStatusBroadCastEvent)event); - } else if (event instanceof ProjectCreateBroadCastEvent) { - onReceiveProjectCreate((ProjectCreateBroadCastEvent)event); - } - } catch (Exception e) { - log.error("BKSystemMonitor| project callback listener execute error", e); - } - } - /** - * 处理创建项目事件 - * @param event ProjectCreateBroadCastEvent - */ - private void onReceiveProjectCreate(ProjectCreateBroadCastEvent event){ - ProjectCreateInfo projectInfo = event.getProjectInfo(); - callBackControl.projectCreate( - projectInfo.getEnglishName(), - projectInfo.getProjectName(), - event.getUserId()); - } - /** - * 处理更新项目事件 - * @param event ProjectUpdateBroadCastEvent - */ - private void onReceiveProjectUpdate(ProjectUpdateBroadCastEvent event){ - ProjectUpdateInfo projectInfo = event.getProjectInfo(); - callBackControl.projectUpdate( - projectInfo.getEnglishName(), - projectInfo.getProjectName(), - event.getUserId() - ); - } - /** - * 处理项目禁用事件 - * @param event ProjectEnableStatusBroadCastEvent - */ - private void onReceiveProjectEnable(ProjectEnableStatusBroadCastEvent event){ - ProjectVO project = getProject(event.getProjectId()); - if (project!=null) { - if (event.getEnable()) { - callBackControl.projectEnable(event.getProjectId(),project.getProjectName(),event.getUserId()); - } else { - callBackControl.projectDisable(event.getProjectId(),project.getProjectName(),event.getUserId()); - } - } - } - - - private ProjectVO getProject(String projectEnglishName){ - if (StringUtils.isEmpty(projectEnglishName)) { - return null; - } - try { - return projectService.getByEnglishName(projectEnglishName); - } catch (Exception e) { - log.warn( - "fail to get project info|projectEnglishName[$projectEnglishName]", - e - ); - return null; - } - } -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceBaseDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceBaseDao.java deleted file mode 100644 index 5820533..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceBaseDao.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.atom; - -import cd.casic.ci.process.process.dataObject.TPipelineAtomReplaceBaseRecord; - -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线原子替换基础 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineAtomReplaceBaseDao { - - /** - * 创建原子替换基础记录 - * - * @param baseId 基础ID - * @param projectId 项目ID - * @param pipelineIdList 流水线ID列表 - * @param fromAtomCode 源原子代码 - * @param toAtomCode 目标原子代码 - * @param userId 用户ID - */ - void createAtomReplaceBase( - @Param("baseId") String baseId, - @Param("projectId") String projectId, - @Param("pipelineIdList") List pipelineIdList, - @Param("fromAtomCode") String fromAtomCode, - @Param("toAtomCode") String toAtomCode, - @Param("userId") String userId - ); - - /** - * 获取原子替换基础记录列表 - * - * @param statusList 状态列表 - * @param descFlag 是否降序 - * @param page 页码 - * @param pageSize 每页大小 - * @return 原子替换基础记录列表 - */ - List getAtomReplaceBaseList( - @Param("statusList") List statusList, - @Param("descFlag") boolean descFlag, - @Param("page") int page, - @Param("pageSize") int pageSize - ); - - /** - * 更新原子替换基础记录 - * - * @param baseId 基础ID - * @param status 状态 - * @param userId 用户ID - */ - void updateAtomReplaceBase( - @Param("baseId") String baseId, - @Param("status") String status, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceHistoryDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceHistoryDao.java deleted file mode 100644 index 3712424..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceHistoryDao.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.atom; - - -import cd.casic.ci.process.api.process.pojo.PipelineAtomReplaceHistory; -import cd.casic.ci.process.process.dataObject.TPipelineAtomReplaceHistoryRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线原子替换历史 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineAtomReplaceHistoryDao { - - /** - * 创建原子替换历史 - * - * @param pipelineAtomReplaceHistory 原子替换历史信息 - */ - void createAtomReplaceHistory( - @Param("pipelineAtomReplaceHistory") PipelineAtomReplaceHistory pipelineAtomReplaceHistory - ); - - /** - * 获取原子替换历史列表 - * - * @param baseId 基础ID - * @param itemId 项ID - * @param projectId 项目ID - * @param busType 业务类型 - * @param statusList 状态列表 - * @param descFlag 是否降序 - * @param page 页码 - * @param pageSize 每页大小 - * @return 原子替换历史记录列表 - */ - List getAtomReplaceHistoryList( - @Param("baseId") String baseId, - @Param("itemId") String itemId, - @Param("projectId") String projectId, - @Param("busType") String busType, - @Param("statusList") List statusList, - @Param("descFlag") Boolean descFlag, - @Param("page") Integer page, - @Param("pageSize") Integer pageSize - ); - - /** - * 更新原子替换历史 - * - * @param id ID - * @param status 状态 - * @param log 日志 - * @param userId 用户ID - */ - void updateAtomReplaceHistory( - @Param("id") String id, - @Param("status") String status, - @Param("log") String log, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceItemDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceItemDao.java deleted file mode 100644 index 332afff..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/atom/PipelineAtomReplaceItemDao.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.atom; - -import cd.casic.ci.process.process.dataObject.TPipelineAtomReplaceItemRecord; - -import cd.casic.ci.process.process.pojo.AtomVersionReplaceInfo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线原子替换项 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineAtomReplaceItemDao { - public void createAtomReplaceItem( - @Param("baseId") String baseId, - @Param("fromAtomCode") String fromAtomCode, - @Param("toAtomCode") String toAtomCode, - @Param("versionInfoList") List versionInfoList, - @Param("userId") String userId - ); - - - - TPipelineAtomReplaceItemRecord getAtomReplaceItemListByBaseId( - @Param("baseId") String baseId, - @Param("statusList") List statusList, - @Param("descFlag") Boolean descFlag, - @Param("page") Integer page, - @Param("pageSize") Integer pageSize - ); -// TODO 这是一个类似wrapper的拼接条件方法 -// private fun TPipelineAtomReplaceItem.getAtomReplaceItemListCondition( -// baseId: String, -// statusList: List? -// ): MutableList - - Long getAtomReplaceItemCountByBaseId( - @Param("baseId") String baseId, - @Param("statusList") List statusList - ); - TPipelineAtomReplaceItemRecord getAtomReplaceItem( - @Param("itemId") String itemId - ); - int deleteByBaseId(@Param("baseId") String baseId); - - int updateAtomReplaceItemByBaseId( - @Param("baseId") String baseId, - @Param("status") String status, - @Param("userId") String userId - ); - - int updateAtomReplaceItemByItemId( - @Param("itemId") String itemId, - @Param("status") String status, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/audit/AuditDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/audit/AuditDao.java deleted file mode 100644 index 6e92c77..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/audit/AuditDao.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.audit; - -import cd.casic.ci.process.api.process.pojo.audit.QueryAudit; -import cd.casic.ci.process.process.dataObject.TAuditResourceRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 审计记录 Mapper 接口 - */ -@Mapper -@Repository -public interface AuditDao { - - Long create( - @Param("resourceType") String resourceType, - @Param("resourceId") String resourceId, - @Param("resourceName") String resourceName, - @Param("userId") String userId, - @Param("action") String action, - @Param("actionContent") String actionContent, - @Param("projectId") String projectId, - @Param("id") Long id - ); - List listByResourceTye( - @Param("queryAudit") QueryAudit queryAudit, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - Long countByResourceTye(@Param("queryAudit")QueryAudit queryAudit); - -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/auth/PipelineRemoteAuthDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/auth/PipelineRemoteAuthDao.java deleted file mode 100644 index 00e9bd1..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/auth/PipelineRemoteAuthDao.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.auth; - -import cd.casic.ci.process.process.dataObject.TPipelineRemoteAuthRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线远程认证 Mapper 接口 - */ -@Repository -public interface PipelineRemoteAuthDao { - - /** - * 创建远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @param authType 认证类型 - * @param authContent 认证内容 - * @param userId 用户ID - * @return 远程认证记录ID - */ - long create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId, - @Param("authType") String authType, - @Param("authContent") String authContent, - @Param("userId") String userId - ); - - /** - * 更新远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @param authType 认证类型 - * @param authContent 认证内容 - * @param userId 用户ID - * @return 影响的行数 - */ - int update( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId, - @Param("authType") String authType, - @Param("authContent") String authContent, - @Param("userId") String userId - ); - - /** - * 删除远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId - ); - - /** - * 获取远程认证记录列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 远程认证记录列表 - */ - List list( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取远程认证记录 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param authId 认证ID - * @return 远程认证记录 - */ - TPipelineRemoteAuthRecord get( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("authId") String authId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/PipelineCallbackDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/PipelineCallbackDao.java deleted file mode 100644 index baec0bf..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/PipelineCallbackDao.java +++ /dev/null @@ -1,62 +0,0 @@ -package cd.casic.ci.process.process.dal.callback; - - - -import cd.casic.ci.common.pipeline.pojo.event.PipelineCallbackEvent; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线回调Mapper接口 - */ -@Repository -public interface PipelineCallbackDao { - - /** - * 保存流水线回调 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param userId 用户ID - * @param list 回调事件列表 - * @return 影响的行数 - */ - int save( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("list") List list - ); - - /** - * 获取流水线回调列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param event 事件类型 - * @return 回调记录列表 - */ - // TODO T_PIPELINE_CALLBACK 这个表找不到 -// Result list( -// @Param("projectId") String projectId, -// @Param("pipelineId") String pipelineId, -// @Param("event") String event -// ); - - /** - * 删除流水线回调 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param names 回调名称集合 - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("names") Set names - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackDao.java deleted file mode 100644 index ffe039f..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackDao.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.callback; - -import cd.casic.ci.process.process.dataObject.TProjectPipelineCallbackRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * 项目流水线回调 Mapper 接口 - */ -@Repository -public interface ProjectPipelineCallbackDao { - - /** - * 可直接更新或插入 - */ - int save( - @Param("projectId") String projectId, - @Param("events") String events, - @Param("userId") String userId, - @Param("callbackUrl") String callbackUrl, - @Param("secretToken") String secretToken, - @Param("id") Long id, - @Param("secretParam") String secretParam - ); - - - List listProjectCallback( - @Param("projectId")String projectId, - @Param("events")String events, - @Param("enable")Boolean enable - ); - - List listByPage( - @Param("projectId")String projectId, - @Param("offset")Integer offset, - @Param("limit")Integer limit - ); - - Long countByPage(String projectId); - - TProjectPipelineCallbackRecord get( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - int deleteById( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - int deleteByProjectId( - @Param("projectId") String projectId - ); - - int disable( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - int enable( - @Param("projectId") String projectId, - @Param("id") Long id - ); - - List getDisableCallbackList( - @Param("projectId") String projectId, - @Param("url") String url, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - int enableByIds( - @Param("projectId") String projectId, - @Param("ids") Listids - ); - - int updateFailureTime( - @Param("projectId") String projectId, - @Param("id") Long id, - @Param("failureTime") LocalDateTime failureTime - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackHistoryDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackHistoryDao.java deleted file mode 100644 index 8f4119b..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/callback/ProjectPipelineCallbackHistoryDao.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.callback; - -import cd.casic.ci.process.process.dataObject.TProjectPipelineCallbackHistoryRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 项目流水线回调历史 Mapper 接口 - */ -@Repository -public interface ProjectPipelineCallbackHistoryDao { - - void create( - @Param("projectId") String projectId, - @Param("callBackUrl") String callBackUrl, - @Param("events") String events, - @Param("status") String status, - @Param("errorMsg") String errorMsg, - @Param("requestHeaders") String requestHeaders, - @Param("requestBody") String requestBody, - @Param("responseCode") Integer responseCode, - @Param("responseBody") String responseBody, - @Param("startTime") Long startTime, - @Param("endTime") Long endTime, - @Param("id") Long id - ); - TProjectPipelineCallbackHistoryRecord get(@Param("id") Long id); - - List list( - @Param("projectId") String projectId, - @Param("callBackUrl") String callBackUrl, - @Param("events") String events, - @Param("startTime") Long startTime, - @Param("endTime") Long endTime, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - Long count( - String projectId, - String callBackUrl, - String events, - Long startTime, - Long endTime - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/engin/PipelineTriggerReviewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/engin/PipelineTriggerReviewDao.java deleted file mode 100644 index 044804f..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/engin/PipelineTriggerReviewDao.java +++ /dev/null @@ -1,26 +0,0 @@ -package cd.casic.ci.process.process.dal.engin; - -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface PipelineTriggerReviewDao { - Integer createReviewRecord( - @Param("buildId") String buildId, - @Param("pipelineId") String pipelineId, - @Param("projectId") String projectId, - @Param("reviewers") List reviewers - ); - Integer updateOperator( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("userId") String userId - ); - List getTriggerReviewers( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId - ); - -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineGroupDao.java deleted file mode 100644 index 7b63f59..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineGroupDao.java +++ /dev/null @@ -1,130 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - - -import cd.casic.ci.process.process.dataObject.TPipelineGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线分组 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineGroupDao { - - /** - * 创建流水线分组 - * - * @param projectId 项目ID - * @param name 分组名称 - * @param userId 用户ID - * @param id 主键ID - * @return 分组ID - */ - Long createPipelineGroup( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("userId") String userId, - @Param("id") Long id - ); - - /** - * 更新流水线分组 - * - * @param projectId 项目ID - * @param groupId 分组ID - * @param name 分组名称 - * @param userId 用户ID - * @return 是否更新成功 - */ - boolean update( - @Param("projectId") String projectId, - @Param("groupId") Long groupId, - @Param("name") String name, - @Param("userId") String userId - ); - - /** - * 删除流水线分组 - * - * @param projectId 项目ID - * @param groupId 分组ID - * @param userId 用户ID - * @return 是否删除成功 - */ - boolean deletePipelineGroup( - @Param("projectId") String projectId, - @Param("groupId") Long groupId, - @Param("userId") String userId - ); - - /** - * 获取项目下的所有分组 - * - * @param projectId 项目ID - * @return 分组记录列表 - */ - List list( - @Param("projectId") String projectId - ); - - /** - * 统计项目下的分组数量 - * - * @param projectId 项目ID - * @return 分组数量 - */ - long count( - @Param("projectId") String projectId - ); - - /** - * 统计项目下指定名称的分组数量 - * - * @param projectId 项目ID - * @param name 分组名称 - * @return 分组数量 - */ - long countByName( - @Param("projectId") String projectId, - @Param("name") String name - ); - - /** - * 根据ID获取分组 - * - * @param id 分组ID - * @return 分组记录 - */ - TPipelineGroupRecord get( - @Param("id") Long id - ); - - /** - * 根据ID列表获取分组 - * - * @param projectId 项目ID - * @param ids 分组ID集合 - * @return 分组记录列表 - */ - List listByIds( - @Param("projectId") String projectId, - @Param("ids") Set ids - ); - - /** - * 获取项目下的指定分组 - * - * @param projectId 项目ID - * @param groupId 分组ID - * @return 分组记录 - */ - TPipelineGroupRecord get( - @Param("projectId") String projectId, - @Param("groupId") Long groupId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelDao.java deleted file mode 100644 index 4a29aaa..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelDao.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.api.process.pojo.classify.PipelineLabel; - -import org.apache.ibatis.annotations.Param; - - -import java.util.List; - -/** - * 流水线标签 Mapper 接口 - */ -public interface PipelineLabelDao { - - /** - * 创建标签 - * - * @param projectId 项目ID - * @param name 标签名称 - * @param desc 标签描述 - * @param userId 用户ID - * @return 标签ID - */ - long create( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("desc") String desc, - @Param("userId") String userId - ); - - /** - * 更新标签 - * - * @param projectId 项目ID - * @param id 标签ID - * @param name 标签名称 - * @param desc 标签描述 - * @param userId 用户ID - * @return 影响的行数 - */ - int update( - @Param("projectId") String projectId, - @Param("id") long id, - @Param("name") String name, - @Param("desc") String desc, - @Param("userId") String userId - ); - - /** - * 删除标签 - * - * @param projectId 项目ID - * @param id 标签ID - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("id") long id - ); - - /** - * 获取标签列表 - * - * @param projectId 项目ID - * @return 标签列表 - */ - List list( - @Param("projectId") String projectId - ); - - /** - * 获取标签 - * - * @param projectId 项目ID - * @param id 标签ID - * @return 标签 - */ - PipelineLabel get( - @Param("projectId") String projectId, - @Param("id") long id - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelPipelineDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelPipelineDao.java deleted file mode 100644 index 2eccb65..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineLabelPipelineDao.java +++ /dev/null @@ -1,150 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.process.dataObject.TPipelineLabelPipelineRecord; -import cd.casic.ci.process.process.pojo.PipelineLabelRelateInfo; -import cn.hutool.core.lang.Pair; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线和标签对应关系Mapper接口 - */ -@Repository -public interface PipelineLabelPipelineDao { - - /** - * 创建流水线标签关系 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param labelId 标签ID - * @param userId 用户ID - * @param id 主键ID - * @return 影响的行数 - */ - int create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("labelId") Long labelId, - @Param("userId") String userId, - @Param("id") Long id - ); - /** - * 批量创建流水线标签关系 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param pipelineLabelRels 流水线标签关系列表 - * @param userId 用户ID - * @return 影响的行数 - */ - int batchCreate( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("pipelineLabelRels") List> pipelineLabelRels, - @Param("userId") String userId - ); - - /** - * 删除流水线标签关系 - * - * @param projectId 项目ID - * @param id 主键ID - * @param userId 用户ID - * @return 影响的行数 - */ - int delete( - @Param("projectId") String projectId, - @Param("id") Long id, - @Param("userId") String userId - ); - - /** - * 删除流水线的所有标签关系 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param userId 用户ID - * @return 影响的行数 - */ - int deleteByPipeline( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId - ); - - /** - * 删除标签的所有流水线关系 - * - * @param projectId 项目ID - * @param labelId 标签ID - * @param userId 用户ID - * @return 影响的行数 - */ - int deleteByLabel( - @Param("projectId") String projectId, - @Param("labelId") Long labelId, - @Param("userId") String userId - ); - - /** - * 获取标签关联的流水线列表 - * - * @param projectId 项目ID - * @param labelId 标签ID集合 - * @return 流水线标签关系记录列表 - */ - TPipelineLabelPipelineRecord listPipelines( - @Param("projectId") String projectId, - @Param("labelId") Set labelId - ); - - /** - * 获取流水线关联的标签列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 流水线标签关系记录列表 - */ - TPipelineLabelPipelineRecord listLabels( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取已存在标签关系的流水线ID集合 - * - * @param projectId 项目ID - * @param pipelineIds 流水线ID集合 - * @return 流水线ID集合 - */ - Set exitsLabelPipelines( - @Param("projectId") String projectId, - @Param("pipelineIds") Set pipelineIds - ); - - /** - * 获取流水线标签关系列表 - * - * @param pipelineIds 流水线ID集合 - * @param projectId 项目ID - * @return 流水线标签关系记录列表 - */ - TPipelineLabelPipelineRecord listPipelineLabelRels( - @Param("pipelineIds") List pipelineIds, - @Param("projectId") String projectId - ); - - /** - * 获取流水线标签关联信息列表 - * - * @param projectIds 项目ID列表 - * @return 流水线标签关联信息列表 - */ - List getPipelineLabelRelateInfos( - @Param("projectIds") List projectIds - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewDao.java deleted file mode 100644 index 3f8cf31..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewDao.java +++ /dev/null @@ -1,362 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - - -import cd.casic.ci.process.process.dataObject.TPipelineViewRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 流水线视图Mapper接口 - */ -@Repository -public interface PipelineViewDao { - - /** - * 创建视图(基础版) - * - * @param projectId 项目ID - * @param name 视图名称 - * @param isProject 是否项目视图 - * @param filterByPipelineName 按流水线名称过滤 - * @param filterByCreator 按创建者过滤 - * @param userId 用户ID - * @param id 视图ID(可选) - * @return 创建的视图ID - */ - Long create( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("isProject") Boolean isProject, - @Param("filterByPipelineName") String filterByPipelineName, - @Param("filterByCreator") String filterByCreator, - @Param("userId") String userId, - @Param("id") Long id - ); - - /** - * 创建视图(高级版) - * - - * @param projectId 项目ID - * @param name 视图名称 - * @param logic 逻辑表达式 - * @param isProject 是否项目视图 - * @param filters 过滤器 - * @param userId 用户ID - * @param id 视图ID(可选) - * @param viewType 视图类型 - * @return 创建的视图ID - */ - Long create( - - @Param("projectId") String projectId, - @Param("name") String name, - @Param("logic") String logic, - @Param("isProject") Boolean isProject, - @Param("filters") String filters, - @Param("userId") String userId, - @Param("id") Long id, - @Param("viewType") Integer viewType - ); - - /** - * 更新视图(基础版) - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @param name 视图名称 - * @param isProject 是否项目视图 - * @param filterByPipelineName 按流水线名称过滤 - * @param filterByCreator 按创建者过滤 - * @return 是否更新成功 - */ - Boolean update( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("name") String name, - @Param("isProject") Boolean isProject, - @Param("filterByPipelineName") String filterByPipelineName, - @Param("filterByCreator") String filterByCreator - ); - - /** - * 更新视图(高级版) - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @param name 视图名称 - * @param logic 逻辑表达式 - * @param isProject 是否项目视图 - * @param filters 过滤器 - * @param viewType 视图类型 - * @return 是否更新成功 - */ - Boolean update( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("name") String name, - @Param("logic") String logic, - @Param("isProject") Boolean isProject, - @Param("filters") String filters, - @Param("viewType") Integer viewType - ); - - /** - * 删除视图 - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @return 是否删除成功 - */ - Boolean delete( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取项目下的所有视图 - * - - * @param projectId 项目ID - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId - ); - - /** - * 获取项目下指定类型的视图 - * - - * @param projectId 项目ID - * @param viewType 视图类型 - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("viewType") Integer viewType - ); - - /** - * 获取项目下指定是否项目视图的列表 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject - ); - - /** - * 获取用户创建的视图列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("userId") String userId - ); - - /** - * 获取用户创建的指定类型视图列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param isProject 是否项目视图 - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("isProject") Boolean isProject - ); - - /** - * 获取用户视图列表(支持多种过滤条件) - * - - * @param userId 用户ID - * @param projectId 项目ID - * @param isProject 是否项目视图(可选) - * @param viewType 视图类型(可选) - * @return 视图记录列表 - */ - List list( - - @Param("userId") String userId, - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("viewType") Integer viewType - ); - - /** - * 获取指定ID的视图列表 - * - - * @param projectId 项目ID(可选) - * @param viewIds 视图ID集合 - * @param viewType 视图类型(可选) - * @return 视图记录列表 - */ - TPipelineViewRecord list( - - @Param("projectId") String projectId, - @Param("viewIds") Collection viewIds, - @Param("viewType") Integer viewType - ); - - /** - * 分页获取视图列表 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @param viewName 视图名称(可选) - * @param limit 每页数量 - * @param offset 偏移量 - * @return 视图记录列表 - */ - TPipelineViewRecord listByPage( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("viewName") String viewName, - @Param("limit") Integer limit, - @Param("offset") Integer offset - ); - - /** - * 获取所有项目或用户视图 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @param userId 用户ID - * @return 视图记录列表 - */ - TPipelineViewRecord listAll( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("userId") String userId - ); - - /** - * 获取动态项目ID列表 - * - - * @return 项目ID列表 - */ - List listDynamicProjectId(); - - /** - * 获取项目的动态视图列表 - * - - * @param projectId 项目ID - * @return 视图记录列表 - */ - TPipelineViewRecord listDynamicViewByProjectId( - - @Param("projectId") String projectId - ); - - /** - * 获取项目或用户视图列表 - * - - * @param projectId 项目ID - * @param isProject 是否项目视图 - * @param userId 用户ID - * @return 视图记录列表 - */ - TPipelineViewRecord listProjectOrUser( - - @Param("projectId") String projectId, - @Param("isProject") Boolean isProject, - @Param("userId") String userId - ); - - /** - * 获取指定视图 - * - - * @param projectId 项目ID - * @param viewId 视图ID - * @return 视图记录 - */ - TPipelineViewRecord get( - - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取用户创建的指定视图 - * - - * @param userId 用户ID - * @param projectId 项目ID - * @param viewId 视图ID - * @return 视图记录 - */ - TPipelineViewRecord get( - - @Param("userId") String userId, - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 统计同名视图数量 - * - - * @param projectId 项目ID - * @param name 视图名称 - * @param creator 创建者(可选) - * @param isProject 是否项目视图 - * @param excludeIds 排除的ID集合 - * @return 数量 - */ - Integer countByName( - - @Param("projectId") String projectId, - @Param("name") String name, - @Param("creator") String creator, - @Param("isProject") Boolean isProject, - @Param("excludeIds") Collection excludeIds - ); - TPipelineViewRecord fetchAnyByName( - String projectId, - String name, - Boolean isProject - ); - - - Integer countForLimit( - @Param("projectId")String projectId, - @Param("isProject") Boolean isProject, - @Param("userId") String userId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewGroupDao.java deleted file mode 100644 index b8be76e..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewGroupDao.java +++ /dev/null @@ -1,216 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.process.dataObject.TPipelineViewGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** - * 流水线视图分组 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineViewGroupDao { - - /** - * 创建视图分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @param pipelineId 流水线ID - * @param userId 用户ID - */ - void create( - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId - ); - - /** - * 获取视图分组列表(分页) - * - * @param viewId 视图ID - * @param offset 偏移量 - * @param limit 每页数量 - * @return 视图分组记录列表 - */ - List list( - @Param("viewId") Long viewId, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - /** - * 获取多个视图的分组列表 - * - * @param projectId 项目ID - * @param viewIds 视图ID列表 - * @return 视图分组记录列表 - */ - List listByViewIds( - @Param("projectId") String projectId, - @Param("viewIds") List viewIds - ); - - /** - * 获取指定视图的分组列表 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @return 视图分组记录列表 - */ - List listByViewId( - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取项目下的所有视图分组 - * - * @param projectId 项目ID - * @return 视图分组记录列表 - */ - List listByProjectId( - @Param("projectId") String projectId - ); - - /** - * 获取流水线所属的视图分组 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 视图分组记录列表 - */ - List listByPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取流水线所属的视图ID列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 视图ID列表 - */ - List listViewIdListByPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取视图包含的流水线ID列表 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @return 流水线ID列表 - */ - List listPipelineIdByViewId( - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 获取多个流水线所属的视图分组 - * - * @param projectId 项目ID - * @param pipelineIds 流水线ID集合 - * @return 视图分组记录列表 - */ - List listByPipelineIds( - @Param("projectId") String projectId, - @Param("pipelineIds") Collection pipelineIds - ); - - /** - * 统计流水线所属的视图分组数量 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 数量 - */ - Integer countByPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 移除视图分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @param pipelineId 流水线ID - */ - void remove( - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("pipelineId") String pipelineId - ); - - /** - * 移除视图的所有分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - */ - void remove( - @Param("projectId") String projectId, - @Param("viewId") Long viewId - ); - - /** - * 批量移除视图分组 - * - * @param projectId 项目ID - * @param viewId 视图ID - * @param pipelineIds 流水线ID列表 - */ - void batchRemove( - @Param("projectId") String projectId, - @Param("viewId") Long viewId, - @Param("pipelineIds") List pipelineIds - ); - - /** - * 统计多个视图的分组数量 - * - * @param projectId 项目ID - * @param viewIds 视图ID集合 - * @param filterPipelineIds 过滤的流水线ID列表(可选) - * @return 视图ID到数量的映射 - */ - Map countByViewId( - @Param("projectId") String projectId, - @Param("viewIds") Collection viewIds, - @Param("filterPipelineIds") List filterPipelineIds - ); - - /** - * 获取不重复的流水线ID列表 - * - * @param projectId 项目ID - * @param viewIds 视图ID集合 - * @return 流水线ID列表 - */ - List distinctPipelineIds( - @Param("projectId") String projectId, - @Param("viewIds") Collection viewIds - ); - - /** - * 删除流水线的视图分组 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 是否删除成功 - */ - boolean delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewTopDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewTopDao.java deleted file mode 100644 index c568f61..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/label/PipelineViewTopDao.java +++ /dev/null @@ -1,28 +0,0 @@ -package cd.casic.ci.process.process.dal.label; - -import cd.casic.ci.process.process.dataObject.TPipelineViewTopRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视图置顶Mapper接口 - */ -@Repository -public interface PipelineViewTopDao { - /** - * 添加视图置顶 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void add(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 移除视图置顶 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void remove(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 获取用户的置顶视图列�? * * @param projectId 项目ID * @param userId 用户ID * @return 置顶视图记录列表 - */ - List list(@Param("projectId") String projectId, @Param("userId") String userId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildDao.java deleted file mode 100644 index f799e6f..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildDao.java +++ /dev/null @@ -1,398 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.process.api.engine.pojo.BuildInfo; -import cd.casic.ci.process.api.engine.pojo.BuildRetryInfo; -import cd.casic.ci.process.api.process.enums.HistorySearchType; -import cd.casic.ci.process.api.process.pojo.BuildStageStatus; -import cd.casic.ci.process.api.process.pojo.app.StartBuildContext; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -public interface PipelineBuildDao { - void create( StartBuildContext startBuildContext); - - void updateBuildRetryInfo( - String projectId, - String pipelineId, - String buildId, - BuildRetryInfo retryInfo - ); - - List getBuildTasksByStatus( - - String projectId, - String pipelineId, - Set statusSet - ); - - int countAllBuildWithStatus( - String projectId, - String pipelineId, - Set status - ); -/* -* TODO Record2 是JOOQ包的对象,这个项目使用mybatis,后续具体分析 -* */ -// List> getBuildTasksByConcurrencyGroup( -// -// String projectId, -// String concurrencyGroup, -// List statusSet -// ); -// -// List> getBuildTasksByConcurrencyGroupNull( -// -// String projectId, -// String pipelineId, -// List statusSet -// ); - - BuildInfo getBuildInfo( - - String projectId, - String buildId - ); - - BuildInfo getUserBuildInfo( - - String projectId, - String buildId - ); - - String getStartUser( - - String projectId, - String buildId - ); - - List listBuildInfoByBuildIds( - - Collection buildIds, - String projectId, - String startBeginTime, - String endBeginTime - ); - - List listBuildInfoByBuildIdsOnly( - - Collection buildIds - ); - - Collection listPipelineBuildInfo( - - String projectId, - String pipelineId, - int offset, - int limit, - Boolean updateTimeDesc - ); - - Collection listPipelineBuildNum( - - String projectId, - String pipelineId, - int offset, - int limit, - Integer debugVersion - ); - - BuildInfo getBuildInfoByBuildNum( - String projectId, - String pipelineId, - Integer buildNum, - Set statusSet, - boolean debug - ); - - BuildInfo getOneQueueBuild( - String projectId, - String pipelineId - ); - - BuildInfo getOneConcurrencyQueueBuild( - - String projectId, - String concurrencyGroup, - String pipelineId - ); - - void startBuild( - - String projectId, - String buildId, - LocalDateTime startTime, - Boolean debug - ); - - void finishBuild( - - String projectId, - String buildId, - BuildStatus buildStatus, - Long executeTime, - String recommendVersion, - String remark, - List errorInfoList, - Boolean debug - ); - - BuildInfo getLatestBuild( - - String projectId, - String pipelineId, - boolean debug - ); - - BuildInfo getLatestFinishedBuild( - - String projectId, - String pipelineId - ); - - BuildInfo getLatestFailedBuild( - - String projectId, - String pipelineId - ); - - BuildInfo getLatestSucceedBuild( - - String projectId, - String pipelineId - ); - - boolean updateStatus( - - String projectId, - String buildId, - BuildStatus oldBuildStatus, - BuildStatus newBuildStatus, - LocalDateTime startTime, - List errorInfoList - ); - - void updateExecuteCount( - - String projectId, - String buildId, - int executeCount - ); - - int count( - - String projectId, - String pipelineId, - List status, - Long startTimeEndTime, - Integer debugVersion - ); - - int countByStatus( - - String projectId, - String pipelineId, - List status, - Long startTimeEndTime, - Boolean onlyDebug - ); - - int count( - - String projectId, - String pipelineId, - List materialAlias, - String materialUrl, - List materialBranch, - String materialCommitId, - String materialCommitMessage, - List status, - List trigger, - Long queueTimeStartTime, - Long queueTimeEndTime, - Long startTimeStartTime, - Long startTimeEndTime, - Long endTimeStartTime, - Long endTimeEndTime, - Long totalTimeMin, - Long totalTimeMax, - String remark, - Integer buildNoStart, - Integer buildNoEnd, - String buildMsg, - List startUser, - Boolean debug, - List triggerAlias, - List triggerBranch, - List triggerUser - ); - - Collection listPipelineBuildInfo( - - String projectId, - String pipelineId, - List materialAlias, - String materialUrl, - List materialBranch, - String materialCommitId, - String materialCommitMessage, - List status, - List trigger, - Long queueTimeStartTime, - Long queueTimeEndTime, - Long startTimeStartTime, - Long startTimeEndTime, - Long endTimeStartTime, - Long endTimeEndTime, - Long totalTimeMin, - Long totalTimeMax, - String remark, - int offset, - int limit, - Integer buildNoStart, - Integer buildNoEnd, - String buildMsg, - List startUser, - Boolean updateTimeDesc, - Boolean debug, - List triggerAlias, - List triggerBranch, - List triggerUser - ); - - void updateBuildRemark( - - String projectId, - String pipelineId, - String buildId, - String remark - ); - - void updateRecommendVersion( - - String projectId, - String buildId, - String recommendVersion - ); - - Collection listHistorySearchOptions( - - String projectId, - String pipelineId, - Integer debugVersion, - HistorySearchType type - ); - - BuildInfo getBuildByBuildNum( - - String projectId, - String pipelineId, - int buildNum, - Integer debugVersion - ); - - List getBuilds( - - String projectId, - String pipelineId, - Set buildStatus, - Integer debugVersion - ); - - int updateArtifactList( - - String artifactList, - String projectId, - String pipelineId, - String buildId - ); - - void updateBuildMaterial( - - String projectId, - String buildId, - String material - ); - - int updateBuildStageStatus( - - String projectId, - String buildId, - List stageStatus, - BuildStatus oldBuildStatus, - BuildStatus newBuildStatus, - List errorInfoList - ); - - String getBuildParameters( - - String projectId, - String buildId - ); - - boolean updateBuildParameters( - - String projectId, - String pipelineId, - String buildId, - Collection buildParameters, - boolean debug - ); - - int countBuildNumByTime( - - String projectId, - String pipelineId, - LocalDateTime startTime, - LocalDateTime endTime, - Integer debugVersion - ); - - BuildInfo getBuildInfo( - - String projectId, - String pipelineId, - String buildId - ); - - int countBuildNumByVersion( - - String projectId, - String pipelineId, - int version - ); - -// List> batchCountBuildNumByVersion( -// -// String projectId, -// String pipelineId, -// Set versions -// ); - - String getDebugResourceStr( - - String projectId, - String buildId - ); - - List getDebugHistory( - - String projectId, - String pipelineId, - Integer version - ); - - int clearDebugHistory( - - String projectId, - String pipelineId, - Integer version - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildTemplateAcrossInfoDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildTemplateAcrossInfoDao.java deleted file mode 100644 index 45218c6..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildTemplateAcrossInfoDao.java +++ /dev/null @@ -1,172 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.process.api.process.pojo.BuildTemplateAcrossInfo; -import cd.casic.ci.process.process.dataObject.TPipelineBuildTemplateAcrossInfoRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线构建模板跨项目信息Mapper接口 - */ -@Repository -public interface PipelineBuildTemplateAcrossInfoDao { - - /** - * 创建模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param templateId 模板ID - * @param templateType 模板类型 - * @param templateInstancesIds 模板实例ID列表 - * @param targetProjectId 目标项目ID - * @param userId 用户ID - * @return 影响行数 - */ - int create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("templateId") String templateId, - @Param("templateType") BuildTemplateAcrossInfo.TemplateAcrossInfoType templateType, - @Param("templateInstancesIds") List templateInstancesIds, - @Param("targetProjectId") String targetProjectId, - @Param("userId") String userId - ); - - /** - * 批量创建模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param userId 用户ID - * @param templateAcrossInfos 模板跨项目信息列表 - * @return 影响行数 - */ - int batchCreate( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("userId") String userId, - @Param("templateAcrossInfos") List templateAcrossInfos - ); - - /** - * 批量更新模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param templateAcrossInfos 模板跨项目信息列表 - * @return 影响行数 - */ - int batchUpdate( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("templateAcrossInfos") List templateAcrossInfos - ); - - /** - * 获取模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param templateId 模板ID - * @return 模板跨项目信息记录列表 - */ - List get( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("templateId") String templateId - ); - - /** - * 根据模板ID获取跨项目信息 - * - - * @param projectId 项目ID - * @param templateId 模板ID - * @return 模板跨项目信息记录列表 - */ - List getByTemplateId( - - @Param("projectId") String projectId, - @Param("templateId") String templateId - ); - - /** - * 更新构建ID - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param templateId 模板ID - * @param buildId 构建ID - * @return 影响行数 - */ - int updateBuildId( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("templateId") String templateId, - @Param("buildId") String buildId - ); - - /** - * 删除模板跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param templateId 模板ID - * @return 影响行数 - */ - int delete( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("templateId") String templateId - ); - - /** - * 根据流水线ID删除跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 影响行数 - */ - int deleteByPipelineId( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 根据构建ID删除跨项目信息 - * - - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @return 影响行数 - */ - int deleteByBuildId( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildVarDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildVarDao.java deleted file mode 100644 index 1e1337e..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineBuildVarDao.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 流水线构建变量 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineBuildVarDao { - - /** - * 创建构建变量 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param varName 变量名 - * @param varValue 变量值 - * @return 构建变量ID - */ - long save( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("varName") String varName, - @Param("varValue") String varValue, - @Param("readOnly") Boolean readOnly - ); - - /** - * 更新构建变量 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param varType 变量类型 - * @return 影响的行数 - */ - int update( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("name") String name, - @Param("value") String value, - @Param("varType") String varType, - @Param("readOnly") Boolean readOnly - ); - - - - Map getVars( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("keys") Set keys - ); - - List getVarsWithType( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("key") String key - ); - - int deleteBuildVar( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("varName") String varName, - @Param("readOnly") Boolean readOnly - ); - - void batchSave( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("variables") List variables - ); - - void batchUpdate( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("variables") List variables - ); - - void deleteBuildVars( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId - ); - - void deletePipelineBuildVar( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - Set fetchVarByLikeKey( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("readOnly") Boolean readOnly, - @Param("likeStr") String likeStr - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineInfoDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineInfoDao.java deleted file mode 100644 index 177b1ae..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineInfoDao.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.enums.VersionStatus; -import cd.casic.ci.process.api.engine.pojo.PipelineInfo; -import cd.casic.ci.process.api.process.pojo.PipelineCollation; -import cd.casic.ci.process.api.process.pojo.PipelineSortType; -import cd.casic.ci.process.process.dataObject.TPipelineInfoRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -/** - * 流水线信息 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineInfoDao { - - int create( - @Param("pipelineId") String pipelineId, - @Param("projectId") String projectId, - @Param("version") int version, - @Param("pipelineName") String pipelineName, - @Param("pipelineDesc") String pipelineDesc, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode, - @Param("manualStartup") boolean manualStartup, - @Param("canElementSkip") boolean canElementSkip, - @Param("taskCount") int taskCount, - @Param("id") Long id, - @Param("latestVersionStatus") VersionStatus latestVersionStatus, - @Param("pipelineDisable") Boolean pipelineDisable - ); - - boolean update( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("version") Integer version, - @Param("pipelineName") String pipelineName, - @Param("pipelineDesc") String pipelineDesc, - @Param("manualStartup") Boolean manualStartup, - @Param("canElementSkip") Boolean canElementSkip, - @Param("taskCount") int taskCount, - @Param("latestVersion") int latestVersion, - @Param("updateLastModifyUser") Boolean updateLastModifyUser, - @Param("latestVersionStatus") VersionStatus latestVersionStatus, - @Param("locked") Boolean locked - ); - - int countByPipelineIds( - @Param("projectId") String projectId, - @Param("channelCode") ChannelCode channelCode, - @Param("pipelineIds") List pipelineIds - ); - - int countByProjectIds( - @Param("projectIds") Collection projectIds, - @Param("channelCode") ChannelCode channelCode, - @Param("keyword") String keyword - ); - - int countByProjectIds( - @Param("projectIds") Collection projectIds, - @Param("channelCodes") List channelCodes, - @Param("keyword") String keyword - ); - - List listPipelineIdByProject( - @Param("projectId") String projectId - ); - - TPipelineInfoRecord listPipelineInfoByProject( - - @Param("projectId") String projectId, - @Param("limit") int limit, - @Param("offset") int offset, - @Param("deleteFlag") Boolean deleteFlag, - @Param("timeDescFlag") boolean timeDescFlag, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord searchByProject( - - @Param("pipelineName") String pipelineName, - @Param("projectCode") String projectCode, - @Param("limit") int limit, - @Param("offset") int offset, - @Param("channelCode") ChannelCode channelCode - ); - - int countPipelineInfoByProject( - - @Param("pipelineName") String pipelineName, - @Param("projectCode") String projectCode, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord searchByProject( - @Param("projectId") String projectId - ); - - TPipelineInfoRecord listPipelinesByProject( - - @Param("projectId") String projectId, - @Param("deleteFlag") Boolean deleteFlag, - @Param("days") Long days, - @Param("offset") Integer offset, - @Param("limit") Integer limit, - @Param("sortType") PipelineSortType sortType, - @Param("collation") PipelineCollation collation, - @Param("filterByPipelineName") String filterByPipelineName - ); - - int countPipeline( - - @Param("projectId") String projectId, - @Param("deleteFlag") Boolean deleteFlag, - @Param("days") Long days, - @Param("filterByPipelineName") String filterByPipelineName - ); - - TPipelineInfoRecord listDeletePipelineBefore( - - @Param("updateTime") LocalDateTime updateTime, - @Param("offset") Integer offset, - @Param("limit") Integer limit - ); - - boolean isNameExist( - - @Param("projectId") String projectId, - @Param("pipelineName") String pipelineName, - @Param("channelCode") ChannelCode channelCode - ); - - boolean isNameExist( - - @Param("projectId") String projectId, - @Param("pipelineName") String pipelineName, - @Param("channelCode") ChannelCode channelCode, - @Param("excludePipelineId") String excludePipelineId - ); - - TPipelineInfoRecord getPipelineInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord getPipelineInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("channelCode") ChannelCode channelCode, - @Param("delete") Boolean delete, - @Param("days") Long days - ); - - int softDelete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("changePipelineName") String changePipelineName, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode - ); - - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - TPipelineInfoRecord listInfoByPipelineIds( - @Param("projectId") String projectId, - @Param("pipelineIds") Set pipelineIds, - @Param("filterDelete") boolean filterDelete - ); - - TPipelineInfoRecord getPipelineInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("version") int version - ); - -// Record1 getPipelineInfoNum( -// -// @Param("projectIds") Set projectIds, -// @Param("channelCodes") Set channelCodes -// ); - - TPipelineInfoRecord listInfoByPipelineName( - - @Param("projectId") String projectId, - @Param("pipelineNames") Set pipelineNames, - @Param("filterDelete") boolean filterDelete - ); - - PipelineInfo convert( - @Param("t") TPipelineInfoRecord t, - @Param("templateId") String templateId - ); - - void restore( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode - ); - - TPipelineInfoRecord searchByProjectId( - @Param("pipelineName") String pipelineName, - @Param("projectCode") String projectCode, - @Param("limit") int limit, - @Param("offset") int offset, - @Param("channelCodes") List channelCodes - ); - - int getPipelineVersion( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("userId") String userId, - @Param("channelCode") ChannelCode channelCode - ); -// TODO -// Result> listByProject( -// -// @Param("projectId") String projectId -// ); - - TPipelineInfoRecord getPipelineId( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int countExcludePipelineIds( - @Param("projectId") String projectId, - @Param("excludePipelineIds") List excludePipelineIds, - @Param("channelCode") ChannelCode channelCode, - @Param("includeDelete") boolean includeDelete, - @Param("filterPipelineIds") List filterPipelineIds - ); - - TPipelineInfoRecord getPipelineByAutoId( - @Param("ids") List ids, - @Param("projectId") String projectId - ); - - void updateLatestStartTime( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("startTime") LocalDateTime startTime - ); - - List getIdByCreateTimePeriod( - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime, - @Param("page") int page, - @Param("pageSize") int pageSize - ); - - TPipelineInfoRecord listByPipelineIds( - @Param("projectId") String projectId, - @Param("excludePipelineIds") List excludePipelineIds, - @Param("channelCode") ChannelCode channelCode, - @Param("limit") int limit, - @Param("offset") int offset - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineJobMutexGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineJobMutexGroupDao.java deleted file mode 100644 index eb895ed..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineJobMutexGroupDao.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.process.process.dataObject.TPipelineJobMutexGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 流水线任务互斥组 Mapper 接口 - */ -@Mapper -@Repository -public interface PipelineJobMutexGroupDao { - - TPipelineJobMutexGroupRecord getByProjectId( - @Param("projectId") String projectId - ); - - boolean insert( - @Param("projectId") String projectId, - @Param("jobMutexGroupName") String jobMutexGroupName - ); - - boolean create( - @Param("projectId") String projectId, - @Param("jobMutexGroupName") String jobMutexGroupName - ); - - boolean exit( - @Param("projectId") String projectId, - @Param("jobMutexGroupName") String jobMutexGroupName - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineModelTaskDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineModelTaskDao.java deleted file mode 100644 index 44d86ac..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineModelTaskDao.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.api.engine.pojo.PipelineModelTask; -import cd.casic.ci.process.process.dataObject.TPipelineModelTaskRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.Collection; - -/** - * 流水线模型任务数据访问接口 - */ -@Mapper -@Repository -public interface PipelineModelTaskDao { - - void batchSave( - @Param("modelTasks") Collection modelTasks - ); - - void deletePipelineTasks( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int getPipelineCountByAtomCode( - @Param("atomCode") String atomCode, - @Param("projectCode") String projectCode - ); - -// Result> batchGetPipelineCountByAtomCode( -// @Param("dslContext") DSLContext dslContext, -// @Param("atomCodeList") List atomCodeList, -// @Param("projectCode") String projectCode -// ); -// -// Result> batchGetPipelineIdByAtomCode( -// @Param("projectId") String projectId, -// @Param("atomCodeList") List atomCodeList, -// @Param("limit") int limit, -// @Param("offset") int offset -// ); - - TPipelineModelTaskRecord getModelTasks( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("isAtomVersionNull") Boolean isAtomVersionNull - ); - - TPipelineModelTaskRecord listByPipelineIds( - @Param("projectId") String projectId, - @Param("pipelineIds") Collection pipelineIds - ); - -// Result listByAtomCode( -// @Param("atomCode") String atomCode, -// @Param("projectId") String projectId, -// @Param("version") String version, -// @Param("startUpdateTime") LocalDateTime startUpdateTime, -// @Param("endUpdateTime") LocalDateTime endUpdateTime, -// @Param("page") Integer page, -// @Param("pageSize") Integer pageSize -// ); - - long countByAtomCode( - @Param("atomCode") String atomCode, - @Param("projectId") String projectId, - @Param("version") String version, - @Param("startUpdateTime") LocalDateTime startUpdateTime, - @Param("endUpdateTime") LocalDateTime endUpdateTime - ); - -// Result listByAtomCodeAndPipelineIds( -// @Param("atomCode") String atomCode, -// @Param("pipelineIds") Set pipelineIds -// ); - - void updateTaskAtomVersion( - @Param("atomVersion") String atomVersion, - @Param("createTime") LocalDateTime createTime, - @Param("updateTime") LocalDateTime updateTime, - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("stageId") String stageId, - @Param("containerId") String containerId, - @Param("taskId") String taskId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineRecentUseDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineRecentUseDao.java deleted file mode 100644 index a4e319e..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineRecentUseDao.java +++ /dev/null @@ -1,76 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * 最近使用的流水线Mapper接口 - */ -@Repository -public interface PipelineRecentUseDao { - - /** - * 新增记录 - * - * @param projectId 项目ID - * @param userId 用户ID - * @param pipelineId 流水线ID - * @return 影响的行数 - */ - int add( - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取最近使用的流水线ID列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param limit 限制数量 - * @return 流水线ID列表 - */ - List listRecentPipelineIds( - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("limit") Integer limit - ); - - /** - * 获取最近使用时间列表 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param limit 限制数量 - * @return 使用时间列表 - */ - List listLastUseTimes( - - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("limit") Integer limit - ); - - /** - * 删除过期记录 - * - - * @param projectId 项目ID - * @param userId 用户ID - * @param endTime 结束时间 - * @return 影响的行数 - */ - int deleteExpire( - - @Param("projectId") String projectId, - @Param("userId") String userId, - @Param("endTime") LocalDateTime endTime - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineResourceDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineResourceDao.java deleted file mode 100644 index c030c78..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineResourceDao.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.Model; -import cd.casic.ci.process.api.process.pojo.pipeline.PipelineResourceVersion; -import cd.casic.ci.process.api.process.pojo.setting.PipelineModelVersion; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -/** - * 流水线资源数据访问接口 - */ -@Mapper -@Repository -public interface PipelineResourceDao { - - /** - * 创建流水线资源 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param creator 创建者 - * @param version 版本号 - * @param versionName 版本名称 - * @param model 流水线模型 - * @param yamlStr YAML字符串 - * @param yamlVersion YAML版本 - * @param versionNum 版本序号 - * @param pipelineVersion 流水线版本 - * @param triggerVersion 触发器版本 - * @param settingVersion 设置版本 - */ - void create( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("creator") String creator, - @Param("version") int version, - @Param("versionName") String versionName, - @Param("model") Model model, - @Param("yamlStr") String yamlStr, - @Param("yamlVersion") String yamlVersion, - @Param("versionNum") Integer versionNum, - @Param("pipelineVersion") Integer pipelineVersion, - @Param("triggerVersion") Integer triggerVersion, - @Param("settingVersion") Integer settingVersion - ); - - /** - * 更新发布版本 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param version 版本号 - * @param versionName 版本名称 - * @param model 流水线模型 - * @param yamlStr YAML字符串 - * @param yamlVersion YAML版本 - * @param versionNum 版本序号 - * @param pipelineVersion 流水线版本 - * @param triggerVersion 触发器版本 - * @param settingVersion 设置版本 - */ - void updateReleaseVersion( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("version") int version, - @Param("versionName") String versionName, - @Param("model") Model model, - @Param("yamlStr") String yamlStr, - @Param("yamlVersion") String yamlVersion, - @Param("versionNum") Integer versionNum, - @Param("pipelineVersion") Integer pipelineVersion, - @Param("triggerVersion") Integer triggerVersion, - @Param("settingVersion") Integer settingVersion - ); - - /** - * 获取发布版本资源 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 流水线资源版本 - */ - PipelineResourceVersion getReleaseVersionResource( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取最新版本模型字符串 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 模型字符串 - */ - String getLatestVersionModelString( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 获取指定版本模型字符串 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param version 版本号 - * @return 模型字符串 - */ - String getVersionModelString( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("version") Integer version - ); - - /** - * 获取最新模型资源列表 - * - * @param pipelineIds 流水线ID集合 - * @param projectId 项目ID - * @return 流水线ID、版本号、模型字符串 - */ - Map> listLatestModelResource( - @Param("pipelineIds") Set pipelineIds, - @Param("projectId") String projectId - ); - - /** - * 删除所有版本 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @return 影响的行数 - */ - int deleteAllVersion( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - /** - * 更新流水线模型 - * - * @param userId 用户ID - * @param pipelineModelVersion 流水线模型版本 - */ - void updatePipelineModel( - @Param("userId") String userId, - @Param("pipelineModelVersion") PipelineModelVersion pipelineModelVersion - ); - - /** - * 更新设置版本 - * - * @param userId 用户ID - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param settingVersion 设置版本 - * @return 版本号 - */ - Integer updateSettingVersion( - @Param("userId") String userId, - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("settingVersion") int settingVersion - ); - - /** - * 获取模型字符串列表 - * - * @param projectId 项目ID - * @param pipelineIds 流水线ID集合 - * @return 流水线ID到模型字符串的映射 - */ - Map listModelString( - @Param("projectId") String projectId, - @Param("pipelineIds") Collection pipelineIds - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineSettingDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineSettingDao.java deleted file mode 100644 index 694e3b7..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineSettingDao.java +++ /dev/null @@ -1,97 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - - -import cd.casic.ci.common.pipeline.pojo.PipelineAsCodeSettings; -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.process.process.dataObject.TPipelineSettingRecord; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Set; - -public interface PipelineSettingDao { - int saveSetting( - @Param("setting") PipelineSetting setting, - @Param("isTemplate") boolean isTemplate - ); - - PipelineSetting getSetting( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - PipelineAsCodeSettings getPipelineAsCodeSettings( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - List getSettings( - - @Param("pipelineIds") Set pipelineIds, - @Param("projectId") String projectId - ); - - void batchUpdate( - - @Param("tPipelineSettingRecords") List tPipelineSettingRecords - ); -// TODO -// Result> getSimpleSettings( -// -// @Param("pipelineIds") Set pipelineIds, -// @Param("projectId") String projectId -// ); - - List getSetting( - @Param("projectId") String projectId, - @Param("name") String name, - @Param("pipelineId") String pipelineId, - @Param("isTemplate") boolean isTemplate - ); - - void updateSettingName( - - @Param("pipelineIdList") List pipelineIdList, - @Param("name") String name - ); - - PipelineSetting updateSetting( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("name") String name, - @Param("desc") String desc - ); -//TODO -// Record1 getSettingByName( -// -// @Param("name") String name, -// @Param("projectId") String projectId, -// @Param("pipelineId") String pipelineId, -// @Param("isTemplate") boolean isTemplate -// ); - - int delete( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int updateMaxConRunningQueueSize( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("maxConRunningQueueSize") int maxConRunningQueueSize - ); - - int updatePipelineAsCodeSettings( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("pipelineAsCodeSettings") PipelineAsCodeSettings pipelineAsCodeSettings - ); - - List getNonInheritedPipelineIds( - - @Param("projectId") String projectId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineStageTagDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineStageTagDao.java deleted file mode 100644 index b1a5db2..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineStageTagDao.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.api.process.pojo.PipelineStageTag; -import cd.casic.ci.process.process.dataObject.TPipelineStageTagRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线阶段标签Mapper接口 - */ -@Repository -public interface PipelineStageTagDao { - - /** - * 添加阶段标签 - * - - * @param id 标签ID - * @param stageTagName 阶段标签名称 - * @param weight 权重 - * @return 影响的行数 - */ - int add( - @Param("id") String id, - @Param("stageTagName") String stageTagName, - @Param("weight") Integer weight - ); - - /** - * 删除阶段标签 - * - - * @param id 标签ID - * @return 影响的行数 - */ - int delete( - @Param("id") String id - ); - - /** - * 更新阶段标签 - * - - * @param id 标签ID - * @param stageTagName 阶段标签名称 - * @param weight 权重 - * @return 影响的行数 - */ - int update( - - @Param("id") String id, - @Param("stageTagName") String stageTagName, - @Param("weight") Integer weight - ); - - /** - * 获取阶段标签 - * - - * @param id 标签ID - * @return 阶段标签记录 - */ - TPipelineStageTagRecord getStageTag( - - @Param("id") String id - ); - - /** - * 获取所有阶段标签 - * - * @return 所有阶段标签记录 - */ - List getAllStageTag(); - - /** - * 获取默认阶段标签 - * - * @return 默认阶段标签记录 - */ - TPipelineStageTagRecord getDefaultStageTag(); - - /** - * 根据名称或权重统计标签数量 - * - - * @param stageTagName 阶段标签名称 - * @param weight 权重 - * @return 标签数量 - */ - Integer countByNameOrWeight( - @Param("stageTagName") String stageTagName, - @Param("weight") Integer weight - ); - static PipelineStageTag convert(TPipelineStageTagRecord record, Boolean defaultFlag){ - return new PipelineStageTag( - record.getId(), - record.getStageTagName(), - record.getWeight(), - defaultFlag, - record.getCreateTime().getTime(), - record.getUpdateTime().getTime() - ); - } -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlSyncDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlSyncDao.java deleted file mode 100644 index 109137d..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlSyncDao.java +++ /dev/null @@ -1,33 +0,0 @@ -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.process.dataObject.TPipelineYamlSyncRecord; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface PipelineYamlSyncDao { - /** - * 创建YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return YAML同步记录ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 更新YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 删除YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取YAML同步记录列表 * * @param projectId 项目ID * @return YAML同步记录列表 - */ - List list(@Param("projectId") String projectId); - - /** - * 获取YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return YAML同步记录 - */ - TPipelineYamlSyncRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlViewDao.java deleted file mode 100644 index 1c7520d..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/PipelineYamlViewDao.java +++ /dev/null @@ -1,41 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.process.dataObject.TPipelineYamlViewRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线YAML视图 Dao 接口 - */ -@Mapper -@Repository -public interface PipelineYamlViewDao { - /** - * 创建YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return YAML视图ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 更新YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param yamlContent YAML内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("yamlContent") String yamlContent, @Param("userId") String userId); - - /** - * 删除YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取YAML视图列表 * * @param projectId 项目ID * @return YAML视图列表 - */ - List list(@Param("projectId") String projectId); - - /** - * 获取YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return YAML视图 - */ - TPipelineYamlViewRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/SubPipelineRefDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/SubPipelineRefDao.java deleted file mode 100644 index 35db857..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/pipeline/SubPipelineRefDao.java +++ /dev/null @@ -1,43 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.pipeline; - -import cd.casic.ci.process.api.process.pojo.pipeline.SubPipelineRef; -import org.apache.commons.lang3.tuple.Triple; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.Set; - -/** - * 子流水线引用 Dao 接口 TODO 不知道是哪个�? - */ -@Mapper -@Repository -//TODO 不知道哪个表 -public interface SubPipelineRefDao { - void batchAdd( - @Param("subPipelineRefList") Collection subPipelineRefList - ); - -// Result list( -// @Param("projectId") String projectId, -// @Param("pipelineId") String pipelineId -// ); - - int deleteAll( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - int delete( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("taskId") String taskId - ); - - void batchDelete( - @Param("infos") Set> infos - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildDetailDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildDetailDao.java deleted file mode 100644 index 4d68d7c..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildDetailDao.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.enums.StartType; -import cd.casic.ci.process.process.dataObject.TPipelineBuildDetailRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; - -/** - * 构建详情 Mapper 接口 - */ -@Mapper -@Repository -public interface BuildDetailDao { - - /** - * 创建构建详情 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param startUser 启动用户 - * @param startType 启动类型 - * @param buildNum 构建编号 - * @param model 模型 - * @param buildStatus 构建状态 - */ - void create( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("startUser") String startUser, - @Param("startType") StartType startType, - @Param("buildNum") Integer buildNum, - @Param("model") String model, - @Param("buildStatus") BuildStatus buildStatus - ); - - /** - * 更新构建取消用户 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param cancelUser 取消用户 - */ - void updateBuildCancelUser( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("cancelUser") String cancelUser - ); - - /** - * 更新构建详情 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param model 模型 - * @param buildStatus 构建状态 - * @param cancelUser 取消用户 - * @return 更新数量 - */ - int update( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("model") String model, - @Param("buildStatus") BuildStatus buildStatus, - @Param("cancelUser") String cancelUser - ); - - /** - * 更新构建状态 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @param buildStatus 构建状态 - * @param startTime 开始时间 - * @param endTime 结束时间 - */ - void updateStatus( - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("buildStatus") BuildStatus buildStatus, - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime - ); - - /** - * 获取构建详情 - * - * @param projectId 项目ID - * @param buildId 构建ID - * @return 构建详情记录 - */ - TPipelineBuildDetailRecord get( - @Param("projectId") String projectId, - @Param("buildId") String buildId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordContainerDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordContainerDao.java deleted file mode 100644 index 078dda9..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordContainerDao.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. - * - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. - * - * A copy of the MIT License is included in this file. - * - * - * Terms of the MIT License: - * --------------------------------------------------- - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of - * the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordContainer; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 构建记录容器 Mapper 接口 - */ -@Mapper -@Repository -public interface BuildRecordContainerDao { - - /** - * 批量保存构建记录容器 - * - * @param records 构建记录容器列表 - */ - void batchSave(@Param("records") List records); - - /** - * 更新构建记录容器 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @param executeCount 执行次数 - * @param containerVar 容器变量 - * @param buildStatus 构建状态 - * @param startTime 开始时间 - * @param endTime 结束时间 - * @param timestamps 时间戳 - */ - void updateRecord( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("containerId") String containerId, - @Param("executeCount") Integer executeCount, - @Param("containerVar") Map containerVar, - @Param("buildStatus") BuildStatus buildStatus, - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime, - @Param("timestamps") Map timestamps - ); - - /** - * 重试时清空结束时间 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @param executeCount 执行次数 - */ - void flushEndTimeWhenRetry( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("containerId") String containerId, - @Param("executeCount") Integer executeCount - ); - - /** - * 获取构建记录容器 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param containerId 容器ID - * @param executeCount 执行次数 - * @return 构建记录容器 - */ - BuildRecordContainer getRecord( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("containerId") String containerId, - @Param("executeCount") Integer executeCount - ); - - /** - * 获取构建记录容器列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @param stageId 阶段ID - * @param matrixGroupId 矩阵组ID - * @param buildStatusSet 构建状态集合 - * @return 构建记录容器列表 - */ - List getRecords( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount, - @Param("stageId") String stageId, - @Param("matrixGroupId") String matrixGroupId, - @Param("buildStatusSet") Set buildStatusSet - ); - - /** - * 更新构建记录容器状态 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @param buildStatus 构建状态 - * @param stageId 阶段ID - */ - void updateRecordStatus( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount, - @Param("buildStatus") BuildStatus buildStatus, - @Param("stageId") String stageId - ); - - /** - * 获取最新的普通构建记录容器列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @param stageId 阶段ID - * @return 构建记录容器列表 - */ - List getLatestNormalRecords( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount, - @Param("stageId") String stageId - ); - - /** - * 获取最新的矩阵构建记录容器列表 - * - * @param projectId 项目ID - * @param pipelineId 流水线ID - * @param buildId 构建ID - * @param executeCount 执行次数 - * @return 构建记录容器列表 - */ - List getLatestMatrixRecords( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("executeCount") Integer executeCount - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordModelDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordModelDao.java deleted file mode 100644 index f51ab62..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordModelDao.java +++ /dev/null @@ -1,57 +0,0 @@ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.ErrorInfo; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.BuildRecordInfo; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordModel; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; - -/** - * 构建记录模型Mapper接口 - */ -@Mapper -@Repository -public interface BuildRecordModelDao { - /** - * 创建构建记录模型 * * @param record 记录 * @return 影响行数 - */ - int createBuildRecordModel(@Param("record") BuildRecordModel record); - - /** - * 更新构建记录模型 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatus 构建状�? * @param modelVar 模型变量 * @param startTime 开始时�? * @param endTime 结束时间 * @param errorInfoList 错误信息列表 * @param cancelUser 取消用户 * @param timestamps 时间�? * @return 影响行数 - */ - int updateBuildRecordModel(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("buildStatus") BuildStatus buildStatus, @Param("modelVar") Map modelVar, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("errorInfoList") List errorInfoList, @Param("cancelUser") String cancelUser, @Param("timestamps") Map timestamps); - - /** - * 更新构建记录模型状�? * * @param projectId 项目ID * @param buildId 构建ID * @param buildStatus 构建状�? * @param executeCount 执行次数 * @return 影响行数 - */ - int updateBuildRecordModelStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("buildStatus") BuildStatus buildStatus, @Param("executeCount") int executeCount); - - /** - * 获取构建记录模型 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @return 记录 - */ - BuildRecordModel getBuildRecordModel(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount); - - /** - * 获取构建记录信息列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @return 记录信息列表 - */ - List getBuildRecordInfoList(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId); - - /** - * 更新构建取消用户 * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param cancelUser 取消用户 * @return 影响行数 - */ - int updateBuildCancelUser(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("cancelUser") String cancelUser); - - /** - * 获取构建取消用户 * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @return 取消用户 - */ - String getBuildCancelUser(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordStageDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordStageDao.java deleted file mode 100644 index 23c251f..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordStageDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordStage; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 构建记录阶段 Dao 接口 - */ -@Repository -public interface BuildRecordStageDao { - /** - * 批量保存记录 * * @param records 记录列表 * @return 影响的行�? - */ - int batchSave(@Param("records") List records); - - /** - * 更新记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param stageId 阶段ID * @param executeCount 执行次数 * @param stageVar 阶段变量 * @param buildStatus 构建状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param timestamps 时间�? * @return 影响的行�? - */ - int updateRecord(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("stageId") String stageId, @Param("executeCount") int executeCount, @Param("stageVar") Map stageVar, @Param("buildStatus") BuildStatus buildStatus, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("timestamps") Map timestamps); - - /** - * 获取记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatusSet 构建状态集�? * @return 构建记录阶段列表 - */ - List getRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("buildStatusSet") Set buildStatusSet); - - /** - * 获取最新的记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @return 构建记录阶段列表 - */ - List getLatestRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordTaskDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordTaskDao.java deleted file mode 100644 index 4f4a35f..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/BuildRecordTaskDao.java +++ /dev/null @@ -1,67 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildRecordTimeStamp; -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.common.pipeline.pojo.time.BuildTimestampType; -import cd.casic.ci.process.api.process.pojo.pipeline.record.BuildRecordTask; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 构建记录任务 Dao 接口 - */ -@Mapper -@Repository -public interface BuildRecordTaskDao { - /** - * 批量保存构建记录任务 * * @param records 构建记录任务列表 - */ - void batchSave(@Param("records") List records); - - /** - * 更新构建记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @param taskVar 任务变量 * @param buildStatus 构建状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param timestamps 时间�? - */ - void updateRecord(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount, @Param("taskVar") Map taskVar, @Param("buildStatus") BuildStatus buildStatus, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("timestamps") Map timestamps); - - /** - * 更新构建记录状�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatus 构建状�? * @param stageId 阶段ID * @param containerId 容器ID - */ - void updateRecordStatus(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("buildStatus") BuildStatus buildStatus, @Param("stageId") String stageId, @Param("containerId") String containerId); - - /** - * 获取构建记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param containerId 容器ID * @param buildStatusSet 构建状态集�? * @return 构建记录任务列表 - */ - List getRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("containerId") String containerId, @Param("buildStatusSet") Set buildStatusSet); - - /** - * 获取最新的普通构建记录列�? * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param matrixContainerIds 矩阵容器ID列表 * @param stageId 阶段ID * @return 构建记录任务列表 - */ - List getLatestNormalRecords(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("matrixContainerIds") List matrixContainerIds, @Param("stageId") String stageId); - - /** - * 获取最新的矩阵构建记录列表 * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param matrixContainerIds 矩阵容器ID列表 * @return 构建记录任务列表 - */ - List getLatestMatrixRecords(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("matrixContainerIds") List matrixContainerIds); - - /** - * 获取构建记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @return 构建记录任务 - */ - BuildRecordTask getRecord(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount); - - /** - * 更新异步状�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @param asyncStatus 异步状�? - */ - void updateAsyncStatus(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount, @Param("asyncStatus") String asyncStatus); - - /** - * 重试时清空结束时�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 - */ - void flushEndTimeWhenRetry(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("executeCount") int executeCount); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildContainerDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildContainerDao.java deleted file mode 100644 index 7b4f64c..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildContainerDao.java +++ /dev/null @@ -1,97 +0,0 @@ -package cd.casic.ci.process.process.dal.record; - - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildContainer; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildContainerControlOption; -import org.apache.ibatis.annotations.Param; - -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -public interface PipelineBuildContainerDao { - void create( - @Param("buildContainer") PipelineBuildContainer buildContainer - ); - - void batchSave( - @Param("containerList") Collection containerList - ); - - void batchUpdate( - - @Param("containerList") List containerList - ); - - PipelineBuildContainer getByContainerId( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containerId") String containerId - ); - - int updateStatus( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containerId") String containerId, - @Param("startTime") LocalDateTime startTime, - @Param("endTime") LocalDateTime endTime, - @Param("controlOption") PipelineBuildContainerControlOption controlOption, - @Param("buildStatus") BuildStatus buildStatus - ); - - int updateControlOption( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containerId") String containerId, - @Param("controlOption") PipelineBuildContainerControlOption controlOption - ); - - List listByBuildId( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("containsMatrix") Boolean containsMatrix, - @Param("statusSet") Set statusSet - ); - - int countStageContainers( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("stageId") String stageId, - @Param("onlyMatrixGroup") boolean onlyMatrixGroup - ); - - List listByMatrixGroupId( - - @Param("projectId") String projectId, - @Param("buildId") String buildId, - @Param("matrixGroupId") String matrixGroupId - ); - - Collection listBuildContainerIdsInMatrixGroup( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("matrixGroupId") String matrixGroupId, - @Param("stageId") String stageId - ); - - int deleteBuildContainerInMatrixGroup( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("matrixGroupId") String matrixGroupId - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildStageDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildStageDao.java deleted file mode 100644 index 670802b..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildStageDao.java +++ /dev/null @@ -1,56 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.process.api.engine.pojo.PipelineBuildStage; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线构建阶�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineBuildStageDao { - /** - * 创建流水线构建阶�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param stageId 阶段ID * @param stageName 阶段名称 * @param status 状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param controlOption 控制选项 * @return 影响行数 - */ - int createPipelineBuildStage(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("stageId") String stageId, @Param("stageName") String stageName, @Param("status") String status, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("controlOption") String controlOption); - - /** - * 批量保存流水线构建阶�? * * @param stages 阶段列表 * @return 影响行数 - */ - int batchSavePipelineBuildStages(@Param("stages") List stages); - - /** - * 获取流水线构建阶�? * * @param projectId 项目ID * @param buildId 构建ID * @param stageId 阶段ID * @return 构建阶段 - */ - PipelineBuildStage getPipelineBuildStage(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("stageId") String stageId); - - /** - * 获取流水线构建阶段列�? * * @param projectId 项目ID * @param buildId 构建ID * @param status 状�? * @return 构建阶段列表 - */ - List listPipelineBuildStages(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("status") String status); - - /** - * 删除流水线构建阶�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数 - */ - int deletePipelineBuildStages(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 更新流水线构建阶段状�? * * @param projectId 项目ID * @param buildId 构建ID * @param stageId 阶段ID * @param status 状�? * @param startTime 开始时�? * @param endTime 结束时间 * @param controlOption 控制选项 * @return 影响行数 - */ - int updatePipelineBuildStageStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("stageId") String stageId, @Param("status") String status, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("controlOption") String controlOption); - - /** - * 获取最大阶�? * * @param projectId 项目ID * @param buildId 构建ID * @return 最大阶�? - */ - PipelineBuildStage getMaxPipelineBuildStage(@Param("projectId") String projectId, @Param("buildId") String buildId); - - /** - * 根据状态获取流水线构建阶段 * * @param projectId 项目ID * @param buildId 构建ID * @param statuses 状态列�? * @return 构建阶段 - */ - PipelineBuildStage getPipelineBuildStageByStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("statuses") List statuses); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildSummaryDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildSummaryDao.java deleted file mode 100644 index 25f9f19..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildSummaryDao.java +++ /dev/null @@ -1,159 +0,0 @@ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.common.pipeline.pojo.BuildNo; -import cd.casic.ci.process.api.process.pojo.PipelineCollation; -import cd.casic.ci.process.api.process.pojo.PipelineSortType; -import cd.casic.ci.process.process.dataObject.TPipelineBuildSummaryRecord; -import cd.casic.ci.process.process.dataObject.TPipelineInfoRecord; -import cd.casic.ci.process.process.pojo.LatestRunningBuild; -import cd.casic.ci.process.process.pojo.PipelineFilterParam; -import org.apache.ibatis.annotations.Param; - -import java.util.Collection; -import java.util.List; -import java.util.Set; - -public interface PipelineBuildSummaryDao { - void create( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildNo") BuildNo buildNo - ); - - void delete( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - TPipelineBuildSummaryRecord get( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId - ); - - TPipelineBuildSummaryRecord getSummaries( - - @Param("projectId") String projectId, - @Param("pipelineIds") Set pipelineIds - ); - - void resetDebugInfo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("debugBuildNo") int debugBuildNo - ); - - void updateBuildNo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildNo") int buildNo, - @Param("debug") boolean debug - ); - - Integer getBuildNo( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("debug") boolean debug - ); - - int updateBuildNum( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("debug") boolean debug, - @Param("buildNum") int buildNum, - @Param("buildNumAlias") String buildNumAlias - ); - - long listPipelineInfoBuildSummaryCount( - - @Param("projectId") String projectId, - @Param("channelCode") ChannelCode channelCode, - @Param("pipelineIds") Collection pipelineIds, - @Param("viewId") String viewId, - @Param("favorPipelines") List favorPipelines, - @Param("authPipelines") List authPipelines, - @Param("pipelineFilterParamList") List pipelineFilterParamList, - @Param("permissionFlag") Boolean permissionFlag, - @Param("includeDelete") Boolean includeDelete, - @Param("userId") String userId - ); - - TPipelineInfoRecord listPipelineInfoBuildSummary( - - @Param("projectId") String projectId, - @Param("channelCode") ChannelCode channelCode, - @Param("sortType") PipelineSortType sortType, - @Param("pipelineIds") Collection pipelineIds, - @Param("favorPipelines") List favorPipelines, - @Param("authPipelines") List authPipelines, - @Param("viewId") String viewId, - @Param("pipelineFilterParamList") List pipelineFilterParamList, - @Param("permissionFlag") Boolean permissionFlag, - @Param("page") Integer page, - @Param("pageSize") Integer pageSize, - @Param("pageOffsetNum") Integer pageOffsetNum, - @Param("includeDelete") Boolean includeDelete, - @Param("collation") PipelineCollation collation, - @Param("userId") String userId - ); - - void updateQueueCount( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("queueIncrement") int queueIncrement - ); - - int startLatestRunningBuild( - - @Param("latestRunningBuild") LatestRunningBuild latestRunningBuild, - @Param("executeCount") int executeCount, - @Param("debug") boolean debug - ); - - void updateCurrentBuildTask( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("currentTaskId") String currentTaskId, - @Param("currentTaskName") String currentTaskName - ); - - void finishLatestRunningBuild( - @Param("latestRunningBuild") LatestRunningBuild latestRunningBuild, - @Param("isStageFinish") boolean isStageFinish, - @Param("debug") boolean debug - ); - - void updateRunningCount( - - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("buildId") String buildId, - @Param("runningIncrement") int runningIncrement, - @Param("debug") boolean debug - ); - - TPipelineBuildSummaryRecord listSummaryByPipelineIds( - - @Param("pipelineIds") Collection pipelineIds, - @Param("projectId") String projectId - ); - - boolean fixPipelineSummaryCount( - @Param("projectId") String projectId, - @Param("pipelineId") String pipelineId, - @Param("finishCount") int finishCount, - @Param("runningCount") Integer runningCount, - @Param("queueCount") Integer queueCount - ); -} \ No newline at end of file diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildTaskDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildTaskDao.java deleted file mode 100644 index 7ce2f44..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildTaskDao.java +++ /dev/null @@ -1,85 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.enums.BuildStatus; -import cd.casic.ci.process.api.engine.pojo.PipelineBuildTask; -import cd.casic.ci.process.process.pojo.UpdateTaskInfo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -/** - * 流水线构建任�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineBuildTaskDao { - /** - * 创建流水线构建任�? * * @param buildTask 构建任务信息 - */ - void create(@Param("buildTask") PipelineBuildTask buildTask); - - /** - * 批量保存流水线构建任�? * * @param taskList 构建任务列表 - */ - void batchSave(@Param("taskList") Collection taskList); - - /** - * 批量更新流水线构建任�? * * @param taskList 构建任务列表 - */ - void batchUpdate(@Param("taskList") List taskList); - - /** - * 获取流水线构建任�? * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @param stepId 步骤ID * @param executeCount 执行次数 * @return 构建任务信息 - */ - PipelineBuildTask get(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("stepId") String stepId, @Param("executeCount") Integer executeCount); - - /** - * 获取任务状�? * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @return 任务状�? - */ - Integer getTaskStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId); - - /** - * 根据构建ID获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @return 任务列表 - */ - Collection getByBuildId(@Param("projectId") String projectId, @Param("buildId") String buildId); - - /** - * 根据条件获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @param containerId 容器ID * @param statusSet 状态集�? * @return 任务列表 - */ - List getTasksInCondition(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("containerId") String containerId, @Param("statusSet") Collection statusSet); - - /** - * 删除构建任务 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param containerId 容器ID * @return 删除数量 - */ - int deleteBuildTasksByContainerSeqId(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("containerId") String containerId); - - /** - * 更新子构建ID * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @param subBuildId 子构建ID * @param subProjectId 子项目ID * @return 更新数量 - */ - int updateSubBuildId(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("subBuildId") String subBuildId, @Param("subProjectId") String subProjectId); - - /** - * 更新任务信息 * * @param updateTaskInfo 更新任务信息 - */ - void updateTaskInfo(@Param("updateTaskInfo") UpdateTaskInfo updateTaskInfo); - - /** - * 根据构建ID统计任务数量 * * @param projectId 项目ID * @param buildIds 构建ID列表 * @return 统计结果 - */ - List> countGroupByBuildId(@Param("projectId") String projectId, @Param("buildIds") Collection buildIds); - - /** - * 更新任务参数 * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @param taskParam 任务参数 * @return 更新数量 - */ - int updateTaskParam(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId, @Param("taskParam") String taskParam); - - /** - * 获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @return 任务列表 - */ - List> list(@Param("projectId") String projectId, @Param("buildId") String buildId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildVarDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildVarDao.java deleted file mode 100644 index f7ca53a..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/record/PipelineBuildVarDao.java +++ /dev/null @@ -1,68 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.record; - -import cd.casic.ci.common.pipeline.pojo.BuildParameters; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 流水线构建变�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineBuildVarDao { - /** - * 保存构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param name 变量�? * @param value 变量�? * @param readOnly 是否只读 - */ - void save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("name") String name, @Param("value") Object value, @Param("readOnly") Boolean readOnly); - - /** - * 更新构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param name 变量�? * @param value 变量�? * @param valueType 变量类型 * @param rewriteReadOnly 是否重写只读 * @return 更新数量 - */ - int update(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("name") String name, @Param("value") Object value, @Param("valueType") String valueType, @Param("rewriteReadOnly") Boolean rewriteReadOnly); - - /** - * 获取构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param keys 变量名集�? * @return 变量映射 - */ - Map getVars(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("keys") Set keys); - - /** - * 获取带类型的构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param key 变量�? * @return 构建参数列表 - */ - List getVarsWithType(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("key") String key); - - /** - * 删除构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param varName 变量�? * @param readOnly 是否只读 * @return 删除数量 - */ - int deleteBuildVar(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("varName") String varName, @Param("readOnly") Boolean readOnly); - - /** - * 批量保存构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param variables 构建参数列表 - */ - void batchSave(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("variables") List variables); - - /** - * 批量更新构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param variables 构建参数列表 - */ - void batchUpdate(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("variables") List variables); - - /** - * 删除构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID - */ - void deleteBuildVars(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId); - - /** - * 删除流水线构建变�? * * @param projectId 项目ID * @param pipelineId 流水线ID - */ - void deletePipelineBuildVar(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 根据关键字模糊查询变�? * * @param projectId 项目ID * @param buildId 构建ID * @param readOnly 是否只读 * @param likeStr 模糊匹配字符�? * @return 变量值集�? - */ - Set fetchVarByLikeKey(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("readOnly") Boolean readOnly, @Param("likeStr") String likeStr); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/report/ReportDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/report/ReportDao.java deleted file mode 100644 index 6798737..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/report/ReportDao.java +++ /dev/null @@ -1,42 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.report; - -import cd.casic.ci.process.api.process.pojo.Report; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Map; - -/** - * 报告 Dao 接口 - */ -@Mapper -@Repository -public interface ReportDao { - /** - * 获取原子信息 * * @param buildId 构建ID * @param taskId 任务ID * @return 原子信息 - */ - Map getAtomInfo(@Param("buildId") String buildId, @Param("taskId") String taskId); - - /** - * 创建报告 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param elementId 元素ID * @param indexFile 索引文件 * @param name 名称 * @param type 类型 * @param atomCode 原子代码 * @param taskName 任务名称 * @param id 记录ID * @return 记录ID - */ - long createReport(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("elementId") String elementId, @Param("indexFile") String indexFile, @Param("name") String name, @Param("type") String type, @Param("atomCode") String atomCode, @Param("taskName") String taskName, @Param("id") Long id); - - /** - * 获取报告 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param elementId 元素ID * @return 报告 - */ - Report getReport(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("elementId") String elementId); - - /** - * 获取报告列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @return 报告列表 - */ - List getReportList(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId); - - /** - * 删除报告 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param elementId 元素ID * @return 影响的行�? - */ - int deleteReport(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("elementId") String elementId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingDao.java deleted file mode 100644 index 346f09e..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingDao.java +++ /dev/null @@ -1,69 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.setting; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.process.process.dataObject.TPipelineSettingRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; -import java.util.Set; - -/** - * 流水线设�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineSettingDao { - /** - * 获取流水线设�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 流水线设�? - */ - PipelineSetting getSetting(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取流水线设�? * * @param projectId 项目ID * @param name 设置名称 * @param pipelineId 流水线ID * @param isTemplate 是否模板 * @return 流水线设置列�? - */ - List getSetting(@Param("projectId") String projectId, @Param("name") String name, @Param("pipelineId") String pipelineId, @Param("isTemplate") Boolean isTemplate); - - /** - * 获取流水线设置列�? * * @param pipelineIds 流水线ID列表 * @param projectId 项目ID * @return 流水线设置列�? - */ - List getSettings(@Param("pipelineIds") Set pipelineIds, @Param("projectId") String projectId); - - /** - * 获取简单的流水线设�? * * @param pipelineIds 流水线ID列表 * @param projectId 项目ID * @return 简单的流水线设�? - */ - // TODO -// Result> getSimpleSettings(@Param("pipelineIds") Set pipelineIds, @Param("projectId") String projectId); - - /** - * 获取流水线设置数�? * * @param name 设置名称 * @param projectId 项目ID * @param pipelineId 流水线ID * @param isTemplate 是否模板 * @return 设置数量 - */ - Integer getSettingCount(@Param("name") String name, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("isTemplate") Boolean isTemplate); - - /** - * 创建流水线设�? * * @param setting 流水线设�? * @return 影响行数 - */ - int create(PipelineSetting setting); - - /** - * 更新流水线设�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param name 设置名称 * @param desc 描述 * @return 更新后的流水线设�? - */ - PipelineSetting updateSetting(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("name") String name, @Param("desc") String desc); - - /** - * 更新模板引用的设置名�? * * @param pipelineIdList 流水线ID列表 * @param name 设置名称 - */ - void updateSettingName(@Param("pipelineIdList") List pipelineIdList, @Param("name") String name); - - /** - * 批量更新流水线设�? * * @param records 流水线设置记录列�? - */ - void batchUpdate(List records); - - /** - * 删除流水线设�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数 - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingVersionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingVersionDao.java deleted file mode 100644 index a0fecda..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/setting/PipelineSettingVersionDao.java +++ /dev/null @@ -1,42 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.setting; - -import cd.casic.ci.process.api.process.pojo.setting.PipelineSettingVersion; -import cd.casic.ci.process.process.dataObject.TPipelineSettingVersionRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线设置版�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineSettingVersionDao { - /** - * 获取流水线设置版�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本�? * @return 流水线设置版�? - */ - PipelineSettingVersion getSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") Integer version); - - /** - * 获取最新的流水线设置版�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 最新的流水线设置版�? - */ - PipelineSettingVersion getLatestSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 创建流水线设置版�? * * @param setting 流水线设�? * @return 影响行数 - */ - int create(PipelineSettingVersion setting); - - /** - * 更新流水线设置版�? * * @param setting 流水线设�? * @return 影响行数 - */ - int update(PipelineSettingVersion setting); - - /** - * 批量更新流水线设置版�? * * @param records 流水线设置版本记录列�? - */ - void batchUpdate(List records); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineFavorDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineFavorDao.java deleted file mode 100644 index e0e8247..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineFavorDao.java +++ /dev/null @@ -1,51 +0,0 @@ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.process.process.dataObject.TPipelineFavorRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 用户收藏流水线Mapper接口 - */ -@Repository -public interface PipelineFavorDao { - /** - * 保存用户收藏 * * @param userId 用户ID * @param projectId 项目ID * @param pipelineId 流水线ID * @param id 主键ID * @return 影响的行�? - */ - int save(@Param("userId") String userId, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("id") Long id); - - /** - * 删除用户收藏 * * @param userId 用户ID * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int delete(@Param("userId") String userId, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 删除流水线的所有用户收�? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行�? - */ - int deleteAllUserFavorByPipeline(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取用户收藏的流水线列表 * * @param userId 用户ID * @param projectId 项目ID * @return 收藏记录列表 - */ - TPipelineFavorRecord list(@Param("userId") String userId, @Param("projectId") String projectId); - - /** - * 获取用户所有收藏的流水线列�? * * @param userId 用户ID * @return 收藏记录列表 - */ - TPipelineFavorRecord listByUserId(@Param("userId") String userId); - - /** - * 统计用户收藏的流水线数量 * * @param projectId 项目ID * @param userId 用户ID * @return 收藏数量 - */ - int countByUserId(@Param("projectId") String projectId, @Param("userId") String userId); - - /** - * 获取用户收藏的指定流水线 * * @param userId 用户ID * @param projectId 项目ID * @param pipelineId 流水线ID * @return 收藏记录列表 - */ - TPipelineFavorRecord listByPipelineId(@Param("userId") String userId, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取最大ID * * @return 最大ID - */ - long getMaxId(); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineSettingVersionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineSettingVersionDao.java deleted file mode 100644 index 53b9704..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/PipelineSettingVersionDao.java +++ /dev/null @@ -1,55 +0,0 @@ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.common.pipeline.pojo.setting.PipelineSetting; -import cd.casic.ci.process.api.process.pojo.setting.PipelineSettingVersion; -import cd.casic.ci.process.process.dataObject.TPipelineSettingVersionRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线设置版本Mapper接口 - */ -@Repository -public interface PipelineSettingVersionDao { - /** - * 保存流水线设置版�? * @param dslContext DSL上下�? * @param setting 流水线设�? * @param version 版本�? * @param isTemplate 是否为模�? * @param id ID * @return 影响行数 - */ - int saveSetting(@Param("setting") PipelineSetting setting, @Param("version") int version, @Param("isTemplate") boolean isTemplate, @Param("id") Long id); - - /** - * 获取流水线设置版�? * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本�? * @return 流水线设置版�? - */ - PipelineSettingVersion getSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") int version); - - /** - * 获取最新的流水线设置版�? * @param projectId 项目ID * @param pipelineId 流水线ID * @return 最新的流水线设置版�? - */ - PipelineSettingVersion getLatestSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 根据流水线ID列表获取设置版本 * @param pipelineIds 流水线ID列表 * @return 流水线设置版本列�? - */ - List getSettingByPipelineIds(@Param("pipelineIds") List pipelineIds); - - /** - * 批量更新流水线设置版�? * @param records 流水线设置版本记录列�? - */ - void batchUpdate(@Param("records") List records); - - /** - * 删除所有版本的流水线设�? * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数 - */ - int deleteAllVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 删除指定版本的流水线设置 * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本�? * @return 影响行数 - */ - int deleteByVer(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") int version); - - /** - * 删除早期版本的流水线设置 * @param projectId 项目ID * @param pipelineId 流水线ID * @param currentVersion 当前版本 * @param maxPipelineResNum 最大流水线资源�? * @return 影响行数 - */ - int deleteEarlyVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("currentVersion") int currentVersion, @Param("maxPipelineResNum") int maxPipelineResNum); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceBaseDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceBaseDao.java deleted file mode 100644 index 0d0b6ea..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceBaseDao.java +++ /dev/null @@ -1,41 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.process.process.dataObject.TTemplateInstanceBaseRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 模板实例基础 Dao 接口 - */ -@Mapper -@Repository -public interface TemplateInstanceBaseDao { - /** - * 创建模板实例基础记录 * * @param projectId 项目ID * @param templateId 模板ID * @param name 名称 * @param userId 用户ID * @return 模板实例基础记录ID - */ - long createTemplateInstanceBase(@Param("projectId") String projectId, @Param("templateId") String templateId, @Param("name") String name, @Param("userId") String userId); - - /** - * 更新模板实例基础记录 * * @param instanceId 实例ID * @param name 名称 * @param userId 用户ID - */ - void updateTemplateInstanceBase(@Param("instanceId") String instanceId, @Param("name") String name, @Param("userId") String userId); - - /** - * 删除模板实例基础记录 * * @param instanceId 实例ID - */ - void deleteTemplateInstanceBase(@Param("instanceId") String instanceId); - - /** - * 获取模板实例基础记录列表 * * @param projectId 项目ID * @return 模板实例基础记录列表 - */ - List getTemplateInstanceBaseList(@Param("projectId") String projectId); - - /** - * 获取模板实例基础记录 * * @param instanceId 实例ID * @return 模板实例基础记录 - */ - TTemplateInstanceBaseRecord getTemplateInstanceBase(@Param("instanceId") String instanceId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceItemDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceItemDao.java deleted file mode 100644 index eb44356..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/template/TemplateInstanceItemDao.java +++ /dev/null @@ -1,47 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.template; - -import cd.casic.ci.process.api.process.pojo.template.TemplateInstanceUpdate; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.Collection; -import java.util.List; - -/** - * 模板实例�?Dao 接口 - */ -@Mapper -@Repository -public interface TemplateInstanceItemDao { - /** - * 创建模板实例�? * * @param projectId 项目ID * @param baseId 基础ID * @param instances 实例列表 * @param status 状�? * @param userId 用户ID - */ - void createTemplateInstanceItem(@Param("projectId") String projectId, @Param("baseId") String baseId, @Param("instances") List instances, @Param("status") String status, @Param("userId") String userId); - - /** - * 获取模板实例项列�? * * @param status 状�? * @param descFlag 是否降序 * @param page 页码 * @param pageSize 每页大小 * @return 模板实例项列�? - */ - List getTemplateInstanceItemList(@Param("status") String status, @Param("descFlag") boolean descFlag, @Param("page") int page, @Param("pageSize") int pageSize); - - /** - * 根据基础ID获取模板实例项列�? * * @param projectId 项目ID * @param baseId 基础ID * @param descFlag 是否降序 * @param page 页码 * @param pageSize 每页大小 * @return 模板实例项列�? - */ - List getTemplateInstanceItemListByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId, @Param("descFlag") boolean descFlag, @Param("page") int page, @Param("pageSize") int pageSize); - - /** - * 根据基础ID获取模板实例项数�? * * @param projectId 项目ID * @param baseId 基础ID * @return 数量 - */ - long getTemplateInstanceItemCountByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId); - - /** - * 根据流水线ID列表获取模板实例项列�? * * @param projectId 项目ID * @param pipelineIds 流水线ID列表 * @return 模板实例项列�? - */ - List getTemplateInstanceItemListByPipelineIds(@Param("projectId") String projectId, @Param("pipelineIds") Collection pipelineIds); - - /** - * 根据基础ID删除模板实例�? * * @param projectId 项目ID * @param baseId 基础ID - */ - void deleteByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerBranchDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerBranchDao.java deleted file mode 100644 index 3ce6023..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerBranchDao.java +++ /dev/null @@ -1,27 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.trigger; - -import cd.casic.ci.process.process.dataObject.TPipelineTimerBranchRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - - -@Repository -public -interface PipelineTimerBranchDao { - - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch, @Param("userId") String userId); - - - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch, @Param("userId") String userId); - - - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch); - - - List list(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId); - - TPipelineTimerBranchRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("timerId") String timerId, @Param("branch") String branch); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerDao.java deleted file mode 100644 index 3dbcdae..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTimerDao.java +++ /dev/null @@ -1,26 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.trigger; - -import cd.casic.ci.common.pipeline.enums.ChannelCode; -import cd.casic.ci.process.process.dataObject.TPipelineTimerRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 娴佹按绾垮畾鏃跺櫒 Dao 鎺ュ彛 - */ -@Mapper -public interface PipelineTimerDao { - - int save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("userId") String userId, @Param("crontabExpression") String crontabExpression, @Param("channelCode") ChannelCode channelCode, @Param("repoHashId") String repoHashId, @Param("branchs") String branchs, @Param("noScm") Boolean noScm); - - - TPipelineTimerRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - List list(@Param("offset") int offset, @Param("limit") int limit); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTriggerEventDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTriggerEventDao.java deleted file mode 100644 index 7bd0f3b..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/trigger/PipelineTriggerEventDao.java +++ /dev/null @@ -1,45 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 钃濋哺鎸佺画闆嗘垚骞冲彴 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.trigger; - -import cd.casic.ci.process.api.process.pojo.trigger.PipelineTriggerDetail; -import cd.casic.ci.process.api.process.pojo.trigger.PipelineTriggerEvent; -import cd.casic.ci.process.api.process.pojo.trigger.PipelineTriggerEventVo; -import org.apache.ibatis.annotations.Param; - -import java.time.LocalDateTime; -import java.util.List; -import java.util.Set; - - -public interface PipelineTriggerEventDao { - - int save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventType") String eventType, @Param("eventId") String eventId, @Param("status") String status, @Param("errorMsg") String errorMsg); - - - int saveDetail(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventId") String eventId, @Param("detail") String detail); - - - List listTriggerDetail(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventType") String eventType, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("status") String status, @Param("page") int page, @Param("pageSize") int pageSize); - - - int countTriggerDetail(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("eventType") String eventType, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("status") String status); - - - List listByEventIds(@Param("eventIds") Set eventIds); - - - int updateStatus(@Param("eventId") String eventId, @Param("status") String status, @Param("errorMsg") String errorMsg); - - - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("beforeTime") LocalDateTime beforeTime); - - - List listTriggerDetail(@Param("pipelineName") String pipelineName, @Param("pipelineId") String pipelineId, @Param("eventId") Long eventId, @Param("eventSource") String eventSource, @Param("projectId") String projectId, @Param("eventType") String eventType, @Param("reason") String reason, @Param("triggerType") String triggerType, @Param("triggerUser") String triggerUser, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("limit") Integer limit, @Param("offset") Integer offset); - - - long countTriggerDetail(@Param("pipelineName") String pipelineName, @Param("pipelineId") String pipelineId, @Param("eventId") Long eventId, @Param("eventSource") String eventSource, @Param("projectId") String projectId, @Param("eventType") String eventType, @Param("reason") String reason, @Param("triggerType") String triggerType, @Param("triggerUser") String triggerUser, @Param("startTime") Long startTime, @Param("endTime") Long endTime); - - - Set getEventIdsByEvent(@Param("eventId") Long eventId, @Param("eventSource") String eventSource, @Param("projectId") String projectId, @Param("eventType") String eventType, @Param("triggerType") String triggerType, @Param("triggerUser") String triggerUser, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("limit") Integer limit, @Param("offset") Integer offset); - -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewDao.java deleted file mode 100644 index 900d4e5..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewDao.java +++ /dev/null @@ -1,61 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewDao { - /** - * 创建流水线视�? * * @param projectId 项目ID * @param name 视图名称 * @param isProject 是否项目视图 * @param filterByPipelineName 按流水线名称过滤 * @param filterByCreator 按创建者过�? * @param userId 用户ID * @param id 视图ID * @return 视图ID - */ - Long create(@Param("projectId") String projectId, @Param("name") String name, @Param("isProject") Boolean isProject, @Param("filterByPipelineName") String filterByPipelineName, @Param("filterByCreator") String filterByCreator, @Param("userId") String userId, @Param("id") Long id); - - /** - * 创建流水线视�? * * @param projectId 项目ID * @param name 视图名称 * @param logic 逻辑 * @param isProject 是否项目视图 * @param filters 过滤�? * @param userId 用户ID * @param id 视图ID * @param viewType 视图类型 * @return 视图ID - */ - Long createWithLogic(@Param("projectId") String projectId, @Param("name") String name, @Param("logic") String logic, @Param("isProject") Boolean isProject, @Param("filters") String filters, @Param("userId") String userId, @Param("id") Long id, @Param("viewType") Integer viewType); - - /** - * 更新流水线视�? * * @param projectId 项目ID * @param viewId 视图ID * @param name 视图名称 * @param isProject 是否项目视图 * @param filterByPipelineName 按流水线名称过滤 * @param filterByCreator 按创建者过�? * @return 是否更新成功 - */ - Boolean update(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("name") String name, @Param("isProject") Boolean isProject, @Param("filterByPipelineName") String filterByPipelineName, @Param("filterByCreator") String filterByCreator); - - /** - * 更新流水线视�? * * @param projectId 项目ID * @param viewId 视图ID * @param name 视图名称 * @param logic 逻辑 * @param isProject 是否项目视图 * @param filters 过滤�? * @param viewType 视图类型 * @return 是否更新成功 - */ - Boolean updateWithLogic(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("name") String name, @Param("logic") String logic, @Param("isProject") Boolean isProject, @Param("filters") String filters, @Param("viewType") Integer viewType); - - /** - * 删除流水线视�? * * @param projectId 项目ID * @param viewId 视图ID * @return 是否删除成功 - */ - Boolean delete(@Param("projectId") String projectId, @Param("viewId") Long viewId); - - /** - * 获取项目下的所有视�? * * @param projectId 项目ID * @return 视图列表 - */ - List list(@Param("projectId") String projectId); - - /** - * 获取项目下指定类型的视图 * * @param projectId 项目ID * @param viewType 视图类型 * @return 视图列表 - */ - List listByType(@Param("projectId") String projectId, @Param("viewType") Integer viewType); - - /** - * 获取用户可见的视图列�? * * @param userId 用户ID * @param projectId 项目ID * @param isProject 是否项目视图 * @param viewType 视图类型 * @return 视图列表 - */ - List listUserViews(@Param("userId") String userId, @Param("projectId") String projectId, @Param("isProject") Boolean isProject, @Param("viewType") Integer viewType); - - /** - * 获取指定ID的视图列�? * * @param projectId 项目ID * @param viewIds 视图ID列表 * @param viewType 视图类型 * @return 视图列表 - */ - List listByIds(@Param("projectId") String projectId, @Param("viewIds") List viewIds, @Param("viewType") Integer viewType); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewGroupDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewGroupDao.java deleted file mode 100644 index 6f4c099..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewGroupDao.java +++ /dev/null @@ -1,36 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewGroupRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视图分�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewGroupDao { - /** - * 创建视图分组 * * @param projectId 项目ID * @param viewId 视图ID * @param pipelineId 流水线ID * @param userId 用户ID - */ - void create(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("pipelineId") String pipelineId, @Param("userId") String userId); - - /** - * 获取视图分组列表 * * @param viewId 视图ID * @param offset 偏移�? * @param limit 限制数量 * @return 视图分组列表 - */ - List list(@Param("viewId") Long viewId, @Param("offset") Integer offset, @Param("limit") Integer limit); - - /** - * 获取视图ID列表对应的分�? * * @param projectId 项目ID * @param viewIds 视图ID列表 * @return 视图分组列表 - */ - List listByViewIds(@Param("projectId") String projectId, @Param("viewIds") List viewIds); - - /** - * 获取指定视图的分�? * * @param projectId 项目ID * @param viewId 视图ID * @return 视图分组列表 - */ - List listByViewId(@Param("projectId") String projectId, @Param("viewId") Long viewId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewTopDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewTopDao.java deleted file mode 100644 index 17c6aaa..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewTopDao.java +++ /dev/null @@ -1,31 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewTopRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线视图置�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewTopDao { - /** - * 添加置顶视图 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void add(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 移除置顶视图 * * @param projectId 项目ID * @param viewId 视图ID * @param userId 用户ID - */ - void remove(@Param("projectId") String projectId, @Param("viewId") Long viewId, @Param("userId") String userId); - - /** - * 获取用户置顶的视图列�? * * @param projectId 项目ID * @param userId 用户ID * @return 置顶视图列表 - */ - List list(@Param("projectId") String projectId, @Param("userId") String userId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserLastViewDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserLastViewDao.java deleted file mode 100644 index d38b9d1..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserLastViewDao.java +++ /dev/null @@ -1,24 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewUserLastViewRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 流水线视图用户最后查看记�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewUserLastViewDao { - /** - * 获取用户最后查看的视图 * * @param userId 用户ID * @param projectId 项目ID * @return 最后查看记�? - */ - TPipelineViewUserLastViewRecord get(@Param("userId") String userId, @Param("projectId") String projectId); - - /** - * 保存用户最后查看的视图 * * @param userId 用户ID * @param projectId 项目ID * @param viewId 视图ID * @return 影响行数 - */ - int save(@Param("userId") String userId, @Param("projectId") String projectId, @Param("viewId") String viewId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserSettingsDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserSettingsDao.java deleted file mode 100644 index c5152bb..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/view/PipelineViewUserSettingsDao.java +++ /dev/null @@ -1,29 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.view; - -import cd.casic.ci.process.process.dataObject.TPipelineViewUserSettingsRecord; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -/** - * 流水线视图用户设�?Dao 接口 - */ -@Mapper -@Repository -public interface PipelineViewUserSettingsDao { - /** - * 获取用户设置 * * @param userId 用户ID * @param projectId 项目ID * @return 用户设置记录 - */ - TPipelineViewUserSettingsRecord get(@Param("userId") String userId, @Param("projectId") String projectId); - - /** - * 创建用户设置 * * @param userId 用户ID * @param projectId 项目ID * @param settings 设置内容 - */ - void create(@Param("userId") String userId, @Param("projectId") String projectId, @Param("settings") String settings); - - /** - * 更新用户设置 * * @param userId 用户ID * @param projectId 项目ID * @param settings 设置内容 - */ - void update(@Param("userId") String userId, @Param("projectId") String projectId, @Param("settings") String settings); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebHookQueueDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebHookQueueDao.java deleted file mode 100644 index 85f80a2..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebHookQueueDao.java +++ /dev/null @@ -1,34 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.webhook; - -import cd.casic.ci.process.process.pojo.PipelineWebHookQueue; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线WebHook队列 Dao 接口 - */ -@Repository -public interface PipelineWebHookQueueDao { - /** - * 保存流水线WebHook队列 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param sourceProjectId 源项目ID * @param sourceRepoName 源仓库名�? * @param sourceBranch 源分�? * @param targetProjectId 目标项目ID * @param targetRepoName 目标仓库名称 * @param targetBranch 目标分支 * @param buildId 构建ID * @param id ID * @return 影响的行�? - */ - int save(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("sourceProjectId") Long sourceProjectId, @Param("sourceRepoName") String sourceRepoName, @Param("sourceBranch") String sourceBranch, @Param("targetProjectId") Long targetProjectId, @Param("targetRepoName") String targetRepoName, @Param("targetBranch") String targetBranch, @Param("buildId") String buildId, @Param("id") Long id); - - /** - * 获取WebHook构建历史 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param sourceProjectId 源项目ID * @param sourceBranch 源分�? * @param targetProjectId 目标项目ID * @param targetBranch 目标分支 * @return WebHook队列列表 - */ - List getWebHookBuildHistory(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("sourceProjectId") Long sourceProjectId, @Param("sourceBranch") String sourceBranch, @Param("targetProjectId") Long targetProjectId, @Param("targetBranch") String targetBranch); - - /** - * 获取WebHook队列 * * @param projectId 项目ID * @param buildId 构建ID * @return WebHook队列 - */ - PipelineWebHookQueue get(@Param("projectId") String projectId, @Param("buildId") String buildId); - - /** - * 根据构建ID删除WebHook队列 * * @param projectId 项目ID * @param buildIds 构建ID列表 * @return 影响的行�? - */ - int deleteByBuildIds(@Param("projectId") String projectId, @Param("buildIds") List buildIds); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookRevisionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookRevisionDao.java deleted file mode 100644 index 4f85186..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookRevisionDao.java +++ /dev/null @@ -1,39 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.webhook; - -import cd.casic.ci.process.process.dataObject.TPipelineWebhookRevisionRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线Webhook修订版本 Dao 接口 - */ -@Repository -public interface PipelineWebhookRevisionDao { - /** - * 创建Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @param content 内容 * @param userId 用户ID * @return Webhook修订版本记录ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId, @Param("content") String content, @Param("userId") String userId); - - /** - * 更新Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @param content 内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId, @Param("content") String content, @Param("userId") String userId); - - /** - * 删除Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId); - - /** - * 获取Webhook修订版本记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return Webhook修订版本记录列表 - */ - List list(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取Webhook修订版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param revisionId 修订版本ID * @return Webhook修订版本记录 - */ - TPipelineWebhookRevisionRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookVersionDao.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookVersionDao.java deleted file mode 100644 index b7cfbbf..0000000 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dal/webhook/PipelineWebhookVersionDao.java +++ /dev/null @@ -1,39 +0,0 @@ -/* * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. * * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. * * A copy of the MIT License is included in this file. * * * Terms of the MIT License: * --------------------------------------------------- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package cd.casic.ci.process.process.dal.webhook; - -import cd.casic.ci.process.process.dataObject.TPipelineWebhookVersionRecord; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -import java.util.List; - -/** - * 流水线Webhook版本 Dao 接口 - */ -@Repository -public interface PipelineWebhookVersionDao { - /** - * 创建Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @param content 内容 * @param userId 用户ID * @return Webhook版本记录ID - */ - long create(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version, @Param("content") String content, @Param("userId") String userId); - - /** - * 更新Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @param content 内容 * @param userId 用户ID * @return 影响的行�? - */ - int update(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version, @Param("content") String content, @Param("userId") String userId); - - /** - * 删除Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @return 影响的行�? - */ - int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version); - - /** - * 获取Webhook版本记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return Webhook版本记录列表 - */ - List list(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId); - - /** - * 获取Webhook版本记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本 * @return Webhook版本记录 - */ - TPipelineWebhookVersionRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version); -} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/stage/PipStage.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/stage/PipStage.java new file mode 100644 index 0000000..b39f779 --- /dev/null +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/dataObject/stage/PipStage.java @@ -0,0 +1,53 @@ +package cd.casic.ci.process.process.dataObject.stage; + +import cd.casic.ci.process.process.dataObject.task.PipTask; +import lombok.Data; + +import java.util.List; +@Data +public class PipStage { + //@ApiProperty(name = "stageId",desc="id") + private String stageId; + + //@ApiProperty(name = "stageName",desc="名称") + private String stageName; + + //@ApiProperty(name = "createTime",desc="创建时间") + private String createTime; + + //@ApiProperty(name="pipelineId",desc="流水线id") + private String pipelineId; + + //@ApiProperty(name="stageSort",desc="阶段顺序") + private int stageSort; + + //@ApiProperty(name = "parentId",desc="主阶段") + private String parentId; + + //@ApiProperty(name = "code",desc="是否是源码") + private boolean code = false; + + //@ApiProperty(name = "taskValues",desc="阶段任务") + private List taskValues; + + //@ApiProperty(name = "stageList",desc="阶段") + private List stageList; + + //@ApiProperty(name = "taskType",desc="任务类型") + private String taskType; + + //@ApiProperty(name = "taskId",desc="任务id") + private String taskId; + + //@ApiProperty(name = "values",desc="更新内容") + private Object values; + + //@ApiProperty(name = "taskSort",desc="任务顺序") + private int taskSort; + + //@ApiProperty(name = "parallelName",desc="并行阶段名称") + private String parallelName; + + // 执行实例id + private String instanceId; +} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/stage/impl/StageServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/stage/impl/StageServiceImpl.java index c481105..754a747 100644 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/stage/impl/StageServiceImpl.java +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/stage/impl/StageServiceImpl.java @@ -1,38 +1,46 @@ package cd.casic.ci.process.process.service.stage.impl; import cd.casic.ci.common.pipeline.constant.PipelineDateUtilConstant; +import cd.casic.ci.common.pipeline.container.Stage; import cd.casic.ci.common.pipeline.req.stage.StageReq; import cd.casic.ci.common.pipeline.resp.stage.StageResp; import cd.casic.ci.common.pipeline.utils.PipelineDateUtil; +import cd.casic.ci.process.process.dataObject.stage.PipStage; +import cd.casic.ci.process.process.dataObject.task.PipTask; import cd.casic.ci.process.process.service.stage.StageService; +import cd.casic.ci.process.process.service.task.TaskService; +import cd.casic.framework.commons.exception.ServiceException; +import jakarta.annotation.Resource; +import org.springframework.core.task.VirtualThreadTaskExecutor; import org.springframework.stereotype.Service; import java.util.List; @Service public class StageServiceImpl implements StageService { + @Resource + private TaskService taskService; @Override public String createStagesOrTask(StageReq stage) { + String stagesId = stage.getStageId(); + String pipelineId = stage.getPipelineId(); + + String taskType = stage.getTaskType(); + int stageSort = stage.getStageSort(); + + stage.setCreateTime(PipelineDateUtil.nowDateString(PipelineDateUtilConstant.yyyy_MM_dd_HH_mm_ss)); + + PipTask tasks = new PipTask(); + tasks.setTaskType(taskType); + tasks.setTaskSort(1); + // TODO 查询是否为已知worker + taskService.taskTypeExist(taskType); return null; -// String stagesId = stage.getStageId(); -// String pipelineId = stage.getPipelineId(); -// -// String taskType = stage.getTaskType(); -// int stageSort = stage.getStageSort(); -// -// stage.setCreateTime(PipelineDateUtil.nowDateString(PipelineDateUtilConstant.yyyy_MM_dd_HH_mm_ss)); -// -// Tasks tasks = new Tasks(); -// tasks.setTaskType(taskType); -// tasks.setTaskSort(1); -// -// String type = tasksService.findTaskType(taskType); -// // //是否为源码 -// if (type.equals(PipelineFinal.TASK_TYPE_CODE)){ -// //判断是否存在代码源 -// findTypeTasks(pipelineId); +// if (taskType.equals(PipelineFinal.TASK_TYPE_CODE)){ +// //判断是否存在代码源(目标)节点 +// findTargetTasks(pipelineId); // // //创建根节点 // int initStage = initStage(pipelineId,1); @@ -179,4 +187,19 @@ public class StageServiceImpl implements StageService { public List findAllStagesList(List idList) { return null; } + /** + * 判断任务是否存在代码源 + * @param pipelineId 流水线id + */ + private void findTargetTasks(String pipelineId) { + List allStage = findAllMainStage(pipelineId); + if (allStage.isEmpty()){ + return; + } + for (StageResp stage : allStage) { + if (stage.isCode()){ + throw new ServiceException(50001,"代码源已存在,无法再次创建。"); + } + } + } } diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/task/TaskService.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/task/TaskService.java new file mode 100644 index 0000000..338d575 --- /dev/null +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/task/TaskService.java @@ -0,0 +1,8 @@ +package cd.casic.ci.process.process.service.task; + +public interface TaskService { + /** + * 查询taskType是否存在(原项目的各种worker) + * */ + public void taskTypeExist(String taskType); +} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/task/impl/TaskServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/task/impl/TaskServiceImpl.java new file mode 100644 index 0000000..0278e0a --- /dev/null +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/task/impl/TaskServiceImpl.java @@ -0,0 +1,33 @@ +package cd.casic.ci.process.process.service.task.impl; + +import cd.casic.ci.common.pipeline.annotation.Plugin; +import cd.casic.ci.process.process.service.task.TaskService; +import cd.casic.framework.commons.util.util.WebFrameworkUtils; +import jakarta.annotation.PostConstruct; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; +import org.springframework.core.type.filter.AnnotationTypeFilter; +import org.springframework.stereotype.Service; + +import java.util.Set; +@Service +public class TaskServiceImpl implements TaskService { + private static final String basePackage = "cd.casic.ci.process.process.service"; + private Set candidates; + + public TaskServiceImpl() { + System.out.println(""); + } + + @PostConstruct + public void init(){ + ClassPathScanningCandidateComponentProvider provider = + new ClassPathScanningCandidateComponentProvider(false); + provider.addIncludeFilter(new AnnotationTypeFilter(Plugin.class)); + candidates = provider.findCandidateComponents(basePackage); + } + @Override + public void taskTypeExist(String taskType) { + + } +} diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/worker/TestWorker.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/worker/TestWorker.java new file mode 100644 index 0000000..c2a93be --- /dev/null +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/worker/TestWorker.java @@ -0,0 +1,7 @@ +package cd.casic.ci.process.process.service.worker; + +import cd.casic.ci.common.pipeline.annotation.Plugin; + +@Plugin +public class TestWorker { +} diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectExtServiceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectExtServiceImpl.java index c3f9da2..89de9e7 100644 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectExtServiceImpl.java +++ b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectExtServiceImpl.java @@ -6,7 +6,7 @@ import cd.casic.ci.project.dal.pojo.ProjectCreateInfo; import cd.casic.ci.project.service.ProjectExtService; import org.springframework.stereotype.Service; -@Service("projectExtService") +//@Service("projectExtService") public class ProjectExtServiceImpl implements ProjectExtService { @Override public void createExtProjectInfo(Long userId, String projectId, String accessToken, ProjectCreateInfo projectCreateInfo, ProjectCreateExtInfo createExtInfo, String logoAddress) { diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectServiceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectServiceImpl.java index 8399378..809b0e3 100644 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectServiceImpl.java +++ b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/ProjectServiceImpl.java @@ -27,7 +27,7 @@ import java.util.Collections; import java.util.List; -@Service("projectService") +//@Service("projectService") @Slf4j public class ProjectServiceImpl { diff --git a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/UserProjectResourceServiceImpl.java b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/UserProjectResourceServiceImpl.java index 410c725..b299965 100644 --- a/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/UserProjectResourceServiceImpl.java +++ b/modules/module-ci-project/src/main/java/cd/casic/ci/project/service/impl/UserProjectResourceServiceImpl.java @@ -12,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional; @Service("userProjectResourceService") +//@Service public class UserProjectResourceServiceImpl implements UserProjectResourceService { @Resource diff --git a/modules/module-ci-ticket/src/main/java/cd/casic/ci/ticket/api/ServiceCredentialApi.java b/modules/module-ci-ticket/src/main/java/cd/casic/ci/ticket/api/ServiceCredentialApi.java index 96424f4..e216418 100644 --- a/modules/module-ci-ticket/src/main/java/cd/casic/ci/ticket/api/ServiceCredentialApi.java +++ b/modules/module-ci-ticket/src/main/java/cd/casic/ci/ticket/api/ServiceCredentialApi.java @@ -50,7 +50,7 @@ public interface ServiceCredentialApi { ); @Operation(summary = "检查凭据是否存在") - @GetMapping("/{projectId}/{credentialId}/") + @PutMapping("/{projectId}/{credentialId}/") CommonResult check( @Parameter(description = "Project ID", required = true) @RequestParam("projectId") diff --git a/ops-server/pom.xml b/ops-server/pom.xml index 78063ce..8925a38 100644 --- a/ops-server/pom.xml +++ b/ops-server/pom.xml @@ -47,6 +47,12 @@ cd.casic.boot module-ci-common-pipeline + + cd.casic.boot + module-ci-process-biz + 2.0.0-jdk17 + compile + diff --git a/ops-server/src/main/java/cd/casic/server/OpsServerApplication.java b/ops-server/src/main/java/cd/casic/server/OpsServerApplication.java index 6697abf..89a928c 100644 --- a/ops-server/src/main/java/cd/casic/server/OpsServerApplication.java +++ b/ops-server/src/main/java/cd/casic/server/OpsServerApplication.java @@ -1,5 +1,6 @@ package cd.casic.server; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @@ -13,6 +14,7 @@ import org.springframework.context.annotation.ComponentScans; @SuppressWarnings("SpringComponentScan") @ComponentScan({"cd.casic"}) +@MapperScan(basePackages = "cd.casic.ci.**.dal") @SpringBootApplication(scanBasePackages = {"${ops.info.base-package}.server", "${ops.info.base-package}.module"}) public class OpsServerApplication { diff --git a/ops-server/src/main/java/cd/casic/server/controller/StageController.java b/ops-server/src/main/java/cd/casic/server/controller/StageController.java index c21fbe2..e83ce4a 100644 --- a/ops-server/src/main/java/cd/casic/server/controller/StageController.java +++ b/ops-server/src/main/java/cd/casic/server/controller/StageController.java @@ -2,10 +2,12 @@ package cd.casic.server.controller; import cd.casic.ci.common.pipeline.req.stage.StageReq; import cd.casic.ci.common.pipeline.resp.stage.StageResp; +import cd.casic.ci.process.process.service.stage.StageService; import cd.casic.framework.commons.pojo.CommonResult; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; +import jakarta.annotation.Resource; import jakarta.annotation.security.PermitAll; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; @@ -28,8 +30,8 @@ import java.util.List; @RequestMapping("/stage") public class StageController { -// @Autowired -// StageService stageService; + @Resource + private StageService stageService; /** * @pi.name:创建流水线阶段及任务