pangweixin 5 роки тому
батько
коміт
39e818f9f7

+ 5 - 5
app/src/main/java/com/qingdaofushan/home/activity/MainActivity.java

@@ -61,12 +61,12 @@ public class MainActivity extends AppCompatActivity {
         findViewById(R.id.start).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-//                initApp("https://pwxmax.cn/fshome.zip", 0);
+                initApp("https://pwxmax.cn/friday.zip", 1);
 //                mServerManager.startServer();
-                Intent intent = new Intent(MainActivity.this, WebViewActivity.class);
-                intent.putExtra("url", editText.getText().toString());
+//                Intent intent = new Intent(MainActivity.this, WebViewActivity.class);
+//                intent.putExtra("url", editText.getText().toString());
 //                intent.putExtra("url", "http://127.0.0.1:8080");
-                startActivity(intent);
+//                startActivity(intent);
             }
         });
     }
@@ -84,7 +84,7 @@ public class MainActivity extends AppCompatActivity {
                             mServerManager = new ServerManager(MainActivity.this);
                             mServerManager.register();
 //                            getVM();
-//                            initApp("https://pwxmax.cn/friday.zip", 1);
+                            initApp("https://pwxmax.cn/friday.zip", 1);
                         } else {
                             initPermission();
                             ToastUtil.showToast("获取部分权限成功,但部分权限未正常授予");

+ 52 - 4
app/src/main/java/com/qingdaofushan/home/component/ApiController.java

@@ -1,18 +1,14 @@
 package com.qingdaofushan.home.component;
 
 import com.yanzhenjie.andserver.annotation.Controller;
-import com.yanzhenjie.andserver.annotation.PostMapping;
 import com.yanzhenjie.andserver.annotation.RequestMapping;
 import com.yanzhenjie.andserver.annotation.RequestMethod;
-import com.yanzhenjie.andserver.annotation.RequestParam;
-import com.yanzhenjie.andserver.annotation.RestController;
 
 @Controller
 public class ApiController {
 
     private static final String MATCH_PREFIX = "/api/";
 
-
     @RequestMapping(path = MATCH_PREFIX + "{v1}",method = {RequestMethod.GET,RequestMethod.POST})
     String v1() {
         return "";
@@ -62,4 +58,56 @@ public class ApiController {
     String v10() {
         return "";
     }
+
+    private static final String OSSMINI_MATCH_PREFIX = "/ossmini/";
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv1() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv2() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv3() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}/{v4}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv4() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}/{v4}/{v5}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv5() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}/{v4}/{v5}/{v6}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv6() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}/{v4}/{v5}/{v6}/{v7}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv7() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}/{v4}/{v5}/{v6}/{v7}/{v8}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv8() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}/{v4}/{v5}/{v6}/{v7}/{v8}/{v9}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv9() {
+        return "";
+    }
+
+    @RequestMapping(path = OSSMINI_MATCH_PREFIX + "{v1}/{v2}/{v3}/{v4}/{v5}/{v6}/{v7}/{v8}/{v9}/{v10}",method = {RequestMethod.GET,RequestMethod.POST})
+    String ossminiv10() {
+        return "";
+    }
 }

+ 1 - 0
app/src/main/java/com/qingdaofushan/home/component/ApiInterceptor.java

@@ -140,6 +140,7 @@ public class ApiInterceptor implements HandlerInterceptor {
 
     @Override
     public boolean onIntercept(@NonNull HttpRequest oRequest, @NonNull HttpResponse oResponse, @NonNull RequestHandler handler) throws Exception {
+        Log.e("curacao: ", oRequest.getPath());
         HttpHost host = findPrefix(oRequest);
         if (host != null) {
             StandardRequest sRequest = (StandardRequest) oRequest;