feats: rule score add max limit.

feihu wang
This commit is contained in:
feihu.wang
2021-03-05 16:18:57 +08:00
parent 6196fadb56
commit 6f21b532a7
10 changed files with 64 additions and 9 deletions

1
.gitignore vendored
View File

@@ -21,3 +21,4 @@ webapp/node_modules/
.settings .settings
.classpath .classpath
.factorypath .factorypath
/radar-kafka-demo/target/

View File

@@ -46,6 +46,11 @@ public class RuleVO implements Serializable{
private Integer rate; private Integer rate;
/**
* 最大得分值.
*/
private Integer max;
@JsonProperty @JsonProperty
private JsonNode ruleDefinition; private JsonNode ruleDefinition;
@@ -197,6 +202,12 @@ public class RuleVO implements Serializable{
public void setLabel(String label) { public void setLabel(String label) {
this.label = label; this.label = label;
} }
public Integer getMax() {
return max;
}
public void setMax(Integer max) {
this.max = max;
}
} }

View File

@@ -44,7 +44,7 @@
<plugin> <plugin>
<groupId>org.mybatis.generator</groupId> <groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId> <artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.6</version> <version>1.3.7</version>
<configuration> <configuration>
<configurationFile> <configurationFile>
${basedir}/src/main/resources/generator/generatorConfig.xml ${basedir}/src/main/resources/generator/generatorConfig.xml

View File

@@ -49,6 +49,9 @@ public class PreItemPO {
@Column(name = "PLUGIN") @Column(name = "PLUGIN")
private String plugin; private String plugin;
/**
* 响应字段配置信息
*/
@Column(name = "CONFIG_JSON") @Column(name = "CONFIG_JSON")
private String configJson; private String configJson;
@@ -204,14 +207,18 @@ public class PreItemPO {
} }
/** /**
* @return CONFIG_JSON * 获取响应字段配置信息
*
* @return CONFIG_JSON - 响应字段配置信息
*/ */
public String getConfigJson() { public String getConfigJson() {
return configJson; return configJson;
} }
/** /**
* @param configJson * 设置响应字段配置信息
*
* @param configJson 响应字段配置信息
*/ */
public void setConfigJson(String configJson) { public void setConfigJson(String configJson) {
this.configJson = configJson; this.configJson = configJson;

View File

@@ -70,6 +70,12 @@ public class RulePO {
@Column(name = "RATE") @Column(name = "RATE")
private Integer rate; private Integer rate;
/**
* 最大值
*/
@Column(name = "MAX")
private Integer max;
/** /**
* 状态 * 状态
*/ */
@@ -279,6 +285,24 @@ public class RulePO {
this.rate = rate; this.rate = rate;
} }
/**
* 获取最大值
*
* @return MAX - 最大值
*/
public Integer getMax() {
return max;
}
/**
* 设置最大值
*
* @param max 最大值
*/
public void setMax(Integer max) {
this.max = max;
}
/** /**
* 获取状态 * 获取状态
* *

View File

@@ -5,6 +5,9 @@ import javax.persistence.*;
@Table(name = "users") @Table(name = "users")
public class UserPO { public class UserPO {
/**
* 主键
*/
@Id @Id
@Column(name = "ID") @Column(name = "ID")
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@@ -41,14 +44,18 @@ public class UserPO {
private Date updateTime; private Date updateTime;
/** /**
* @return ID * 获取主键
*
* @return ID - 主键
*/ */
public Long getId() { public Long getId() {
return id; return id;
} }
/** /**
* @param id * 设置主键
*
* @param id 主键
*/ */
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;

View File

@@ -1,4 +1,4 @@
jdbc.driverClass=com.mysql.jdbc.Driver jdbc.driverClass=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/radar?characterEncoding=UTF-8&useSSL=false jdbc.url=jdbc:mysql://localhost:3306/radar?characterEncoding=UTF-8&useSSL=false
jdbc.user=root jdbc.user=root
jdbc.password=456132 jdbc.password=456132

View File

@@ -25,6 +25,8 @@
connectionURL="${jdbc.url}" connectionURL="${jdbc.url}"
userId="${jdbc.user}" userId="${jdbc.user}"
password="${jdbc.password}"> password="${jdbc.password}">
<property name="serverTimezone" value="Asia/Shanghai"/>
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection> </jdbcConnection>
<javaModelGenerator targetPackage="com.pgmmers.radar.model" <javaModelGenerator targetPackage="com.pgmmers.radar.model"
@@ -38,7 +40,7 @@
type="XMLMAPPER"/> type="XMLMAPPER"/>
<table tableName="USERS" domainObjectName="User"> <table tableName="radar.USERS" domainObjectName="User">
<generatedKey column="ID" sqlStatement="JDBC"/> <generatedKey column="ID" sqlStatement="JDBC"/>
</table> </table>

View File

@@ -16,6 +16,7 @@
<result column="OPERATOR" jdbcType="VARCHAR" property="operator" /> <result column="OPERATOR" jdbcType="VARCHAR" property="operator" />
<result column="ABSTRACTION_NAME" jdbcType="VARCHAR" property="abstractionName" /> <result column="ABSTRACTION_NAME" jdbcType="VARCHAR" property="abstractionName" />
<result column="RATE" jdbcType="INTEGER" property="rate" /> <result column="RATE" jdbcType="INTEGER" property="rate" />
<result column="MAX" jdbcType="INTEGER" property="max" />
<result column="STATUS" jdbcType="INTEGER" property="status" /> <result column="STATUS" jdbcType="INTEGER" property="status" />
<result column="RULE_DEFINITION" jdbcType="VARCHAR" property="ruleDefinition" /> <result column="RULE_DEFINITION" jdbcType="VARCHAR" property="ruleDefinition" />
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" /> <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />

2
sql/radar-1.0.8.sql Normal file
View File

@@ -0,0 +1,2 @@
ALTER TABLE `engine_rule`
ADD COLUMN `MAX` int(11) NOT NULL DEFAULT 0 COMMENT '最大得分值' AFTER `RATE`;