增加生成后端服务代码。
This commit is contained in:
parent
693bd8d833
commit
56523ddf01
@ -0,0 +1,28 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.api;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.controller.BaseController;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsBuild;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsBuildDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsBuildQuery;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息 Controller
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1/jenkins-build")
|
||||||
|
@Tag(name = "Jenkins构建信息管理", description = "Jenkins构建信息管理相关接口")
|
||||||
|
public class JenkinsBuildApiController extends BaseController<JenkinsBuild, JenkinsBuildDTO, Long, JenkinsBuildQuery> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void exportData(HttpServletResponse response, List<JenkinsBuildDTO> data) {
|
||||||
|
// TODO: 实现导出逻辑
|
||||||
|
log.info("导出Jenkins构建信息数据,数据量:{}", data.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.api;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.controller.BaseController;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsJob;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsJobDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsJobQuery;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins工作 Controller
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1/jenkins-job")
|
||||||
|
@Tag(name = "Jenkins工作管理", description = "Jenkins工作管理相关接口")
|
||||||
|
public class JenkinsJobApiController extends BaseController<JenkinsJob, JenkinsJobDTO, Long, JenkinsJobQuery> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void exportData(HttpServletResponse response, List<JenkinsJobDTO> data) {
|
||||||
|
// TODO: 实现导出逻辑
|
||||||
|
log.info("导出Jenkins工作数据,数据量:{}", data.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.api;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.deploy.service.IJenkinsManagerService;
|
||||||
|
import com.qqchen.deploy.backend.framework.api.Response;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息 Controller
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1/jenkins-manager")
|
||||||
|
@Tag(name = "Jenkins三方系统管理", description = "Jenkins三方系统管理")
|
||||||
|
public class JenkinsManagerApiController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IJenkinsManagerService jenkinsManagerService;
|
||||||
|
|
||||||
|
@GetMapping("/views/page")
|
||||||
|
public Response<Void> page() {
|
||||||
|
return Response.success(jenkinsManagerService.viewsPage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.api;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.controller.BaseController;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsView;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsViewDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsViewQuery;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins视图 Controller
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v1/jenkins-view")
|
||||||
|
@Tag(name = "Jenkins视图管理", description = "Jenkins视图管理相关接口")
|
||||||
|
public class JenkinsViewApiController extends BaseController<JenkinsView, JenkinsViewDTO, Long, JenkinsViewQuery> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void exportData(HttpServletResponse response, List<JenkinsViewDTO> data) {
|
||||||
|
// TODO: 实现导出逻辑
|
||||||
|
log.info("导出Jenkins视图数据,数据量:{}", data.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.converter;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.converter.BaseConverter;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsBuild;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsBuildDTO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息 Converter
|
||||||
|
*/
|
||||||
|
@Mapper(config = BaseConverter.class)
|
||||||
|
public interface JenkinsBuildConverter extends BaseConverter<JenkinsBuild, JenkinsBuildDTO> {
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.converter;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.converter.BaseConverter;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsJob;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsJobDTO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins工作 Converter
|
||||||
|
*/
|
||||||
|
@Mapper(config = BaseConverter.class)
|
||||||
|
public interface JenkinsJobConverter extends BaseConverter<JenkinsJob, JenkinsJobDTO> {
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.converter;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.converter.BaseConverter;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsView;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsViewDTO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins视图 Converter
|
||||||
|
*/
|
||||||
|
@Mapper(config = BaseConverter.class)
|
||||||
|
public interface JenkinsViewConverter extends BaseConverter<JenkinsView, JenkinsViewDTO> {
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.dto;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.dto.BaseDTO;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息 DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class JenkinsBuildDTO extends BaseDTO {
|
||||||
|
|
||||||
|
private Integer buildNumber;
|
||||||
|
|
||||||
|
private String buildStatus;
|
||||||
|
|
||||||
|
private String buildUrl;
|
||||||
|
|
||||||
|
private Long duration;
|
||||||
|
|
||||||
|
private LocalDateTime starttime;
|
||||||
|
|
||||||
|
private String actions;
|
||||||
|
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
private Long jobId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.dto;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.dto.BaseDTO;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins工作 DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class JenkinsJobDTO extends BaseDTO {
|
||||||
|
|
||||||
|
private Boolean buildable;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private String jobName;
|
||||||
|
|
||||||
|
private String jobUrl;
|
||||||
|
|
||||||
|
private Integer nextBuildNumber;
|
||||||
|
|
||||||
|
private Integer lastBuildNumber;
|
||||||
|
|
||||||
|
private String lastBuildStatus;
|
||||||
|
|
||||||
|
private Integer healthReportScore;
|
||||||
|
|
||||||
|
private LocalDateTime lastBuildTime;
|
||||||
|
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
private Long viewId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.dto;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.dto.BaseDTO;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins视图 DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class JenkinsViewDTO extends BaseDTO {
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
private String viewName;
|
||||||
|
|
||||||
|
private String viewUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,42 +1,42 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.entity;
|
package com.qqchen.deploy.backend.deploy.entity;
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.framework.annotation.LogicDelete;
|
|
||||||
import com.qqchen.deploy.backend.framework.domain.Entity;
|
import com.qqchen.deploy.backend.framework.domain.Entity;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Table;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息实体
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@jakarta.persistence.Entity
|
@jakarta.persistence.Entity
|
||||||
@Table(name = "deploy_jenkins_build")
|
@Table(name = "deploy_jenkins_build")
|
||||||
@LogicDelete
|
|
||||||
public class JenkinsBuild extends Entity<Long> {
|
public class JenkinsBuild extends Entity<Long> {
|
||||||
|
|
||||||
@Column(name = "external_system_id", nullable = false)
|
|
||||||
private Long external_system_id;
|
|
||||||
|
|
||||||
@Column(name = "job_id", nullable = false)
|
|
||||||
private Long jobId;
|
|
||||||
|
|
||||||
@Column(name = "build_number", nullable = false)
|
@Column(name = "build_number", nullable = false)
|
||||||
private Integer buildNumber;
|
private Integer buildNumber;
|
||||||
|
|
||||||
@Column(name = "build_url", nullable = false)
|
|
||||||
private String buildUrl;
|
|
||||||
|
|
||||||
@Column(name = "build_status", nullable = false)
|
@Column(name = "build_status", nullable = false)
|
||||||
private String buildStatus;
|
private String buildStatus;
|
||||||
|
|
||||||
@Column(name = "start_time", nullable = false)
|
@Column(name = "build_url", nullable = false)
|
||||||
private LocalDateTime startTime;
|
private String buildUrl;
|
||||||
|
|
||||||
@Column(name = "duration", nullable = false)
|
@Column(name = "duration", nullable = false)
|
||||||
private Long duration;
|
private Long duration;
|
||||||
|
|
||||||
@Column(name = "trigger_cause", columnDefinition = "TEXT")
|
@Column(name = "startTime", nullable = false)
|
||||||
private String triggerCause;
|
private LocalDateTime starttime;
|
||||||
|
|
||||||
|
@Column(name = "actions")
|
||||||
|
private String actions;
|
||||||
|
|
||||||
|
@Column(name = "external_system_id", nullable = false)
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
@Column(name = "job_id", nullable = false)
|
||||||
|
private Long jobId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,32 +1,25 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.entity;
|
package com.qqchen.deploy.backend.deploy.entity;
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.framework.annotation.LogicDelete;
|
|
||||||
import com.qqchen.deploy.backend.framework.domain.Entity;
|
import com.qqchen.deploy.backend.framework.domain.Entity;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.FetchType;
|
|
||||||
import jakarta.persistence.JoinColumn;
|
|
||||||
import jakarta.persistence.ManyToOne;
|
|
||||||
import jakarta.persistence.Table;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins工作实体
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@jakarta.persistence.Entity
|
@jakarta.persistence.Entity
|
||||||
@Table(name = "deploy_jenkins_job")
|
@Table(name = "deploy_jenkins_job")
|
||||||
@LogicDelete
|
|
||||||
public class JenkinsJob extends Entity<Long> {
|
public class JenkinsJob extends Entity<Long> {
|
||||||
|
|
||||||
@Column(name = "external_system_id", nullable = false)
|
@Column(name = "buildable")
|
||||||
private Long external_system_id;
|
private Boolean buildable;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@Column(name = "description")
|
||||||
@JoinColumn(name = "view_id")
|
private String description;
|
||||||
private JenkinsView view;
|
|
||||||
|
|
||||||
@Column(name = "job_name", nullable = false)
|
@Column(name = "job_name", nullable = false)
|
||||||
private String jobName;
|
private String jobName;
|
||||||
@ -34,16 +27,25 @@ public class JenkinsJob extends Entity<Long> {
|
|||||||
@Column(name = "job_url", nullable = false)
|
@Column(name = "job_url", nullable = false)
|
||||||
private String jobUrl;
|
private String jobUrl;
|
||||||
|
|
||||||
private String description;
|
@Column(name = "next_build_number", nullable = false)
|
||||||
|
private Integer nextBuildNumber;
|
||||||
|
|
||||||
private Boolean buildable;
|
@Column(name = "last_build_number", nullable = false)
|
||||||
|
|
||||||
@Column(name = "last_build_number")
|
|
||||||
private Integer lastBuildNumber;
|
private Integer lastBuildNumber;
|
||||||
|
|
||||||
|
@Column(name = "last_build_status", nullable = false)
|
||||||
|
private String lastBuildStatus;
|
||||||
|
|
||||||
|
@Column(name = "health_report_score", nullable = false)
|
||||||
|
private Integer healthReportScore;
|
||||||
|
|
||||||
@Column(name = "last_build_time")
|
@Column(name = "last_build_time")
|
||||||
private LocalDateTime lastBuildTime;
|
private LocalDateTime lastBuildTime;
|
||||||
|
|
||||||
@Column(name = "last_build_status")
|
@Column(name = "external_system_id", nullable = false)
|
||||||
private String lastBuildStatus;
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
@Column(name = "view_id", nullable = false)
|
||||||
|
private Long viewId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,28 +1,31 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.entity;
|
package com.qqchen.deploy.backend.deploy.entity;
|
||||||
|
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.framework.annotation.LogicDelete;
|
|
||||||
import com.qqchen.deploy.backend.framework.domain.Entity;
|
import com.qqchen.deploy.backend.framework.domain.Entity;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.Table;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins视图实体
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@jakarta.persistence.Entity
|
@jakarta.persistence.Entity
|
||||||
@Table(name = "deploy_jenkins_view")
|
@Table(name = "deploy_jenkins_view")
|
||||||
@LogicDelete
|
|
||||||
public class JenkinsView extends Entity<Long> {
|
public class JenkinsView extends Entity<Long> {
|
||||||
|
|
||||||
@Column(name = "external_system_id", nullable = false)
|
|
||||||
private Long external_system_id;
|
|
||||||
|
|
||||||
@Column(name = "view_name", nullable = false)
|
@Column(name = "view_name", nullable = false)
|
||||||
private String viewName;
|
private String viewName;
|
||||||
|
|
||||||
@Column(name = "view_url", nullable = false)
|
@Column(name = "view_url", nullable = false)
|
||||||
private String viewUrl;
|
private String viewUrl;
|
||||||
|
|
||||||
|
@Column(name = "description")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@Column(name = "external_system_id", nullable = false)
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.query;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.annotation.QueryField;
|
||||||
|
import com.qqchen.deploy.backend.framework.enums.QueryType;
|
||||||
|
import com.qqchen.deploy.backend.framework.query.BaseQuery;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息查询对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class JenkinsBuildQuery extends BaseQuery {
|
||||||
|
|
||||||
|
@QueryField(field = "build_number")
|
||||||
|
private Integer buildNumber;
|
||||||
|
|
||||||
|
@QueryField(field = "build_status", type = QueryType.LIKE)
|
||||||
|
private String buildStatus;
|
||||||
|
|
||||||
|
@QueryField(field = "build_url", type = QueryType.LIKE)
|
||||||
|
private String buildUrl;
|
||||||
|
|
||||||
|
@QueryField(field = "duration")
|
||||||
|
private Long duration;
|
||||||
|
|
||||||
|
@QueryField(field = "startTime")
|
||||||
|
private LocalDateTime starttime;
|
||||||
|
|
||||||
|
@QueryField(field = "actions", type = QueryType.LIKE)
|
||||||
|
private String actions;
|
||||||
|
|
||||||
|
@QueryField(field = "external_system_id")
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
@QueryField(field = "job_id")
|
||||||
|
private Long jobId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.query;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.annotation.QueryField;
|
||||||
|
import com.qqchen.deploy.backend.framework.enums.QueryType;
|
||||||
|
import com.qqchen.deploy.backend.framework.query.BaseQuery;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins工作查询对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class JenkinsJobQuery extends BaseQuery {
|
||||||
|
|
||||||
|
@QueryField(field = "buildable")
|
||||||
|
private Boolean buildable;
|
||||||
|
|
||||||
|
@QueryField(field = "description", type = QueryType.LIKE)
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@QueryField(field = "job_name", type = QueryType.LIKE)
|
||||||
|
private String jobName;
|
||||||
|
|
||||||
|
@QueryField(field = "job_url", type = QueryType.LIKE)
|
||||||
|
private String jobUrl;
|
||||||
|
|
||||||
|
@QueryField(field = "next_build_number")
|
||||||
|
private Integer nextBuildNumber;
|
||||||
|
|
||||||
|
@QueryField(field = "last_build_number")
|
||||||
|
private Integer lastBuildNumber;
|
||||||
|
|
||||||
|
@QueryField(field = "last_build_status", type = QueryType.LIKE)
|
||||||
|
private String lastBuildStatus;
|
||||||
|
|
||||||
|
@QueryField(field = "health_report_score")
|
||||||
|
private Integer healthReportScore;
|
||||||
|
|
||||||
|
@QueryField(field = "last_build_time")
|
||||||
|
private LocalDateTime lastBuildTime;
|
||||||
|
|
||||||
|
@QueryField(field = "external_system_id")
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
@QueryField(field = "view_id")
|
||||||
|
private Long viewId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.query;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.annotation.QueryField;
|
||||||
|
import com.qqchen.deploy.backend.framework.enums.QueryType;
|
||||||
|
import com.qqchen.deploy.backend.framework.query.BaseQuery;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins视图查询对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class JenkinsViewQuery extends BaseQuery {
|
||||||
|
|
||||||
|
@QueryField(field = "description", type = QueryType.LIKE)
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@QueryField(field = "external_system_id")
|
||||||
|
private Long externalSystemId;
|
||||||
|
|
||||||
|
@QueryField(field = "view_name", type = QueryType.LIKE)
|
||||||
|
private String viewName;
|
||||||
|
|
||||||
|
@QueryField(field = "view_url", type = QueryType.LIKE)
|
||||||
|
private String viewUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,15 +1,12 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.repository;
|
package com.qqchen.deploy.backend.deploy.repository;
|
||||||
|
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
|
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
|
||||||
import com.qqchen.deploy.backend.deploy.entity.JenkinsBuild;
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsBuild;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
/**
|
||||||
|
* Jenkins构建信息 Repository
|
||||||
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface IJenkinsBuildRepository extends IBaseRepository<JenkinsBuild, Long> {
|
public interface IJenkinsBuildRepository extends IBaseRepository<JenkinsBuild, Long> {
|
||||||
List<JenkinsBuild> findByJobIdAndDeletedFalse(Long jobId);
|
|
||||||
List<JenkinsBuild> findByJobIdAndBuildNumberAndDeletedFalse(Long jobId, Integer buildNumber);
|
|
||||||
void deleteByJobIdAndDeletedFalse(Long jobId);
|
|
||||||
List<JenkinsBuild> findByJobIdAndDeletedFalseOrderByBuildNumberDesc(Long jobId);
|
|
||||||
}
|
}
|
||||||
@ -2,12 +2,11 @@ package com.qqchen.deploy.backend.deploy.repository;
|
|||||||
|
|
||||||
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
|
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
|
||||||
import com.qqchen.deploy.backend.deploy.entity.JenkinsJob;
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsJob;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.data.repository.query.Param;
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
/**
|
||||||
|
* Jenkins工作 Repository
|
||||||
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface IJenkinsJobRepository extends IBaseRepository<JenkinsJob, Long> {
|
public interface IJenkinsJobRepository extends IBaseRepository<JenkinsJob, Long> {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,13 +1,12 @@
|
|||||||
package com.qqchen.deploy.backend.deploy.repository;
|
package com.qqchen.deploy.backend.deploy.repository;
|
||||||
|
|
||||||
|
|
||||||
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
|
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
|
||||||
import com.qqchen.deploy.backend.deploy.entity.JenkinsView;
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsView;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
/**
|
||||||
|
* Jenkins视图 Repository
|
||||||
|
*/
|
||||||
@Repository
|
@Repository
|
||||||
public interface IJenkinsViewRepository extends IBaseRepository<JenkinsView, Long> {
|
public interface IJenkinsViewRepository extends IBaseRepository<JenkinsView, Long> {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.service.IBaseService;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsBuild;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsBuildDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsBuildQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息 Service接口
|
||||||
|
*/
|
||||||
|
public interface IJenkinsBuildService extends IBaseService<JenkinsBuild, JenkinsBuildDTO, JenkinsBuildQuery, Long> {
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.service.IBaseService;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsJob;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsJobDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsJobQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins工作 Service接口
|
||||||
|
*/
|
||||||
|
public interface IJenkinsJobService extends IBaseService<JenkinsJob, JenkinsJobDTO, JenkinsJobQuery, Long> {
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IJenkinsManagerService {
|
||||||
|
|
||||||
|
Void viewsPage();
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.service.IBaseService;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsView;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsViewDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsViewQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins视图 Service接口
|
||||||
|
*/
|
||||||
|
public interface IJenkinsViewService extends IBaseService<JenkinsView, JenkinsViewDTO, JenkinsViewQuery, Long> {
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service.impl;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.service.impl.BaseServiceImpl;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsBuild;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsBuildDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsBuildQuery;
|
||||||
|
import com.qqchen.deploy.backend.deploy.service.IJenkinsBuildService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins构建信息 Service实现
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class JenkinsBuildServiceImpl extends BaseServiceImpl<JenkinsBuild, JenkinsBuildDTO, JenkinsBuildQuery, Long>
|
||||||
|
implements IJenkinsBuildService {
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service.impl;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.service.impl.BaseServiceImpl;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsJob;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsJobDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsJobQuery;
|
||||||
|
import com.qqchen.deploy.backend.deploy.service.IJenkinsJobService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins工作 Service实现
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class JenkinsJobServiceImpl extends BaseServiceImpl<JenkinsJob, JenkinsJobDTO, JenkinsJobQuery, Long>
|
||||||
|
implements IJenkinsJobService {
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service.impl;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.deploy.service.IJenkinsManagerService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class JenkinsManagerServiceImpl implements IJenkinsManagerService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void viewsPage() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.qqchen.deploy.backend.deploy.service.impl;
|
||||||
|
|
||||||
|
import com.qqchen.deploy.backend.framework.service.impl.BaseServiceImpl;
|
||||||
|
import com.qqchen.deploy.backend.deploy.entity.JenkinsView;
|
||||||
|
import com.qqchen.deploy.backend.deploy.dto.JenkinsViewDTO;
|
||||||
|
import com.qqchen.deploy.backend.deploy.query.JenkinsViewQuery;
|
||||||
|
import com.qqchen.deploy.backend.deploy.service.IJenkinsViewService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Jenkins视图 Service实现
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class JenkinsViewServiceImpl extends BaseServiceImpl<JenkinsView, JenkinsViewDTO, JenkinsViewQuery, Long>
|
||||||
|
implements IJenkinsViewService {
|
||||||
|
}
|
||||||
@ -81,7 +81,7 @@ VALUES
|
|||||||
|
|
||||||
(204, '部署配置管理', '/deploy/deployment', '/src/pages/Deploy/Deployment/List/index', 'CloudOutlined', 2, 200, 4, FALSE, TRUE, 'system', '2024-01-01 00:00:00', 0, FALSE),
|
(204, '部署配置管理', '/deploy/deployment', '/src/pages/Deploy/Deployment/List/index', 'CloudOutlined', 2, 200, 4, FALSE, TRUE, 'system', '2024-01-01 00:00:00', 0, FALSE),
|
||||||
|
|
||||||
(205, 'Jenkins管理', '/deploy/jenkins', '/src/pages/Deploy/Jenkins/List/index', 'CloudOutlined', 2, 200, 5, FALSE, TRUE, 'system', '2024-01-01 00:00:00', 0, FALSE),
|
(205, 'Jenkins管理', '/deploy/jenkins-manager', '/src/pages/Deploy/JenkinsManager/List', 'CloudOutlined', 2, 200, 5, FALSE, TRUE, 'system', '2024-01-01 00:00:00', 0, FALSE),
|
||||||
-- 三方系统
|
-- 三方系统
|
||||||
(206, '三方系统管理', '/deploy/external', '/src/pages/Deploy/external/index', 'ApiOutlined', 2, 200, 6, FALSE, TRUE, 'system', '2024-01-01 00:00:00', 0, FALSE);
|
(206, '三方系统管理', '/deploy/external', '/src/pages/Deploy/external/index', 'ApiOutlined', 2, 200, 6, FALSE, TRUE, 'system', '2024-01-01 00:00:00', 0, FALSE);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user