多余代码删除,配置修改
This commit is contained in:
parent
3824daf37b
commit
258f1f96ac
@ -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 {
|
||||
}
|
@ -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
|
||||
|
@ -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<ProjectBroadCastEvent> {
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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<String> pipelineIdList,
|
||||
@Param("fromAtomCode") String fromAtomCode,
|
||||
@Param("toAtomCode") String toAtomCode,
|
||||
@Param("userId") String userId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取原子替换基础记录列表
|
||||
*
|
||||
* @param statusList 状态列表
|
||||
* @param descFlag 是否降序
|
||||
* @param page 页码
|
||||
* @param pageSize 每页大小
|
||||
* @return 原子替换基础记录列表
|
||||
*/
|
||||
List<TPipelineAtomReplaceBaseRecord> getAtomReplaceBaseList(
|
||||
@Param("statusList") List<String> 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
|
||||
);
|
||||
}
|
@ -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<TPipelineAtomReplaceHistoryRecord> getAtomReplaceHistoryList(
|
||||
@Param("baseId") String baseId,
|
||||
@Param("itemId") String itemId,
|
||||
@Param("projectId") String projectId,
|
||||
@Param("busType") String busType,
|
||||
@Param("statusList") List<String> 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
|
||||
);
|
||||
}
|
@ -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<AtomVersionReplaceInfo> versionInfoList,
|
||||
@Param("userId") String userId
|
||||
);
|
||||
|
||||
|
||||
|
||||
TPipelineAtomReplaceItemRecord getAtomReplaceItemListByBaseId(
|
||||
@Param("baseId") String baseId,
|
||||
@Param("statusList") List<String> statusList,
|
||||
@Param("descFlag") Boolean descFlag,
|
||||
@Param("page") Integer page,
|
||||
@Param("pageSize") Integer pageSize
|
||||
);
|
||||
// TODO 这是一个类似wrapper的拼接条件方法
|
||||
// private fun TPipelineAtomReplaceItem.getAtomReplaceItemListCondition(
|
||||
// baseId: String,
|
||||
// statusList: List<String>?
|
||||
// ): MutableList<Condition>
|
||||
|
||||
Long getAtomReplaceItemCountByBaseId(
|
||||
@Param("baseId") String baseId,
|
||||
@Param("statusList") List<String> 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
|
||||
);
|
||||
}
|
@ -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<TAuditResourceRecord> listByResourceTye(
|
||||
@Param("queryAudit") QueryAudit queryAudit,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit
|
||||
);
|
||||
Long countByResourceTye(@Param("queryAudit")QueryAudit queryAudit);
|
||||
|
||||
}
|
@ -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<TPipelineRemoteAuthRecord> 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
|
||||
);
|
||||
}
|
@ -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<PipelineCallbackEvent> list
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取流水线回调列表
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param pipelineId 流水线ID
|
||||
* @param event 事件类型
|
||||
* @return 回调记录列表
|
||||
*/
|
||||
// TODO T_PIPELINE_CALLBACK 这个表找不到
|
||||
// Result<TPipelineCallbackRecord> 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<String> names
|
||||
);
|
||||
}
|
@ -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<TProjectPipelineCallbackRecord> listProjectCallback(
|
||||
@Param("projectId")String projectId,
|
||||
@Param("events")String events,
|
||||
@Param("enable")Boolean enable
|
||||
);
|
||||
|
||||
List<TProjectPipelineCallbackRecord> 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<TProjectPipelineCallbackRecord> 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") List<Integer>ids
|
||||
);
|
||||
|
||||
int updateFailureTime(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("id") Long id,
|
||||
@Param("failureTime") LocalDateTime failureTime
|
||||
);
|
||||
}
|
@ -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<TProjectPipelineCallbackHistoryRecord> 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
|
||||
);
|
||||
}
|
@ -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<String> reviewers
|
||||
);
|
||||
Integer updateOperator(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("userId") String userId
|
||||
);
|
||||
List<String> getTriggerReviewers(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("buildId") String buildId
|
||||
);
|
||||
|
||||
}
|
@ -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<TPipelineGroupRecord> 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<TPipelineGroupRecord> listByIds(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("ids") Set<Long> ids
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取项目下的指定分组
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param groupId 分组ID
|
||||
* @return 分组记录
|
||||
*/
|
||||
TPipelineGroupRecord get(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("groupId") Long groupId
|
||||
);
|
||||
}
|
@ -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<PipelineLabel> list(
|
||||
@Param("projectId") String projectId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取标签
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param id 标签ID
|
||||
* @return 标签
|
||||
*/
|
||||
PipelineLabel get(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("id") long id
|
||||
);
|
||||
}
|
@ -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<Pair<Long, Long>> 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<Long> 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<String> exitsLabelPipelines(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineIds") Set<String> pipelineIds
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取流水线标签关系列表
|
||||
*
|
||||
* @param pipelineIds 流水线ID集合
|
||||
* @param projectId 项目ID
|
||||
* @return 流水线标签关系记录列表
|
||||
*/
|
||||
TPipelineLabelPipelineRecord listPipelineLabelRels(
|
||||
@Param("pipelineIds") List<String> pipelineIds,
|
||||
@Param("projectId") String projectId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取流水线标签关联信息列表
|
||||
*
|
||||
* @param projectIds 项目ID列表
|
||||
* @return 流水线标签关联信息列表
|
||||
*/
|
||||
List<PipelineLabelRelateInfo> getPipelineLabelRelateInfos(
|
||||
@Param("projectIds") List<String> projectIds
|
||||
);
|
||||
}
|
@ -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<TPipelineViewRecord> 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<Long> 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<String> 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<Long> excludeIds
|
||||
);
|
||||
TPipelineViewRecord fetchAnyByName(
|
||||
String projectId,
|
||||
String name,
|
||||
Boolean isProject
|
||||
);
|
||||
|
||||
|
||||
Integer countForLimit(
|
||||
@Param("projectId")String projectId,
|
||||
@Param("isProject") Boolean isProject,
|
||||
@Param("userId") String userId
|
||||
);
|
||||
}
|
@ -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<TPipelineViewGroupRecord> list(
|
||||
@Param("viewId") Long viewId,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("limit") Integer limit
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取多个视图的分组列表
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param viewIds 视图ID列表
|
||||
* @return 视图分组记录列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> listByViewIds(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("viewIds") List<Long> viewIds
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取指定视图的分组列表
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param viewId 视图ID
|
||||
* @return 视图分组记录列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> listByViewId(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("viewId") Long viewId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取项目下的所有视图分组
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @return 视图分组记录列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> listByProjectId(
|
||||
@Param("projectId") String projectId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取流水线所属的视图分组
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param pipelineId 流水线ID
|
||||
* @return 视图分组记录列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> listByPipelineId(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取流水线所属的视图ID列表
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param pipelineId 流水线ID
|
||||
* @return 视图ID列表
|
||||
*/
|
||||
List<Long> listViewIdListByPipelineId(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取视图包含的流水线ID列表
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param viewId 视图ID
|
||||
* @return 流水线ID列表
|
||||
*/
|
||||
List<String> listPipelineIdByViewId(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("viewId") Long viewId
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取多个流水线所属的视图分组
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param pipelineIds 流水线ID集合
|
||||
* @return 视图分组记录列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> listByPipelineIds(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineIds") Collection<String> 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<String> pipelineIds
|
||||
);
|
||||
|
||||
/**
|
||||
* 统计多个视图的分组数量
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param viewIds 视图ID集合
|
||||
* @param filterPipelineIds 过滤的流水线ID列表(可选)
|
||||
* @return 视图ID到数量的映射
|
||||
*/
|
||||
Map<Long, Integer> countByViewId(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("viewIds") Collection<Long> viewIds,
|
||||
@Param("filterPipelineIds") List<String> filterPipelineIds
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取不重复的流水线ID列表
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param viewIds 视图ID集合
|
||||
* @return 流水线ID列表
|
||||
*/
|
||||
List<String> distinctPipelineIds(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("viewIds") Collection<Long> viewIds
|
||||
);
|
||||
|
||||
/**
|
||||
* 删除流水线的视图分组
|
||||
*
|
||||
* @param projectId 项目ID
|
||||
* @param pipelineId 流水线ID
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
boolean delete(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId
|
||||
);
|
||||
}
|
@ -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);
|
||||
|
||||
/**
|
||||
* 获取用户的置顶视图列<EFBFBD>? * * @param projectId 项目ID * @param userId 用户ID * @return 置顶视图记录列表
|
||||
*/
|
||||
List<TPipelineViewTopRecord> list(@Param("projectId") String projectId, @Param("userId") String userId);
|
||||
}
|
@ -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<BuildInfo> getBuildTasksByStatus(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
Set<BuildStatus> statusSet
|
||||
);
|
||||
|
||||
int countAllBuildWithStatus(
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
Set<BuildStatus> status
|
||||
);
|
||||
/*
|
||||
* TODO Record2 是JOOQ包的对象,这个项目使用mybatis,后续具体分析
|
||||
* */
|
||||
// List<Record2<String, String>> getBuildTasksByConcurrencyGroup(
|
||||
//
|
||||
// String projectId,
|
||||
// String concurrencyGroup,
|
||||
// List<BuildStatus> statusSet
|
||||
// );
|
||||
//
|
||||
// List<Record2<String, String>> getBuildTasksByConcurrencyGroupNull(
|
||||
//
|
||||
// String projectId,
|
||||
// String pipelineId,
|
||||
// List<BuildStatus> statusSet
|
||||
// );
|
||||
|
||||
BuildInfo getBuildInfo(
|
||||
|
||||
String projectId,
|
||||
String buildId
|
||||
);
|
||||
|
||||
BuildInfo getUserBuildInfo(
|
||||
|
||||
String projectId,
|
||||
String buildId
|
||||
);
|
||||
|
||||
String getStartUser(
|
||||
|
||||
String projectId,
|
||||
String buildId
|
||||
);
|
||||
|
||||
List<BuildInfo> listBuildInfoByBuildIds(
|
||||
|
||||
Collection<String> buildIds,
|
||||
String projectId,
|
||||
String startBeginTime,
|
||||
String endBeginTime
|
||||
);
|
||||
|
||||
List<BuildInfo> listBuildInfoByBuildIdsOnly(
|
||||
|
||||
Collection<String> buildIds
|
||||
);
|
||||
|
||||
Collection<BuildInfo> listPipelineBuildInfo(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
int offset,
|
||||
int limit,
|
||||
Boolean updateTimeDesc
|
||||
);
|
||||
|
||||
Collection<Integer> listPipelineBuildNum(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
int offset,
|
||||
int limit,
|
||||
Integer debugVersion
|
||||
);
|
||||
|
||||
BuildInfo getBuildInfoByBuildNum(
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
Integer buildNum,
|
||||
Set<BuildStatus> 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<ErrorInfo> 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<ErrorInfo> errorInfoList
|
||||
);
|
||||
|
||||
void updateExecuteCount(
|
||||
|
||||
String projectId,
|
||||
String buildId,
|
||||
int executeCount
|
||||
);
|
||||
|
||||
int count(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
List<BuildStatus> status,
|
||||
Long startTimeEndTime,
|
||||
Integer debugVersion
|
||||
);
|
||||
|
||||
int countByStatus(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
List<BuildStatus> status,
|
||||
Long startTimeEndTime,
|
||||
Boolean onlyDebug
|
||||
);
|
||||
|
||||
int count(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
List<String> materialAlias,
|
||||
String materialUrl,
|
||||
List<String> materialBranch,
|
||||
String materialCommitId,
|
||||
String materialCommitMessage,
|
||||
List<BuildStatus> status,
|
||||
List<StartType> 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<String> startUser,
|
||||
Boolean debug,
|
||||
List<String> triggerAlias,
|
||||
List<String> triggerBranch,
|
||||
List<String> triggerUser
|
||||
);
|
||||
|
||||
Collection<BuildInfo> listPipelineBuildInfo(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
List<String> materialAlias,
|
||||
String materialUrl,
|
||||
List<String> materialBranch,
|
||||
String materialCommitId,
|
||||
String materialCommitMessage,
|
||||
List<BuildStatus> status,
|
||||
List<StartType> 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<String> startUser,
|
||||
Boolean updateTimeDesc,
|
||||
Boolean debug,
|
||||
List<String> triggerAlias,
|
||||
List<String> triggerBranch,
|
||||
List<String> triggerUser
|
||||
);
|
||||
|
||||
void updateBuildRemark(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
String buildId,
|
||||
String remark
|
||||
);
|
||||
|
||||
void updateRecommendVersion(
|
||||
|
||||
String projectId,
|
||||
String buildId,
|
||||
String recommendVersion
|
||||
);
|
||||
|
||||
Collection<BuildInfo> listHistorySearchOptions(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
Integer debugVersion,
|
||||
HistorySearchType type
|
||||
);
|
||||
|
||||
BuildInfo getBuildByBuildNum(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
int buildNum,
|
||||
Integer debugVersion
|
||||
);
|
||||
|
||||
List<String> getBuilds(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
Set<BuildStatus> 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<BuildStageStatus> stageStatus,
|
||||
BuildStatus oldBuildStatus,
|
||||
BuildStatus newBuildStatus,
|
||||
List<ErrorInfo> errorInfoList
|
||||
);
|
||||
|
||||
String getBuildParameters(
|
||||
|
||||
String projectId,
|
||||
String buildId
|
||||
);
|
||||
|
||||
boolean updateBuildParameters(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
String buildId,
|
||||
Collection<BuildParameters> 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<Record2<Integer, Integer>> batchCountBuildNumByVersion(
|
||||
//
|
||||
// String projectId,
|
||||
// String pipelineId,
|
||||
// Set<Integer> versions
|
||||
// );
|
||||
|
||||
String getDebugResourceStr(
|
||||
|
||||
String projectId,
|
||||
String buildId
|
||||
);
|
||||
|
||||
List<BuildInfo> getDebugHistory(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
Integer version
|
||||
);
|
||||
|
||||
int clearDebugHistory(
|
||||
|
||||
String projectId,
|
||||
String pipelineId,
|
||||
Integer version
|
||||
);
|
||||
}
|
@ -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<String> 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<BuildTemplateAcrossInfo> 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<BuildTemplateAcrossInfo> templateAcrossInfos
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取模板跨项目信息
|
||||
*
|
||||
|
||||
* @param projectId 项目ID
|
||||
* @param pipelineId 流水线ID
|
||||
* @param templateId 模板ID
|
||||
* @return 模板跨项目信息记录列表
|
||||
*/
|
||||
List<TPipelineBuildTemplateAcrossInfoRecord> get(
|
||||
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("templateId") String templateId
|
||||
);
|
||||
|
||||
/**
|
||||
* 根据模板ID获取跨项目信息
|
||||
*
|
||||
|
||||
* @param projectId 项目ID
|
||||
* @param templateId 模板ID
|
||||
* @return 模板跨项目信息记录列表
|
||||
*/
|
||||
List<TPipelineBuildTemplateAcrossInfoRecord> 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
|
||||
);
|
||||
}
|
@ -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<String, String> getVars(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("keys") Set<String> keys
|
||||
);
|
||||
|
||||
List<BuildParameters> 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<BuildParameters> variables
|
||||
);
|
||||
|
||||
void batchUpdate(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("variables") List<BuildParameters> 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<String> fetchVarByLikeKey(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("readOnly") Boolean readOnly,
|
||||
@Param("likeStr") String likeStr
|
||||
);
|
||||
}
|
@ -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<String> pipelineIds
|
||||
);
|
||||
|
||||
int countByProjectIds(
|
||||
@Param("projectIds") Collection<String> projectIds,
|
||||
@Param("channelCode") ChannelCode channelCode,
|
||||
@Param("keyword") String keyword
|
||||
);
|
||||
|
||||
int countByProjectIds(
|
||||
@Param("projectIds") Collection<String> projectIds,
|
||||
@Param("channelCodes") List<ChannelCode> channelCodes,
|
||||
@Param("keyword") String keyword
|
||||
);
|
||||
|
||||
List<String> 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<String> pipelineIds,
|
||||
@Param("filterDelete") boolean filterDelete
|
||||
);
|
||||
|
||||
TPipelineInfoRecord getPipelineInfo(
|
||||
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("version") int version
|
||||
);
|
||||
|
||||
// Record1<Int> getPipelineInfoNum(
|
||||
//
|
||||
// @Param("projectIds") Set<String> projectIds,
|
||||
// @Param("channelCodes") Set<ChannelCode> channelCodes
|
||||
// );
|
||||
|
||||
TPipelineInfoRecord listInfoByPipelineName(
|
||||
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineNames") Set<String> 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<ChannelCode> channelCodes
|
||||
);
|
||||
|
||||
int getPipelineVersion(
|
||||
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("userId") String userId,
|
||||
@Param("channelCode") ChannelCode channelCode
|
||||
);
|
||||
// TODO
|
||||
// Result<Record2<String, Long>> listByProject(
|
||||
//
|
||||
// @Param("projectId") String projectId
|
||||
// );
|
||||
|
||||
TPipelineInfoRecord getPipelineId(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId
|
||||
);
|
||||
|
||||
int countExcludePipelineIds(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("excludePipelineIds") List<String> excludePipelineIds,
|
||||
@Param("channelCode") ChannelCode channelCode,
|
||||
@Param("includeDelete") boolean includeDelete,
|
||||
@Param("filterPipelineIds") List<String> filterPipelineIds
|
||||
);
|
||||
|
||||
TPipelineInfoRecord getPipelineByAutoId(
|
||||
@Param("ids") List<Long> ids,
|
||||
@Param("projectId") String projectId
|
||||
);
|
||||
|
||||
void updateLatestStartTime(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("startTime") LocalDateTime startTime
|
||||
);
|
||||
|
||||
List<String> 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<String> excludePipelineIds,
|
||||
@Param("channelCode") ChannelCode channelCode,
|
||||
@Param("limit") int limit,
|
||||
@Param("offset") int offset
|
||||
);
|
||||
}
|
@ -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
|
||||
);
|
||||
}
|
@ -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<PipelineModelTask> modelTasks
|
||||
);
|
||||
|
||||
void deletePipelineTasks(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId
|
||||
);
|
||||
|
||||
int getPipelineCountByAtomCode(
|
||||
@Param("atomCode") String atomCode,
|
||||
@Param("projectCode") String projectCode
|
||||
);
|
||||
|
||||
// Result<Record2<Integer, String>> batchGetPipelineCountByAtomCode(
|
||||
// @Param("dslContext") DSLContext dslContext,
|
||||
// @Param("atomCodeList") List<String> atomCodeList,
|
||||
// @Param("projectCode") String projectCode
|
||||
// );
|
||||
//
|
||||
// Result<Record2<String, String>> batchGetPipelineIdByAtomCode(
|
||||
// @Param("projectId") String projectId,
|
||||
// @Param("atomCodeList") List<String> 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<String> pipelineIds
|
||||
);
|
||||
|
||||
// Result<Record> 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<Record> listByAtomCodeAndPipelineIds(
|
||||
// @Param("atomCode") String atomCode,
|
||||
// @Param("pipelineIds") Set<String> 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
|
||||
);
|
||||
}
|
@ -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<String> listRecentPipelineIds(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("userId") String userId,
|
||||
@Param("limit") Integer limit
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取最近使用时间列表
|
||||
*
|
||||
|
||||
* @param projectId 项目ID
|
||||
* @param userId 用户ID
|
||||
* @param limit 限制数量
|
||||
* @return 使用时间列表
|
||||
*/
|
||||
List<LocalDateTime> 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
|
||||
);
|
||||
}
|
@ -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<String, Map<Integer, String>> listLatestModelResource(
|
||||
@Param("pipelineIds") Set<String> 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<String, String> listModelString(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineIds") Collection<String> pipelineIds
|
||||
);
|
||||
}
|
@ -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<PipelineSetting> getSettings(
|
||||
|
||||
@Param("pipelineIds") Set<String> pipelineIds,
|
||||
@Param("projectId") String projectId
|
||||
);
|
||||
|
||||
void batchUpdate(
|
||||
|
||||
@Param("tPipelineSettingRecords") List<TPipelineSettingRecord> tPipelineSettingRecords
|
||||
);
|
||||
// TODO
|
||||
// Result<Record4<String, String, Integer, String>> getSimpleSettings(
|
||||
//
|
||||
// @Param("pipelineIds") Set<String> pipelineIds,
|
||||
// @Param("projectId") String projectId
|
||||
// );
|
||||
|
||||
List<PipelineSetting> getSetting(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("name") String name,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("isTemplate") boolean isTemplate
|
||||
);
|
||||
|
||||
void updateSettingName(
|
||||
|
||||
@Param("pipelineIdList") List<String> 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<Integer> 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<String> getNonInheritedPipelineIds(
|
||||
|
||||
@Param("projectId") String projectId
|
||||
);
|
||||
}
|
@ -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<TPipelineStageTagRecord> 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()
|
||||
);
|
||||
}
|
||||
}
|
@ -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 影响的行<EFBFBD>?
|
||||
*/
|
||||
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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 获取YAML同步记录列表 * * @param projectId 项目ID * @return YAML同步记录列表
|
||||
*/
|
||||
List<TPipelineYamlSyncRecord> list(@Param("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* 获取YAML同步记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return YAML同步记录
|
||||
*/
|
||||
TPipelineYamlSyncRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
}
|
@ -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 影响的行<EFBFBD>?
|
||||
*/
|
||||
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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 获取YAML视图列表 * * @param projectId 项目ID * @return YAML视图列表
|
||||
*/
|
||||
List<TPipelineYamlViewRecord> list(@Param("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* 获取YAML视图 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return YAML视图
|
||||
*/
|
||||
TPipelineYamlViewRecord get(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
}
|
@ -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 不知道是哪个<EFBFBD>?
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
//TODO 不知道哪个表
|
||||
public interface SubPipelineRefDao {
|
||||
void batchAdd(
|
||||
@Param("subPipelineRefList") Collection<SubPipelineRef> subPipelineRefList
|
||||
);
|
||||
|
||||
// Result<TPipelineSubRefRecord> 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<Triple<String, String, String>> infos
|
||||
);
|
||||
}
|
@ -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
|
||||
);
|
||||
}
|
@ -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<BuildRecordContainer> 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<String, Object> containerVar,
|
||||
@Param("buildStatus") BuildStatus buildStatus,
|
||||
@Param("startTime") LocalDateTime startTime,
|
||||
@Param("endTime") LocalDateTime endTime,
|
||||
@Param("timestamps") Map<BuildTimestampType, String> 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<BuildRecordContainer> 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<BuildStatus> 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<BuildRecordContainer> 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<BuildRecordContainer> getLatestMatrixRecords(
|
||||
@Param("projectId") String projectId,
|
||||
@Param("pipelineId") String pipelineId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("executeCount") Integer executeCount
|
||||
);
|
||||
}
|
@ -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 构建状<EFBFBD>? * @param modelVar 模型变量 * @param startTime 开始时<EFBFBD>? * @param endTime 结束时间 * @param errorInfoList 错误信息列表 * @param cancelUser 取消用户 * @param timestamps 时间<EFBFBD>? * @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<String, Object> modelVar, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("errorInfoList") List<ErrorInfo> errorInfoList, @Param("cancelUser") String cancelUser, @Param("timestamps") Map<BuildTimestampType, BuildRecordTimeStamp> timestamps);
|
||||
|
||||
/**
|
||||
* 更新构建记录模型状<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @param buildStatus 构建状<EFBFBD>? * @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<BuildRecordInfo> 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);
|
||||
}
|
@ -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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int batchSave(@Param("records") List<BuildRecordStage> records);
|
||||
|
||||
/**
|
||||
* 更新记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param stageId 阶段ID * @param executeCount 执行次数 * @param stageVar 阶段变量 * @param buildStatus 构建状<EFBFBD>? * @param startTime 开始时<EFBFBD>? * @param endTime 结束时间 * @param timestamps 时间<EFBFBD>? * @return 影响的行<EFBFBD>?
|
||||
*/
|
||||
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<String, Object> stageVar, @Param("buildStatus") BuildStatus buildStatus, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("timestamps") Map<BuildTimestampType, BuildRecordTimeStamp> timestamps);
|
||||
|
||||
/**
|
||||
* 获取记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatusSet 构建状态集<EFBFBD>? * @return 构建记录阶段列表
|
||||
*/
|
||||
List<BuildRecordStage> getRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("buildStatusSet") Set<BuildStatus> buildStatusSet);
|
||||
|
||||
/**
|
||||
* 获取最新的记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @return 构建记录阶段列表
|
||||
*/
|
||||
List<BuildRecordStage> getLatestRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount);
|
||||
}
|
@ -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<BuildRecordTask> records);
|
||||
|
||||
/**
|
||||
* 更新构建记录 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @param taskVar 任务变量 * @param buildStatus 构建状<EFBFBD>? * @param startTime 开始时<EFBFBD>? * @param endTime 结束时间 * @param timestamps 时间<EFBFBD>?
|
||||
*/
|
||||
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<String, Object> taskVar, @Param("buildStatus") BuildStatus buildStatus, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("timestamps") Map<BuildTimestampType, BuildRecordTimeStamp> timestamps);
|
||||
|
||||
/**
|
||||
* 更新构建记录状<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param executeCount 执行次数 * @param buildStatus 构建状<EFBFBD>? * @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 构建状态集<EFBFBD>? * @return 构建记录任务列表
|
||||
*/
|
||||
List<BuildRecordTask> getRecords(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("containerId") String containerId, @Param("buildStatusSet") Set<BuildStatus> buildStatusSet);
|
||||
|
||||
/**
|
||||
* 获取最新的普通构建记录列<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param matrixContainerIds 矩阵容器ID列表 * @param stageId 阶段ID * @return 构建记录任务列表
|
||||
*/
|
||||
List<BuildRecordTask> getLatestNormalRecords(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("matrixContainerIds") List<String> matrixContainerIds, @Param("stageId") String stageId);
|
||||
|
||||
/**
|
||||
* 获取最新的矩阵构建记录列表 * * @param projectId 项目ID * @param buildId 构建ID * @param executeCount 执行次数 * @param matrixContainerIds 矩阵容器ID列表 * @return 构建记录任务列表
|
||||
*/
|
||||
List<BuildRecordTask> getLatestMatrixRecords(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("executeCount") int executeCount, @Param("matrixContainerIds") List<String> 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);
|
||||
|
||||
/**
|
||||
* 更新异步状<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param taskId 任务ID * @param executeCount 执行次数 * @param asyncStatus 异步状<EFBFBD>?
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* 重试时清空结束时<EFBFBD>? * * @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);
|
||||
}
|
@ -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<PipelineBuildContainer> containerList
|
||||
);
|
||||
|
||||
void batchUpdate(
|
||||
|
||||
@Param("containerList") List<PipelineBuildContainer> 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<PipelineBuildContainer> listByBuildId(
|
||||
|
||||
@Param("projectId") String projectId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("stageId") String stageId,
|
||||
@Param("containsMatrix") Boolean containsMatrix,
|
||||
@Param("statusSet") Set<BuildStatus> statusSet
|
||||
);
|
||||
|
||||
int countStageContainers(
|
||||
|
||||
@Param("projectId") String projectId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("stageId") String stageId,
|
||||
@Param("onlyMatrixGroup") boolean onlyMatrixGroup
|
||||
);
|
||||
|
||||
List<PipelineBuildContainer> listByMatrixGroupId(
|
||||
|
||||
@Param("projectId") String projectId,
|
||||
@Param("buildId") String buildId,
|
||||
@Param("matrixGroupId") String matrixGroupId
|
||||
);
|
||||
|
||||
Collection<String> 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
|
||||
);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线构建阶<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PipelineBuildStageDao {
|
||||
/**
|
||||
* 创建流水线构建阶<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param stageId 阶段ID * @param stageName 阶段名称 * @param status 状<EFBFBD>? * @param startTime 开始时<EFBFBD>? * @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);
|
||||
|
||||
/**
|
||||
* 批量保存流水线构建阶<EFBFBD>? * * @param stages 阶段列表 * @return 影响行数
|
||||
*/
|
||||
int batchSavePipelineBuildStages(@Param("stages") List<PipelineBuildStage> stages);
|
||||
|
||||
/**
|
||||
* 获取流水线构建阶<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @param stageId 阶段ID * @return 构建阶段
|
||||
*/
|
||||
PipelineBuildStage getPipelineBuildStage(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("stageId") String stageId);
|
||||
|
||||
/**
|
||||
* 获取流水线构建阶段列<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @param status 状<EFBFBD>? * @return 构建阶段列表
|
||||
*/
|
||||
List<PipelineBuildStage> listPipelineBuildStages(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("status") String status);
|
||||
|
||||
/**
|
||||
* 删除流水线构建阶<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数
|
||||
*/
|
||||
int deletePipelineBuildStages(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 更新流水线构建阶段状<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @param stageId 阶段ID * @param status 状<EFBFBD>? * @param startTime 开始时<EFBFBD>? * @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);
|
||||
|
||||
/**
|
||||
* 获取最大阶<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @return 最大阶<EFBFBD>?
|
||||
*/
|
||||
PipelineBuildStage getMaxPipelineBuildStage(@Param("projectId") String projectId, @Param("buildId") String buildId);
|
||||
|
||||
/**
|
||||
* 根据状态获取流水线构建阶段 * * @param projectId 项目ID * @param buildId 构建ID * @param statuses 状态列<EFBFBD>? * @return 构建阶段
|
||||
*/
|
||||
PipelineBuildStage getPipelineBuildStageByStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("statuses") List<String> statuses);
|
||||
}
|
@ -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<String> 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<String> pipelineIds,
|
||||
@Param("viewId") String viewId,
|
||||
@Param("favorPipelines") List<String> favorPipelines,
|
||||
@Param("authPipelines") List<String> authPipelines,
|
||||
@Param("pipelineFilterParamList") List<PipelineFilterParam> 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<String> pipelineIds,
|
||||
@Param("favorPipelines") List<String> favorPipelines,
|
||||
@Param("authPipelines") List<String> authPipelines,
|
||||
@Param("viewId") String viewId,
|
||||
@Param("pipelineFilterParamList") List<PipelineFilterParam> 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<String> 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
|
||||
);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线构建任<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PipelineBuildTaskDao {
|
||||
/**
|
||||
* 创建流水线构建任<EFBFBD>? * * @param buildTask 构建任务信息
|
||||
*/
|
||||
void create(@Param("buildTask") PipelineBuildTask buildTask);
|
||||
|
||||
/**
|
||||
* 批量保存流水线构建任<EFBFBD>? * * @param taskList 构建任务列表
|
||||
*/
|
||||
void batchSave(@Param("taskList") Collection<PipelineBuildTask> taskList);
|
||||
|
||||
/**
|
||||
* 批量更新流水线构建任<EFBFBD>? * * @param taskList 构建任务列表
|
||||
*/
|
||||
void batchUpdate(@Param("taskList") List<PipelineBuildTask> taskList);
|
||||
|
||||
/**
|
||||
* 获取流水线构建任<EFBFBD>? * * @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);
|
||||
|
||||
/**
|
||||
* 获取任务状<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @param taskId 任务ID * @return 任务状<EFBFBD>?
|
||||
*/
|
||||
Integer getTaskStatus(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* 根据构建ID获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @return 任务列表
|
||||
*/
|
||||
Collection<PipelineBuildTask> getByBuildId(@Param("projectId") String projectId, @Param("buildId") String buildId);
|
||||
|
||||
/**
|
||||
* 根据条件获取任务列表 * * @param projectId 项目ID * @param buildId 构建ID * @param containerId 容器ID * @param statusSet 状态集<EFBFBD>? * @return 任务列表
|
||||
*/
|
||||
List<PipelineBuildTask> getTasksInCondition(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("containerId") String containerId, @Param("statusSet") Collection<BuildStatus> 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<Map<String, Object>> countGroupByBuildId(@Param("projectId") String projectId, @Param("buildIds") Collection<String> 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<Map<String, Object>> list(@Param("projectId") String projectId, @Param("buildId") String buildId);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线构建变<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PipelineBuildVarDao {
|
||||
/**
|
||||
* 保存构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID * @param name 变量<EFBFBD>? * @param value 变量<EFBFBD>? * @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 变量<EFBFBD>? * @param value 变量<EFBFBD>? * @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 变量名集<EFBFBD>? * @return 变量映射
|
||||
*/
|
||||
Map<String, String> getVars(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("keys") Set<String> keys);
|
||||
|
||||
/**
|
||||
* 获取带类型的构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param key 变量<EFBFBD>? * @return 构建参数列表
|
||||
*/
|
||||
List<BuildParameters> getVarsWithType(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("key") String key);
|
||||
|
||||
/**
|
||||
* 删除构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param varName 变量<EFBFBD>? * @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<BuildParameters> variables);
|
||||
|
||||
/**
|
||||
* 批量更新构建变量 * * @param projectId 项目ID * @param buildId 构建ID * @param variables 构建参数列表
|
||||
*/
|
||||
void batchUpdate(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("variables") List<BuildParameters> variables);
|
||||
|
||||
/**
|
||||
* 删除构建变量 * * @param projectId 项目ID * @param pipelineId 流水线ID * @param buildId 构建ID
|
||||
*/
|
||||
void deleteBuildVars(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId);
|
||||
|
||||
/**
|
||||
* 删除流水线构建变<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID
|
||||
*/
|
||||
void deletePipelineBuildVar(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 根据关键字模糊查询变<EFBFBD>? * * @param projectId 项目ID * @param buildId 构建ID * @param readOnly 是否只读 * @param likeStr 模糊匹配字符<EFBFBD>? * @return 变量值集<EFBFBD>?
|
||||
*/
|
||||
Set<String> fetchVarByLikeKey(@Param("projectId") String projectId, @Param("buildId") String buildId, @Param("readOnly") Boolean readOnly, @Param("likeStr") String likeStr);
|
||||
}
|
@ -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<String, String> 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<Report> 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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int deleteReport(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("buildId") String buildId, @Param("elementId") String elementId);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线设<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PipelineSettingDao {
|
||||
/**
|
||||
* 获取流水线设<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 流水线设<EFBFBD>?
|
||||
*/
|
||||
PipelineSetting getSetting(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 获取流水线设<EFBFBD>? * * @param projectId 项目ID * @param name 设置名称 * @param pipelineId 流水线ID * @param isTemplate 是否模板 * @return 流水线设置列<EFBFBD>?
|
||||
*/
|
||||
List<PipelineSetting> getSetting(@Param("projectId") String projectId, @Param("name") String name, @Param("pipelineId") String pipelineId, @Param("isTemplate") Boolean isTemplate);
|
||||
|
||||
/**
|
||||
* 获取流水线设置列<EFBFBD>? * * @param pipelineIds 流水线ID列表 * @param projectId 项目ID * @return 流水线设置列<EFBFBD>?
|
||||
*/
|
||||
List<PipelineSetting> getSettings(@Param("pipelineIds") Set<String> pipelineIds, @Param("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* 获取简单的流水线设<EFBFBD>? * * @param pipelineIds 流水线ID列表 * @param projectId 项目ID * @return 简单的流水线设<EFBFBD>?
|
||||
*/
|
||||
// TODO
|
||||
// Result<Record4<String, String, Integer, String>> getSimpleSettings(@Param("pipelineIds") Set<String> pipelineIds, @Param("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* 获取流水线设置数<EFBFBD>? * * @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);
|
||||
|
||||
/**
|
||||
* 创建流水线设<EFBFBD>? * * @param setting 流水线设<EFBFBD>? * @return 影响行数
|
||||
*/
|
||||
int create(PipelineSetting setting);
|
||||
|
||||
/**
|
||||
* 更新流水线设<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param name 设置名称 * @param desc 描述 * @return 更新后的流水线设<EFBFBD>?
|
||||
*/
|
||||
PipelineSetting updateSetting(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("name") String name, @Param("desc") String desc);
|
||||
|
||||
/**
|
||||
* 更新模板引用的设置名<EFBFBD>? * * @param pipelineIdList 流水线ID列表 * @param name 设置名称
|
||||
*/
|
||||
void updateSettingName(@Param("pipelineIdList") List<String> pipelineIdList, @Param("name") String name);
|
||||
|
||||
/**
|
||||
* 批量更新流水线设<EFBFBD>? * * @param records 流水线设置记录列<EFBFBD>?
|
||||
*/
|
||||
void batchUpdate(List<TPipelineSettingRecord> records);
|
||||
|
||||
/**
|
||||
* 删除流水线设<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响行数
|
||||
*/
|
||||
int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线设置版<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PipelineSettingVersionDao {
|
||||
/**
|
||||
* 获取流水线设置版<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本<EFBFBD>? * @return 流水线设置版<EFBFBD>?
|
||||
*/
|
||||
PipelineSettingVersion getSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") Integer version);
|
||||
|
||||
/**
|
||||
* 获取最新的流水线设置版<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 最新的流水线设置版<EFBFBD>?
|
||||
*/
|
||||
PipelineSettingVersion getLatestSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 创建流水线设置版<EFBFBD>? * * @param setting 流水线设<EFBFBD>? * @return 影响行数
|
||||
*/
|
||||
int create(PipelineSettingVersion setting);
|
||||
|
||||
/**
|
||||
* 更新流水线设置版<EFBFBD>? * * @param setting 流水线设<EFBFBD>? * @return 影响行数
|
||||
*/
|
||||
int update(PipelineSettingVersion setting);
|
||||
|
||||
/**
|
||||
* 批量更新流水线设置版<EFBFBD>? * * @param records 流水线设置版本记录列<EFBFBD>?
|
||||
*/
|
||||
void batchUpdate(List<TPipelineSettingVersionRecord> records);
|
||||
}
|
@ -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 影响的行<EFBFBD>?
|
||||
*/
|
||||
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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int delete(@Param("userId") String userId, @Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 删除流水线的所有用户收<EFBFBD>? * * @param projectId 项目ID * @param pipelineId 流水线ID * @return 影响的行<EFBFBD>?
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* 获取用户所有收藏的流水线列<EFBFBD>? * * @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();
|
||||
}
|
@ -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 {
|
||||
/**
|
||||
* 保存流水线设置版<EFBFBD>? * @param dslContext DSL上下<EFBFBD>? * @param setting 流水线设<EFBFBD>? * @param version 版本<EFBFBD>? * @param isTemplate 是否为模<EFBFBD>? * @param id ID * @return 影响行数
|
||||
*/
|
||||
int saveSetting(@Param("setting") PipelineSetting setting, @Param("version") int version, @Param("isTemplate") boolean isTemplate, @Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 获取流水线设置版<EFBFBD>? * @param projectId 项目ID * @param pipelineId 流水线ID * @param version 版本<EFBFBD>? * @return 流水线设置版<EFBFBD>?
|
||||
*/
|
||||
PipelineSettingVersion getSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") int version);
|
||||
|
||||
/**
|
||||
* 获取最新的流水线设置版<EFBFBD>? * @param projectId 项目ID * @param pipelineId 流水线ID * @return 最新的流水线设置版<EFBFBD>?
|
||||
*/
|
||||
PipelineSettingVersion getLatestSettingVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId);
|
||||
|
||||
/**
|
||||
* 根据流水线ID列表获取设置版本 * @param pipelineIds 流水线ID列表 * @return 流水线设置版本列<EFBFBD>?
|
||||
*/
|
||||
List<PipelineSettingVersion> getSettingByPipelineIds(@Param("pipelineIds") List<String> pipelineIds);
|
||||
|
||||
/**
|
||||
* 批量更新流水线设置版<EFBFBD>? * @param records 流水线设置版本记录列<EFBFBD>?
|
||||
*/
|
||||
void batchUpdate(@Param("records") List<TPipelineSettingVersionRecord> records);
|
||||
|
||||
/**
|
||||
* 删除所有版本的流水线设<EFBFBD>? * @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 版本<EFBFBD>? * @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 最大流水线资源<EFBFBD>? * @return 影响行数
|
||||
*/
|
||||
int deleteEarlyVersion(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("currentVersion") int currentVersion, @Param("maxPipelineResNum") int maxPipelineResNum);
|
||||
}
|
@ -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<TTemplateInstanceBaseRecord> getTemplateInstanceBaseList(@Param("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* 获取模板实例基础记录 * * @param instanceId 实例ID * @return 模板实例基础记录
|
||||
*/
|
||||
TTemplateInstanceBaseRecord getTemplateInstanceBase(@Param("instanceId") String instanceId);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 模板实例<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface TemplateInstanceItemDao {
|
||||
/**
|
||||
* 创建模板实例<EFBFBD>? * * @param projectId 项目ID * @param baseId 基础ID * @param instances 实例列表 * @param status 状<EFBFBD>? * @param userId 用户ID
|
||||
*/
|
||||
void createTemplateInstanceItem(@Param("projectId") String projectId, @Param("baseId") String baseId, @Param("instances") List<TemplateInstanceUpdate> instances, @Param("status") String status, @Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 获取模板实例项列<EFBFBD>? * * @param status 状<EFBFBD>? * @param descFlag 是否降序 * @param page 页码 * @param pageSize 每页大小 * @return 模板实例项列<EFBFBD>?
|
||||
*/
|
||||
List<TemplateInstanceUpdate> getTemplateInstanceItemList(@Param("status") String status, @Param("descFlag") boolean descFlag, @Param("page") int page, @Param("pageSize") int pageSize);
|
||||
|
||||
/**
|
||||
* 根据基础ID获取模板实例项列<EFBFBD>? * * @param projectId 项目ID * @param baseId 基础ID * @param descFlag 是否降序 * @param page 页码 * @param pageSize 每页大小 * @return 模板实例项列<EFBFBD>?
|
||||
*/
|
||||
List<TemplateInstanceUpdate> getTemplateInstanceItemListByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId, @Param("descFlag") boolean descFlag, @Param("page") int page, @Param("pageSize") int pageSize);
|
||||
|
||||
/**
|
||||
* 根据基础ID获取模板实例项数<EFBFBD>? * * @param projectId 项目ID * @param baseId 基础ID * @return 数量
|
||||
*/
|
||||
long getTemplateInstanceItemCountByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId);
|
||||
|
||||
/**
|
||||
* 根据流水线ID列表获取模板实例项列<EFBFBD>? * * @param projectId 项目ID * @param pipelineIds 流水线ID列表 * @return 模板实例项列<EFBFBD>?
|
||||
*/
|
||||
List<TemplateInstanceUpdate> getTemplateInstanceItemListByPipelineIds(@Param("projectId") String projectId, @Param("pipelineIds") Collection<String> pipelineIds);
|
||||
|
||||
/**
|
||||
* 根据基础ID删除模板实例<EFBFBD>? * * @param projectId 项目ID * @param baseId 基础ID
|
||||
*/
|
||||
void deleteByBaseId(@Param("projectId") String projectId, @Param("baseId") String baseId);
|
||||
}
|
@ -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<TPipelineTimerBranchRecord> 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);
|
||||
}
|
@ -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<TPipelineTimerRecord> list(@Param("offset") int offset, @Param("limit") int limit);
|
||||
}
|
@ -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<PipelineTriggerEventVo> 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<PipelineTriggerEvent> listByEventIds(@Param("eventIds") Set<String> 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<PipelineTriggerDetail> 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<Long> 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);
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线视<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PipelineViewDao {
|
||||
/**
|
||||
* 创建流水线视<EFBFBD>? * * @param projectId 项目ID * @param name 视图名称 * @param isProject 是否项目视图 * @param filterByPipelineName 按流水线名称过滤 * @param filterByCreator 按创建者过<EFBFBD>? * @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);
|
||||
|
||||
/**
|
||||
* 创建流水线视<EFBFBD>? * * @param projectId 项目ID * @param name 视图名称 * @param logic 逻辑 * @param isProject 是否项目视图 * @param filters 过滤<EFBFBD>? * @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);
|
||||
|
||||
/**
|
||||
* 更新流水线视<EFBFBD>? * * @param projectId 项目ID * @param viewId 视图ID * @param name 视图名称 * @param isProject 是否项目视图 * @param filterByPipelineName 按流水线名称过滤 * @param filterByCreator 按创建者过<EFBFBD>? * @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);
|
||||
|
||||
/**
|
||||
* 更新流水线视<EFBFBD>? * * @param projectId 项目ID * @param viewId 视图ID * @param name 视图名称 * @param logic 逻辑 * @param isProject 是否项目视图 * @param filters 过滤<EFBFBD>? * @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);
|
||||
|
||||
/**
|
||||
* 删除流水线视<EFBFBD>? * * @param projectId 项目ID * @param viewId 视图ID * @return 是否删除成功
|
||||
*/
|
||||
Boolean delete(@Param("projectId") String projectId, @Param("viewId") Long viewId);
|
||||
|
||||
/**
|
||||
* 获取项目下的所有视<EFBFBD>? * * @param projectId 项目ID * @return 视图列表
|
||||
*/
|
||||
List<TPipelineViewRecord> list(@Param("projectId") String projectId);
|
||||
|
||||
/**
|
||||
* 获取项目下指定类型的视图 * * @param projectId 项目ID * @param viewType 视图类型 * @return 视图列表
|
||||
*/
|
||||
List<TPipelineViewRecord> listByType(@Param("projectId") String projectId, @Param("viewType") Integer viewType);
|
||||
|
||||
/**
|
||||
* 获取用户可见的视图列<EFBFBD>? * * @param userId 用户ID * @param projectId 项目ID * @param isProject 是否项目视图 * @param viewType 视图类型 * @return 视图列表
|
||||
*/
|
||||
List<TPipelineViewRecord> listUserViews(@Param("userId") String userId, @Param("projectId") String projectId, @Param("isProject") Boolean isProject, @Param("viewType") Integer viewType);
|
||||
|
||||
/**
|
||||
* 获取指定ID的视图列<EFBFBD>? * * @param projectId 项目ID * @param viewIds 视图ID列表 * @param viewType 视图类型 * @return 视图列表
|
||||
*/
|
||||
List<TPipelineViewRecord> listByIds(@Param("projectId") String projectId, @Param("viewIds") List<Long> viewIds, @Param("viewType") Integer viewType);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线视图分<EFBFBD>?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 偏移<EFBFBD>? * @param limit 限制数量 * @return 视图分组列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> list(@Param("viewId") Long viewId, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 获取视图ID列表对应的分<EFBFBD>? * * @param projectId 项目ID * @param viewIds 视图ID列表 * @return 视图分组列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> listByViewIds(@Param("projectId") String projectId, @Param("viewIds") List<Long> viewIds);
|
||||
|
||||
/**
|
||||
* 获取指定视图的分<EFBFBD>? * * @param projectId 项目ID * @param viewId 视图ID * @return 视图分组列表
|
||||
*/
|
||||
List<TPipelineViewGroupRecord> listByViewId(@Param("projectId") String projectId, @Param("viewId") Long viewId);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线视图置<EFBFBD>?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);
|
||||
|
||||
/**
|
||||
* 获取用户置顶的视图列<EFBFBD>? * * @param projectId 项目ID * @param userId 用户ID * @return 置顶视图列表
|
||||
*/
|
||||
List<TPipelineViewTopRecord> list(@Param("projectId") String projectId, @Param("userId") String userId);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线视图用户最后查看记<EFBFBD>?Dao 接口
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PipelineViewUserLastViewDao {
|
||||
/**
|
||||
* 获取用户最后查看的视图 * * @param userId 用户ID * @param projectId 项目ID * @return 最后查看记<EFBFBD>?
|
||||
*/
|
||||
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);
|
||||
}
|
@ -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;
|
||||
|
||||
/**
|
||||
* 流水线视图用户设<EFBFBD>?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);
|
||||
}
|
@ -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 源仓库名<EFBFBD>? * @param sourceBranch 源分<EFBFBD>? * @param targetProjectId 目标项目ID * @param targetRepoName 目标仓库名称 * @param targetBranch 目标分支 * @param buildId 构建ID * @param id ID * @return 影响的行<EFBFBD>?
|
||||
*/
|
||||
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 源分<EFBFBD>? * @param targetProjectId 目标项目ID * @param targetBranch 目标分支 * @return WebHook队列列表
|
||||
*/
|
||||
List<PipelineWebHookQueue> 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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int deleteByBuildIds(@Param("projectId") String projectId, @Param("buildIds") List<String> buildIds);
|
||||
}
|
@ -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 影响的行<EFBFBD>?
|
||||
*/
|
||||
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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("revisionId") String revisionId);
|
||||
|
||||
/**
|
||||
* 获取Webhook修订版本记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return Webhook修订版本记录列表
|
||||
*/
|
||||
List<TPipelineWebhookRevisionRecord> 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);
|
||||
}
|
@ -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 影响的行<EFBFBD>?
|
||||
*/
|
||||
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 影响的行<EFBFBD>?
|
||||
*/
|
||||
int delete(@Param("projectId") String projectId, @Param("pipelineId") String pipelineId, @Param("version") String version);
|
||||
|
||||
/**
|
||||
* 获取Webhook版本记录列表 * * @param projectId 项目ID * @param pipelineId 流水线ID * @return Webhook版本记录列表
|
||||
*/
|
||||
List<TPipelineWebhookVersionRecord> 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);
|
||||
}
|
@ -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<PipTask> taskValues;
|
||||
|
||||
//@ApiProperty(name = "stageList",desc="阶段")
|
||||
private List<PipStage> 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;
|
||||
}
|
@ -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<StageResp> findAllStagesList(List<String> idList) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 判断任务是否存在代码源
|
||||
* @param pipelineId 流水线id
|
||||
*/
|
||||
private void findTargetTasks(String pipelineId) {
|
||||
List<StageResp> allStage = findAllMainStage(pipelineId);
|
||||
if (allStage.isEmpty()){
|
||||
return;
|
||||
}
|
||||
for (StageResp stage : allStage) {
|
||||
if (stage.isCode()){
|
||||
throw new ServiceException(50001,"代码源已存在,无法再次创建。");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
package cd.casic.ci.process.process.service.task;
|
||||
|
||||
public interface TaskService {
|
||||
/**
|
||||
* 查询taskType是否存在(原项目的各种worker)
|
||||
* */
|
||||
public void taskTypeExist(String taskType);
|
||||
}
|
@ -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<BeanDefinition> 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) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package cd.casic.ci.process.process.service.worker;
|
||||
|
||||
import cd.casic.ci.common.pipeline.annotation.Plugin;
|
||||
|
||||
@Plugin
|
||||
public class TestWorker {
|
||||
}
|
@ -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) {
|
||||
|
@ -27,7 +27,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service("projectService")
|
||||
//@Service("projectService")
|
||||
@Slf4j
|
||||
public class ProjectServiceImpl {
|
||||
|
||||
|
@ -12,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
@Service("userProjectResourceService")
|
||||
//@Service
|
||||
public class UserProjectResourceServiceImpl implements UserProjectResourceService {
|
||||
|
||||
@Resource
|
||||
|
@ -50,7 +50,7 @@ public interface ServiceCredentialApi {
|
||||
);
|
||||
|
||||
@Operation(summary = "检查凭据是否存在")
|
||||
@GetMapping("/{projectId}/{credentialId}/")
|
||||
@PutMapping("/{projectId}/{credentialId}/")
|
||||
CommonResult<Boolean> check(
|
||||
@Parameter(description = "Project ID", required = true)
|
||||
@RequestParam("projectId")
|
||||
|
@ -47,6 +47,12 @@
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-common-pipeline</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cd.casic.boot</groupId>
|
||||
<artifactId>module-ci-process-biz</artifactId>
|
||||
<version>2.0.0-jdk17</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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:创建流水线阶段及任务
|
||||
|
Loading…
x
Reference in New Issue
Block a user