规则引擎列表
parent
8bfbd8afb0
commit
f5488fa41b
|
@ -22,6 +22,13 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-openapi</artifactId>-->
|
||||
<!-- <version>3.0.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,10 +1,22 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.req.EngineMaintenanceEditReq;
|
||||
import com.muyu.req.EngineMaintenanceQueryReq;
|
||||
import com.muyu.req.EngineMaintenanceSaveReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @Author:qdm
|
||||
* @Package:com.muyu.domain
|
||||
|
@ -13,9 +25,103 @@ import lombok.experimental.SuperBuilder;
|
|||
* @Date:2024/8/22 15:38
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class EngineMaintenance {
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("engine_maintenance")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
//@ApiModel(value = "EngineMaintenance", description = "引擎维护")
|
||||
public class EngineMaintenance extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
// @ApiModelProperty(name = "编号", value = "编号")
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
// @ApiModelProperty(name = "名称", value = "名称")
|
||||
private String name;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
// @ApiModelProperty(name = "类型", value = "类型")
|
||||
private Integer type;
|
||||
|
||||
/** 作用域 */
|
||||
@Excel(name = "作用域")
|
||||
// @ApiModelProperty(name = "作用域", value = "作用域")
|
||||
private Integer scope;
|
||||
|
||||
/** 引擎编码 */
|
||||
@Excel(name = "引擎编码")
|
||||
// @ApiModelProperty(name = "引擎编码", value = "引擎编码")
|
||||
private String engineCode;
|
||||
|
||||
/** 是否激活 */
|
||||
@Excel(name = "是否激活")
|
||||
// @ApiModelProperty(name = "是否激活", value = "是否激活")
|
||||
private String isActivate;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
// @ApiModelProperty(name = "状态", value = "状态")
|
||||
private String status;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
// @ApiModelProperty(name = "描述", value = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static EngineMaintenance queryBuild( EngineMaintenanceQueryReq engineMaintenanceQueryReq){
|
||||
return EngineMaintenance.builder()
|
||||
.name(engineMaintenanceQueryReq.getName())
|
||||
.type(engineMaintenanceQueryReq.getType())
|
||||
.scope(engineMaintenanceQueryReq.getScope())
|
||||
.engineCode(engineMaintenanceQueryReq.getEngineCode())
|
||||
.isActivate(engineMaintenanceQueryReq.getIsActivate())
|
||||
.status(engineMaintenanceQueryReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static EngineMaintenance saveBuild(EngineMaintenanceSaveReq engineMaintenanceSaveReq, Supplier<String> createBy){
|
||||
return EngineMaintenance.builder()
|
||||
.name(engineMaintenanceSaveReq.getName())
|
||||
.type(engineMaintenanceSaveReq.getType())
|
||||
.scope(engineMaintenanceSaveReq.getScope())
|
||||
.engineCode(engineMaintenanceSaveReq.getEngineCode())
|
||||
.isActivate(engineMaintenanceSaveReq.getIsActivate())
|
||||
.status(engineMaintenanceSaveReq.getStatus())
|
||||
.description(engineMaintenanceSaveReq.getDescription())
|
||||
.remark(engineMaintenanceSaveReq.getRemark())
|
||||
.createBy(createBy.get())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 修改构造器
|
||||
// */
|
||||
// public static EngineMaintenance editBuild(Long id, EngineMaintenanceEditReq engineMaintenanceEditReq, Supplier<String> updateBy){
|
||||
// return EngineMaintenance.builder()
|
||||
// .id(id)
|
||||
// .name(engineMaintenanceEditReq.getName())
|
||||
// .type(engineMaintenanceEditReq.getType())
|
||||
// .scope(engineMaintenanceEditReq.getScope())
|
||||
// .engineCode(engineMaintenanceEditReq.getEngineCode())
|
||||
// .isActivate(engineMaintenanceEditReq.getIsActivate())
|
||||
// .status(engineMaintenanceEditReq.getStatus())
|
||||
// .description(engineMaintenanceEditReq.getDescription())
|
||||
// .remark(engineMaintenanceEditReq.getRemark())
|
||||
// .updateBy(updateBy.get())
|
||||
// .updateTime(new Date())
|
||||
// .build();
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.req;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:qdm
|
||||
* @Package:com.muyu.req
|
||||
* @Project:cloud-etl-engine
|
||||
* @name:EngineMaintenanceEditReq
|
||||
* @Date:2024/8/22 16:02
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel(value = "EngineVersionSaveReq", description = "规则引擎版本")
|
||||
public class EngineMaintenanceEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 版本类名 */
|
||||
// @ApiModelProperty(name = "版本类名", value = "版本类名", required = true)
|
||||
private String versionClass;
|
||||
|
||||
/** 版本名称 */
|
||||
// @ApiModelProperty(name = "版本名称", value = "版本名称", required = true)
|
||||
private String name;
|
||||
|
||||
/** 版本编码 */
|
||||
// @ApiModelProperty(name = "版本编码", value = "版本编码", required = true)
|
||||
private String versionCode;
|
||||
|
||||
/** 是否激活 */
|
||||
// @ApiModelProperty(name = "是否激活", value = "是否激活", required = true)
|
||||
private String isActivate;
|
||||
|
||||
/** 版本状态 */
|
||||
// @ApiModelProperty(name = "版本状态", value = "版本状态", required = true)
|
||||
private Integer status;
|
||||
|
||||
/** 版本测试状态 */
|
||||
// @ApiModelProperty(name = "版本测试状态", value = "版本测试状态", required = true)
|
||||
private Integer testStatus;
|
||||
|
||||
/** 规则内容 */
|
||||
// @ApiModelProperty(name = "规则内容", value = "规则内容", required = true)
|
||||
private String ruleContent;
|
||||
|
||||
/** 引擎维护编号 */
|
||||
// @ApiModelProperty(name = "引擎维护编号", value = "引擎维护编号", required = true)
|
||||
private Long engineMaintenanceId;
|
||||
|
||||
/** 描述 */
|
||||
// @ApiModelProperty(name = "描述", value = "描述", required = true)
|
||||
private String description;
|
||||
|
||||
private String getType;
|
||||
|
||||
private String getScope;
|
||||
|
||||
private String getEngineCode;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.muyu.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:qdm
|
||||
* @Package:com.muyu.req
|
||||
* @Project:cloud-etl-engine
|
||||
* @name:EngineMaintenanceQueryReq
|
||||
* @Date:2024/8/22 16:00
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel(value = "EngineMaintenanceEditReq", description = "引擎维护")
|
||||
public class EngineMaintenanceQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 名称 */
|
||||
// @ApiModelProperty(name = "名称", value = "名称")
|
||||
private String name;
|
||||
|
||||
/** 类型 */
|
||||
// @ApiModelProperty(name = "类型", value = "类型")
|
||||
private Integer type;
|
||||
|
||||
/** 作用域 */
|
||||
// @ApiModelProperty(name = "作用域", value = "作用域")
|
||||
private Integer scope;
|
||||
|
||||
/** 引擎编码 */
|
||||
// @ApiModelProperty(name = "引擎编码", value = "引擎编码")
|
||||
private String engineCode;
|
||||
|
||||
/** 是否激活 */
|
||||
// @ApiModelProperty(name = "是否激活", value = "是否激活")
|
||||
private String isActivate;
|
||||
|
||||
/** 状态 */
|
||||
// @ApiModelProperty(name = "状态", value = "状态")
|
||||
private String status;
|
||||
|
||||
/** 描述 */
|
||||
// @ApiModelProperty(name = "描述", value = "描述")
|
||||
private String description;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.muyu.req;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:qdm
|
||||
* @Package:com.muyu.req
|
||||
* @Project:cloud-etl-engine
|
||||
* @name:EngineMaintenanceSaveReq
|
||||
* @Date:2024/8/22 16:02
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel(value = "EngineVersionSaveReq", description = "规则引擎版本")
|
||||
public class EngineMaintenanceSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 名称 */
|
||||
// @ApiModelProperty(name = "名称", value = "名称")
|
||||
private String name;
|
||||
|
||||
/** 类型 */
|
||||
// @ApiModelProperty(name = "类型", value = "类型")
|
||||
private Integer type;
|
||||
|
||||
/** 作用域 */
|
||||
// @ApiModelProperty(name = "作用域", value = "作用域")
|
||||
private Integer scope;
|
||||
|
||||
/** 引擎编码 */
|
||||
// @ApiModelProperty(name = "引擎编码", value = "引擎编码")
|
||||
private String engineCode;
|
||||
|
||||
/** 是否激活 */
|
||||
// @ApiModelProperty(name = "是否激活", value = "是否激活")
|
||||
private String isActivate;
|
||||
|
||||
/** 状态 */
|
||||
// @ApiModelProperty(name = "状态", value = "状态")
|
||||
private String status;
|
||||
|
||||
/** 描述 */
|
||||
// @ApiModelProperty(name = "描述", value = "描述")
|
||||
private String description;
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package com.muyu.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.domain.EngineMaintenance;
|
||||
import com.muyu.service.EngIneService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -18,14 +20,19 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/engine")
|
||||
public class EngIneController {
|
||||
public class EngIneController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
EngIneService engIneService;
|
||||
|
||||
/**
|
||||
* 规则引擎列表
|
||||
* @param engineMaintenance
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getMaintenanceList")
|
||||
public Result<List<EngineMaintenance>> getMaintenanceList() {
|
||||
List<EngineMaintenance> list = engineMaintenanceService.list();
|
||||
public Result<List<EngineMaintenance>> getMaintenanceList(EngineMaintenance engineMaintenance) {
|
||||
List<EngineMaintenance> list = engIneService.list(engineMaintenance);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.muyu.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.EngineMaintenance;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
|
@ -10,5 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
* @Date:2024/8/22 15:05
|
||||
*/
|
||||
@Mapper
|
||||
public interface EngineMapper {
|
||||
public interface EngineMapper extends BaseMapper<EngineMaintenance> {
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package com.muyu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.domain.EngineMaintenance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:qdm
|
||||
* @Package:com.muyu.service
|
||||
|
@ -7,5 +12,6 @@ package com.muyu.service;
|
|||
* @name:EngIneService
|
||||
* @Date:2024/8/22 15:37
|
||||
*/
|
||||
public interface EngIneService {
|
||||
public interface EngIneService extends IService<EngineMaintenance> {
|
||||
List<EngineMaintenance> list(EngineMaintenance engineMaintenance);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
package com.muyu.service.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.domain.EngineMaintenance;
|
||||
import com.muyu.mapper.EngineMapper;
|
||||
import com.muyu.service.EngIneService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:qdm
|
||||
* @Package:com.muyu.service.serviceImpl
|
||||
|
@ -13,8 +19,39 @@ import org.springframework.stereotype.Service;
|
|||
* @Date:2024/8/22 15:37
|
||||
*/
|
||||
@Service
|
||||
public class EngIneServiceImpl implements EngIneService {
|
||||
public class EngIneServiceImpl extends ServiceImpl<EngineMapper, EngineMaintenance> implements EngIneService {
|
||||
|
||||
@Autowired
|
||||
EngineMapper engineMapper;
|
||||
|
||||
@Override
|
||||
public List<EngineMaintenance> list(EngineMaintenance engineMaintenance) {
|
||||
LambdaQueryWrapper<EngineMaintenance> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (StringUtils.isNotNull(engineMaintenance.getName())) {
|
||||
queryWrapper.like(EngineMaintenance::getName, engineMaintenance.getName());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotNull(engineMaintenance.getType())) {
|
||||
queryWrapper.eq(EngineMaintenance::getType, engineMaintenance.getType());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotNull(engineMaintenance.getScope())) {
|
||||
queryWrapper.eq(EngineMaintenance::getScope, engineMaintenance.getScope());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotNull(engineMaintenance.getEngineCode())) {
|
||||
queryWrapper.eq(EngineMaintenance::getEngineCode, engineMaintenance.getEngineCode());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotNull(engineMaintenance.getIsActivate())) {
|
||||
queryWrapper.eq(EngineMaintenance::getIsActivate, engineMaintenance.getIsActivate());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotNull(engineMaintenance.getStatus())) {
|
||||
queryWrapper.eq(EngineMaintenance::getStatus, engineMaintenance.getStatus());
|
||||
}
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 10005
|
||||
port: 9008
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
|
|
Loading…
Reference in New Issue