|
|
@@ -1,13 +1,17 @@
|
|
|
package controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.jfinal.aop.Before;
|
|
|
import com.jfinal.core.Controller;
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
import interceptor.AuthInterceptor;
|
|
|
import model.SwapPath;
|
|
|
+import service.SwapPathService;
|
|
|
import util.MyRet;
|
|
|
|
|
|
public class SwapPathController extends Controller {
|
|
|
+ SwapPathService service = new SwapPathService();
|
|
|
+
|
|
|
@Before(AuthInterceptor.class)
|
|
|
public void appendOrUpdate() {
|
|
|
if (StrKit.isBlank(getPara("sum_value"))
|
|
|
@@ -42,6 +46,7 @@ public class SwapPathController extends Controller {
|
|
|
if (StrKit.isBlank(getPara("sum_value"))
|
|
|
|| StrKit.isBlank(getPara("level"))) {
|
|
|
renderJson(MyRet.create().setFail().setMsg("缺少参数,请检查参数[sum_value, level]。"));
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
String sumValueAndLevel = getPara("sum_value") + "_" + getPara("level");
|
|
|
@@ -54,4 +59,21 @@ public class SwapPathController extends Controller {
|
|
|
renderJson(MyRet.create().setFail().setMsg("查询失败,没有找到。"));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Before(AuthInterceptor.class)
|
|
|
+ public void findLevel2PathByLpAddress() {
|
|
|
+ if (StrKit.isBlank(getPara("lp_address"))) {
|
|
|
+ renderJson(MyRet.create().setFail().setMsg("缺少参数,请检查参数[lp_address]。"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String lpAddress = getPara("lp_address");
|
|
|
+ JSONArray pathList = service.generatePathListByLpAddress(lpAddress);
|
|
|
+
|
|
|
+ if (pathList.size() == 0) {
|
|
|
+ renderJson(MyRet.create().setOk().setMsg("没有找到LP:" + lpAddress + "相关路径。").setData(pathList));
|
|
|
+ } else {
|
|
|
+ renderJson(MyRet.create().setOk().setMsg("查询成功,LP:" + lpAddress + "。").setData(pathList));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|