Browse Source

rev:代码更新

master
管理员 6 months ago
parent
commit
2cc9059f2c
  1. 2
      lms/nladmin-system/README.md
  2. 2
      lms/nladmin-system/nlsso-server/pom.xml
  3. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java
  4. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java
  5. 4
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml
  6. 32
      lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml
  7. 4
      lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml

2
lms/nladmin-system/README.md

@ -1,4 +1,4 @@
# 荣力-马钢 # 上电科项目
```java ```java
├── cockpit ├── cockpit

2
lms/nladmin-system/nlsso-server/pom.xml

@ -43,7 +43,7 @@
<dependency> <dependency>
<groupId>org.dromara.dynamictp</groupId> <groupId>org.dromara.dynamictp</groupId>
<artifactId>dynamic-tp-spring-boot-starter-adapter-webserver</artifactId> <artifactId>dynamic-tp-spring-boot-starter-adapter-webserver</artifactId>
<version>1.1.6.1</version> <version>1.1.7</version>
</dependency> </dependency>
<!-- 日志链路追踪 https://tlog.yomahub.com/pages/f62a84/#%E5%90%8C%E6%AD%A5%E6%97%A5%E5%BF%97--> <!-- 日志链路追踪 https://tlog.yomahub.com/pages/f62a84/#%E5%90%8C%E6%AD%A5%E6%97%A5%E5%BF%97-->

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java

@ -58,11 +58,8 @@ public class AppRun {
* @return / * @return /
*/ */
@GetMapping("/") @GetMapping("/")
@Limit(period = 2, count = 1)
@SaIgnore @SaIgnore
public String index() { public String index() {
MDC.put("system", "SSS");
log.info("sssss");
return "Backend service started successfully"; return "Backend service started successfully";
} }
} }

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java

@ -1,12 +1,13 @@
package org.nl.system.service.quartz.utils; package org.nl.system.service.quartz.utils;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.yomahub.tlog.core.thread.TLogInheritableTask;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.config.SpringContextHolder; import org.nl.config.SpringContextHolder;
import org.springframework.util.ReflectionUtils; import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.concurrent.Callable;
/** /**
* 执行定时任务 * 执行定时任务
@ -14,7 +15,7 @@ import java.util.concurrent.Callable;
* @author / * @author /
*/ */
@Slf4j @Slf4j
public class QuartzRunnable implements Callable { public class QuartzRunnable extends TLogInheritableTask {
private final Object target; private final Object target;
private final Method method; private final Method method;
@ -32,14 +33,15 @@ public class QuartzRunnable implements Callable {
} }
} }
@SneakyThrows
@Override @Override
public Object call() throws Exception { public void runTask() {
ReflectionUtils.makeAccessible(method); ReflectionUtils.makeAccessible(method);
if (StrUtil.isNotEmpty(params)) { if (StrUtil.isNotEmpty(params)) {
method.invoke(target, params); method.invoke(target, params);
} else { } else {
method.invoke(target); method.invoke(target);
} }
return null;
} }
} }

4
lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

@ -13,9 +13,9 @@ spring:
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.93.41.198}:${DB_PORT:3306}/${DB_NAME:rl_mg_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:10.93.41.198}:${DB_PORT:3306}/${DB_NAME:rl_mg_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# username: ${DB_USER:root} # username: ${DB_USER:root}
# password: ${DB_PWD:123456} # password: ${DB_PWD:123456}
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:rtmg_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:rlmg_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:12356} password: ${DB_PWD:P@ssw0rd}
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
oracle: oracle:
driver-class-name: oracle.jdbc.OracleDriver driver-class-name: oracle.jdbc.OracleDriver

32
lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml

@ -46,7 +46,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: dev2 active: dev
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:
@ -63,35 +63,11 @@ spring:
monitorInterval: 8 monitorInterval: 8
tomcatTp: # tomcat webserver 线程池配置 tomcatTp: # tomcat webserver 线程池配置
threadPoolAliasName: tomcat线程池 # 线程池别名,可选 threadPoolAliasName: tomcat线程池 # 线程池别名,可选
corePoolSize: 100 corePoolSize: 10
maximumPoolSize: 200 maximumPoolSize: 50
keepAliveTime: 60 keepAliveTime: 60
runTimeout: 10000 runTimeout: 10000
queueTimeout: 100 queueTimeout: 100
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警、拒绝报警、任务超时报警)
- type: change
enabled: true
- type: capacity # 队列容量使用率,报警项类型,查看源码 NotifyTypeEnum枚举类
enabled: true
threshold: 80 # 报警阈值,默认70,意思是队列使用率达到70%告警
interval: 120 # 报警间隔(单位:s),默认120
- type: liveness # 线程池活性
enabled: true
threshold: 80 # 报警阈值,默认 70,意思是活性达到70%告警
- type: reject # 触发任务拒绝告警
enabled: true
threshold: 100 # 默认阈值10
- type: run_timeout # 任务执行超时告警
enabled: true
threshold: 100 # 默认阈值10
- type: queue_timeout # 任务排队超时告警
enabled: true
threshold: 100 # 默认阈值10
task: task:
pool: pool:
# 核心线程池大小 # 核心线程池大小
@ -188,3 +164,5 @@ jetcache:
maxTotal: 50 # 连接池中的最大连接数 maxTotal: 50 # 连接池中的最大连接数
host: 127.0.0.1 host: 127.0.0.1
port: 6379 port: 6379
tlog:
enable-invoke-time-print: true

4
lms/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml

@ -69,10 +69,8 @@ https://juejin.cn/post/6844903775631572999
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
</appender> </appender>
<!--开发环境:打印控制台--> <!--开发环境:打印控制台-->
<springProfile name="dev2"> <springProfile name="dev">
<root level="DEBUG"> <root level="DEBUG">
<appender-ref ref="asyncLuceneAppender"/>
<appender-ref ref="asyncFileAppender"/>
<appender-ref ref="CONSOLE"/> <appender-ref ref="CONSOLE"/>
</root> </root>
<logger name="com.baomidou.mybatisplus.core.MybatisConfiguration" level="ERROR" additivity="false"> <logger name="com.baomidou.mybatisplus.core.MybatisConfiguration" level="ERROR" additivity="false">

Loading…
Cancel
Save