mirror of
https://gitee.com/freshday/radar.git
synced 2026-03-22 04:37:16 +08:00
feats: rule score add max limit.
feihu wang
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,3 +21,4 @@ webapp/node_modules/
|
|||||||
.settings
|
.settings
|
||||||
.classpath
|
.classpath
|
||||||
.factorypath
|
.factorypath
|
||||||
|
/radar-kafka-demo/target/
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取状态
|
* 获取状态
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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
2
sql/radar-1.0.8.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `engine_rule`
|
||||||
|
ADD COLUMN `MAX` int(11) NOT NULL DEFAULT 0 COMMENT '最大得分值' AFTER `RATE`;
|
||||||
Reference in New Issue
Block a user