查询用户授权app
parent
b6b758a770
commit
bab20f84ad
|
@ -63,4 +63,15 @@ public class IndexDataController {
|
||||||
public GeneralResult userStatic(@Value(Common.REQ_CONTEXT) RequestContext requestContext) {
|
public GeneralResult userStatic(@Value(Common.REQ_CONTEXT) RequestContext requestContext) {
|
||||||
return indexService.userDataStatic(requestContext);
|
return indexService.userDataStatic(requestContext);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 当前用户授权应用列表
|
||||||
|
* @param pager
|
||||||
|
* @param requestContext
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/userAppList")
|
||||||
|
@Operation(summary = "当前用户首页数据展示模块的数据查询")
|
||||||
|
public GeneralResult userAppList(@Value(Common.REQ_CONTEXT) RequestContext requestContext) {
|
||||||
|
return indexService.userAppList(requestContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,4 +13,6 @@ public interface IndexService {
|
||||||
GeneralResult workOrderStatic(RequestContext requestContext);
|
GeneralResult workOrderStatic(RequestContext requestContext);
|
||||||
|
|
||||||
GeneralResult userDataStatic(RequestContext requestContext);
|
GeneralResult userDataStatic(RequestContext requestContext);
|
||||||
|
|
||||||
|
GeneralResult userAppList(RequestContext requestContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,11 +84,10 @@ public class IndexServiceImpl implements IndexService {
|
||||||
@Override
|
@Override
|
||||||
public GeneralResult userDataStatic(RequestContext requestContext) {
|
public GeneralResult userDataStatic(RequestContext requestContext) {
|
||||||
try {
|
try {
|
||||||
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
//查询当前用户授权应用
|
//查询当前用户授权应用
|
||||||
JSONObject param = new JSONObject();
|
List<JSONObject> userAppList = getUserAppList(requestContext);
|
||||||
param.put("userId", "1111");
|
resultMap.put("userAppCount", userAppList.size());
|
||||||
param.put("type", "user");
|
|
||||||
String result = ykUtil.call(YkInfo.getUserAppList, param, JSONArray.class);
|
|
||||||
|
|
||||||
//获取用户信息
|
//获取用户信息
|
||||||
JSONObject userParam = new JSONObject();
|
JSONObject userParam = new JSONObject();
|
||||||
|
@ -96,10 +95,31 @@ public class IndexServiceImpl implements IndexService {
|
||||||
String userRolesStr = ykUtil.call(YkInfo.getUserRoles, userParam, JSONArray.class);
|
String userRolesStr = ykUtil.call(YkInfo.getUserRoles, userParam, JSONArray.class);
|
||||||
|
|
||||||
|
|
||||||
return new GeneralResult(true, "查询成功");
|
return new GeneralResult(true, resultMap, "查询成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("查询失败", e);
|
log.info("查询失败", e);
|
||||||
return new GeneralResult(false, "查询失败");
|
return new GeneralResult(false, "查询失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GeneralResult userAppList(RequestContext requestContext) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
List<JSONObject> userAppList = getUserAppList(requestContext);
|
||||||
|
return new GeneralResult(true, userAppList, "查询成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("查询失败", e);
|
||||||
|
return new GeneralResult(false, "查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<JSONObject> getUserAppList(RequestContext requestContext) throws Exception {
|
||||||
|
//查询当前用户授权应用
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("userId", "1111");
|
||||||
|
param.put("type", "user");
|
||||||
|
String result = ykUtil.call(YkInfo.getUserAppList, param, JSONArray.class);
|
||||||
|
return JSONObject.parseObject(result, List.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue