|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
package com.dsideal.ZhuQue.Ylt.Controller;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.dsideal.ZhuQue.Interceptor.IsLoginInterface;
|
|
|
|
@ -9,61 +8,16 @@ import com.dsideal.ZhuQue.Ylt.Model.YltModel;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.core.Controller;
|
|
|
|
|
import com.jfinal.ext.interceptor.GET;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.kit.PropKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
import java.sql.Time;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class YltController extends Controller {
|
|
|
|
|
Logger log = LoggerFactory.getLogger(YltController.class);
|
|
|
|
|
YltModel ym = new YltModel();
|
|
|
|
|
private static Logger log = LoggerFactory.getLogger(YltController.class);
|
|
|
|
|
|
|
|
|
|
public List<Record> getAll() {
|
|
|
|
|
List<Record> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
Record r1 = new Record();
|
|
|
|
|
r1.set("dictKey", 1);
|
|
|
|
|
r1.set("dictValue", "卫生间");
|
|
|
|
|
r1.set("imageUrl", "station-toilet");
|
|
|
|
|
r1.set("id", null);
|
|
|
|
|
r1.set("parentId", null);
|
|
|
|
|
r1.set("code", null);
|
|
|
|
|
r1.set("sort", null);
|
|
|
|
|
r1.set("remark", null);
|
|
|
|
|
r1.set("isSealed", null);
|
|
|
|
|
r1.set("isDeleted", null);
|
|
|
|
|
list.add(r1);
|
|
|
|
|
|
|
|
|
|
Record r2 = new Record();
|
|
|
|
|
r2.set("dictKey", 1);
|
|
|
|
|
r2.set("dictValue", "卫生间");
|
|
|
|
|
r2.set("imageUrl", "station-toilet");
|
|
|
|
|
r2.set("id", null);
|
|
|
|
|
r2.set("parentId", null);
|
|
|
|
|
r2.set("code", null);
|
|
|
|
|
r2.set("sort", null);
|
|
|
|
|
r2.set("remark", null);
|
|
|
|
|
r2.set("isSealed", null);
|
|
|
|
|
r2.set("isDeleted", null);
|
|
|
|
|
list.add(r2);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:测试不依赖JWT的TOKEN数据的方法
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
public void getList() {
|
|
|
|
|
List<Record> list = getAll();
|
|
|
|
|
renderJson(CommonUtil.getRet(list, true, "获取成功!"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:测试依赖JWT的TOKEN数据的方法
|
|
|
|
@ -78,34 +32,9 @@ public class YltController extends Controller {
|
|
|
|
|
|
|
|
|
|
System.out.println(userId);
|
|
|
|
|
System.out.println(phone);
|
|
|
|
|
|
|
|
|
|
List<Record> list = getAll();
|
|
|
|
|
renderJson(CommonUtil.getRet(list, true, "获取成功!"));
|
|
|
|
|
renderJson(CommonUtil.getRet(true, "获取成功!"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:测试保存数据
|
|
|
|
|
*
|
|
|
|
|
* @param xm
|
|
|
|
|
* @param xb
|
|
|
|
|
* @param yw_id
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void testPostWithAuth(String xm, String xb, int yw_id) {
|
|
|
|
|
//获取当前登录人员信息
|
|
|
|
|
Record user = ym.getUser(getRequest());
|
|
|
|
|
String userId = user.get("userId");
|
|
|
|
|
String phone = user.get("phone");
|
|
|
|
|
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record.set("xm", xm);
|
|
|
|
|
record.set("xb", xb);
|
|
|
|
|
record.set("yw_id", yw_id);
|
|
|
|
|
record.set("userId", userId);
|
|
|
|
|
record.set("phone", phone);
|
|
|
|
|
renderJson(CommonUtil.getRet(record, true, "保存成功!"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能: 向第三方道闸同步充电桩支付信息
|
|
|
|
|