master
wangbing 4 years ago
parent 538b2711e8
commit 09caff8e8c

Binary file not shown.

@ -11,7 +11,7 @@ import xyz.wbsite.frame.base.BaseEntity;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2021-02-07 * @since 2021-02-08
*/ */
@ExcelSheet("配置预设") @ExcelSheet("配置预设")
public class Config extends BaseEntity { public class Config extends BaseEntity {
@ -28,6 +28,12 @@ public class Config extends BaseEntity {
@ExcelProperty("配置类型") @ExcelProperty("配置类型")
@ExcelNote("") @ExcelNote("")
private String confType; private String confType;
/**
* CONF_KEY -
*/
@ExcelProperty("配置属名")
@ExcelNote("")
private String confKey;
/** /**
* CONF_VALUE - * CONF_VALUE -
*/ */
@ -57,6 +63,14 @@ public class Config extends BaseEntity {
this.confType = confType; this.confType = confType;
} }
public String getConfKey() {
return this.confKey;
}
public void setConfKey(String confKey) {
this.confKey = confKey;
}
public String getConfValue() { public String getConfValue() {
return this.confValue; return this.confValue;
} }

@ -15,7 +15,7 @@ import xyz.wbsite.frame.base.Token;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2021-02-07 * @since 2021-02-08
*/ */
public interface ConfigManager { public interface ConfigManager {

@ -28,7 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2021-02-07 * @since 2021-02-08
*/ */
@Transactional @Transactional
@Service @Service

@ -12,7 +12,7 @@ import java.util.List;
* CONFIG - * CONFIG -
* *
* @author wangbing * @author wangbing
* @since 2021-02-07 * @since 2021-02-08
*/ */
@Mapper @Mapper
public interface ConfigMapper { public interface ConfigMapper {

@ -7,13 +7,14 @@
<sql id="table">"NA_CONFIG"</sql> <sql id="table">"NA_CONFIG"</sql>
<sql id="entityColumnList"> <sql id="entityColumnList">
"ID","CONF_NAME","CONF_TYPE","CONF_VALUE","CONF_NOTE","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME" "ID","CONF_NAME","CONF_TYPE","CONF_KEY","CONF_VALUE","CONF_NOTE","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME"
</sql> </sql>
<resultMap id="config" type="xyz.wbsite.module.admin.ent.Config"> <resultMap id="config" type="xyz.wbsite.module.admin.ent.Config">
<result column="ID" jdbcType="BIGINT" property="id"/> <result column="ID" jdbcType="BIGINT" property="id"/>
<result column="CONF_NAME" jdbcType="VARCHAR" property="confName"/> <result column="CONF_NAME" jdbcType="VARCHAR" property="confName"/>
<result column="CONF_TYPE" jdbcType="VARCHAR" property="confType"/> <result column="CONF_TYPE" jdbcType="VARCHAR" property="confType"/>
<result column="CONF_KEY" jdbcType="VARCHAR" property="confKey"/>
<result column="CONF_VALUE" jdbcType="VARCHAR" property="confValue"/> <result column="CONF_VALUE" jdbcType="VARCHAR" property="confValue"/>
<result column="CONF_NOTE" jdbcType="VARCHAR" property="confNote"/> <result column="CONF_NOTE" jdbcType="VARCHAR" property="confNote"/>
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/> <result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
@ -35,6 +36,7 @@
#{request.id}, #{request.id},
#{request.confName,jdbcType=VARCHAR}, #{request.confName,jdbcType=VARCHAR},
#{request.confType,jdbcType=VARCHAR}, #{request.confType,jdbcType=VARCHAR},
#{request.confKey,jdbcType=VARCHAR},
#{request.confValue,jdbcType=VARCHAR}, #{request.confValue,jdbcType=VARCHAR},
#{request.confNote,jdbcType=VARCHAR}, #{request.confNote,jdbcType=VARCHAR},
0, 0,
@ -57,6 +59,7 @@
#{item.id}, #{item.id},
#{item.confName,jdbcType=VARCHAR}, #{item.confName,jdbcType=VARCHAR},
#{item.confType,jdbcType=VARCHAR}, #{item.confType,jdbcType=VARCHAR},
#{item.confKey,jdbcType=VARCHAR},
#{item.confValue,jdbcType=VARCHAR}, #{item.confValue,jdbcType=VARCHAR},
#{item.confNote,jdbcType=VARCHAR}, #{item.confNote,jdbcType=VARCHAR},
0, 0,
@ -93,6 +96,7 @@
SET SET
CONF_NAME = #{request.confName,jdbcType=VARCHAR}, CONF_NAME = #{request.confName,jdbcType=VARCHAR},
CONF_TYPE = #{request.confType,jdbcType=VARCHAR}, CONF_TYPE = #{request.confType,jdbcType=VARCHAR},
CONF_KEY = #{request.confKey,jdbcType=VARCHAR},
CONF_VALUE = #{request.confValue,jdbcType=VARCHAR}, CONF_VALUE = #{request.confValue,jdbcType=VARCHAR},
CONF_NOTE = #{request.confNote,jdbcType=VARCHAR}, CONF_NOTE = #{request.confNote,jdbcType=VARCHAR},
"ROW_VERSION" = "ROW_VERSION" + 1, "ROW_VERSION" = "ROW_VERSION" + 1,
@ -115,6 +119,12 @@
<if test="request.confType != null and request.confType != ''"> <if test="request.confType != null and request.confType != ''">
AND "CONF_TYPE" = #{request.confType} AND "CONF_TYPE" = #{request.confType}
</if> </if>
<if test="request.confKey != null and request.confKey != ''">
AND "CONF_KEY" = #{request.confKey}
</if>
<if test="request.confValue != null and request.confValue != ''">
AND "CONF_VALUE" = #{request.confValue}
</if>
</select> </select>
<select id="find" resultMap="config"> <select id="find" resultMap="config">
@ -132,6 +142,15 @@
<if test="request.confType != null and request.confType != ''"> <if test="request.confType != null and request.confType != ''">
AND "CONF_TYPE" = #{request.confType} AND "CONF_TYPE" = #{request.confType}
</if> </if>
<if test="request.confKey != null and request.confKey != ''">
AND "CONF_KEY" = #{request.confKey}
</if>
<if test="request.confKeyLike != null and request.confKeyLike != ''">
AND "CONF_KEY" LIKE '%'||#{request.confKeyLike}||'%'
</if>
<if test="request.confValue != null and request.confValue != ''">
AND "CONF_VALUE" = #{request.confValue}
</if>
<if test="request.confValueLike != null and request.confValueLike != ''"> <if test="request.confValueLike != null and request.confValueLike != ''">
AND "CONF_VALUE" LIKE '%'||#{request.confValueLike}||'%' AND "CONF_VALUE" LIKE '%'||#{request.confValueLike}||'%'
</if> </if>

@ -11,7 +11,7 @@ import xyz.wbsite.frame.validation.Select;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2021-02-07 * @since 2021-02-08
*/ */
public class ConfigCreateRequest extends BaseRequest { public class ConfigCreateRequest extends BaseRequest {
@ -32,9 +32,17 @@ public class ConfigCreateRequest extends BaseRequest {
@Select({"HTTP", "SERVER", "LOCATION"}) @Select({"HTTP", "SERVER", "LOCATION"})
private String confType; private String confType;
/**
* .
*/
@NotBlank(message = "[confKey]配置属名不能为空")
@Length(min = 0, max = 50, message = "[confKey]配置属名长度不合法(0-50)")
private String confKey;
/** /**
* . * .
*/ */
@NotBlank(message = "[confValue]配置属值不能为空")
@Length(min = 0, max = 255, message = "[confValue]配置属值长度不合法(0-255)") @Length(min = 0, max = 255, message = "[confValue]配置属值长度不合法(0-255)")
private String confValue; private String confValue;
@ -60,6 +68,14 @@ public class ConfigCreateRequest extends BaseRequest {
this.confType = confType; this.confType = confType;
} }
public String getConfKey() {
return this.confKey;
}
public void setConfKey(String confKey) {
this.confKey = confKey;
}
public String getConfValue() { public String getConfValue() {
return this.confValue; return this.confValue;
} }

@ -9,7 +9,7 @@ import xyz.wbsite.frame.validation.Select;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2021-02-07 * @since 2021-02-08
*/ */
public class ConfigFindRequest extends BaseFindRequest { public class ConfigFindRequest extends BaseFindRequest {
@ -32,6 +32,21 @@ public class ConfigFindRequest extends BaseFindRequest {
@Select({"HTTP", "SERVER", "LOCATION"}) @Select({"HTTP", "SERVER", "LOCATION"})
private String confType; private String confType;
/**
* .
*/
private String confKey;
/**
* .
*/
private String confKeyLike;
/**
* .
*/
private String confValue;
/** /**
* . * .
*/ */
@ -76,6 +91,30 @@ public class ConfigFindRequest extends BaseFindRequest {
this.confType = confType; this.confType = confType;
} }
public String getConfKey() {
return this.confKey;
}
public void setConfKey(String confKey) {
this.confKey = confKey;
}
public String getConfKeyLike() {
return this.confKeyLike;
}
public void setConfKeyLike(String confKeyLike) {
this.confKeyLike = confKeyLike;
}
public String getConfValue() {
return this.confValue;
}
public void setConfValue(String confValue) {
this.confValue = confValue;
}
public String getConfValueLike() { public String getConfValueLike() {
return this.confValueLike; return this.confValueLike;
} }

@ -12,7 +12,7 @@ import xyz.wbsite.frame.validation.Select;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2021-02-07 * @since 2021-02-08
*/ */
public class ConfigUpdateRequest extends BaseUpdateRequest { public class ConfigUpdateRequest extends BaseUpdateRequest {
@ -39,9 +39,17 @@ public class ConfigUpdateRequest extends BaseUpdateRequest {
@Select({"HTTP", "SERVER", "LOCATION"}) @Select({"HTTP", "SERVER", "LOCATION"})
private String confType; private String confType;
/**
* .
*/
@NotBlank(message = "[confKey]配置属名不能为空")
@Length(min = 0, max = 50, message = "[confKey]配置属名长度不合法(0-50)")
private String confKey;
/** /**
* . * .
*/ */
@NotBlank(message = "[confValue]配置属值不能为空")
@Length(min = 0, max = 255, message = "[confValue]配置属值长度不合法(0-255)") @Length(min = 0, max = 255, message = "[confValue]配置属值长度不合法(0-255)")
private String confValue; private String confValue;
@ -75,6 +83,14 @@ public class ConfigUpdateRequest extends BaseUpdateRequest {
this.confType = confType; this.confType = confType;
} }
public String getConfKey() {
return this.confKey;
}
public void setConfKey(String confKey) {
this.confKey = confKey;
}
public String getConfValue() { public String getConfValue() {
return this.confValue; return this.confValue;
} }

@ -2,7 +2,7 @@
-- Table structure for SERVICES - 虚拟主机 -- Table structure for SERVICES - 虚拟主机
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_SERVICES ( CREATE TABLE IF NOT EXISTS NA_SERVICES (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,
@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS NA_SERVICES (
"DOMAIN" VARCHAR(50) NOT NULL, "DOMAIN" VARCHAR(50) NOT NULL,
"TYPE" VARCHAR(20) NOT NULL, "TYPE" VARCHAR(20) NOT NULL,
"PORT" MEDIUMINT NOT NULL, "PORT" MEDIUMINT NOT NULL,
"VALID" BOOLEAN NOT NULL, "VALID" BOOLEAN,
"FILTER" BOOLEAN NOT NULL, "FILTER" BOOLEAN NOT NULL,
"FILTER_CONF" VARCHAR(500), "FILTER_CONF" VARCHAR(500),
"ROW_VERSION" BIGINT NOT NULL, "ROW_VERSION" BIGINT NOT NULL,
@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS NA_SERVICES (
-- Table structure for LOCATIONS - 路径配置 -- Table structure for LOCATIONS - 路径配置
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_LOCATIONS ( CREATE TABLE IF NOT EXISTS NA_LOCATIONS (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,
@ -48,13 +48,14 @@ CREATE TABLE IF NOT EXISTS NA_LOCATIONS (
-- Table structure for CONFIG - 配置预设 -- Table structure for CONFIG - 配置预设
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_CONFIG ( CREATE TABLE IF NOT EXISTS NA_CONFIG (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,
"CONF_NAME" VARCHAR(50) NOT NULL, "CONF_NAME" VARCHAR(50) NOT NULL,
"CONF_TYPE" VARCHAR(50) NOT NULL, "CONF_TYPE" VARCHAR(50) NOT NULL,
"CONF_VALUE" VARCHAR(250), "CONF_KEY" VARCHAR(50) NOT NULL,
"CONF_VALUE" VARCHAR(250) NOT NULL,
"CONF_NOTE" VARCHAR(250), "CONF_NOTE" VARCHAR(250),
"ROW_VERSION" BIGINT NOT NULL, "ROW_VERSION" BIGINT NOT NULL,
"IS_DELETED" BOOLEAN NOT NULL, "IS_DELETED" BOOLEAN NOT NULL,
@ -68,13 +69,14 @@ CREATE TABLE IF NOT EXISTS NA_CONFIG (
-- Table structure for CONFIG_DATA - 配置数据 -- Table structure for CONFIG_DATA - 配置数据
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_CONFIG_DATA ( CREATE TABLE IF NOT EXISTS NA_CONFIG_DATA (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,
"TARGET_ID" BIGINT NOT NULL, "TARGET_ID" BIGINT NOT NULL,
"CONF_NAME" VARCHAR(50) NOT NULL, "CONF_NAME" VARCHAR(50) NOT NULL,
"CONF_TYPE" VARCHAR(50) NOT NULL, "CONF_TYPE" VARCHAR(50) NOT NULL,
"CONF_KEY" VARCHAR(50) NOT NULL,
"CONF_VALUE" VARCHAR(250) NOT NULL, "CONF_VALUE" VARCHAR(250) NOT NULL,
"CONF_NOTE" VARCHAR(250), "CONF_NOTE" VARCHAR(250),
"ROW_VERSION" BIGINT NOT NULL, "ROW_VERSION" BIGINT NOT NULL,

@ -2,13 +2,14 @@
-- Table structure for CONFIG - 配置预设 -- Table structure for CONFIG - 配置预设
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_CONFIG ( CREATE TABLE IF NOT EXISTS NA_CONFIG (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,
"CONF_NAME" VARCHAR(50) NOT NULL, "CONF_NAME" VARCHAR(50) NOT NULL,
"CONF_TYPE" VARCHAR(50) NOT NULL, "CONF_TYPE" VARCHAR(50) NOT NULL,
"CONF_VALUE" VARCHAR(250), "CONF_KEY" VARCHAR(50) NOT NULL,
"CONF_VALUE" VARCHAR(250) NOT NULL,
"CONF_NOTE" VARCHAR(250), "CONF_NOTE" VARCHAR(250),
"ROW_VERSION" BIGINT NOT NULL, "ROW_VERSION" BIGINT NOT NULL,
"IS_DELETED" BOOLEAN NOT NULL, "IS_DELETED" BOOLEAN NOT NULL,

@ -2,13 +2,14 @@
-- Table structure for CONFIG_DATA - 配置数据 -- Table structure for CONFIG_DATA - 配置数据
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_CONFIG_DATA ( CREATE TABLE IF NOT EXISTS NA_CONFIG_DATA (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,
"TARGET_ID" BIGINT NOT NULL, "TARGET_ID" BIGINT NOT NULL,
"CONF_NAME" VARCHAR(50) NOT NULL, "CONF_NAME" VARCHAR(50) NOT NULL,
"CONF_TYPE" VARCHAR(50) NOT NULL, "CONF_TYPE" VARCHAR(50) NOT NULL,
"CONF_KEY" VARCHAR(50) NOT NULL,
"CONF_VALUE" VARCHAR(250) NOT NULL, "CONF_VALUE" VARCHAR(250) NOT NULL,
"CONF_NOTE" VARCHAR(250), "CONF_NOTE" VARCHAR(250),
"ROW_VERSION" BIGINT NOT NULL, "ROW_VERSION" BIGINT NOT NULL,

@ -2,7 +2,7 @@
-- Table structure for LOCATIONS - 路径配置 -- Table structure for LOCATIONS - 路径配置
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_LOCATIONS ( CREATE TABLE IF NOT EXISTS NA_LOCATIONS (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,

@ -2,7 +2,7 @@
-- Table structure for SERVICES - 虚拟主机 -- Table structure for SERVICES - 虚拟主机
-- Target : SQLite -- Target : SQLite
-- Author : wangbing -- Author : wangbing
-- Date: : 2021-02-07 -- Date: : 2021-02-08
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS NA_SERVICES ( CREATE TABLE IF NOT EXISTS NA_SERVICES (
"ID" BIGINT PRIMARY KEY NOT NULL, "ID" BIGINT PRIMARY KEY NOT NULL,
@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS NA_SERVICES (
"DOMAIN" VARCHAR(50) NOT NULL, "DOMAIN" VARCHAR(50) NOT NULL,
"TYPE" VARCHAR(20) NOT NULL, "TYPE" VARCHAR(20) NOT NULL,
"PORT" MEDIUMINT NOT NULL, "PORT" MEDIUMINT NOT NULL,
"VALID" BOOLEAN NOT NULL, "VALID" BOOLEAN,
"FILTER" BOOLEAN NOT NULL, "FILTER" BOOLEAN NOT NULL,
"FILTER_CONF" VARCHAR(500), "FILTER_CONF" VARCHAR(500),
"ROW_VERSION" BIGINT NOT NULL, "ROW_VERSION" BIGINT NOT NULL,

@ -3,7 +3,7 @@
<modules> <modules>
<module name="admin" needGenerate="true" note="配置模块" prefix="NA_"> <module name="admin" needGenerate="true" note="配置模块" prefix="NA_">
<table ajax="true" api="false" create="true" delete="true" find="true" get="false" html="true" methods="[]" msvr="false" pageAdd="true" pageDel="true" pageExp="true" pageImp="true" search="false" sys="true" tableComment="虚拟主机" tableName="SERVICES" update="true"> <table ajax="true" api="false" create="true" delete="true" find="true" get="false" html="true" methods="[]" msvr="false" pageAdd="true" pageDel="true" pageExp="true" pageImp="true" search="false" sys="true" tableComment="虚拟主机" tableName="SERVICES" update="true">
<field defaultValue="" fieldComment="主键" fieldLength="0" fieldName="ID" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="true" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="主键" fieldLength="19" fieldName="ID" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="true" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="NULL" fieldComment="主机标题" fieldLength="50" fieldName="TITLE" fieldType="String_var50" isLike="true" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="true"/> <field defaultValue="NULL" fieldComment="主机标题" fieldLength="50" fieldName="TITLE" fieldType="String_var50" isLike="true" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="true"/>
<field defaultValue="NULL" fieldComment="主机域名" fieldLength="50" fieldName="DOMAIN" fieldType="String_var50" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="true"/> <field defaultValue="NULL" fieldComment="主机域名" fieldLength="50" fieldName="DOMAIN" fieldType="String_var50" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="true"/>
<field defaultValue="NULL" fieldComment="服务类型" fieldLength="20" fieldName="TYPE" fieldType="Select" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"> <field defaultValue="NULL" fieldComment="服务类型" fieldLength="20" fieldName="TYPE" fieldType="Select" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false">
@ -17,9 +17,9 @@
<field defaultValue="NULL" fieldComment="是否启用" fieldLength="0" fieldName="VALID" fieldType="Boolean" isLike="false" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="是否启用" fieldLength="0" fieldName="VALID" fieldType="Boolean" isLike="false" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="启用过滤" fieldLength="0" fieldName="FILTER" fieldType="Boolean" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="启用过滤" fieldLength="0" fieldName="FILTER" fieldType="Boolean" isLike="false" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="过滤配置" fieldLength="500" fieldName="FILTER_CONF" fieldType="String_var500" isLike="false" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="过滤配置" fieldLength="500" fieldName="FILTER_CONF" fieldType="String_var500" isLike="false" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="行版本" fieldLength="19" fieldName="ROW_VERSION" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="0" fieldComment="是否已删除" fieldLength="1" fieldName="IS_DELETED" fieldType="Boolean" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="" fieldComment="创建用户" fieldLength="0" fieldName="CREATE_BY" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="创建用户" fieldLength="19" fieldName="CREATE_BY" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="NULL" fieldComment="创建时间" fieldLength="0" fieldName="CREATE_TIME" fieldType="Date" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="NULL" fieldComment="创建时间" fieldLength="0" fieldName="CREATE_TIME" fieldType="Date" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="" fieldComment="最后更新用户" fieldLength="19" fieldName="LAST_UPDATE_BY" fieldType="Long" isLike="false" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="最后更新用户" fieldLength="19" fieldName="LAST_UPDATE_BY" fieldType="Long" isLike="false" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="" fieldComment="最后更新时间" fieldLength="0" fieldName="LAST_UPDATE_TIME" fieldType="Date" isLike="false" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="最后更新时间" fieldLength="0" fieldName="LAST_UPDATE_TIME" fieldType="Date" isLike="false" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
@ -48,7 +48,8 @@
<selectItem label="主机配置" value="SERVER"/> <selectItem label="主机配置" value="SERVER"/>
<selectItem label="路径配置" value="LOCATION"/> <selectItem label="路径配置" value="LOCATION"/>
</field> </field>
<field defaultValue="NULL" fieldComment="配置属值" fieldLength="255" fieldName="CONF_VALUE" fieldType="String_var255" isLike="true" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="配置属名" fieldLength="50" fieldName="CONF_KEY" fieldType="String_var50" isLike="true" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="配置属值" fieldLength="255" fieldName="CONF_VALUE" fieldType="String_var255" isLike="true" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="配置备注" fieldLength="255" fieldName="CONF_NOTE" fieldType="String_var255" isLike="true" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="配置备注" fieldLength="255" fieldName="CONF_NOTE" fieldType="String_var255" isLike="true" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
<field defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>
@ -66,6 +67,7 @@
<selectItem label="主机配置" value="SERVER"/> <selectItem label="主机配置" value="SERVER"/>
<selectItem label="路径配置" value="LOCATION"/> <selectItem label="路径配置" value="LOCATION"/>
</field> </field>
<field defaultValue="NULL" fieldComment="配置属名" fieldLength="50" fieldName="CONF_KEY" fieldType="String_var50" isLike="true" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="配置属值" fieldLength="255" fieldName="CONF_VALUE" fieldType="String_var255" isLike="true" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="配置属值" fieldLength="255" fieldName="CONF_VALUE" fieldType="String_var255" isLike="true" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="NULL" fieldComment="配置备注" fieldLength="255" fieldName="CONF_NOTE" fieldType="String_var255" isLike="true" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/> <field defaultValue="NULL" fieldComment="配置备注" fieldLength="255" fieldName="CONF_NOTE" fieldType="String_var255" isLike="true" isMust="false" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="false" isUnique="false"/>
<field defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/> <field defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isLike="false" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false" isSystem="true" isUnique="false"/>

@ -13,6 +13,15 @@
<el-option key="SERVER" label="主机配置" value="SERVER"></el-option> <el-option key="SERVER" label="主机配置" value="SERVER"></el-option>
<el-option key="LOCATION" label="路径配置" value="LOCATION"></el-option> <el-option key="LOCATION" label="路径配置" value="LOCATION"></el-option>
</el-select> </el-select>
</el-form-item>
<el-form-item label="配置属名" prop="confKey" size="mini">
<el-input v-model="vm.confKey" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置属名"></el-input>
</el-form-item>
<el-form-item label="配置属名" prop="confKeyLike" size="mini">
<el-input v-model="vm.confKeyLike" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置属名模糊查询"></el-input>
</el-form-item>
<el-form-item label="配置属值" prop="confValue" size="mini">
<el-input v-model="vm.confValue" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置属值"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="配置属值" prop="confValueLike" size="mini"> <el-form-item label="配置属值" prop="confValueLike" size="mini">
<el-input v-model="vm.confValueLike" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置属值模糊查询"></el-input> <el-input v-model="vm.confValueLike" @keyup.enter.native="onSearch" clearable size="mini" placeholder="请输入配置属值模糊查询"></el-input>
@ -107,6 +116,13 @@
<el-tag size="mini" v-if="scope.row.confType == 'LOCATION'">路径配置</el-tag> <el-tag size="mini" v-if="scope.row.confType == 'LOCATION'">路径配置</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
min-width="180"
prop="confKey"
label="配置属名"
show-overflow-tooltip>
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
min-width="180" min-width="180"
@ -186,6 +202,9 @@
<el-option key="LOCATION" label="路径配置" value="LOCATION"></el-option> <el-option key="LOCATION" label="路径配置" value="LOCATION"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="配置属名" prop="confKey" size="mini">
<el-input v-model="form.confKey" clearable size="mini" placeholder="请输入配置属名" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="配置属值" prop="confValue" size="mini" class="full"> <el-form-item label="配置属值" prop="confValue" size="mini" class="full">
<el-input v-model="form.confValue" <el-input v-model="form.confValue"
rows="7" rows="7"
@ -225,6 +244,9 @@
confName: null, confName: null,
confNameLike: null, confNameLike: null,
confType: null, confType: null,
confKey: null,
confKeyLike: null,
confValue: null,
confValueLike: null, confValueLike: null,
confNoteLike: null, confNoteLike: null,
startDate: null, startDate: null,
@ -241,6 +263,7 @@
id: null, id: null,
confName: null, confName: null,
confType: null, confType: null,
confKey: null,
confValue: null, confValue: null,
confNote: null, confNote: null,
rowVersion: null rowVersion: null
@ -253,7 +276,12 @@
confType: [ confType: [
{required: true, message: '配置类型不能为空', trigger: 'blur'}, {required: true, message: '配置类型不能为空', trigger: 'blur'},
], ],
confKey: [
{required: true, message: '配置属名不能为空', trigger: 'blur'},
{min: 1, max: 50, message: '配置属名长度在 1 到 50 个字符', trigger: 'blur'}
],
confValue: [ confValue: [
{required: true, message: '配置属值不能为空', trigger: 'blur'},
{min: 1, max: 255, message: '配置属值长度在 1 到 255 个字符', trigger: 'blur'} {min: 1, max: 255, message: '配置属值长度在 1 到 255 个字符', trigger: 'blur'}
], ],
confNote: [ confNote: [
@ -268,6 +296,7 @@
this.form.id = ""; this.form.id = "";
this.form.confName = ""; this.form.confName = "";
this.form.confType = ""; this.form.confType = "";
this.form.confKey = "";
this.form.confValue = ""; this.form.confValue = "";
this.form.confNote = ""; this.form.confNote = "";
}, },
@ -277,6 +306,7 @@
this.form.id = item.id; this.form.id = item.id;
this.form.confName = item.confName; this.form.confName = item.confName;
this.form.confType = item.confType; this.form.confType = item.confType;
this.form.confKey = item.confKey;
this.form.confValue = item.confValue; this.form.confValue = item.confValue;
this.form.confNote = item.confNote; this.form.confNote = item.confNote;
this.form.rowVersion = item.rowVersion; this.form.rowVersion = item.rowVersion;

@ -0,0 +1,48 @@
package xyz.wbsite;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import xyz.wbsite.frame.base.Token;
import xyz.wbsite.module.admin.mgr.ConfigManager;
import xyz.wbsite.module.admin.req.ConfigCreateRequest;
import xyz.wbsite.module.admin.rsp.ConfigCreateResponse;
@RunWith(SpringRunner.class)
@SpringBootTest
@Transactional
public class DataInit {
@Autowired
private Token token;
@Autowired
private ConfigManager configManager;
@Test
@Rollback(false)
public void init() {
create("记录客户端的IP地址","LOCATION","$remote_addr","","","");
create("记录客户端的IP地址","LOCATION","$remote_addr","","","");
create("记录客户端的IP地址","LOCATION","$http_x_forwarded_for","","","");
create("记录客户端用户名称","LOCATION","$remote_user","","","");
create("记录访问时间与时区","LOCATION","$time_local","","","");
create("记录请求的url与http协议","LOCATION","$request","","","");
create("用来记录请求状态;成功是200","LOCATION","$status","","","");
create("从哪个链接访问过来","LOCATION","$http_referer","","","");
create("客户端浏览器信息","LOCATION","$http_user_agent","","","");
}
private void create(String... data) {
ConfigCreateRequest request = new ConfigCreateRequest();
request.setConfName(data[0]);
request.setConfType(data[1]);
request.setConfKey(data[2]);
request.setConfValue(data[3]);
request.setConfNote(data[4]);
ConfigCreateResponse configCreateResponse = configManager.create(request, token);
}
}
Loading…
Cancel
Save

Powered by TurnKey Linux.