|
@@ -1,16 +1,12 @@
|
|
|
package com.txz.mall.configurer.jpush;
|
|
|
|
|
|
-import feign.okhttp.OkHttpClient;
|
|
|
-import io.github.engagelab.api.*;
|
|
|
+import io.github.engagelab.api.PushApi;
|
|
|
import io.github.engagelab.enums.DataCenterHost;
|
|
|
import lombok.Data;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
-
|
|
|
/**
|
|
|
* @author: MTD®️
|
|
|
* @date: 2025/9/17
|
|
@@ -28,65 +24,11 @@ public class JPushConf {
|
|
|
public PushApi pushApi() {
|
|
|
return new PushApi.Builder()
|
|
|
.setHost(DataCenterHost.HK.getUrl())
|
|
|
- .setAppKey(this.appKey)
|
|
|
- .setMasterSecret(this.masterSecret)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public DeviceApi deviceApi() {
|
|
|
- return new DeviceApi.Builder()
|
|
|
- .setHost(DataCenterHost.HK.getUrl())
|
|
|
- .setAppKey(this.appKey)
|
|
|
- .setMasterSecret(this.masterSecret)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public StatusApi statusApi() {
|
|
|
- return new StatusApi.Builder()
|
|
|
- .setHost(DataCenterHost.HK.getUrl())
|
|
|
- .setAppKey(this.appKey)
|
|
|
- .setMasterSecret(this.masterSecret)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public ScheduleApi scheduleApi() {
|
|
|
- return new ScheduleApi.Builder()
|
|
|
- .setHost(DataCenterHost.HK.getUrl())
|
|
|
- .setAppKey(this.appKey)
|
|
|
- .setMasterSecret(this.masterSecret)
|
|
|
+ .setAppKey(appKey)
|
|
|
+ .setMasterSecret(masterSecret)
|
|
|
.build();
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Bean("okHttpClient")
|
|
|
- public OkHttpClient okHttpClient() {
|
|
|
- okhttp3.OkHttpClient okHttpClient = new okhttp3.OkHttpClient().newBuilder()
|
|
|
- // .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy_host", proxy_port)))
|
|
|
- .connectTimeout(5, TimeUnit.SECONDS)
|
|
|
- .build();
|
|
|
- return new OkHttpClient(okHttpClient);
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public GroupPushApi groupPushApi(@Qualifier("okHttpClient") OkHttpClient okHttpClient) {
|
|
|
- return new GroupPushApi.Builder()
|
|
|
- .setHost(DataCenterHost.HK.getUrl())
|
|
|
- .setClient(okHttpClient)
|
|
|
- .setAppKey(this.appKey)
|
|
|
- .setMasterSecret(this.masterSecret)
|
|
|
- .build();
|
|
|
- }
|
|
|
-
|
|
|
- @Bean
|
|
|
- public PushPlanApi pushPlanApi() {
|
|
|
- return new PushPlanApi.Builder()
|
|
|
- .setHost(DataCenterHost.HK.getUrl())
|
|
|
- .setAppKey(this.appKey)
|
|
|
- .setMasterSecret(this.masterSecret)
|
|
|
- .build();
|
|
|
- }
|
|
|
|
|
|
}
|