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

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

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

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

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

@ -11,7 +11,7 @@ import xyz.wbsite.frame.validation.Select;
*
* @author wangbing
* @version 0.0.1
* @since 2021-02-07
* @since 2021-02-08
*/
public class ConfigCreateRequest extends BaseRequest {
@ -32,9 +32,17 @@ public class ConfigCreateRequest extends BaseRequest {
@Select({"HTTP", "SERVER", "LOCATION"})
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)")
private String confValue;
@ -60,6 +68,14 @@ public class ConfigCreateRequest extends BaseRequest {
this.confType = confType;
}
public String getConfKey() {
return this.confKey;
}
public void setConfKey(String confKey) {
this.confKey = confKey;
}
public String getConfValue() {
return this.confValue;
}

@ -9,7 +9,7 @@ import xyz.wbsite.frame.validation.Select;
*
* @author wangbing
* @version 0.0.1
* @since 2021-02-07
* @since 2021-02-08
*/
public class ConfigFindRequest extends BaseFindRequest {
@ -32,6 +32,21 @@ public class ConfigFindRequest extends BaseFindRequest {
@Select({"HTTP", "SERVER", "LOCATION"})
private String confType;
/**
* .
*/
private String confKey;
/**
* .
*/
private String confKeyLike;
/**
* .
*/
private String confValue;
/**
* .
*/
@ -76,6 +91,30 @@ public class ConfigFindRequest extends BaseFindRequest {
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() {
return this.confValueLike;
}

@ -12,7 +12,7 @@ import xyz.wbsite.frame.validation.Select;
*
* @author wangbing
* @version 0.0.1
* @since 2021-02-07
* @since 2021-02-08
*/
public class ConfigUpdateRequest extends BaseUpdateRequest {
@ -39,9 +39,17 @@ public class ConfigUpdateRequest extends BaseUpdateRequest {
@Select({"HTTP", "SERVER", "LOCATION"})
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)")
private String confValue;
@ -75,6 +83,14 @@ public class ConfigUpdateRequest extends BaseUpdateRequest {
this.confType = confType;
}
public String getConfKey() {
return this.confKey;
}
public void setConfKey(String confKey) {
this.confKey = confKey;
}
public String getConfValue() {
return this.confValue;
}

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

@ -2,13 +2,14 @@
-- Table structure for CONFIG - 配置预设
-- Target : SQLite
-- Author : wangbing
-- Date: : 2021-02-07
-- Date: : 2021-02-08
-- ----------------------------
CREATE TABLE IF NOT EXISTS NA_CONFIG (
"ID" BIGINT PRIMARY KEY NOT NULL,
"CONF_NAME" 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),
"ROW_VERSION" BIGINT NOT NULL,
"IS_DELETED" BOOLEAN NOT NULL,

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

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

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

@ -3,7 +3,7 @@
<modules>
<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">
<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="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">
@ -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="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="" 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="" 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="ROW_VERSION" fieldType="Long" 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="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="" 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"/>
@ -48,7 +48,8 @@
<selectItem label="主机配置" value="SERVER"/>
<selectItem label="路径配置" value="LOCATION"/>
</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="" 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"/>
@ -66,6 +67,7 @@
<selectItem label="主机配置" value="SERVER"/>
<selectItem label="路径配置" value="LOCATION"/>
</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_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"/>

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