Skip to content

Commit

Permalink
✨ 依赖兼容处理
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xunhuan committed Dec 23, 2024
1 parent 84e1ed8 commit c6031b0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Binary file removed .idea/icon.png
Binary file not shown.
2 changes: 1 addition & 1 deletion mica-logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</dependency>
<dependency>
<groupId>com.github.loki4j</groupId>
<artifactId>loki-logback-appender-jdk8</artifactId>
<artifactId>loki-logback-appender</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package net.dreamlu.mica.logging.loki;

import com.github.loki4j.client.http.HttpConfig;
import com.github.loki4j.client.http.HttpHeaders;
import com.github.loki4j.client.http.HttpHeader;
import com.github.loki4j.client.http.Loki4jHttpClient;
import com.github.loki4j.client.http.LokiResponse;
import okhttp3.*;
Expand Down Expand Up @@ -57,9 +57,9 @@ private static OkHttpClient okHttpClientBuilder(HttpConfig conf) {
private static Request requestBuilder(HttpConfig conf) {
Request.Builder request = new Request.Builder()
.url(conf.pushUrl)
.addHeader(HttpHeaders.CONTENT_TYPE, conf.contentType);
conf.tenantId.ifPresent(tenant -> request.addHeader(HttpHeaders.X_SCOPE_ORGID, tenant));
conf.basicAuthToken().ifPresent(token -> request.addHeader(HttpHeaders.AUTHORIZATION, "Basic " + token));
.addHeader(HttpHeader.CONTENT_TYPE, conf.contentType);
conf.tenantId.ifPresent(tenant -> request.addHeader(HttpHeader.X_SCOPE_ORGID, tenant));
conf.basicAuthToken().ifPresent(token -> request.addHeader(HttpHeader.AUTHORIZATION, "Basic " + token));
return request.build();
}

Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
</dependency>
<dependency>
<groupId>com.github.loki4j</groupId>
<artifactId>loki-logback-appender-jdk8</artifactId>
<artifactId>loki-logback-appender</artifactId>
<version>${loki.logback.appender.version}</version>
</dependency>
<!-- mica 相关 -->
Expand Down Expand Up @@ -433,6 +433,12 @@
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun-plugin</id>
<url>https://maven.aliyun.com/repository/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>release</id>
Expand Down

0 comments on commit c6031b0

Please sign in to comment.