11111
parent
b64875c107
commit
95cf10d1e2
|
@ -2,6 +2,7 @@ package com.muyu.rule.common.domain;
|
|||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.rule.common.domain.req.VersionAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -48,7 +49,32 @@ public class RuleEngineVersion extends BaseEntity {
|
|||
*/
|
||||
private String versionDesc;
|
||||
|
||||
/**
|
||||
* 状态 0正常 1.停用
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 引擎类
|
||||
*/
|
||||
|
||||
private String versionClazz;
|
||||
|
||||
|
||||
|
||||
public static RuleEngineVersion addBuild(VersionAddReq versionAddReq){
|
||||
|
||||
return RuleEngineVersion.builder()
|
||||
.ruleId(versionAddReq.getRuleId())
|
||||
.open(versionAddReq.getOpen())
|
||||
.status(versionAddReq.getStatus())
|
||||
.versionName(versionAddReq.getVersionName())
|
||||
.versionCode(versionAddReq.getVersionCode())
|
||||
.versionClazz(versionAddReq.getVersionClazz())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.muyu.rule.common.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Package:com.muyu.rule.common.domain.req
|
||||
* @Project:cloud-etl-rule
|
||||
* @name:VersionAddReq
|
||||
* @Date:2024/8/26 9:47
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "客户端版本添加请求对象")
|
||||
public class VersionAddReq {
|
||||
|
||||
|
||||
/**
|
||||
* 版本名称
|
||||
*/
|
||||
private String versionName;
|
||||
/**
|
||||
* 版本编码
|
||||
*/
|
||||
private String versionCode;
|
||||
/**
|
||||
* 规则引擎外键
|
||||
*/
|
||||
private String ruleId;
|
||||
/**
|
||||
* 是否开启规则引擎
|
||||
*/
|
||||
private String open;
|
||||
/**
|
||||
* 版本描述
|
||||
*/
|
||||
private String versionDesc;
|
||||
|
||||
/**
|
||||
* 状态 0正常 1.停用
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 引擎类
|
||||
*/
|
||||
|
||||
private String versionClazz;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,8 +1,17 @@
|
|||
package com.muyu.rule.server.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.rule.common.domain.RuleEngineVersion;
|
||||
import com.muyu.rule.common.domain.req.VersionAddReq;
|
||||
import com.muyu.rule.server.service.RuleEngineVersionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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;
|
||||
|
||||
|
@ -20,8 +29,23 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@Tag(name = "规则版本控制层", description = "规则版本管理,查看等相关操作")
|
||||
public class RuleEngineVersionController {
|
||||
|
||||
@Autowired
|
||||
private RuleEngineVersionService versionService;
|
||||
|
||||
/**
|
||||
* 添加规则引擎版本
|
||||
* @param versionAddReq 引擎版本添加实体类
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/insertVersion")
|
||||
@Operation(summary = "规则引擎版本",description = "通过传入版本添加的实体类,进行规则引擎的版本添加")
|
||||
public Result insertVersion(@Validated @RequestBody VersionAddReq versionAddReq){
|
||||
|
||||
versionService.save(RuleEngineVersion.addBuild(versionAddReq));
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -14,8 +14,15 @@ import java.util.List;
|
|||
*/
|
||||
public interface RuleEngineVersionService extends IService<RuleEngineVersion> {
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询规则引擎和对应的规则引擎版本
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<RuleEngineVersion> selectRuleEngineVersion(Long id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.rule.common.domain.RuleEngineVersion;
|
||||
import com.muyu.rule.server.mapper.RuleEngineVersionMapper;
|
||||
import com.muyu.rule.server.service.RuleEngineVersionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -18,7 +19,7 @@ import java.util.List;
|
|||
* @Date:2024/8/25 14:17
|
||||
*/
|
||||
@Service
|
||||
public class RuleEngineServiceImpl extends ServiceImpl<BaseMapper<RuleEngineVersion>,RuleEngineVersion> implements RuleEngineVersionService {
|
||||
public class RuleEngineServiceImpl extends ServiceImpl<RuleEngineVersionMapper,RuleEngineVersion> implements RuleEngineVersionService {
|
||||
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue