Skip to content

Commit

Permalink
✨ 简化,删除部分模块
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xunhuan committed Jun 21, 2024
1 parent e80b013 commit ea8db29
Show file tree
Hide file tree
Showing 36 changed files with 17 additions and 2,640 deletions.
7 changes: 3 additions & 4 deletions gradle/version.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ ext {
micaWeiXinVersion = "3.0.0"
knife4jVersion = "3.0.3"
swaggerVersion = "1.6.9"
swagger3xVersion = "2.2.19"
springDocVersion = "2.2.0"
druidVersion = "1.2.22"
swagger3xVersion = "2.2.22"
druidVersion = "1.2.23"
okhttpVersion = "4.12.0"
jsoupVersion = "1.17.2"
lombokVersion = "1.18.32"
Expand All @@ -16,6 +15,6 @@ ext {
lokiLogbackAppender = "1.4.2"
zxingVersion = "3.5.2"
xxlJobVersion = "2.4.0"
jetCacheVersion = "2.7.5"
jetCacheVersion = "2.7.6"
jfinalVersion = "5.1.6"
}
5 changes: 1 addition & 4 deletions mica-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ dependencies {
// commons
api "com.google.code.findbugs:jsr305:$findbugsVersion"
api "io.swagger:swagger-annotations:$swaggerVersion"
api "io.swagger.core.v3:swagger-annotations:$swagger3xVersion"
api "io.swagger.core.v3:swagger-annotations-jakarta:$swagger3xVersion"
api "org.springdoc:springdoc-openapi-starter-webmvc-ui:$springDocVersion"
api "com.github.xiaoymin:knife4j-spring-boot-starter:$knife4jVersion"
api "com.github.xiaoymin:knife4j-springdoc-ui:$knife4jVersion"
api "com.github.xiaoymin:knife4j-openapi3-jakarta-spring-boot-starter:$knife4jVersion"
api "com.squareup.okhttp3:okhttp:$okhttpVersion"
api "com.squareup.okhttp3:logging-interceptor:$okhttpVersion"
api "org.jsoup:jsoup:$jsoupVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package net.dreamlu.mica.logging.appender;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.rolling.RollingFileAppender;
Expand All @@ -28,8 +27,9 @@
import net.dreamlu.mica.logging.utils.LogStashUtil;
import net.dreamlu.mica.logging.utils.LoggingUtil;
import net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.logging.LoggingSystemProperties;
import org.springframework.boot.logging.LoggingSystemProperty;
import org.springframework.core.env.Environment;

import java.util.HashMap;
Expand All @@ -54,7 +54,8 @@ public LoggingJsonFileAppender(Environment environment,
String profile = environment.getRequiredProperty(MicaConstant.ACTIVE_PROFILES_PROPERTY);
// 2. 文件日志格式
String fileLogPattern = environment.resolvePlaceholders(LoggingUtil.DEFAULT_FILE_LOG_PATTERN);
System.setProperty(LoggingSystemProperties.FILE_LOG_PATTERN, fileLogPattern);
String filePatternEnvName = LoggingSystemProperty.FILE_PATTERN.getEnvironmentVariableName();
System.setProperty(filePatternEnvName, fileLogPattern);
// 3. 生成日志文件的文件
String logDir = environment.getProperty("logging.file.path", LoggingUtil.DEFAULT_LOG_DIR);
this.logAllFile = logDir + CharPool.SLASH + appName + CharPool.SLASH + LoggingUtil.LOG_FILE_ALL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package net.dreamlu.mica.logging.appender;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import lombok.extern.slf4j.Slf4j;
import net.dreamlu.mica.core.constant.MicaConstant;
Expand All @@ -25,6 +24,7 @@
import net.dreamlu.mica.logging.utils.LogStashUtil;
import net.logstash.logback.appender.LogstashTcpSocketAppender;
import net.logstash.logback.encoder.LogstashEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package net.dreamlu.mica.logging.appender;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.CoreConstants;
import com.github.loki4j.logback.*;
Expand All @@ -26,6 +25,7 @@
import net.dreamlu.mica.core.utils.StringUtil;
import net.dreamlu.mica.logging.config.MicaLoggingProperties;
import net.dreamlu.mica.logging.loki.Loki4jOkHttpSender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.util.Assert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@

package net.dreamlu.mica.logging.utils;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.FileAppender;
import ch.qos.logback.core.rolling.RollingPolicy;
import ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy;
import ch.qos.logback.core.util.FileSize;
import net.dreamlu.mica.core.utils.SystemUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.logging.logback.LogbackLoggingSystemProperties;
import org.springframework.boot.logging.logback.RollingPolicySystemProperty;

/**
* 参考自 jhipster
Expand Down Expand Up @@ -62,11 +62,11 @@ public static RollingPolicy rollingPolicy(LoggerContext context,
String logErrorFile) {
final SizeAndTimeBasedRollingPolicy<ILoggingEvent> rollingPolicy = new SizeAndTimeBasedRollingPolicy<>();
rollingPolicy.setContext(context);
rollingPolicy.setCleanHistoryOnStart(SystemUtil.getPropToBool(LogbackLoggingSystemProperties.ROLLINGPOLICY_CLEAN_HISTORY_ON_START, false));
rollingPolicy.setCleanHistoryOnStart(SystemUtil.getPropToBool(RollingPolicySystemProperty.CLEAN_HISTORY_ON_START.getEnvironmentVariableName(), false));
rollingPolicy.setFileNamePattern(logErrorFile + ".%d{yyyy-MM-dd}.%i.gz");
rollingPolicy.setMaxFileSize(FileSize.valueOf(SystemUtil.getProp(LogbackLoggingSystemProperties.ROLLINGPOLICY_MAX_FILE_SIZE, "10MB")));
rollingPolicy.setMaxHistory(SystemUtil.getPropToInt(LogbackLoggingSystemProperties.ROLLINGPOLICY_MAX_HISTORY, 7));
rollingPolicy.setTotalSizeCap(FileSize.valueOf(SystemUtil.getProp(LogbackLoggingSystemProperties.ROLLINGPOLICY_TOTAL_SIZE_CAP, "0")));
rollingPolicy.setMaxFileSize(FileSize.valueOf(SystemUtil.getProp(RollingPolicySystemProperty.MAX_FILE_SIZE.getEnvironmentVariableName(), "10MB")));
rollingPolicy.setMaxHistory(SystemUtil.getPropToInt(RollingPolicySystemProperty.MAX_HISTORY.getEnvironmentVariableName(), 7));
rollingPolicy.setTotalSizeCap(FileSize.valueOf(SystemUtil.getProp(RollingPolicySystemProperty.TOTAL_SIZE_CAP.getEnvironmentVariableName(), "0")));
rollingPolicy.setParent(appender);
rollingPolicy.start();
return rollingPolicy;
Expand Down
18 changes: 0 additions & 18 deletions mica-nats/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions mica-nats/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ea8db29

Please sign in to comment.