瀏覽代碼

去掉router

tags/v20231201
李俊才 2 年之前
父節點
當前提交
fe367eb67b
共有 8 個文件被更改,包括 6 次插入36 次删除
  1. +1
    -1
      .idea/gradle.xml
  2. +0
    -2
      app/build.gradle
  3. +0
    -2
      app/src/p_common/main/java/com/bigwinepot/nwdn/network/platform/BusinessInterceptor.java
  4. +0
    -2
      app/src/p_common/main/java/com/bigwinepot/nwdn/network/platform/CrawlerInterceptor.java
  5. +2
    -20
      app/src/p_common/main/java/com/bigwinepot/nwdn/network/platform/InterceptorRetriever.java
  6. +0
    -1
      base/build.gradle
  7. +0
    -5
      base/src/main/java/com/shareopen/library/CommonApplication.java
  8. +3
    -3
      build.gradle

+ 1
- 1
.idea/gradle.xml 查看文件

@@ -7,7 +7,7 @@
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="corretto-11" />
<option name="gradleJvm" value="jbr-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />


+ 0
- 2
app/build.gradle 查看文件

@@ -1,5 +1,4 @@
apply plugin: 'com.android.application'
apply plugin: 'WMRouter'
apply from: 'p_module.gradle'

def VERSION_CODE = 3
@@ -142,7 +141,6 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.android.material:material:1.4.0'
annotationProcessor 'com.sankuai.waimai.router:compiler:1.2.0'

implementation group: 'org.java-websocket', name: 'Java-WebSocket', version: '1.5.1'
implementation("io.minio:minio:8.2.2") {


+ 0
- 2
app/src/p_common/main/java/com/bigwinepot/nwdn/network/platform/BusinessInterceptor.java 查看文件

@@ -5,7 +5,6 @@ import android.os.Bundle;
import androidx.annotation.NonNull;

import com.bigwinepot.nwdn.network.sg.BaseResponse;
import com.sankuai.waimai.router.annotation.RouterService;
import com.shareopen.library.MVVM.application.AppContext;
import com.shareopen.library.util.GsonUtils;
import com.shareopen.library.utils.StringUtils;
@@ -25,7 +24,6 @@ import okio.Buffer;
* Created by Arthas on 18/6/27.
* 这里处理网络业务层 拦截器的通用逻辑
*/
@RouterService(interfaces = Interceptor.class, key = InterceptorRetriever.INTERCEPTOR_BUSINESS)
public class BusinessInterceptor implements Interceptor {
public static final int STATUS_LOCKED = 0;
public static final int STATUS_UNLOCK_FALSE = 1;


+ 0
- 2
app/src/p_common/main/java/com/bigwinepot/nwdn/network/platform/CrawlerInterceptor.java 查看文件

@@ -5,7 +5,6 @@ import android.text.TextUtils;
import com.bigwinepot.nwdn.network.crawler.CrawlerManager;
import com.bigwinepot.nwdn.network.crawler.CrawlerUtil;
import com.google.gson.JsonElement;
import com.sankuai.waimai.router.annotation.RouterService;
import com.shareopen.library.MVVM.application.AppContext;
import com.shareopen.library.util.GsonUtils;

@@ -24,7 +23,6 @@ import okio.Buffer;
* Created by wyx on 2017/12/14.
* 处理反爬虫逻辑的拦截器
*/
@RouterService(interfaces = Interceptor.class, key = InterceptorRetriever.INTERCEPTOR_CRAWLER)
public class CrawlerInterceptor implements Interceptor {

// 由于CrawlerManager中对观察者是弱引用,所以需要将观察者声明为成员变量,防止被回收


+ 2
- 20
app/src/p_common/main/java/com/bigwinepot/nwdn/network/platform/InterceptorRetriever.java 查看文件

@@ -1,7 +1,5 @@
package com.bigwinepot.nwdn.network.platform;

import com.sankuai.waimai.router.Router;

import java.util.ArrayList;
import java.util.List;

@@ -19,32 +17,16 @@ public class InterceptorRetriever {

public static List<Interceptor> interceptors() {
List<Interceptor> interceptors = new ArrayList<>();
boolean isNeed = false;
if (isNeed) {
Interceptor serverInterceptor = Router.getService(Interceptor.class,
INTERCEPTOR_SERVER);
if (serverInterceptor != null) {
interceptors.add(serverInterceptor);
}
}

Interceptor crawlerInterceptor = Router.getService(Interceptor.class, INTERCEPTOR_CRAWLER);
Interceptor crawlerInterceptor = new CrawlerInterceptor();
if (crawlerInterceptor != null) {
interceptors.add(crawlerInterceptor);
}

Interceptor businessInterceptor = Router.getService(Interceptor.class,
INTERCEPTOR_BUSINESS);
Interceptor businessInterceptor = new BusinessInterceptor();
if (businessInterceptor != null) {
interceptors.add(businessInterceptor);
}
if (isNeed) {
Interceptor commonParamsInterceptor = Router.getService(Interceptor.class,
INTERCEPTOR_MT_COMMON_PARAMS);
if (commonParamsInterceptor != null) {
interceptors.add(commonParamsInterceptor);
}
}

return interceptors;
}


+ 0
- 1
base/build.gradle 查看文件

@@ -22,7 +22,6 @@ dependencies {
api 'androidx.recyclerview:recyclerview:1.0.0'
api 'androidx.constraintlayout:constraintlayout:1.1.3'
api 'com.google.android.material:material:1.0.0'
api 'com.sankuai.waimai.router:router:1.2.0'
api ('com.squareup.retrofit2:retrofit:2.3.0') {
exclude group: 'com.squareup.okhttp3'
}//导入retrofit


+ 0
- 5
base/src/main/java/com/shareopen/library/CommonApplication.java 查看文件

@@ -3,9 +3,6 @@ package com.shareopen.library;


import android.os.Bundle;

import com.sankuai.waimai.router.Router;
import com.sankuai.waimai.router.common.DefaultRootUriHandler;
import com.shareopen.library.MVVM.application.BaseApplication;
import com.uc.crashsdk.export.CrashApi;
import com.umeng.commonsdk.UMConfigure;
@@ -26,8 +23,6 @@ public class CommonApplication extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
DefaultRootUriHandler rootHandler = new DefaultRootUriHandler(CommonApplication.this);
Router.init(rootHandler);
initUm();
}



+ 3
- 3
build.gradle 查看文件

@@ -20,9 +20,9 @@ buildscript {
maven { url 'https://repo1.maven.org/maven2/' }
}
dependencies {
classpath ("com.sankuai.waimai.router:plugin:1.2.0") {
exclude group: 'com.android.tools.build'
}
// classpath ("com.sankuai.waimai.router:plugin:1.2.0") {
// exclude group: 'com.android.tools.build'
// }
}
}



Loading…
取消
儲存