Commit 5fc75492 authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent b0f184b0
diff a/microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysLoginController.java b/microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysLoginController.java (rejected hunks)
@@ -135,7 +135,6 @@
}
user.setRoleIdList(roleIdList);
String jwtToken = null;
- user.setSysSystem(sysSystem);
try {
jwtToken =
JwtUtil.createJwt("longingJWT", JwtUtil.generalSubject(user), 1000 * 60 * 60 * 24 * 7);
...@@ -16,22 +16,11 @@ import com.devplatform.common.util.R; ...@@ -16,22 +16,11 @@ import com.devplatform.common.util.R;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import java.util.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 系统菜单 * 系统菜单
...@@ -54,34 +43,12 @@ public class SysMenuController extends AbstractController { ...@@ -54,34 +43,12 @@ public class SysMenuController extends AbstractController {
@GetMapping("/nav") @GetMapping("/nav")
public R nav(String stationId) { public R nav(String stationId) {
List<Map<String, Object>> menuList = List<Map<String, Object>> menuList =
sysMenuService.getUserMenuList(getUserId(), stationId, null); sysMenuService.getUserMenuList(getUserId(), stationId);
List<Map<String, Object>> nav = sysMenuService.getNav(getUserId(), stationId); List<Map<String, Object>> nav = sysMenuService.getNav(getUserId(), stationId);
Set<String> permissions = shiroService.getUserPermissions(getUserId()); Set<String> permissions = shiroService.getUserPermissions(getUserId());
return R.ok().put("menuList", menuList).put("permissions", permissions).put("nav", nav); return R.ok().put("menuList", menuList).put("permissions", permissions).put("nav", nav);
} }
/** 导航菜单 */
@ApiOperation(value = "站点子系统获取导航菜单", notes = "站点子系统获取导航菜单")
@GetMapping("/nav1")
public R nav1(String stationId) {
List<Map<String, Object>> menuList =
sysMenuService.getUserMenuList(getUserId(), stationId, "1");
for (Map<String, Object> map1 : menuList) {
ArrayList<Map<String, Object>> list = (ArrayList<Map<String, Object>>) map1.get("list");
Iterator<Map<String, Object>> iterator = list.iterator();
while (iterator.hasNext()) {
Map<String, Object> next = iterator.next();
if ("/sys/takeover".equals(String.valueOf(next.get("path")))) {
iterator.remove();
break;
}
}
}
List<Map<String, Object>> nav = sysMenuService.getNav("1", stationId);
Set<String> permissions = shiroService.getUserPermissions("1");
return R.ok().put("menuList", menuList).put("permissions", permissions).put("nav", nav);
}
/** 所有菜单列表 */ /** 所有菜单列表 */
@ApiOperation(value = "根据条件获取分页数据列表", notes = "根据条件获取分页数据列表") @ApiOperation(value = "根据条件获取分页数据列表", notes = "根据条件获取分页数据列表")
@ApiImplicitParam( @ApiImplicitParam(
......
...@@ -42,10 +42,9 @@ public interface SysMenuService extends MyBaseService<SysMenuEntity> { ...@@ -42,10 +42,9 @@ public interface SysMenuService extends MyBaseService<SysMenuEntity> {
* 获取用户菜单列表 * 获取用户菜单列表
* @param userId * @param userId
* @param stationId * @param stationId
* @param isActive
* @return * @return
*/ */
List<Map<String, Object>> getUserMenuList(String userId, String stationId, String isActive); List<Map<String, Object>> getUserMenuList(String userId, String stationId);
/** /**
* 删除 * 删除
......
...@@ -53,19 +53,14 @@ public class SysMenuServiceImpl extends MyBaseServiceImpl<SysMenuDao, SysMenuEnt ...@@ -53,19 +53,14 @@ public class SysMenuServiceImpl extends MyBaseServiceImpl<SysMenuDao, SysMenuEnt
@Override @Override
public List<Map<String, Object>> getUserMenuList( public List<Map<String, Object>> getUserMenuList(
String userId, String stationId, String isActive) { String userId, String stationId) {
List<Map<String, Object>> list; List<Map<String, Object>> list;
// 系统管理员,拥有所有权限 // 系统管理员,拥有所有权限
if (Constant.SUPER_ADMIN.equals(userId)) { if (Constant.SUPER_ADMIN.equals(userId)) {
list = baseMapper.getAllMenuListByUserId(null, stationId); list = baseMapper.getAllMenuListByUserId(null, stationId);
} else { } else {
if (isActive != null) {
// 子系统查询
list = baseMapper.getAllMenuListByUserId1(userId);
} else {
// 站点查询 // 站点查询
list = baseMapper.getAllMenuListByUserId(userId, stationId); list = baseMapper.getAllMenuListByUserId(userId, stationId);
}
} }
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
// 生成树结构 // 生成树结构
......
...@@ -28,12 +28,11 @@ ...@@ -28,12 +28,11 @@
<if test="stationId != null and stationId != ''"> <if test="stationId != null and stationId != ''">
AND me.station_id = #{stationId} AND me.station_id = #{stationId}
</if> </if>
AND me.type = 2 -- AND me.type = 2
</select> </select>
<select id="getAllMenuListByUserId" resultType="java.util.Map"> <select id="getAllMenuListByUserId" resultType="java.util.Map">
SELECT DISTINCT sm.menu_id AS menuId, sm.parent_id AS parentId, sm.name,sm.name AS title,sm.url, sm.url AS path, SELECT DISTINCT sm.menu_id AS menuId, sm.parent_id AS parentId, sm.name,sm.name AS title,sm.url, sm.url AS path,
sm.perms, sm.type, sm.icon, sm.order_num AS orderNum, sm.is_system_menu AS isSystemMenu, sm.status, sm.sys_sign sm.perms, sm.type, sm.icon, sm.order_num AS orderNum, sm.is_system_menu AS isSystemMenu, sm.status
AS sysSign
FROM sys_menu sm FROM sys_menu sm
LEFT JOIN sys_role_menu srm ON sm.menu_id = srm.menu_id LEFT JOIN sys_role_menu srm ON sm.menu_id = srm.menu_id
LEFT JOIN sys_user_role sur ON srm.role_id = sur.role_id LEFT JOIN sys_user_role sur ON srm.role_id = sur.role_id
...@@ -61,9 +60,7 @@ ...@@ -61,9 +60,7 @@
sm.icon, sm.icon,
sm.order_num AS orderNum, sm.order_num AS orderNum,
sm.is_system_menu AS isSystemMenu, sm.is_system_menu AS isSystemMenu,
sm.status, sm.status
sm.sys_sign
AS sysSign
FROM sys_menu sm FROM sys_menu sm
LEFT JOIN rt_sys_role_menu srm ON sm.menu_id = srm.menu_id AND srm.byx1 = '2' LEFT JOIN rt_sys_role_menu srm ON sm.menu_id = srm.menu_id AND srm.byx1 = '2'
LEFT JOIN rt_sys_user_role sur ON srm.role_id = sur.role_id LEFT JOIN rt_sys_user_role sur ON srm.role_id = sur.role_id
......
...@@ -16,7 +16,7 @@ eureka: ...@@ -16,7 +16,7 @@ eureka:
healthcheck: healthcheck:
enabled: true enabled: true
serviceUrl: serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka defaultZone: http://user:password123@eureka:8761/eureka
instance: instance:
lease-renewal-interval-in-seconds: 4 lease-renewal-interval-in-seconds: 4
lease-expiration-duration-in-seconds: 12 lease-expiration-duration-in-seconds: 12
......
...@@ -41,6 +41,7 @@ spring: ...@@ -41,6 +41,7 @@ spring:
async: async:
request-timeout: 60000 request-timeout: 60000
redis: redis:
# host: 10.20.72.35
host: 47.94.207.62 host: 47.94.207.62
port: 6379 port: 6379
password: password:
...@@ -62,6 +63,9 @@ spring: ...@@ -62,6 +63,9 @@ spring:
url: jdbc:mysql://47.94.207.62:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false url: jdbc:mysql://47.94.207.62:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
username: root username: root
password: superAdmin&321 password: superAdmin&321
# url: jdbc:mysql://10.20.72.31:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
# username: root
# password: root
initialSize: 5 initialSize: 5
minIdle: 0 minIdle: 0
maxActive: 1000 maxActive: 1000
...@@ -88,7 +92,7 @@ eureka: ...@@ -88,7 +92,7 @@ eureka:
healthcheck: healthcheck:
enabled: false enabled: false
serviceUrl: serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka defaultZone: http://user:password123@eureka:8761/eureka
instance: instance:
lease-renewal-interval-in-seconds: 4 lease-renewal-interval-in-seconds: 4
lease-expiration-duration-in-seconds: 12 lease-expiration-duration-in-seconds: 12
......
...@@ -17,8 +17,8 @@ eureka: ...@@ -17,8 +17,8 @@ eureka:
healthcheck: healthcheck:
enabled: true enabled: true
serviceUrl: serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka # defaultZone: http://user:password123@eureka:8762/eureka
# defaultZone: http://user:password123@eureka:8761/eureka defaultZone: http://user:password123@eureka:8761/eureka
# defaultZone: http://user:password123@172.19.0.1:8761/eureka # defaultZone: http://user:password123@172.19.0.1:8761/eureka
instance: instance:
lease-renewal-interval-in-seconds: 4 lease-renewal-interval-in-seconds: 4
......
...@@ -5,7 +5,7 @@ security: ...@@ -5,7 +5,7 @@ security:
name: user name: user
password: password123 password: password123
server: server:
port: 8762 port: 8761
eureka: eureka:
client: client:
register-with-eureka: false register-with-eureka: false
......
...@@ -100,7 +100,7 @@ eureka: ...@@ -100,7 +100,7 @@ eureka:
fetch-registry: true fetch-registry: true
registry-fetch-interval-seconds: 8 registry-fetch-interval-seconds: 8
serviceUrl: serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka defaultZone: http://user:password123@eureka:8761/eureka
instance: instance:
lease-renewal-interval-in-seconds: 4 lease-renewal-interval-in-seconds: 4
lease-expiration-duration-in-seconds: 12 lease-expiration-duration-in-seconds: 12
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment