Browse Source

重构common-cache
新增common-async

LiTaohong 7 năm trước cách đây
mục cha
commit
ccfb2fd2f8
34 tập tin đã thay đổi với 647 bổ sung167 xóa
  1. 22 0
      base/common-async/pom.xml
  2. 58 0
      base/common-async/src/main/java/com/yihu/base/async/AsyncExecutorUtils.java
  3. 8 0
      base/common-async/src/main/resources/template.yml
  4. 7 2
      base/common-cache/pom.xml
  5. 1 15
      base/common-cache/src/main/java/com/yihu/base/cache/cache/CustomMapCache.java
  6. 31 23
      base/common-cache/src/main/java/com/yihu/base/cache/cache/CustomRedisCache.java
  7. 3 2
      base/common-cache/src/main/java/com/yihu/base/cache/manager/CacheManagerFactory.java
  8. 4 7
      base/common-cache/src/main/java/com/yihu/base/cache/manager/CustomCacheManager.java
  9. 2 1
      base/common-cache/src/main/java/com/yihu/base/cache/support/CacheSupportImpl.java
  10. 4 0
      base/common-cache/src/main/java/com/yihu/base/cache/support/CachingAnnoationAspect.java
  11. 15 18
      base/common-cache/src/main/java/com/yihu/base/cache/util/RedisTemplateUtils.java
  12. 0 32
      base/common-cache/src/main/java/com/yihu/base/cache/util/ThreadTaskUtils.java
  13. 4 1
      base/common-cache/src/main/resources/template.yml
  14. 1 1
      common/common-entity/src/main/java/com/yihu/jw/base/base/SystemDictDO.java
  15. 1 1
      common/common-entity/src/main/java/com/yihu/jw/base/base/SystemDictListDO.java
  16. 86 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/base/SystemDictListVO.java
  17. 70 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/base/SystemDictVO.java
  18. 56 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/BaseEmployVO.java
  19. 56 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/BaseMenuVO.java
  20. 56 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/BaseRoleVO.java
  21. 1 1
      server/svr-configuration/src/main/resources/application.yml
  22. 2 1
      server/svr-configuration/src/main/resources/bootstrap.yml
  23. 2 2
      server/svr-dashboard/src/main/resources/bootstrap.yml
  24. 1 1
      svr/svr-base/src/main/resources/application.yml
  25. 2 2
      svr/svr-base/src/main/resources/bootstrap.yml
  26. 1 1
      web-gateway/src/main/java/com/yihu/jw/aspect/LogAspect.java
  27. 18 4
      web-gateway/src/main/java/com/yihu/jw/commnon/base/user/BaseUserContants.java
  28. 46 0
      web-gateway/src/main/java/com/yihu/jw/controller/base/user/BaseRoleController.java
  29. 10 43
      web-gateway/src/main/java/com/yihu/jw/controller/base/user/EmployController.java
  30. 2 0
      web-gateway/src/main/java/com/yihu/jw/feign/base/base/FunctionFeign.java
  31. 13 0
      web-gateway/src/main/java/com/yihu/jw/feign/base/user/BaseRoleFeign.java
  32. 0 1
      web-gateway/src/main/java/com/yihu/jw/feign/base/user/EmployFeign.java
  33. 30 2
      web-gateway/src/main/java/com/yihu/jw/feign/fallbackfactory/base/user/BaseRoleFeignFallbackFactory.java
  34. 34 6
      web-gateway/src/main/java/com/yihu/jw/feign/fallbackfactory/base/user/EmployeeFeignFallbackFactory.java

+ 22 - 0
base/common-async/pom.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>common-lib-parent-pom</artifactId>
        <groupId>com.yihu.base</groupId>
        <version>1.0.0</version>
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>common-async</artifactId>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
    </dependencies>
</project>

+ 58 - 0
base/common-async/src/main/java/com/yihu/base/async/AsyncExecutorUtils.java

@ -0,0 +1,58 @@
package com.yihu.base.async;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/**
 * 异步线程类
 */
@Configuration
@EnableAsync
public class AsyncExecutorUtils implements AsyncConfigurer {
    private ThreadPoolTaskExecutor taskExecutor = null;
    @Value("core-size")
    private int coreSize;
    @Value("max-size")
    private int maxSize;
    @Value("quenue-capacity")
    private int queueCapacity;
    @Value("keep-alive-seconds")
    private int aliveSeconds;
    @Override
    public Executor getAsyncExecutor() {
        taskExecutor.setCorePoolSize(5);
        taskExecutor.setMaxPoolSize(20);
        taskExecutor.setQueueCapacity(25);
        taskExecutor.setKeepAliveSeconds(120);
        // 线程池对拒绝任务(无线程可用)的处理策略 ThreadPoolExecutor.CallerRunsPolicy策略 ,调用者的线程会执行该任务,如果执行器已关闭,则丢弃.
        taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
        taskExecutor.initialize();
        return taskExecutor;
    }
    @Override
    public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
        return null;
    }
}

+ 8 - 0
base/common-async/src/main/resources/template.yml

@ -0,0 +1,8 @@
thread:
  pool: #线程池配置
    core-size: 5 # 线程池里最小线程数
    max-size: 50 # 线程池里最大线程数量
    quenue-capacity: 1000 # 线程队列容量
    keep-alive-seconds: 120 # 线程最大的存活时间(毫秒)

+ 7 - 2
base/common-cache/pom.xml

@ -10,8 +10,8 @@
        <relativePath>../../common-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>common-customCache</groupId>
    <artifactId>common-customCache</artifactId>
    <groupId>common-cache</groupId>
    <artifactId>common-cache</artifactId>
    <version>1.0.0</version>
    <dependencies>
@ -24,6 +24,11 @@
            <artifactId>aspectjrt</artifactId>
            <version>1.8.10</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.base</groupId>
            <artifactId>common-async</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
    
</project>

+ 1 - 15
base/common-cache/src/main/java/com/yihu/base/cache/cache/CustomMapCache.java

@ -1,25 +1,11 @@
package com.yihu.base.cache.cache;
import com.yihu.base.cache.config.CacheKeyGenerator;
import com.yihu.base.cache.lock.CacheLock;
import com.yihu.base.cache.support.CacheSupport;
import com.yihu.base.cache.util.ReflectionUtils;
import com.yihu.base.cache.util.SpringContextUtils;
import com.yihu.base.cache.util.ThreadTaskUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.Cache;
import org.springframework.cache.concurrent.ConcurrentMapCache;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.cache.RedisCacheElement;
import org.springframework.data.redis.cache.RedisCacheKey;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.Assert;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
public class CustomMapCache extends ConcurrentMapCache{

+ 31 - 23
base/common-cache/src/main/java/com/yihu/base/cache/cache/CustomRedisCache.java

@ -1,11 +1,13 @@
package com.yihu.base.cache.cache;
import com.yihu.base.async.AsyncExecutorUtils;
import com.yihu.base.cache.config.CacheKeyGenerator;
import com.yihu.base.cache.support.CacheSupport;
import com.yihu.base.cache.lock.CacheLock;
import com.yihu.base.cache.util.SpringContextUtils;
import com.yihu.base.cache.util.ThreadTaskUtils;
import org.springframework.beans.factory.annotation.Value;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.cache.RedisCache;
import org.springframework.data.redis.cache.RedisCacheElement;
@ -14,16 +16,22 @@ import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.util.Assert;
public class CustomRedisCache extends RedisCache{
    public Logger logger = LoggerFactory.getLogger(CustomRedisCache.class);
    private Long expireTime;
    private Long refreshTime;
    private RedisOperations redisOperations;
    @Autowired
    private AsyncExecutorUtils asyncExecutorUtils;
    private CacheSupport getCacheSupport() {
        return SpringContextUtils.getBean(CacheSupport.class);
    }
@ -102,32 +110,32 @@ public class CustomRedisCache extends RedisCache{
    }
    /**
     * 刷新缓存数据
     * 新缓存数据
     * @param key
     * @param cacheKeyStr
     */
    private void refreshCache(Object key, String cacheKeyStr) {
    @Async("asyncExecutorUtils")
    public void refreshCache(Object key, String cacheKeyStr) {
        Long ttl = this.redisOperations.getExpire(cacheKeyStr);
        if (null != ttl && ttl <= CustomRedisCache.this.refreshTime) {
        if (null != ttl && ttl <= getRefreshTime()) {
            // 尽量少的去开启线程,因为线程池是有限的
            ThreadTaskUtils.run(new Runnable() {
                @Override
                public void run() {
                    // 加一个分布式锁,只放一个请求去刷新缓存
                    CacheLock cacheLock = new CacheLock((RedisTemplate) redisOperations, cacheKeyStr + "_lock");
                    try {
                        if (cacheLock.lock()) {
                            // 获取锁之后再判断一下过期时间,看是否需要加载数据
                            Long ttl = CustomRedisCache.this.redisOperations.getExpire(cacheKeyStr);
                            if (null != ttl && ttl <= CustomRedisCache.this.refreshTime) {
                                // 通过获取代理方法信息重新加载缓存数据
                                CustomRedisCache.this.getCacheSupport().refreshCacheByKey(CustomRedisCache.super.getName(), key.toString());
                            }
                        }
                    } catch (Exception e) {
                    } finally {
                        cacheLock.unlock();
            // 加一个分布式锁,只放一个请求去刷新缓存
            CacheLock cacheLock = new CacheLock((RedisTemplate) redisOperations, cacheKeyStr + "_lock");
            try {
                if (cacheLock.lock()) {
                    // 获取锁之后再判断一下过期时间,看是否需要加载数据
                    Long ttl2 = CustomRedisCache.this.redisOperations.getExpire(cacheKeyStr);
                    if (null != ttl2 && ttl2 <= getRefreshTime()) {
                        // 通过获取代理方法信息重新加载缓存数据
                        CustomRedisCache.this.getCacheSupport().refreshCacheByKey(CustomRedisCache.super.getName(), key.toString());
                    }
                }
            });
            } catch (Exception e) {
                logger.error("刷新缓存失败");
            } finally {
                cacheLock.unlock();
            }
        }
    }

+ 3 - 2
base/common-cache/src/main/java/com/yihu/base/cache/manager/CacheManagerFactory.java

@ -3,12 +3,13 @@ package com.yihu.base.cache.manager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
@Component
public class CacheManagerFactory {
    @Value("cache")
    @Value("cache.type")
    private String caceType;
    public CacheManager getCacheManager(){

+ 4 - 7
base/common-cache/src/main/java/com/yihu/base/cache/manager/CustomCacheManager.java

@ -1,17 +1,14 @@
package com.yihu.base.cache.manager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
public interface CustomCacheManager extends CacheManager{
    /**
     * 注解分隔符
     */
     //注解分隔符
    String SEPARATOR = "#";
    /**
     * SpEL标示符
     */
     String MARK = "$";
    // SpEL标示符
    String MARK = "$";
    Long getExpireTime();

+ 2 - 1
base/common-cache/src/main/java/com/yihu/base/cache/support/CacheSupportImpl.java

@ -15,6 +15,8 @@ import java.util.concurrent.ConcurrentHashMap;
@Component
public class CacheSupportImpl implements CacheSupport {
    @Autowired
    private CacheManagerFactory cacheManagerFactory;
    /**
     * 根据name获取cache列表
     * @param annoationCacheName
@ -26,7 +28,6 @@ public class CacheSupportImpl implements CacheSupport {
            return Collections.EMPTY_LIST;
        }
        Collection<Cache> cacheResults = new ArrayList<>();
        CacheManagerFactory cacheManagerFactory = new CacheManagerFactory();
        for(String cacheName:cacheNames){
            Cache cache = cacheManagerFactory.getCacheManager().getCache(cacheName);
            if(null == cache){

+ 4 - 0
base/common-cache/src/main/java/com/yihu/base/cache/support/CachingAnnoationAspect.java

@ -8,6 +8,7 @@ import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.core.BridgeMethodResolver;
import org.springframework.stereotype.Component;
@ -61,6 +62,9 @@ public class CachingAnnoationAspect {
        Object object = null;
        Method method = getSpecificMethod(proceedingJoinPoint);
        List<Cacheable> annotations =  getMethodAnnotations(method,Cacheable.class);
        if(null == annotations){
            return object;
        }
        Set<String> cacheSet = new HashSet<>();
        String cacheKey = "";

+ 15 - 18
base/common-cache/src/main/java/com/yihu/base/cache/util/RedisTemplateUtils.java

@ -9,24 +9,21 @@ public class RedisTemplateUtils {
    private static RedisTemplate redisTemplate;
    public static RedisTemplate getRedisTemplate(RedisConnectionFactory redisConnectionFactory){
        if(null == redisTemplate){
            synchronized (RedisTemplateUtils.class){
                if(null == redisTemplate){
                    redisTemplate = new RedisTemplate();
                    redisTemplate.setConnectionFactory(redisConnectionFactory);
                    JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer();
                    redisTemplate.setValueSerializer(jdkSerializationRedisSerializer);
                    redisTemplate.setHashValueSerializer(jdkSerializationRedisSerializer);
                    //key采用StringRedisSserializer来序列化
                    redisTemplate.setKeySerializer(new StringRedisSerializer());
                    redisTemplate.setHashKeySerializer(new StringRedisSerializer());
                    redisTemplate.afterPropertiesSet();
                }
            }
    //对方法进行同步,以确保redisTemplate只初始化一次
    public static synchronized RedisTemplate getRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
        if (null == redisTemplate) {
            redisTemplate = new RedisTemplate();
            redisTemplate.setConnectionFactory(redisConnectionFactory);
            JdkSerializationRedisSerializer jdkSerializationRedisSerializer = new JdkSerializationRedisSerializer();
            redisTemplate.setValueSerializer(jdkSerializationRedisSerializer);
            redisTemplate.setHashValueSerializer(jdkSerializationRedisSerializer);
            //key采用StringRedisSserializer来序列化
            redisTemplate.setKeySerializer(new StringRedisSerializer());
            redisTemplate.setHashKeySerializer(new StringRedisSerializer());
            redisTemplate.afterPropertiesSet();
        }
        return redisTemplate;
    }

+ 0 - 32
base/common-cache/src/main/java/com/yihu/base/cache/util/ThreadTaskUtils.java

@ -1,32 +0,0 @@
package com.yihu.base.cache.util;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ThreadPoolExecutor;
/**
 *
 */
public class ThreadTaskUtils {
    private static ThreadPoolTaskExecutor taskExecutor = null;
    static {
        taskExecutor = new ThreadPoolTaskExecutor();
        // 核心线程数
        taskExecutor.setCorePoolSize(5);
        // 最大线程数
        taskExecutor.setMaxPoolSize(50);
        // 队列最大长度
        taskExecutor.setQueueCapacity(1000);
        // 线程池维护线程所允许的空闲时间(单位秒)
        taskExecutor.setKeepAliveSeconds(120);
        // 线程池对拒绝任务(无线程可用)的处理策略 ThreadPoolExecutor.CallerRunsPolicy策略 ,调用者的线程会执行该任务,如果执行器已关闭,则丢弃.
        taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
        taskExecutor.initialize();
    }
    public static void run(Runnable runnable) {
        taskExecutor.execute(runnable);
    }
}

+ 4 - 1
base/common-cache/src/main/resources/template.yml

@ -1,4 +1,7 @@
cache: 1 # 1-内存 2-redis
cache: # 1-内存 2-redis
  type: 1
  expire-time: 2
  refresh-time: 1.5
spring:
  redis:

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/base/base/SystemDictDO.java

@ -12,7 +12,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "system_dict")
public class SystemDictDO extends IdEntityWithOperation implements java.io.Serializable {
public class SystemDictDO extends IdEntity implements java.io.Serializable {
	// Fields

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/base/base/SystemDictListDO.java

@ -12,7 +12,7 @@ import javax.persistence.Table;
 */
@Entity
@Table(name = "system_dict_list")
public class SystemDictListDO extends IdEntityWithOperation implements java.io.Serializable {
public class SystemDictListDO extends IdEntity implements java.io.Serializable {
	// Fields

+ 86 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/base/SystemDictListVO.java

@ -0,0 +1,86 @@
package com.yihu.jw.restmodel.base.base;
public class SystemDictListVO {
    private String dictName;
    private String chineseName;
    private String pyCode;
    private String pid;
    private String remark;
    private String relationTable;
    private String relationColCode;
    private String relationColValue;
    private String relationColExtend;
    public String getDictName() {
        return dictName;
    }
    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    public String getChineseName() {
        return chineseName;
    }
    public void setChineseName(String chineseName) {
        this.chineseName = chineseName;
    }
    public String getPyCode() {
        return pyCode;
    }
    public void setPyCode(String pyCode) {
        this.pyCode = pyCode;
    }
    public String getPid() {
        return pid;
    }
    public void setPid(String pid) {
        this.pid = pid;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getRelationTable() {
        return relationTable;
    }
    public void setRelationTable(String relationTable) {
        this.relationTable = relationTable;
    }
    public String getRelationColCode() {
        return relationColCode;
    }
    public void setRelationColCode(String relationColCode) {
        this.relationColCode = relationColCode;
    }
    public String getRelationColValue() {
        return relationColValue;
    }
    public void setRelationColValue(String relationColValue) {
        this.relationColValue = relationColValue;
    }
    public String getRelationColExtend() {
        return relationColExtend;
    }
    public void setRelationColExtend(String relationColExtend) {
        this.relationColExtend = relationColExtend;
    }
}

+ 70 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/base/SystemDictVO.java

@ -0,0 +1,70 @@
package com.yihu.jw.restmodel.base.base;
import java.util.Date;
public class SystemDictVO {
    private String id;
    private String saasId;
    private String dictName;
    private String code;
    private String value;
    private String pyCode;
    private Integer sort;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getDictName() {
        return dictName;
    }
    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    public String getPyCode() {
        return pyCode;
    }
    public void setPyCode(String pyCode) {
        this.pyCode = pyCode;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
}

+ 56 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/BaseEmployVO.java

@ -1,5 +1,7 @@
package com.yihu.jw.restmodel.base.user;
import java.util.Date;
public class BaseEmployVO {
    private String id; //id
    private String saasId; //saasIDF
@ -20,6 +22,12 @@ public class BaseEmployVO {
    private String xlzc;//学历职称
    private String xzzc;//行政职称
    private Integer status;//-1 删除 0 禁用 1可用
    private String createUser;
    private String createUserName;
    private Date createTime;
    private String updateUser;
    private String updateUserName;
    private Date updateTime;
    public String getId() {
        return id;
@ -172,4 +180,52 @@ public class BaseEmployVO {
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public String getUpdateUserName() {
        return updateUserName;
    }
    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}

+ 56 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/BaseMenuVO.java

@ -1,5 +1,7 @@
package com.yihu.jw.restmodel.base.user;
import java.util.Date;
public class BaseMenuVO {
    private String id;
    private String url;//请求路径
@ -10,6 +12,12 @@ public class BaseMenuVO {
    private Integer sort;
    private Integer status;
    private String remark;
    private String createUser;
    private String createUserName;
    private Date createTime;
    private String updateUser;
    private String updateUserName;
    private Date updateTime;
    public String getId() {
        return id;
@ -82,4 +90,52 @@ public class BaseMenuVO {
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public String getUpdateUserName() {
        return updateUserName;
    }
    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}

+ 56 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/user/BaseRoleVO.java

@ -1,5 +1,7 @@
package com.yihu.jw.restmodel.base.user;
import java.util.Date;
public class BaseRoleVO {
    private String id;
@ -7,6 +9,12 @@ public class BaseRoleVO {
    private String name;
    private Integer status;
    private String remark;
    private String createUser;
    private String createUserName;
    private Date createTime;
    private String updateUser;
    private String updateUserName;
    private Date updateTime;
    public String getId() {
        return id;
@ -47,4 +55,52 @@ public class BaseRoleVO {
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getUpdateUser() {
        return updateUser;
    }
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public String getUpdateUserName() {
        return updateUserName;
    }
    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}

+ 1 - 1
server/svr-configuration/src/main/resources/application.yml

@ -59,7 +59,7 @@ eureka:
---
spring:
  profiles: native
  profiles: jwdev
eureka:

+ 2 - 1
server/svr-configuration/src/main/resources/bootstrap.yml

@ -32,7 +32,8 @@ spring:
        git:
#          uri: http://192.168.1.220:10080/chenweida/jw.config.git
#          uri: http://192.168.116.100:10080/chenweida/mini.jw.config.git
         uri: http://192.168.1.220:10080/jiwei/jw.config.git
#         uri: http://192.168.1.220:10080/jiwei/jw.config.git
         uri: 172.19.103.33:1221/jiwei/jw.config.git
        default-label: jwdev

+ 2 - 2
server/svr-dashboard/src/main/resources/bootstrap.yml

@ -3,11 +3,11 @@ spring:
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true ##启动快速失败 即链接不到配置服务就启动失败
      failFast: true #启动快速失败 即链接不到配置服务就启动失败
      username: jw
      password: jkzl
      discovery:
        enabled: true ##使用发现服务
        enabled: true #使用发现服务
        service-id: svr-configurations ##配置服务的名字

+ 1 - 1
svr/svr-base/src/main/resources/application.yml

@ -1,7 +1,7 @@
##如果有配置服务的话,远程服务器和本地服务器配置不一致的情况下,优先远程的为主  git上 svr-base ->  git application ->本地 appliction ->本地 bootstarp
spring:
  application:
    name:  svr-base  ##注册到发现服务的id 如果id一样 eurika会自动做负载
    name:  svr-base-lith  #注册到发现服务的id 如果id一样 eurika会自动做负载
#hibernate 配置

+ 2 - 2
svr/svr-base/src/main/resources/bootstrap.yml

@ -1,4 +1,4 @@
##优先读取 boostarap配置 然后在读取application。yml的配置
##优先读取 boostarap配置 然后在读取application.yml的配置
spring:
  #从发现服务里面取配置服务的信息
  cloud:
@ -8,7 +8,7 @@ spring:
      password: jkzl
      discovery:
        enabled: true #使用发现服务
        service-id: svr-configurations ##配置服务的名字
        service-id: svr-configurations #配置服务的名字
---

+ 1 - 1
web-gateway/src/main/java/com/yihu/jw/aspect/LogAspect.java

@ -38,7 +38,7 @@ public class LogAspect {
            tracer.getCurrentSpan().tag(GatewayContanrts.ZipkinElasticKey.gateway_input_params,new JSONObject(request.getParameterMap()).toString());
            o = point.proceed();
            //访问后日志
            tracer.getCurrentSpan().tag(GatewayContanrts.ZipkinElasticKey.gateway_out_params,new JSONObject(o).toString());
            tracer.getCurrentSpan().tag(GatewayContanrts.ZipkinElasticKey.gateway_out_params,new JSONObject(o.toString()).toString());
        } catch (Exception ex) {
            ex.printStackTrace();
        }

+ 18 - 4
web-gateway/src/main/java/com/yihu/jw/commnon/base/user/BaseUserContants.java

@ -16,9 +16,18 @@ public class BaseUserContants {
        public static final String api_getById="/{id}";
        public static final String api_getListNoPage="/listNoPage";
        public static final String api_getList="/list";
        public static final String api_getChildren="/children/{id}";
    }
    //角色菜单常量
    public static class BaseRoleMenu{
        public static final String api_create="/";
        public static final String api_update="/";
        public static final String api_delete="/{id}";
        public static final String api_getListNoPage="/listNoPage";
    }
    //用户常量
    public static class Employee{
        public static final String api_create="/";
@ -27,8 +36,14 @@ public class BaseUserContants {
        public static final String api_getById="/{id}";
        public static final String api_getListNoPage="/listNoPage";
        public static final String api_getList="/list";
        public static final String api_getChildren="/children/{id}";
    }
    //用户角色常量
    public static class EmployeeRole{
        public static final String api_create="/";
        public static final String api_update="/";
        public static final String api_delete="/{id}";
        public static final String api_getListNoPage="/listNoPage";
    }
    //菜单常量
@ -39,7 +54,6 @@ public class BaseUserContants {
        public static final String api_getById="/{id}";
        public static final String api_getListNoPage="/listNoPage";
        public static final String api_getList="/list";
        public static final String api_getChildren="/children/{id}";
    }
}

+ 46 - 0
web-gateway/src/main/java/com/yihu/jw/controller/base/user/BaseRoleController.java

@ -132,4 +132,50 @@ public class BaseRoleController extends EnvelopRestController {
        return fegin.getListNoPage(fields, filterStr, sorts);
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @PostMapping(value = BaseUserContants.BaseRoleMenu.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增角色菜单", notes = "新增角色菜单")
    public Envelop createRoleMenus(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws JiWeiException {
        return fegin.createRoleMenus(jsonData);
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @PutMapping(value = BaseUserContants.BaseRoleMenu.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改角色菜单", notes = "修改角色菜单")
    public Envelop updateRoleMenu(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws JiWeiException {
        return fegin.updateRoleMenus(jsonData);
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @DeleteMapping(value = BaseUserContants.BaseRoleMenu.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "删除角色菜单", notes = "删除角色菜单")
    public Envelop deleteRoleMenus(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws JiWeiException {
        return fegin.deleteRoleMenus(jsonData);
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @GetMapping(value = BaseUserContants.BaseRoleMenu.api_getListNoPage)
    @ApiOperation(value = "获取角菜单列表,不分页")
    public Envelop getMenuListNoPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,name,saasId,sex,phone,email,jxzc,lczcn,xlzc,xzzc,createUser,remark") @RequestParam(value = "fields", required = false) String fields) throws Exception {
        return fegin.getMenuList(fields);
    }
}

+ 10 - 43
web-gateway/src/main/java/com/yihu/jw/controller/base/user/EmployController.java

@ -113,31 +113,7 @@ public class EmployController extends EnvelopRestController {
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @GetMapping(value = BaseUserContants.Employee.api_getListNoPage)
    @ApiOperation(value = "获取功能列表,不分页")
    public Envelop getRolesListNoPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,name,saasId,sex,phone,email,jxzc,lczcn,xlzc,xzzc,createUser,remark")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+name,+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        String filterStr = "";
        if(StringUtils.isNotBlank(filters)){
            JSONObject jsonResult = new JSONObject(filters);
            if(jsonResult.has("saasId")){
                filterStr+="saasId="+jsonResult.get("saasId")+";";
            }
        }
        return fegin.getRoleList(fields);
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @PostMapping(value = BaseUserContants.Employee.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @PostMapping(value = BaseUserContants.EmployeeRole.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增用戶角色", notes = "新增用戶角色")
    public Envelop createEmployRoles(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
@ -146,13 +122,11 @@ public class EmployController extends EnvelopRestController {
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @PostMapping(value = BaseUserContants.Employee.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增用戶角色", notes = "新增用戶角色")
    @PutMapping(value = BaseUserContants.EmployeeRole.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改用戶角色", notes = "修改用戶角色")
    public Envelop updateEmployRoles(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws JiWeiException {
@ -160,13 +134,11 @@ public class EmployController extends EnvelopRestController {
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @PostMapping(value = BaseUserContants.Employee.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增用戶角色", notes = "新增用戶角色")
    @DeleteMapping(value = BaseUserContants.EmployeeRole.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "删除用戶角色", notes = "删除用戶角色")
    public Envelop deleteEmployRoles(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws JiWeiException {
@ -174,19 +146,14 @@ public class EmployController extends EnvelopRestController {
    }
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
            @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
    @PostMapping(value = BaseUserContants.Employee.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增用戶角色", notes = "新增用戶角色")
    public Envelop getRoleList(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) throws JiWeiException {
        return fegin.create(jsonData);
    @GetMapping(value = BaseUserContants.EmployeeRole.api_getListNoPage)
    @ApiOperation(value = "获取用戶角色列表,不分页")
    public Envelop getRolesListNoPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,name,saasId,sex,phone,email,jxzc,lczcn,xlzc,xzzc,createUser,remark") @RequestParam(value = "fields", required = false) String fields) throws Exception {
        return fegin.getRoleList(fields);
    }
}

+ 2 - 0
web-gateway/src/main/java/com/yihu/jw/feign/base/base/FunctionFeign.java

@ -43,4 +43,6 @@ public interface FunctionFeign {
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "sorts", required = false) String sorts) throws JiWeiException;
    @GetMapping(value = BaseRequestMapping.Function.api_getChildren)
    Envelop getChildren(@PathVariable(value="id") String id) throws JiWeiException;
}

+ 13 - 0
web-gateway/src/main/java/com/yihu/jw/feign/base/user/BaseRoleFeign.java

@ -43,4 +43,17 @@ public interface BaseRoleFeign {
            @RequestParam(value = "fields", required = false) String fields,
            @RequestParam(value = "filters", required = false) String filters,
            @RequestParam(value = "sorts", required = false) String sorts) throws JiWeiException;
    @RequestMapping(value = BaseUserRequestMapping.BaseRoleMenu.api_create,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.POST)
    Envelop createRoleMenus(@RequestBody String jsonData) throws JiWeiException;
    @RequestMapping(value = BaseUserRequestMapping.BaseRoleMenu.api_update,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.POST)
    Envelop updateRoleMenus(@RequestBody String jsonData) throws JiWeiException;
    @RequestMapping(value = BaseUserRequestMapping.BaseRoleMenu.api_delete,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.POST)
    Envelop deleteRoleMenus(@RequestBody String jsonData) throws JiWeiException;
    @RequestMapping(value = BaseUserRequestMapping.BaseRoleMenu.api_getListNoPage,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.POST)
    Envelop getMenuList(@RequestBody String jsonData) throws JiWeiException;
}

+ 0 - 1
web-gateway/src/main/java/com/yihu/jw/feign/base/user/EmployFeign.java

@ -57,6 +57,5 @@ public interface EmployFeign {
    @RequestMapping(value = BaseUserRequestMapping.BaseEmployRole.api_getListNoPage,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.POST)
    Envelop getRoleList(@RequestBody String jsonData) throws JiWeiException;
}

+ 30 - 2
web-gateway/src/main/java/com/yihu/jw/feign/fallbackfactory/base/user/BaseRoleFeignFallbackFactory.java

@ -50,7 +50,7 @@ public class BaseRoleFeignFallbackFactory implements FallbackFactory<BaseRoleFei
            @Override
            public Envelop getList(String fields, String filterStr, String sorts, int size, int page) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("分页查找角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("分页查找角色列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("fields:" + fields);
                tracer.getCurrentSpan().logEvent("filters:" + filterStr);
                tracer.getCurrentSpan().logEvent("sorts:" + sorts);
@ -61,13 +61,41 @@ public class BaseRoleFeignFallbackFactory implements FallbackFactory<BaseRoleFei
            @Override
            public Envelop getListNoPage(String fields, String filters, String sorts) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("查找角色列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("不分页查找角色列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("fields:" + fields);
                tracer.getCurrentSpan().logEvent("filters:" + filters);
                tracer.getCurrentSpan().logEvent("sorts:" + sorts);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop createRoleMenus(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("创建角色菜单失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop updateRoleMenus(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("修改角色菜单失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop deleteRoleMenus(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("删除角色菜单失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop getMenuList(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("获取角色菜单列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
        };
    }
}

+ 34 - 6
web-gateway/src/main/java/com/yihu/jw/feign/fallbackfactory/base/user/EmployeeFeignFallbackFactory.java

@ -21,35 +21,35 @@ public class EmployeeFeignFallbackFactory  implements FallbackFactory<EmployFeig
        return new EmployFeign() {
            @Override
            public Envelop create(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("创建角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("创建用户失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop update(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("更新角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("更新用户失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop delete(@PathVariable String id) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("删除角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("删除用户失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("id:"+id);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop findById(String id) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("查找单个角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("查找单个用户失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("id:"+id);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop getList(String fields, String filterStr, String sorts, int size, int page) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("分页查找角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("分页查找用户失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("fields:" + fields);
                tracer.getCurrentSpan().logEvent("filters:" + filterStr);
                tracer.getCurrentSpan().logEvent("sorts:" + sorts);
@ -60,13 +60,41 @@ public class EmployeeFeignFallbackFactory  implements FallbackFactory<EmployFeig
            @Override
            public Envelop getListNoPage(String fields, String filters, String sorts) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("查找角色列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("不分页查找用户列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("fields:" + fields);
                tracer.getCurrentSpan().logEvent("filters:" + filters);
                tracer.getCurrentSpan().logEvent("sorts:" + sorts);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop createEmployRoles(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("新增用户角色列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop updateEmployRoles(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("修改用户角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop deleteEmployRoles(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("删除用户角色失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
            @Override
            public Envelop getRoleList(@RequestBody String jsonData) throws JiWeiException {
                tracer.getCurrentSpan().logEvent("获取用户角色列表失败:原因:"+e.getMessage());
                tracer.getCurrentSpan().logEvent("jsonData:"+jsonData);
                throw new JiWeiException(e);
            }
        };
    }
}