查询用户授权app
parent
b6b758a770
commit
bab20f84ad
|
@ -63,4 +63,15 @@ public class IndexDataController {
|
|||
public GeneralResult userStatic(@Value(Common.REQ_CONTEXT) RequestContext 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 userDataStatic(RequestContext requestContext);
|
||||
|
||||
GeneralResult userAppList(RequestContext requestContext);
|
||||
}
|
||||
|
|
|
@ -84,11 +84,10 @@ public class IndexServiceImpl implements IndexService {
|
|||
@Override
|
||||
public GeneralResult userDataStatic(RequestContext requestContext) {
|
||||
try {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
//查询当前用户授权应用
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("userId", "1111");
|
||||
param.put("type", "user");
|
||||
String result = ykUtil.call(YkInfo.getUserAppList, param, JSONArray.class);
|
||||
List<JSONObject> userAppList = getUserAppList(requestContext);
|
||||
resultMap.put("userAppCount", userAppList.size());
|
||||
|
||||
//获取用户信息
|
||||
JSONObject userParam = new JSONObject();
|
||||
|
@ -96,10 +95,31 @@ public class IndexServiceImpl implements IndexService {
|
|||
String userRolesStr = ykUtil.call(YkInfo.getUserRoles, userParam, JSONArray.class);
|
||||
|
||||
|
||||
return new GeneralResult(true, "查询成功");
|
||||
return new GeneralResult(true, resultMap, "查询成功");
|
||||
} catch (Exception e) {
|
||||
log.info("查询失败", e);
|
||||
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