升级jar包

This commit is contained in:
冷冷 2018-03-06 22:26:01 +08:00
parent 0ded66330b
commit ba7228f81c
11 changed files with 59 additions and 11 deletions

View File

@ -3,7 +3,7 @@ package com.github.pig.auth.component.mobile;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pig.common.constant.CommonConstant;
import com.xiaoleilu.hutool.util.MapUtil;
import com.xiaoleilu.hutool.map.MapUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -2,7 +2,7 @@ package com.github.pig.auth.component.social;
import com.alibaba.fastjson.JSONObject;
import com.github.pig.auth.config.AuthServerConfig;
import com.xiaoleilu.hutool.util.MapUtil;
import com.xiaoleilu.hutool.map.MapUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -2,7 +2,7 @@ package com.github.pig.common.bean.interceptor;
import com.baomidou.mybatisplus.plugins.SqlParserHandler;
import com.baomidou.mybatisplus.toolkit.PluginUtils;
import com.xiaoleilu.hutool.util.CollectionUtil;
import com.xiaoleilu.hutool.collection.CollectionUtil;
import com.xiaoleilu.hutool.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.executor.statement.StatementHandler;

View File

@ -10,7 +10,7 @@ spring:
config:
server:
git:
uri: https://gitee.com/cqzqxq_lxh/pig-config.git
uri: https://gitee.com/boding1/pig-config.git
---
spring:
profiles: dev

View File

@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.toolkit.StringUtils;
import com.github.pig.common.vo.MenuVo;
import com.github.pig.gateway.feign.MenuService;
import com.github.pig.gateway.service.PermissionService;
import com.xiaoleilu.hutool.util.CollectionUtil;
import com.xiaoleilu.hutool.collection.CollectionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.authority.SimpleGrantedAuthority;

View File

@ -49,6 +49,15 @@ public class MenuController extends BaseController {
return getMenuTree(sysMenuService.selectList(new EntityWrapper<>(condition)), -1);
}
/**
* 返回当前用户的树形菜单集合
* @return 当前用户的树形菜单
*/
@GetMapping(value = "/getUserTree")
public List<MenuTree> getUserTree(){
return sysMenuService.findUserMenuTree(getRole().get(0));
}
/**
* 返回当前用户树形菜单集合
*

View File

@ -2,9 +2,11 @@ package com.github.pig.admin.service;
import com.baomidou.mybatisplus.service.IService;
import com.github.pig.admin.model.dto.MenuTree;
import com.github.pig.admin.model.entity.SysMenu;
import com.github.pig.common.vo.MenuVo;
import java.util.List;
import java.util.Set;
/**
@ -49,4 +51,11 @@ public interface SysMenuService extends IService<SysMenu> {
* @return 成功失败
*/
Boolean updateMenuById(SysMenu sysMenu, String role);
/**
* 返回角色的菜单
* @param roleName 角色
* @return 菜单列表
*/
List<MenuTree> findUserMenuTree(String roleName);
}

View File

@ -2,7 +2,9 @@ package com.github.pig.admin.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pig.admin.common.util.TreeUtil;
import com.github.pig.admin.mapper.SysMenuMapper;
import com.github.pig.admin.model.dto.MenuTree;
import com.github.pig.admin.model.entity.SysMenu;
import com.github.pig.admin.service.SysMenuService;
import com.github.pig.common.constant.CommonConstant;
@ -14,7 +16,9 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
@ -78,4 +82,32 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
public Boolean updateMenuById(SysMenu sysMenu, String role) {
return this.updateById(sysMenu);
}
/**
* 返回角色的菜单
*
* @param roleName 角色
* @return 菜单列表
*/
@Override
public List<MenuTree> findUserMenuTree(String roleName) {
Set<MenuVo> all = findMenuByRole(roleName);
List<MenuTree> menuTreeList = new ArrayList<>();
MenuTree node = null;
for (MenuVo menuVo : all) {
if (CommonConstant.MENU.equals(menuVo.getType())) {
node = new MenuTree();
node.setId(menuVo.getMenuId());
node.setParentId(menuVo.getParentId());
node.setName(menuVo.getName());
node.setUrl(menuVo.getUrl());
node.setCode(menuVo.getPermission());
node.setLabel(menuVo.getName());
node.setComponent(menuVo.getComponent());
node.setIcon(menuVo.getIcon());
menuTreeList.add(node);
}
}
return TreeUtil.bulid(menuTreeList, -1);
}
}

View File

@ -23,12 +23,10 @@ import com.github.pig.common.util.UserUtils;
import com.github.pig.common.util.template.MobileMsgTemplate;
import com.github.pig.common.vo.SysRole;
import com.github.pig.common.vo.UserVo;
import com.xiaoleilu.hutool.util.CollectionUtil;
import com.xiaoleilu.hutool.collection.CollectionUtil;
import com.xiaoleilu.hutool.util.RandomUtil;
import com.xiaoleilu.hutool.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -4,8 +4,8 @@ import com.github.pig.common.constant.MqQueueConstant;
import com.github.pig.common.constant.enums.EnumSmsChannel;
import com.github.pig.common.util.template.MobileMsgTemplate;
import com.github.pig.monitor.config.MonitorMobilePropertiesConfig;
import com.xiaoleilu.hutool.collection.CollectionUtil;
import com.xiaoleilu.hutool.date.DateUtil;
import com.xiaoleilu.hutool.util.CollectionUtil;
import de.codecentric.boot.admin.event.ClientApplicationEvent;
import de.codecentric.boot.admin.event.ClientApplicationStatusChangedEvent;
import de.codecentric.boot.admin.notify.AbstractStatusChangeNotifier;

View File

@ -26,7 +26,7 @@
<spring-cloud.version>Edgware.RELEASE</spring-cloud.version>
<!--Lombok-->
<lombok.version>[1.0.0,9.99.99]</lombok.version>
<lombok.version>1.16.20</lombok.version>
<jjwt.version>0.9.0</jjwt.version>
<fastjson.version>1.2.46</fastjson.version>
@ -35,7 +35,7 @@
<jasypt.version>1.18</jasypt.version>
<mybatis-plus.version>2.1.9</mybatis-plus.version>
<mybatisplus-spring-boot-starter.version>1.0.5</mybatisplus-spring-boot-starter.version>
<hibernate-validator.version>6.0.7.Final</hibernate-validator.version>
<hibernate-validator.version>5.4.1.Final</hibernate-validator.version>
<swagger2.version>2.8.0</swagger2.version>
<fastdfs.version>0.2.0</fastdfs.version>
<sharding-jdbc-core-spring-boot-starter.version>2.0.1</sharding-jdbc-core-spring-boot-starter.version>