|
@@ -2,11 +2,10 @@ package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.service.IBindAccountLoginService;
|
|
|
import cn.com.ctop.common.module.service.ISysRoleService;
|
|
|
-import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
|
import cn.com.ctop.common.module.utils.ResultMapUtils;
|
|
|
import cn.com.ctop.common.module.utils.StatusCode;
|
|
|
+import cn.com.ctop.common.module.vo.PangolinReportAppMonthVO;
|
|
|
import cn.com.ctop.crawler.modules.pangolin.service.*;
|
|
|
-import cn.com.ctop.crawler.modules.pangolin.vo.PangolinReportAppMonthVO;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
@@ -38,33 +37,6 @@ public class PangolinController {
|
|
|
@Autowired
|
|
|
private IBindAccountLoginService bindAccountLoginService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private IUserAllocationService userAllocationService;
|
|
|
- @PostMapping("api/user/list")
|
|
|
- public Map<String, Object> userList(@RequestBody JSONObject data) {
|
|
|
-// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
-// String userId = user.getId();
|
|
|
- String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
- String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
|
- if(null!=roleCode&&(roleCode.equals("admin"))){
|
|
|
- userId = null;
|
|
|
- }
|
|
|
-
|
|
|
- return userAllocationService.getPangolinAccountListByParams(userId,data);
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("api/project/list")
|
|
|
- public Map<String, Object> projectList(@RequestBody JSONObject data) {
|
|
|
-// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
-// String userId = user.getId();
|
|
|
- String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
- String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
|
- if(null!=roleCode&&(roleCode.equals("admin"))){
|
|
|
- userId = null;
|
|
|
- }
|
|
|
- return userAllocationService.getPangolinProjectListByParams(userId);
|
|
|
- }
|
|
|
-
|
|
|
@PostMapping("api/channel/list")
|
|
|
public Map<String, Object> channelList(@RequestBody JSONObject data) {
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
@@ -77,23 +49,11 @@ public class PangolinController {
|
|
|
return pangolinChannelService.getListByUserId(userId);
|
|
|
}
|
|
|
|
|
|
-// @PostMapping("api/user/list")
|
|
|
-// public Map<String, Object> userList() {
|
|
|
-// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
-// String userId = user.getId();
|
|
|
-//// String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
-// String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
|
-// if(null!=roleCode&&(roleCode.equals("admin"))){
|
|
|
-// userId = null;
|
|
|
-// }
|
|
|
-// return bindAccountLoginService.getListByUserId(userId);
|
|
|
-// }
|
|
|
-
|
|
|
@PostMapping("api/app/list")
|
|
|
public Map<String, Object> appList(@RequestBody JSONObject data) {
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
- String userId = user.getId();
|
|
|
-// String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
+// String userId = user.getId();
|
|
|
+ String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
|
if(null!=roleCode&&(roleCode.equals("admin"))){
|
|
|
userId = null;
|
|
@@ -102,14 +62,34 @@ public class PangolinController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @PostMapping("api/memberList")
|
|
|
+ public Map<String,Object> memberList(){
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ try {
|
|
|
+// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+// String userId = user.getId();
|
|
|
+ String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
+ String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
|
+ if (null!=roleCode&&"admin".equals(roleCode)) {
|
|
|
+ userId = null;
|
|
|
+ }
|
|
|
+ resultMap = pangolinAppService.getMemberList(userId);
|
|
|
+ return resultMap;
|
|
|
+ } catch (Exception e) {
|
|
|
+ ResultMapUtils.setResultMap(resultMap,StatusCode.COMMON_SERVER_ERROR);
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 实时数据
|
|
|
*/
|
|
|
@PostMapping("api/realtime")
|
|
|
public Map<String, Object> realTime(@RequestBody JSONObject data) {
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
- String userId = user.getId();
|
|
|
-// String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
+// String userId = user.getId();
|
|
|
+ String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
|
if(null!=roleCode&&(roleCode.equals("admin"))){
|
|
|
userId = null;
|
|
@@ -139,8 +119,8 @@ public class PangolinController {
|
|
|
public Map<String,Object> checkAppList(@RequestBody JSONObject data) {
|
|
|
Map<String,Object> result = new HashMap<>();
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
- String userId = user.getId();
|
|
|
-// String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
+// String userId = user.getId();
|
|
|
+ String userId = "6b4c821adc414dc8b7718ab63ccbfcaf";
|
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
|
if(null!=roleCode&&(roleCode.equals("admin"))){
|
|
|
userId = null;
|