From a3677a1b24a1e8a191c7172c34c70fcbb8d1e5ca Mon Sep 17 00:00:00 2001 From: yuan <1363654894@qq.com> Date: Tue, 10 Sep 2024 10:51:05 +0800 Subject: [PATCH] =?UTF-8?q?feat():=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/muyu/controller/RuleVersionController.java | 9 +++++++++ .../src/main/java/com/muyu/mapper/RuleVersionMapper.java | 3 +++ .../main/java/com/muyu/servier/RuleVersionService.java | 2 ++ .../com/muyu/servier/impl/RuleVersionServiceImpl.java | 5 +++++ .../src/main/resources/mapper/RuleVersionMapper.xml | 3 +++ 5 files changed, 22 insertions(+) diff --git a/cloud-rule-server/src/main/java/com/muyu/controller/RuleVersionController.java b/cloud-rule-server/src/main/java/com/muyu/controller/RuleVersionController.java index 421e9f6..70f4d4a 100644 --- a/cloud-rule-server/src/main/java/com/muyu/controller/RuleVersionController.java +++ b/cloud-rule-server/src/main/java/com/muyu/controller/RuleVersionController.java @@ -158,6 +158,7 @@ public class RuleVersionController { public Result compileLoad( @Validated @RequestBody ValueData valueData ) throws IOException { + ruleVersionService.selectAll(valueData.getRuleVersionType()); ruleVersionService.valueTest(valueData); return Result.success(null,"测试成功"); } @@ -166,6 +167,7 @@ public class RuleVersionController { @Operation(summary = "行数据测试",description = "行数据测试") public Result row( @Validated @RequestBody DataRecord dataRecord){ + ruleVersionService.selectAll(dataRecord.getRuleVersionType()); ruleVersionService.rowTest(dataRecord); return Result.success(null,"测试成功"); } @@ -174,6 +176,7 @@ public class RuleVersionController { @Operation(summary = "集数据测试",description = "数据测试") public Result set( @Validated @RequestBody DataSet dataSet){ + ruleVersionService.selectAll(dataSet.getRuleVersionType()); ruleVersionService.setTest(dataSet); return Result.success(null,"测试成功"); } @@ -194,4 +197,10 @@ public class RuleVersionController { return Result.success(selectTableShow,"查询成功"); } + @PostMapping("/selectVersion") + @Operation(summary = "查询所有版本") + public Result> selectVersion(){ + return Result.success(ruleVersionService.list()); + } + } diff --git a/cloud-rule-server/src/main/java/com/muyu/mapper/RuleVersionMapper.java b/cloud-rule-server/src/main/java/com/muyu/mapper/RuleVersionMapper.java index 1ba2475..aadd59d 100644 --- a/cloud-rule-server/src/main/java/com/muyu/mapper/RuleVersionMapper.java +++ b/cloud-rule-server/src/main/java/com/muyu/mapper/RuleVersionMapper.java @@ -2,6 +2,7 @@ package com.muyu.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.common.domain.RuleVersion; +import com.muyu.common.domain.ValueData; import com.muyu.common.domain.req.RuleVersionUpdReq; import com.muyu.common.domain.resp.RuleVersionResp; import org.apache.ibatis.annotations.Mapper; @@ -21,4 +22,6 @@ public interface RuleVersionMapper extends BaseMapper { List selectByIdList(@Param("ruleId") Long ruleId); void updateStatus(@Param("ruleVersionId") Long ruleVersionId, @Param("ruleVersionUpdReq") RuleVersionUpdReq ruleVersionUpdReq); + + RuleVersion selectAll(@Param("RuleVersionType") String RuleVersionType); } diff --git a/cloud-rule-server/src/main/java/com/muyu/servier/RuleVersionService.java b/cloud-rule-server/src/main/java/com/muyu/servier/RuleVersionService.java index da3a5c1..0f9052a 100644 --- a/cloud-rule-server/src/main/java/com/muyu/servier/RuleVersionService.java +++ b/cloud-rule-server/src/main/java/com/muyu/servier/RuleVersionService.java @@ -42,4 +42,6 @@ public interface RuleVersionService extends IService { List selectTableShow(String dataTableName); void uploadOSSJava(String ruleVersionType, String ruleVersionText); + + RuleVersion selectAll(String RuleVersionType); } diff --git a/cloud-rule-server/src/main/java/com/muyu/servier/impl/RuleVersionServiceImpl.java b/cloud-rule-server/src/main/java/com/muyu/servier/impl/RuleVersionServiceImpl.java index c5185ae..933add9 100644 --- a/cloud-rule-server/src/main/java/com/muyu/servier/impl/RuleVersionServiceImpl.java +++ b/cloud-rule-server/src/main/java/com/muyu/servier/impl/RuleVersionServiceImpl.java @@ -168,6 +168,11 @@ public class RuleVersionServiceImpl log.info(objectResult.getData()); } + @Override + public RuleVersion selectAll(String RuleVersionType) { + return ruleVersionMapper.selectAll(RuleVersionType); + } + @Override public void rowTest(DataRecord dataRecord) { diff --git a/cloud-rule-server/src/main/resources/mapper/RuleVersionMapper.xml b/cloud-rule-server/src/main/resources/mapper/RuleVersionMapper.xml index 60f9ae8..56bf1ef 100644 --- a/cloud-rule-server/src/main/resources/mapper/RuleVersionMapper.xml +++ b/cloud-rule-server/src/main/resources/mapper/RuleVersionMapper.xml @@ -34,4 +34,7 @@ WHERE rule_id = #{ruleId} +