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
.classpath
.factorypath
/radar-kafka-demo/target/

View File

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

View File

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

View File

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

View File

@ -70,6 +70,12 @@ public class RulePO {
@Column(name = "RATE")
private Integer rate;
/**
* 最大值
*/
@Column(name = "MAX")
private Integer max;
/**
* 状态
*/
@ -279,6 +285,24 @@ public class RulePO {
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")
public class UserPO {
/**
* 主键
*/
@Id
@Column(name = "ID")
@GeneratedValue(generator = "JDBC")
@ -41,14 +44,18 @@ public class UserPO {
private Date updateTime;
/**
* @return ID
* 获取主键
*
* @return ID - 主键
*/
public Long getId() {
return id;
}
/**
* @param id
* 设置主键
*
* @param id 主键
*/
public void setId(Long 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.user=root
jdbc.password=456132

View File

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

View File

@ -16,6 +16,7 @@
<result column="OPERATOR" jdbcType="VARCHAR" property="operator" />
<result column="ABSTRACTION_NAME" jdbcType="VARCHAR" property="abstractionName" />
<result column="RATE" jdbcType="INTEGER" property="rate" />
<result column="MAX" jdbcType="INTEGER" property="max" />
<result column="STATUS" jdbcType="INTEGER" property="status" />
<result column="RULE_DEFINITION" jdbcType="VARCHAR" property="ruleDefinition" />
<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`;