0510 ljc
This commit is contained in:
parent
dda88d0fdd
commit
67afdbf867
@ -0,0 +1,30 @@
|
||||
package cd.casic.framework.commons.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName group
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:20
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class Group {
|
||||
// id
|
||||
private String id;
|
||||
|
||||
// 环境名称
|
||||
private String groupName;
|
||||
|
||||
// 创建时间
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* @pi.model:User
|
||||
* @pi.desc:用户
|
||||
*/
|
||||
private User user;
|
||||
|
||||
// 说明
|
||||
private String detail;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cd.casic.framework.commons.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName PatchUser
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:21
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PatchUser {
|
||||
private String userId;
|
||||
private Integer roleType = 0;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cd.casic.framework.commons.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName User
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:19
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class User {
|
||||
private String id;
|
||||
private String name;
|
||||
private String phone;
|
||||
private String email;
|
||||
private String avatar;
|
||||
private String nickname;
|
||||
private String dirId;
|
||||
private String password;
|
||||
private Integer status;
|
||||
private Integer type;
|
||||
private String openId;
|
||||
private String newPassword;
|
||||
|
||||
}
|
@ -82,6 +82,10 @@ public class CommonResult<T> implements Serializable {
|
||||
return Objects.equals(code, GlobalErrorCodeConstants.SUCCESS.getCode());
|
||||
}
|
||||
|
||||
public static CommonResult ok() {
|
||||
return new CommonResult();
|
||||
}
|
||||
|
||||
@JsonIgnore // 避免 jackson 序列化
|
||||
public boolean isSuccess() {
|
||||
return isSuccess(code);
|
||||
|
@ -0,0 +1,24 @@
|
||||
package cd.casic.ci.common.pipeline.req.env;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName EnvQueryReq
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 11:03
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class EnvQueryReq {
|
||||
// 环境名称
|
||||
private String envName;
|
||||
|
||||
|
||||
// 用户ID
|
||||
private String userId;
|
||||
|
||||
|
||||
//@ApiProperty(name ="pageParam",desc = "分页参数")
|
||||
private Page pageParam= new Page();
|
||||
}
|
27
modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/req/env/EnvReq.java
vendored
Normal file
27
modules/module-ci-common-pipeline/src/main/java/cd/casic/ci/common/pipeline/req/env/EnvReq.java
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
package cd.casic.ci.common.pipeline.req.env;
|
||||
|
||||
import cd.casic.framework.commons.dataobject.User;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName EnvReq
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 11:00
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class EnvReq {
|
||||
// id
|
||||
private String id;
|
||||
|
||||
// 环境名称
|
||||
private String envName;
|
||||
|
||||
// 创建时间
|
||||
private String createTime;
|
||||
|
||||
private User user;
|
||||
|
||||
// 说明
|
||||
private String detail;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package cd.casic.ci.common.pipeline.req.group;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName GroupQueryReq
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 11:50
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GroupQueryReq {
|
||||
// 环境名称
|
||||
private String groupName;
|
||||
|
||||
// 用户ID
|
||||
private String userId;
|
||||
|
||||
//@ApiProperty(name ="pageParam",desc = "分页参数")
|
||||
private Page pageParam= new Page();
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cd.casic.ci.common.pipeline.req.group;
|
||||
|
||||
import cd.casic.framework.commons.dataobject.User;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName GroupReq
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 11:47
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GroupReq {
|
||||
// id
|
||||
private String id;
|
||||
|
||||
// 环境名称
|
||||
private String groupName;
|
||||
|
||||
// 创建时间
|
||||
private String createTime;
|
||||
|
||||
|
||||
private User user;
|
||||
|
||||
// 说明
|
||||
private String detail;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package cd.casic.ci.common.pipeline.req.pipeline;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName PipelineQueryReq
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 9:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PipelineQueryReq {
|
||||
private String userId;
|
||||
|
||||
// 创建人
|
||||
private String createUserId;
|
||||
|
||||
private String pipelineName;
|
||||
|
||||
/**
|
||||
* 流水线状态 1.运行中 2.未运行,3.等待执行
|
||||
*/
|
||||
private Integer pipelineState;
|
||||
|
||||
/**
|
||||
* 流水线类型 1.多任务 2.多阶段
|
||||
*/
|
||||
private Integer pipelineType;
|
||||
|
||||
private Integer pipelinePower;
|
||||
|
||||
private Integer pipelineFollow;
|
||||
|
||||
private String[] idString;
|
||||
|
||||
private boolean eqName;
|
||||
|
||||
// 环境
|
||||
private String envId;
|
||||
|
||||
// 分组
|
||||
private String groupId;
|
||||
|
||||
|
||||
private Page pageParam= new Page();
|
||||
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
package cd.casic.ci.common.pipeline.req.pipeline;
|
||||
|
||||
import cd.casic.framework.commons.dataobject.Group;
|
||||
import cd.casic.framework.commons.dataobject.PatchUser;
|
||||
import cd.casic.framework.commons.dataobject.User;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.autoconfigure.couchbase.CouchbaseProperties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName PipelineReq
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:53
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PipelineReq {
|
||||
|
||||
/**
|
||||
* @pi.name:id
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线id
|
||||
* @pi.value:11111
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* @pi.name:name
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线名称
|
||||
* @pi.value:name
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* @pi.model:User
|
||||
* @pi.desc:用户
|
||||
*/
|
||||
private User user;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.model:Env
|
||||
* @pi.desc:流水线环境
|
||||
*/
|
||||
private CouchbaseProperties.Env env;
|
||||
|
||||
/**
|
||||
* @pi.model:Env
|
||||
* @pi.desc:流水线组
|
||||
*/
|
||||
private Group group;
|
||||
|
||||
/**
|
||||
* @pi.name:createTime
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线创建时间
|
||||
* @pi.value:createTime
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* @pi.name:type
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:流水线类型 1.多任务 2.多阶段
|
||||
* @pi.value: 1
|
||||
*/
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* @pi.name:state
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:运行状态 1.未运行 2.运行中
|
||||
* @pi.value:1
|
||||
*/
|
||||
private int state;
|
||||
|
||||
/**
|
||||
* @pi.name:power
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:项目作用域 1.全局 2.项目
|
||||
* @pi.value:1
|
||||
*/
|
||||
private int power;
|
||||
|
||||
/**
|
||||
* @pi.name:color
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:颜色 1~5随机生成
|
||||
* @pi.value:2
|
||||
*/
|
||||
private int color;
|
||||
|
||||
/**
|
||||
* @pi.name:template
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线模板
|
||||
* @pi.value:template
|
||||
*/
|
||||
private String template;
|
||||
|
||||
/**
|
||||
* @pi.name:collect
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:收藏 0.未收藏 1.收藏
|
||||
* @pi.value:2
|
||||
*/
|
||||
private int collect;
|
||||
|
||||
/**
|
||||
* @pi.model:userList
|
||||
* @pi.desc:流水线成员
|
||||
*/
|
||||
private List<PatchUser> userList;
|
||||
|
||||
|
||||
// 以下为统计信息
|
||||
|
||||
|
||||
/**
|
||||
* @pi.model:execUser
|
||||
* @pi.desc:用户(执行人)
|
||||
*/
|
||||
private User execUser;
|
||||
|
||||
/**
|
||||
* @pi.name:number
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:执行次数
|
||||
* @pi.value:2
|
||||
*/
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* @pi.name:instanceId
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:实例id
|
||||
* @pi.value:instanceId
|
||||
*/
|
||||
private String instanceId;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.name:buildStatus
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:最近构建状态
|
||||
* @pi.value:buildStatus
|
||||
*/
|
||||
private String buildStatus;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.name:lastBuildTime
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:最近构建时间
|
||||
* @pi.value:lastBuildTime
|
||||
*/
|
||||
private String lastBuildTime;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.name:isExec
|
||||
* @pi.dataType:boolean
|
||||
* @pi.desc:是否可以执行
|
||||
* @pi.value:true
|
||||
*/
|
||||
private Boolean isExec;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cd.casic.ci.common.pipeline.resp.env;
|
||||
|
||||
import cd.casic.framework.commons.dataobject.User;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName EnvReq
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 11:00
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class EnvResp {
|
||||
// id
|
||||
private String id;
|
||||
|
||||
// 环境名称
|
||||
private String envName;
|
||||
|
||||
// 创建时间
|
||||
private String createTime;
|
||||
|
||||
private User user;
|
||||
|
||||
// 说明
|
||||
private String detail;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cd.casic.ci.common.pipeline.resp.group;
|
||||
|
||||
import cd.casic.framework.commons.dataobject.User;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName GroupResp
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 11:47
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class GroupResp {
|
||||
// id
|
||||
private String id;
|
||||
|
||||
// 环境名称
|
||||
private String groupName;
|
||||
|
||||
// 创建时间
|
||||
private String createTime;
|
||||
|
||||
|
||||
private User user;
|
||||
|
||||
// 说明
|
||||
private String detail;
|
||||
}
|
@ -0,0 +1,169 @@
|
||||
package cd.casic.ci.common.pipeline.resp.pipeline;
|
||||
|
||||
import cd.casic.framework.commons.dataobject.Group;
|
||||
import cd.casic.framework.commons.dataobject.PatchUser;
|
||||
import cd.casic.framework.commons.dataobject.User;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.autoconfigure.couchbase.CouchbaseProperties;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName PipelineResp
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:53
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PipelineResp {
|
||||
|
||||
/**
|
||||
* @pi.name:id
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线id
|
||||
* @pi.value:11111
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* @pi.name:name
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线名称
|
||||
* @pi.value:name
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* @pi.model:User
|
||||
* @pi.desc:用户
|
||||
*/
|
||||
private User user;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.model:Env
|
||||
* @pi.desc:流水线环境
|
||||
*/
|
||||
private CouchbaseProperties.Env env;
|
||||
|
||||
/**
|
||||
* @pi.model:Env
|
||||
* @pi.desc:流水线组
|
||||
*/
|
||||
private Group group;
|
||||
|
||||
/**
|
||||
* @pi.name:createTime
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线创建时间
|
||||
* @pi.value:createTime
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* @pi.name:type
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:流水线类型 1.多任务 2.多阶段
|
||||
* @pi.value: 1
|
||||
*/
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* @pi.name:state
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:运行状态 1.未运行 2.运行中
|
||||
* @pi.value:1
|
||||
*/
|
||||
private int state;
|
||||
|
||||
/**
|
||||
* @pi.name:power
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:项目作用域 1.全局 2.项目
|
||||
* @pi.value:1
|
||||
*/
|
||||
private int power;
|
||||
|
||||
/**
|
||||
* @pi.name:color
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:颜色 1~5随机生成
|
||||
* @pi.value:2
|
||||
*/
|
||||
private int color;
|
||||
|
||||
/**
|
||||
* @pi.name:template
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:流水线模板
|
||||
* @pi.value:template
|
||||
*/
|
||||
private String template;
|
||||
|
||||
/**
|
||||
* @pi.name:collect
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:收藏 0.未收藏 1.收藏
|
||||
* @pi.value:2
|
||||
*/
|
||||
private int collect;
|
||||
|
||||
/**
|
||||
* @pi.model:userList
|
||||
* @pi.desc:流水线成员
|
||||
*/
|
||||
private List<PatchUser> userList;
|
||||
|
||||
|
||||
// 以下为统计信息
|
||||
|
||||
|
||||
/**
|
||||
* @pi.model:execUser
|
||||
* @pi.desc:用户(执行人)
|
||||
*/
|
||||
private User execUser;
|
||||
|
||||
/**
|
||||
* @pi.name:number
|
||||
* @pi.dataType:Integer
|
||||
* @pi.desc:执行次数
|
||||
* @pi.value:2
|
||||
*/
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* @pi.name:instanceId
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:实例id
|
||||
* @pi.value:instanceId
|
||||
*/
|
||||
private String instanceId;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.name:buildStatus
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:最近构建状态
|
||||
* @pi.value:buildStatus
|
||||
*/
|
||||
private String buildStatus;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.name:lastBuildTime
|
||||
* @pi.dataType:string
|
||||
* @pi.desc:最近构建时间
|
||||
* @pi.value:lastBuildTime
|
||||
*/
|
||||
private String lastBuildTime;
|
||||
|
||||
|
||||
/**
|
||||
* @pi.name:isExec
|
||||
* @pi.dataType:boolean
|
||||
* @pi.desc:是否可以执行
|
||||
* @pi.value:true
|
||||
*/
|
||||
private Boolean isExec;
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package cd.casic.server.controller;
|
||||
|
||||
import cd.casic.ci.common.pipeline.req.env.EnvQueryReq;
|
||||
import cd.casic.ci.common.pipeline.req.env.EnvReq;
|
||||
import cd.casic.ci.common.pipeline.resp.env.EnvResp;
|
||||
import cd.casic.framework.commons.pojo.CommonResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.validation.Valid;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName EnvController
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:57
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/env")
|
||||
public class EnvController {
|
||||
|
||||
@PostMapping(path="/createEnv")
|
||||
public CommonResult<String> createEnv(@RequestBody @NotNull @Valid EnvReq envReq){
|
||||
|
||||
// String pipelineAuthHostId = envService.createEnv(env);
|
||||
|
||||
String envId = "1";
|
||||
return CommonResult.success(envId);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/deleteEnv")
|
||||
public CommonResult<Void> deleteEnv(@NotNull String envId){
|
||||
|
||||
// envService.deleteEnv(envId);
|
||||
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
@PostMapping(path="/findEnvList")
|
||||
public CommonResult<List<EnvResp>> findOnePipeline(@NotNull EnvQueryReq query){
|
||||
|
||||
// List<Env> envList = envService.findEnvList(envQuery);
|
||||
List<EnvResp> envRespList = new ArrayList<>(0);
|
||||
EnvResp envResp = new EnvResp();
|
||||
envResp.setId("1");
|
||||
envResp.setEnvName("test数据交互测试");
|
||||
envRespList.add(envResp);
|
||||
|
||||
return CommonResult.success(envRespList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping(path="/updateEnv")
|
||||
public CommonResult<Void> updateEnv(@RequestBody @NotNull @Valid EnvReq envReq){
|
||||
|
||||
// this.envService.updateEnv(env);
|
||||
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/findEnvPage")
|
||||
public CommonResult<Page<EnvResp>> findEnvPage(@RequestBody @NotNull @Valid EnvQueryReq query){
|
||||
|
||||
// Pagination<Env> envPage = envService.findEnvPage(envQuery);
|
||||
Page<EnvResp> envRespPage = new Page<>();
|
||||
List<EnvResp> envRespList = new ArrayList<>(0);
|
||||
EnvResp envResp = new EnvResp();
|
||||
envResp.setId("1");
|
||||
envResp.setEnvName("test数据交互测试");
|
||||
envRespList.add(envResp);
|
||||
envRespPage.setRecords(envRespList);
|
||||
return CommonResult.success(envRespPage);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package cd.casic.server.controller;
|
||||
|
||||
import cd.casic.ci.common.pipeline.req.group.GroupQueryReq;
|
||||
import cd.casic.ci.common.pipeline.req.group.GroupReq;
|
||||
import cd.casic.ci.common.pipeline.resp.group.GroupResp;
|
||||
import cd.casic.framework.commons.pojo.CommonResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.validation.Valid;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName GroupController
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:57
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/group")
|
||||
public class GroupController {
|
||||
|
||||
@PostMapping(path="/createGroup")
|
||||
public CommonResult<String> createGroup(@RequestBody @NotNull @Valid GroupReq groupReq){
|
||||
|
||||
// String pipelineAuthHostId = groupService.createGroup(group);
|
||||
|
||||
String envId = "1";
|
||||
return CommonResult.success(envId);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/deleteGroup")
|
||||
public CommonResult<Void> deleteGroup(@NotNull String groupId){
|
||||
|
||||
// groupService.deleteGroup(groupId);
|
||||
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
@PostMapping(path="/findGroupList")
|
||||
public CommonResult<List<GroupResp>> findGroupList(@NotNull GroupQueryReq query){
|
||||
|
||||
// List<Group> groupList = groupService.findGroupList(groupQuery);
|
||||
List<GroupResp> groupRespList = new ArrayList<>(0);
|
||||
GroupResp groupResp = new GroupResp();
|
||||
groupResp.setId("1");
|
||||
groupResp.setGroupName("test数据交互测试");
|
||||
groupRespList.add(groupResp);
|
||||
|
||||
return CommonResult.success(groupRespList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping(path="/updateGroup")
|
||||
public CommonResult<Void> updateGroup(@RequestBody @NotNull @Valid GroupReq groupReq){
|
||||
|
||||
// this.groupService.updateGroup(group);
|
||||
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/findGroupPage")
|
||||
public CommonResult<Page<GroupResp>> findGroupPage(@RequestBody @NotNull @Valid GroupQueryReq query){
|
||||
|
||||
// Pagination<Group> groupPage = groupService.findGroupPage(groupQuery);
|
||||
Page<GroupResp> groupRespPage = new Page<>();
|
||||
List<GroupResp> groupRespList = new ArrayList<>(0);
|
||||
GroupResp groupResp = new GroupResp();
|
||||
groupResp.setId("1");
|
||||
groupResp.setGroupName("test数据交互测试");
|
||||
groupRespList.add(groupResp);
|
||||
groupRespPage.setRecords(groupRespList);
|
||||
return CommonResult.success(groupRespPage);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,225 @@
|
||||
package cd.casic.server.controller;
|
||||
|
||||
import cd.casic.ci.common.pipeline.req.pipeline.PipelineQueryReq;
|
||||
import cd.casic.ci.common.pipeline.req.pipeline.PipelineReq;
|
||||
import cd.casic.ci.common.pipeline.resp.pipeline.PipelineResp;
|
||||
import cd.casic.framework.commons.dataobject.User;
|
||||
import cd.casic.framework.commons.pojo.CommonResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.validation.Valid;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName PipelineController
|
||||
* @Author hopeli
|
||||
* @Date 2025/5/10 10:28
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/pipeline")
|
||||
public class PipelineController {
|
||||
|
||||
@PostMapping(path="/createPipeline")
|
||||
public CommonResult<String> createPipeline(@RequestBody @NotNull @Valid PipelineReq pipelineReq){
|
||||
|
||||
// String pipelineId = pipelineService.createPipeline(pipeline);
|
||||
|
||||
String pipelineId = "1";
|
||||
return CommonResult.success(pipelineId);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/findAllPipeline")
|
||||
public CommonResult<List<PipelineResp>> findAllPipeline(){
|
||||
|
||||
// List<PipelineResp> selectAllPipeline = pipelineService.findAllPipeline();
|
||||
|
||||
List<PipelineResp> selectAllPipeline = new ArrayList<>(0);
|
||||
return CommonResult.success(selectAllPipeline);
|
||||
}
|
||||
|
||||
@PostMapping(path="/deletePipeline")
|
||||
public CommonResult<Void> deletePipeline(@NotNull String pipelineId){
|
||||
|
||||
// pipelineService.deletePipeline(pipelineId);
|
||||
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
@PostMapping(path="/findOnePipeline")
|
||||
public CommonResult<List<PipelineResp>> findOnePipeline(@NotNull String pipelineId){
|
||||
|
||||
// Pipeline pipeline = pipelineService.findOnePipeline(pipelineId);
|
||||
List<PipelineResp> pipelineRespList = new ArrayList<>(0);
|
||||
PipelineResp pipeline = new PipelineResp();
|
||||
pipeline.setId("1");
|
||||
pipeline.setName("test数据交互测试");
|
||||
pipelineRespList.add(pipeline);
|
||||
|
||||
return CommonResult.success(pipelineRespList);
|
||||
}
|
||||
|
||||
@PostMapping(path="/findPipelineNoQuery")
|
||||
public CommonResult<PipelineResp> findPipelineNoQuery(@NotNull String pipelineId){
|
||||
|
||||
// Pipeline pipeline = pipelineService.findPipelineNoQuery(pipelineId);
|
||||
|
||||
PipelineResp pipeline = new PipelineResp();
|
||||
pipeline.setId("1");
|
||||
pipeline.setName("test数据交互测试");
|
||||
|
||||
return CommonResult.success(pipeline);
|
||||
}
|
||||
|
||||
// @RequestMapping(path="/updatePipelineRootUser",method = RequestMethod.POST)
|
||||
// // @ApiMethod(name = "updatePipelineRootUser",desc = "更新流水线负责人")
|
||||
// // @ApiParam(name = "dmRolePatch",desc = "流水线负责人信息",required = true)
|
||||
// public Result<Void> updatePipelineRootUser(@RequestBody @NotNull @Valid DmRolePatch dmRolePatch){
|
||||
//
|
||||
// pipelineService.updatePipelineRootUser(dmRolePatch);
|
||||
//
|
||||
// return Result.ok();
|
||||
// }
|
||||
|
||||
|
||||
@PostMapping(path="/updatePipeline")
|
||||
public CommonResult<Void> updatePipeline(@RequestBody @NotNull @Valid PipelineReq pipeline){
|
||||
|
||||
// pipelineService.updatePipeline(pipeline);
|
||||
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/findUserPipelinePage")
|
||||
public CommonResult<Page<PipelineResp>> findUserPipelinePage(@RequestBody @NotNull @Valid PipelineQueryReq query){
|
||||
|
||||
// Pagination<Pipeline> userPipeline = pipelineService.findUserPipelinePage(query);
|
||||
Page<PipelineResp> pipelineRespPage = new Page<>();
|
||||
List<PipelineResp> pipelineRespList = new ArrayList<>(0);
|
||||
PipelineResp pipeline = new PipelineResp();
|
||||
pipeline.setId("1");
|
||||
pipeline.setName("test数据交互测试");
|
||||
pipelineRespList.add(pipeline);
|
||||
pipelineRespPage.setRecords(pipelineRespList);
|
||||
return CommonResult.success(pipelineRespPage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping(path="/findUserPipeline")
|
||||
public CommonResult<List<PipelineResp>> findAllUserPipeline(@RequestBody @NotNull @Valid PipelineQueryReq query){
|
||||
// List<Pipeline> userPipeline = pipelineService.findUserPipeline(query);
|
||||
|
||||
List<PipelineResp> pipelineRespList = new ArrayList<>(0);
|
||||
PipelineResp pipeline = new PipelineResp();
|
||||
pipeline.setId("1");
|
||||
pipeline.setName("test数据交互测试");
|
||||
pipelineRespList.add(pipeline);
|
||||
return CommonResult.success(pipelineRespList);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(path="/findPipelineUser")
|
||||
public CommonResult<List<User>> findPipelineUser(@NotNull String pipelineId){
|
||||
|
||||
// List<User> dmUser = pipelineService.findPipelineUser(pipelineId);
|
||||
List<User> userList = new ArrayList<>(0);
|
||||
User user = new User();
|
||||
user.setId("1");
|
||||
user.setName("test数据交互测试");
|
||||
userList.add(user);
|
||||
return CommonResult.success(userList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping(path="/pipelineClone")
|
||||
public CommonResult<Void> pipelineClone(@NotNull String pipelineId,@NotNull String pipelineName){
|
||||
|
||||
// pipelineService.pipelineClone(pipelineId,pipelineName);
|
||||
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
@PostMapping(path="/findPipelineCloneName")
|
||||
public CommonResult<String> findPipelineCloneName(@NotNull String pipelineId){
|
||||
|
||||
// String name = pipelineService.findPipelineCloneName(pipelineId);
|
||||
String name = "test";
|
||||
|
||||
return CommonResult.success(name);
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * @pi.name:获取最近打开的流水线
|
||||
// * @pi.url:/findRecentlyPipeline
|
||||
// * @pi.methodType:post
|
||||
// * @pi.request-type: formdata
|
||||
// * @pi.param: name=number;dataType=Integer;value=查询数量;
|
||||
// * @pi.param: name=pipelineId;dataType=String;value=流水线id;
|
||||
// */
|
||||
// @RequestMapping(path="/findRecentlyPipeline",method = RequestMethod.POST)
|
||||
// public Result<String> findRecentlyPipeline(@NotNull Integer number,@NotNull String pipelineId){
|
||||
//
|
||||
// List<Pipeline> pipelineList = pipelineService.findRecentlyPipeline(number,pipelineId);
|
||||
//
|
||||
// return Result.ok(pipelineList);
|
||||
// }
|
||||
|
||||
|
||||
// /**
|
||||
// * @pi.name:流水线导出为Yaml格式
|
||||
// * @pi.url:/importPipelineYaml
|
||||
// * @pi.methodType:post
|
||||
// * @pi.request-type: formdata
|
||||
// * @pi.param: name=request;dataType=HttpServletResponse;value=请求;
|
||||
// * @pi.param: name=response;dataType=HttpServletRequest;value=请求体;
|
||||
// */
|
||||
// @RequestMapping(path="/importPipelineYaml",method = RequestMethod.POST)
|
||||
// public ResponseEntity<Object> importPipelineYaml(HttpServletRequest request, HttpServletResponse response) {
|
||||
// try {
|
||||
// Map<String, String[]> parameterMap = request.getParameterMap();
|
||||
//
|
||||
// String pipelineId = Arrays.toString(parameterMap.get("pipelineId")).replace("[","").replace("]","");
|
||||
//
|
||||
// String yamlString = yamlService.importPipelineYaml(pipelineId);
|
||||
//
|
||||
// Pipeline pipeline = pipelineService.findPipelineById(pipelineId);
|
||||
//
|
||||
// String tempFile = PipelineFileUtil.createTempFile(yamlString, ".yaml");
|
||||
// File file = new File(tempFile);
|
||||
// BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
|
||||
//
|
||||
// ServletOutputStream outputStream = response.getOutputStream();
|
||||
// response.setHeader("Content-Disposition", "attachment; filename="+pipeline.getName());
|
||||
// response.setContentLength((int) file.length());
|
||||
//
|
||||
// int buf_size = 1024;
|
||||
// byte[] buffer = new byte[buf_size];
|
||||
// int len = 0;
|
||||
// while (-1 != (len = in.read(buffer, 0, buf_size))) {
|
||||
// outputStream.write(buffer,0,len);
|
||||
// }
|
||||
// in.close();
|
||||
// outputStream.close();
|
||||
//
|
||||
// file.delete();
|
||||
//
|
||||
// return ResponseEntity.ok().build();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(Result.error(1000,"下载失败"));
|
||||
// }
|
||||
// }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user