初始化项目
This commit is contained in:
@@ -0,0 +1 @@
|
||||
druid.filters.DruidFilter=org.nl.config.DruidFilter
|
||||
@@ -11,8 +11,26 @@ erp:
|
||||
|
||||
#配置数据源
|
||||
spring:
|
||||
profiles:
|
||||
dev
|
||||
data:
|
||||
mongodb:
|
||||
host: 127.0.0.1
|
||||
port: 27017
|
||||
database: nlwms
|
||||
elasticsearch:
|
||||
repositories:
|
||||
enabled: true
|
||||
client:
|
||||
reactive:
|
||||
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
|
||||
# endpoints: 47.96.133.178:8200 #外网
|
||||
endpoints: http://47.96.133.178:8200 #外网
|
||||
elasticsearch:
|
||||
rest:
|
||||
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
|
||||
# uris: 47.96.133.178:8200 #外网
|
||||
uris: http://47.96.133.178:8200 #外网
|
||||
username: elastic
|
||||
password: 123456
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
@@ -56,21 +74,9 @@ spring:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 记录慢SQL
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-alagvslow: true
|
||||
data:
|
||||
mongodb:
|
||||
host: 127.0.0.1
|
||||
port: 27017
|
||||
database: nlwms
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
|
||||
@@ -149,29 +155,50 @@ file:
|
||||
maxSize: 100
|
||||
avatarMaxSize: 5
|
||||
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: random-128
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix:
|
||||
cookie:
|
||||
# 配置 Cookie 作用域:根据二级域名实现sso登入如lms.sso.com;acs.sso.com
|
||||
domain:
|
||||
|
||||
|
||||
jetcache:
|
||||
defaultCacheType: LOCAL
|
||||
statIntervalMinutes: 15
|
||||
areaInCacheName: false
|
||||
hiddenPackages: com.yb
|
||||
local:
|
||||
default:
|
||||
type: caffeine
|
||||
limit: 100
|
||||
keyConvertor: fastjson
|
||||
expireAfterWriteInMillis: 60000
|
||||
remote:
|
||||
default:
|
||||
type: redis.lettuce
|
||||
keyConvertor: fastjson
|
||||
valueEncoder: kryo
|
||||
valueDecoder: kryo
|
||||
poolConfig:
|
||||
minIdle: 5
|
||||
maxIdle: 200
|
||||
maxTotal: 1000
|
||||
uri:
|
||||
- redis://127.0.0.1:6379
|
||||
|
||||
#jetcache:
|
||||
# defaultCacheType: LOCAL
|
||||
# statIntervalMinutes: 15
|
||||
# areaInCacheName: false
|
||||
# hiddenPackages: com.yb
|
||||
# local:
|
||||
# default:
|
||||
# type: caffeine
|
||||
# limit: 100
|
||||
# keyConvertor: fastjson
|
||||
# expireAfterWriteInMillis: 60000
|
||||
# remote:
|
||||
# default:
|
||||
# type: redis.lettuce
|
||||
# keyConvertor: fastjson
|
||||
# valueEncoder: kryo
|
||||
# valueDecoder: kryo
|
||||
# poolConfig:
|
||||
# minIdle: 5
|
||||
# maxIdle: 200
|
||||
# maxTotal: 1000
|
||||
# uri:
|
||||
# - redis://127.0.0.1:6379
|
||||
es:
|
||||
index: mes_log
|
||||
|
||||
@@ -49,3 +49,47 @@ demo:
|
||||
server-url: https://www.demo-monitor.com
|
||||
username: MessiLoveRidingBike
|
||||
password: 123456
|
||||
security:
|
||||
# 排除路径
|
||||
excludes:
|
||||
# 认证
|
||||
- /auth/login
|
||||
- /auth/code
|
||||
- /auth/logout
|
||||
# swagger
|
||||
- /swagger-ui.html
|
||||
- /swagger-resources/**
|
||||
- /webjars/**
|
||||
- /file/**
|
||||
- /webSocket/**
|
||||
# 静态资源
|
||||
- /*.html
|
||||
- /**/*.html
|
||||
- /**/*.css
|
||||
- /**/*.js
|
||||
# swagger 文档配置
|
||||
- /favicon.ico
|
||||
- /*/api-docs
|
||||
- /*/api-docs/**
|
||||
# druid 监控配置
|
||||
- /druid/**
|
||||
# actuator 监控配置
|
||||
- /actuator
|
||||
- /actuator/**
|
||||
# 上传
|
||||
- /api/localStorage/pictures
|
||||
# 参数
|
||||
- /api/param/getValueByCode
|
||||
- /plumelog/**
|
||||
- /api/esLog/**
|
||||
- /api/users
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mapper-locations:
|
||||
- classpath:org.nl.**.mapper/*.xml
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: INPUT
|
||||
banner: false
|
||||
|
||||
@@ -17,6 +17,65 @@ https://juejin.cn/post/6844903775631572999
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!--引入默认的一些设置-->
|
||||
<!-- <include resource="log/AutoCreateInst.xml"/>-->
|
||||
<appender name="esLogAppender" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
|
||||
<url>http://47.96.133.178:8200/_bulk</url>
|
||||
<index>${esIndex}</index>
|
||||
<type>mes_log</type>
|
||||
<loggerName>es-logger</loggerName> <!-- optional -->
|
||||
<errorLoggerName>es-error-logger</errorLoggerName> <!-- optional -->
|
||||
<connectTimeout>30000</connectTimeout> <!-- optional (in ms, default 30000) -->
|
||||
<errorsToStderr>false</errorsToStderr> <!-- optional (default false) -->
|
||||
<includeCallerData>false</includeCallerData> <!-- optional (default false) -->
|
||||
<logsToStderr>false</logsToStderr> <!-- optional (default false) -->
|
||||
<maxQueueSize>104857600</maxQueueSize> <!-- optional (default 104857600) -->
|
||||
<maxRetries>3</maxRetries> <!-- optional (default 3) -->
|
||||
<readTimeout>30000</readTimeout> <!-- optional (in ms, default 30000) -->
|
||||
<sleepTime>250</sleepTime> <!-- optional (in ms, default 250) -->
|
||||
<rawJsonMessage>false</rawJsonMessage> <!-- optional (default false) -->
|
||||
<includeMdc>false</includeMdc> <!-- optional (default false) -->
|
||||
<maxMessageSize>20000</maxMessageSize> <!-- optional (default -1 -->
|
||||
<!-- <authentication class="com.internetitem.logback.elasticsearch.config.BasicAuthentication" /> <!– optional –>-->
|
||||
<properties>
|
||||
<property>
|
||||
<name>system</name>
|
||||
<value>lms</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>traceId</name>
|
||||
<value>%X{traceId}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>logLevel</name>
|
||||
<value>%level</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestMethod</name>
|
||||
<value>%X{requestMethod}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestTime</name>
|
||||
<value>%d{yyyy-MM-dd HH:mm:ss.SSS}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestIp</name>
|
||||
<value>%X{requestIp}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>thread</name>
|
||||
<value>%thread</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>logger</name>
|
||||
<value>%logger</value>
|
||||
</property>
|
||||
</properties>
|
||||
<headers>
|
||||
<header>
|
||||
<name>Content-Type</name>
|
||||
<value>application/json</value>
|
||||
</header>
|
||||
</headers>
|
||||
</appender>
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
@@ -56,8 +115,9 @@ https://juejin.cn/post/6844903775631572999
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<root level="debugger">
|
||||
<root level="debug">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<!-- <appender-ref ref="esLogAppender"/>-->
|
||||
</root>
|
||||
|
||||
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
||||
|
||||
@@ -3,7 +3,8 @@ package ${package}.rest;
|
||||
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package ${package}.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
<#if hasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package ${package}.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package ${package}.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
<#if queryHasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package ${package}.service.impl;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -14,10 +14,10 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
@@ -70,17 +70,17 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(${className}Dto dto) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
dto.set${pkChangeColName ? cap_first }(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
@@ -93,13 +93,13 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
${className}Dto entity = this.findById(dto.get${pkChangeColName ? cap_first }());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
@@ -109,9 +109,9 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(${pkColumnType}[] ids) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getNickName();
|
||||
String now = DateUtil.now();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
for (${pkColumnType} ${pkChangeColName}: ids) {
|
||||
@@ -120,9 +120,9 @@ public class ${className}ServiceImpl implements ${className}Service {
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
param.put("update_time", DateUtil.now());
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user