diff --git a/README.md b/README.md index d5587a2f286c799fead4b771d63f4f734e1545f5..414b71eb69a446019daa02184fe0c72a755b0aa1 100644 --- a/README.md +++ b/README.md @@ -44,14 +44,13 @@ BootDo 提供了常用工具进行封装,包括日志工具、缓存工具、 * 数据库连接池:Alibaba Druid * 缓存框架:Ehcache 、Redis * 日志管理:SLF4J -* 工具类:Apache Commons、Jackson 、Xstream 1.4、Dozer 5.3、POI 3.9 +* 工具类:Apache Commons、Jackson 2、前端 * JS框架:jQuery * 客户端验证:JQuery Validation * 富文本在线编辑:summernote -* 在线文件管理:CKFinder * 数据表格:bootstrapTable * 弹出层:layer * 树结构控件:jsTree @@ -59,8 +58,7 @@ BootDo 提供了常用工具进行封装,包括日志工具、缓存工具、 4、平台 * 服务器中间件:SpringBoot内置 -* 数据库支持:目前仅提供MySql数据库的支持,但不限于数据库,平台留有其它数据库支持接口, -你可以很方便的更改为其它数据库,如:SqlServer 2008、MySql 5.5、H2等 +* 数据库支持:目前仅提供MySql数据库的支持,但不限于数据库 * 开发环境:Java、Eclipse Java EE 、Maven 、Git ## 安全考虑 diff --git "a/bootdo/bootdo(\345\246\202\346\236\234\346\212\245\351\224\231\350\257\267\346\211\247\350\241\214\350\277\231\344\270\252\345\205\274\345\256\271\347\211\210\346\234\254).sql" "b/bootdo/bootdo(\345\246\202\346\236\234\346\212\245\351\224\231\350\257\267\346\211\247\350\241\214\350\277\231\344\270\252\345\205\274\345\256\271\347\211\210\346\234\254).sql" new file mode 100644 index 0000000000000000000000000000000000000000..e9c31d5cebadc71a827a6d1cce6601ee7a5c5294 --- /dev/null +++ "b/bootdo/bootdo(\345\246\202\346\236\234\346\212\245\351\224\231\350\257\267\346\211\247\350\241\214\350\277\231\344\270\252\345\205\274\345\256\271\347\211\210\346\234\254).sql" @@ -0,0 +1,1219 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 50717 +Source Host : localhost:3306 +Source Database : bootdo + +Target Server Type : MYSQL +Target Server Version : 50717 +File Encoding : 65001 + +Date: 2018-01-04 14:01:20 +*/ + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for `blog_content` +-- ---------------------------- +DROP TABLE IF EXISTS `blog_content`; +CREATE TABLE `blog_content` ( + `cid` bigint(20) NOT NULL AUTO_INCREMENT, + `title` varchar(255) DEFAULT NULL COMMENT '标题', + `slug` varchar(255) DEFAULT NULL, + `created` bigint(20) DEFAULT NULL COMMENT '创建人id', + `modified` bigint(20) DEFAULT NULL COMMENT '最近修改人id', + `content` text COMMENT '内容', + `type` varchar(16) DEFAULT NULL COMMENT '类型', + `tags` varchar(200) DEFAULT NULL COMMENT '标签', + `categories` varchar(200) DEFAULT NULL COMMENT '分类', + `hits` int(5) DEFAULT NULL, + `comments_num` int(5) DEFAULT '0' COMMENT '评论数量', + `allow_comment` int(1) DEFAULT '0' COMMENT '开启评论', + `allow_ping` int(1) DEFAULT '0' COMMENT '允许ping', + `allow_feed` int(1) DEFAULT '0' COMMENT '允许反馈', + `status` int(1) DEFAULT NULL COMMENT '状态', + `author` varchar(100) DEFAULT NULL COMMENT '作者', + `gtm_create` datetime DEFAULT NULL COMMENT '创建时间', + `gtm_modified` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`cid`) +) ENGINE=InnoDB AUTO_INCREMENT=122 DEFAULT CHARSET=utf8 COMMENT='文章内容'; + +-- ---------------------------- +-- Records of blog_content +-- ---------------------------- +INSERT INTO `blog_content` VALUES ('75', '基于 Springboot 和 Mybatis 的后台管理系统 BootDo', null, null, null, '

项目介绍

演示地址 http://47.93.239.129

功能简介

1. 用户管理
2. 角色管理
3. 部门管理
4. 菜单管理
5. 系统日志
6. 代码生成
7. 内容管理

所用框架

前端
1. Bootstrap
2. jQuery
3. bootstrap-table
4. layer
5. jsTree 
6. summernote
7. jquery-validate
8. jquery-treegrid

后端
1. SpringBoot 
2. MyBatis
3. Thymeleaf
4. Shiro
5. druid

项目截图

', 'article', null, null, null, null, '0', '0', '1', '1', 'bootdo', '2017-09-22 14:44:44', '2017-09-22 14:44:44'); +INSERT INTO `blog_content` VALUES ('100', 'springboot thymeleaf和shiro 整合——按钮可见性', null, null, null, '

添加依赖

<dependency> \r\n   <groupId>com.github.theborakompanioni</groupId>\r\n    <artifactId>thymeleaf-extras-shiro</artifactId>\r\n    <version>1.2.1</version> \r\n</dependency>

 

在shiro的configuration中配置

@Bean\r\n    public ShiroDialect shiroDialect() {\r\n        return new ShiroDialect();\r\n    }

 

在html中加入xmlns

<html lang=\"zh_CN\" xmlns:th=\"http://www.thymeleaf.org\"\r\n      xmlns:shiro=\"http://www.pollix.at/thymeleaf/shiro\">

例子

<button shiro:hasPermission=\"sys:user:add\" type=\"button\" class=\"btn  btn-primary\" onclick=\"add()\">\r\n   <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>添加\r\n</button>
', 'article', null, null, null, null, '1', null, '0', '1', 'bootdo', '2017-09-22 13:24:30', '2017-09-22 13:24:30'); +INSERT INTO `blog_content` VALUES ('108', 'spring boot ehcache整合', null, null, null, '

pom.xml配置 引入依赖包

<dependency>\r\n    <groupId>org.springframework.boot</groupId>\r\n    <artifactId>spring-boot-starter-cache</artifactId>\r\n</dependency>\r\n<dependency>\r\n    <groupId>net.sf.ehcache</groupId>\r\n    <artifactId>ehcache</artifactId>\r\n</dependency>

编写配置类,设置缓存机制

@Configuration\r\n@EnableCaching\r\npublic class CacheConfiguration {\r\n\r\n    @Bean\r\n    public EhCacheCacheManager ehCacheCacheManager(EhCacheManagerFactoryBean bean) {\r\n        return new EhCacheCacheManager(bean.getObject());\r\n    }\r\n\r\n    @Bean\r\n    public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {\r\n        EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();\r\n        cacheManagerFactoryBean.setConfigLocation(new ClassPathResource(\"config/ehcache.xml\"));\r\n        cacheManagerFactoryBean.setShared(true);\r\n        return cacheManagerFactoryBean;\r\n    }\r\n}

ehcache.xml配置:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<ehcache xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://ehcache.org/ehcache.xsd\"\r\n    updateCheck=\"false\">\r\n    <!-- diskStore:为缓存路径,ehcache分为内存和磁盘两级,此属性定义磁盘的缓存位置。\r\n    参数解释如下: user.home – 用户主目录 \r\n    user.dir – 用户当前工作目录 \r\n    java.io.tmpdir – 默认临时文件路径 -->\r\n    <diskStore path=\"java.io.tmpdir/Tmp_EhCache\" />\r\n    <!-- defaultCache:默认缓存策略,当ehcache找不到定义的缓存时,则使用这个缓存策略。只能定义一个。 -->\r\n    <!-- name:缓存名称。 \r\n        maxElementsInMemory:缓存最大数目\r\n        maxElementsOnDisk:硬盘最大缓存个数。 \r\n        eternal:对象是否永久有效,一但设置了,timeout将不起作用。 \r\n        overflowToDisk:是否保存到磁盘,当系统当机时 \r\n        timeToIdleSeconds:设置对象在失效前的允许闲置时间(单位:秒)。仅当eternal=false对象不是永久有效时使 用,可选属性,默认值是0,也就是可闲置时间无穷大。\r\n        timeToLiveSeconds:设置对象在失效前允许存活时间(单位:秒)。最大时间介于创建时间和失效时间之间。仅 当eternal=false对象不是永久有效时使用,默认是0.,也就是对象存活时间无穷大。 \r\n        diskPersistent:是否缓存虚拟机重启期数据Whether the disk store persists between restarts \r\n        of the Virtual Machine. The default value is false. \r\n        diskSpoolBufferSizeMB:这个参数设置DiskStore(磁盘缓存)的缓存区大小。默认是30MB。每个Cache都应该 有自己的一个缓冲区。 \r\n        diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认是120秒。 \r\n        memoryStoreEvictionPolicy:当达到maxElementsInMemory限制时,Ehcache将会根据指定的策略去清理内 存。默认策略是LRU(最近最少使用)。\r\n        你可以设置为FIFO(先进先出)或是LFU(较少使用)。 \r\n        clearOnFlush:内存数量最大时是否清除。\r\n        memoryStoreEvictionPolicy:可选策略有:LRU(最近最少使用,默认策略)、FIFO(先进先出)、LFU(最少 访问次数)。 \r\n         FIFO,first in first out,这个是大家最熟的,先进先出。\r\n         LFU, Less Frequently Used,就是上面例子中使用的策略,直白一点就是讲一直以来最少被使用的。如上面 所讲,缓存的元素有一个hit属性,hit值最小的将会被清出缓存。 \r\n         LRU,Least Recently Used,最近最少使用的,缓存的元素有一个时间戳,当缓存容量满了,而又需要腾出地 方来缓存新的元素的时候,\r\n         那么现有缓存元素中时间戳离当前时间最远的元素将被清出缓存。 -->\r\n    <defaultCache eternal=\"false\" maxElementsInMemory=\"1000\" overflowToDisk=\"false\" diskPersistent=\"false\"\r\n        timeToIdleSeconds=\"0\" timeToLiveSeconds=\"600\" memoryStoreEvictionPolicy=\"LRU\" />\r\n    <cache name=\"snailAuthCache\" eternal=\"false\" maxElementsInMemory=\"10000\" overflowToDisk=\"false\" diskPersistent=\"false\"\r\n        timeToIdleSeconds=\"0\" timeToLiveSeconds=\"0\" memoryStoreEvictionPolicy=\"LFU\" />\r\n</ehcache>


', 'article', null, null, null, null, '1', null, '0', '1', 'bootdo', '2017-09-22 17:48:29', '2017-09-22 17:48:29'); +INSERT INTO `blog_content` VALUES ('109', 'spring-boot整合ehcache实现缓存机制', null, null, null, '


  EhCache 是一个纯Java的进程内缓存框架,具有快速、精干等特点,是Hibernate中默认的CacheProvider。

  ehcache提供了多种缓存策略,主要分为内存和磁盘两级,所以无需担心容量问题。

  spring-boot是一个快速的集成框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。

  由于spring-boot无需任何样板化的配置文件,所以spring-boot集成一些其他框架时会有略微的不同。

  1.spring-boot是一个通过maven管理的jar包的框架,集成ehcache需要的依赖如下

\"复制代码\"
 <dependency>\r\n    <groupId>org.springframework</groupId>\r\n     <artifactId>spring-context-support</artifactId>\r\n</dependency>\r\n<dependency>\r\n         <groupId>net.sf.ehcache</groupId>\r\n      <artifactId>ehcache</artifactId>\r\n          <version>2.8.3</version>\r\n</dependency>        
\"复制代码\"

    具体pom.xml文件如下

\"复制代码\"
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n    xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n    <modelVersion>4.0.0</modelVersion>\r\n\r\n    <groupId>com.lclc.boot</groupId>\r\n    <artifactId>boot-cache</artifactId>\r\n    <version>0.0.1-SNAPSHOT</version>\r\n    <!-- Inherit defaults from Spring Boot -->\r\n    <parent>\r\n        <groupId>org.springframework.boot</groupId>\r\n        <artifactId>spring-boot-starter-parent</artifactId>\r\n        <version>1.1.3.RELEASE</version>\r\n    </parent>\r\n    <dependencies>\r\n        <dependency>\r\n            <groupId>org.springframework.boot</groupId>\r\n            <artifactId>spring-boot-starter-web</artifactId>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>org.springframework.boot</groupId>\r\n            <artifactId>spring-boot-starter-data-jpa</artifactId>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>org.springframework.boot</groupId>\r\n            <artifactId>spring-boot-starter-thymeleaf</artifactId>\r\n        </dependency>\r\n        \r\n        <dependency>\r\n            <groupId>mysql</groupId>\r\n            <artifactId>mysql-connector-java</artifactId>\r\n        </dependency>\r\n\r\n        <dependency>\r\n            <groupId>com.google.guava</groupId>\r\n            <artifactId>guava</artifactId>\r\n            <version>17.0</version>\r\n        </dependency>\r\n        \r\n        <dependency>\r\n            <groupId>org.springframework</groupId>\r\n            <artifactId>spring-context-support</artifactId>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>net.sf.ehcache</groupId>\r\n            <artifactId>ehcache</artifactId>\r\n            <version>2.8.3</version>\r\n        </dependency>\r\n    </dependencies>\r\n\r\n    <dependencyManagement>\r\n        <dependencies>\r\n        </dependencies>\r\n    </dependencyManagement>\r\n\r\n    <build>\r\n        <plugins>\r\n            <plugin>\r\n                <groupId>org.springframework.boot</groupId>\r\n                <artifactId>spring-boot-maven-plugin</artifactId>\r\n            </plugin>\r\n        </plugins>\r\n    </build>\r\n\r\n    <repositories>\r\n        <repository>\r\n            <id>spring-snapshots</id>\r\n            <url>http://repo.spring.io/snapshot</url>\r\n            <snapshots>\r\n                <enabled>true</enabled>\r\n            </snapshots>\r\n        </repository>\r\n        <repository>\r\n            <id>spring-milestones</id>\r\n            <url>http://repo.spring.io/milestone</url>\r\n        </repository>\r\n    </repositories>\r\n    <pluginRepositories>\r\n        <pluginRepository>\r\n            <id>spring-snapshots</id>\r\n            <url>http://repo.spring.io/snapshot</url>\r\n        </pluginRepository>\r\n        <pluginRepository>\r\n            <id>spring-milestones</id>\r\n            <url>http://repo.spring.io/milestone</url>\r\n        </pluginRepository>\r\n    </pluginRepositories>\r\n\r\n</project>
\"复制代码\"

   2.使用ehcache,我们需要一个ehcache.xml来定义一些cache的属性。

\"复制代码\"
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<ehcache xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://ehcache.org/ehcache.xsd\"\r\n  updateCheck=\"false\">\r\n          <diskStore path=\"java.io.tmpdir/Tmp_EhCache\" />\r\n           <defaultCache eternal=\"false\" maxElementsInMemory=\"1000\" overflowToDisk=\"false\" diskPersistent=\"false\"\r\n    timeToIdleSeconds=\"0\" timeToLiveSeconds=\"600\" memoryStoreEvictionPolicy=\"LRU\" />\r\n\r\n            <cache name=\"demo\" eternal=\"false\" maxElementsInMemory=\"100\" overflowToDisk=\"false\" diskPersistent=\"false\"\r\n    timeToIdleSeconds=\"0\" timeToLiveSeconds=\"300\" memoryStoreEvictionPolicy=\"LRU\" />\r\n\r\n</ehcache>
\"复制代码\"

   解释下这个xml文件中的标签。

  (1).diskStore: 为缓存路径,ehcache分为内存和磁盘两级,此属性定义磁盘的缓存位置。参数解释如下:    
             user.home – 用户主目录
             user.dir  – 用户当前工作目录
             java.io.tmpdir – 默认临时文件路径

  (2).defaultCache:默认缓存策略,当ehcache找不到定义的缓存时,则使用这个缓存策略。只能定义一个。

       (3).cache:自定缓存策略,为自定义的缓存策略。参数解释如下:

    cache元素的属性:   
            name:缓存名称                  
            maxElementsInMemory:内存中最大缓存对象数                  
            maxElementsOnDisk:硬盘中最大缓存对象数,若是0表示无穷大                  
            eternal:true表示对象永不过期,此时会忽略timeToIdleSeconds和timeToLiveSeconds属性,默认为false                
            overflowToDisk:true表示当内存缓存的对象数目达到了maxElementsInMemory界限后,会把溢出的对象写到硬盘缓存中。注意:如果缓存的对象要写入到硬盘中的话,则该对象必须实现了Serializable接口才行。                  
            diskSpoolBufferSizeMB:磁盘缓存区大小,默认为30MB。每个Cache都应该有自己的一个缓存区。               
            diskPersistent:是否缓存虚拟机重启期数据                  
            diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认为120秒     
            timeToIdleSeconds: 设定允许对象处于空闲状态的最长时间,以秒为单位。当对象自从最近一次被访问后,如果处于空闲状态的时间超过了timeToIdleSeconds属性值,这个对象就会过期,EHCache将把它从缓存中清空。只有当eternal属性为false,该属性才有效。如果该属性值为0,则表示对象可以无限期地处于空闲状态                  
            timeToLiveSeconds:设定对象允许存在于缓存中的最长时间,以秒为单位。当对象自从被存放到缓存中后,如果处于缓存中的时间超过了 timeToLiveSeconds属性值,这个对象就会过期,EHCache将把它从缓存中清除。只有当eternal属性为false,该属性才有效。如果该属性值为0,则表示对象可以无限期地存在于缓存中。timeToLiveSeconds必须大于timeToIdleSeconds属性,才有意义     
            memoryStoreEvictionPolicy:当达到maxElementsInMemory限制时,Ehcache将会根据指定的策略去清理内存。可选策略有:LRU(最近最少使用,默认策略)、FIFO(先进先出)、LFU(最少访问次数)。  

 

  3.将ehcache的管理器暴露给spring的上下文容器,

  

\"复制代码\"
@Configuration\r\n// 标注启动了缓存\r\n@EnableCaching\r\npublic class CacheConfiguration {\r\n\r\n    /*\r\n     * ehcache 主要的管理器\r\n     */\r\n    @Bean(name = \"appEhCacheCacheManager\")\r\n    public EhCacheCacheManager ehCacheCacheManager(EhCacheManagerFactoryBean bean){\r\n        return new EhCacheCacheManager (bean.getObject ());\r\n    }\r\n\r\n    /*\r\n     * 据shared与否的设置,Spring分别通过CacheManager.create()或new CacheManager()方式来创建一个ehcache基地.\r\n     */\r\n    @Bean\r\n    public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){\r\n        EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean ();\r\n        cacheManagerFactoryBean.setConfigLocation (new ClassPathResource (\"conf/ehcache-app.xml\"));\r\n        cacheManagerFactoryBean.setShared (true);\r\n        return cacheManagerFactoryBean;\r\n    }\r\n}
\"复制代码\"

 

       @Configuration:为spring-boot注解,主要标注此为配置类,优先扫描。

      @Bean:向spring容器中加入bean。

  至此所有的配置都做好了,通过spring-boot进行集成框架就是这么简单。

  4.使用ehcache

    使用ehcache主要通过spring的缓存机制,上面我们将spring的缓存机制使用了ehcache进行实现,所以使用方面就完全使用spring缓存机制就行了。
    具体牵扯到几个注解:

    @Cacheable:负责将方法的返回值加入到缓存中,参数3
    @CacheEvict:负责清除缓存,参数4

     参数解释:

    value:缓存位置名称,不能为空,如果使用EHCache,就是ehcache.xml中声明的cache的name
    key:缓存的key,默认为空,既表示使用方法的参数类型及参数值作为key,支持SpEL
    condition:触发条件,只有满足条件的情况才会加入缓存,默认为空,既表示全部都加入缓存,支持SpEL

    allEntries:CacheEvict参数,true表示清除value中的全部缓存,默认为false

  不多说,直接上代码:

  

\"复制代码\"
@Service\r\npublic class CacheDemoServiceImpl implements CacheDemoService {\r\n\r\n    /**\r\n     * 缓存的key\r\n     */\r\n    public static final String THING_ALL_KEY   = \"\\\"thing_all\\\"\";\r\n    /**\r\n     * value属性表示使用哪个缓存策略,缓存策略在ehcache.xml\r\n     */\r\n    public static final String DEMO_CACHE_NAME = \"demo\";\r\n   \r\n    @CacheEvict(value = DEMO_CACHE_NAME,key = THING_ALL_KEY)\r\n    @Override\r\n    public void create(Thing thing){\r\n        Long id = getNextId ();\r\n        thing.setId (id);\r\n        data.put (id, thing);\r\n    } \r\n      \r\n     @Cacheable(value = DEMO_CACHE_NAME,key = \"#thing.getId()+\'thing\'\")\r\n    @Override\r\n    public Thing findById(Long id){\r\n        System.err.println (\"没有走缓存!\" + id);\r\n        return data.get (id);\r\n    }\r\n\r\n      @Cacheable(value = DEMO_CACHE_NAME,key = THING_ALL_KEY)\r\n    @Override\r\n    public List<Thing> findAll(){\r\n        return Lists.newArrayList (data.values ());\r\n    }\r\n   \r\n   \r\n      @Override\r\n    @CachePut(value = DEMO_CACHE_NAME,key = \"#thing.getId()+\'thing\'\")\r\n    @CacheEvict(value = DEMO_CACHE_NAME,key = THING_ALL_KEY)\r\n    public Thing update(Thing thing){\r\n        System.out.println (thing);\r\n        data.put (thing.getId (), thing);\r\n        return thing;\r\n    }\r\n\r\n    @CacheEvict(value = DEMO_CACHE_NAME)\r\n    @Override\r\n    public void delete(Long id){\r\n        data.remove (id);\r\n    }\r\n   \r\n}
\"复制代码\"

 

    5.只需要通过注解在service层方法上打注解便可以使用缓存,在find**上存入缓存,在delete**,update**上清除缓存。

 

', 'article', null, null, null, null, '1', null, '0', '1', 'bootdo', '2017-09-24 11:15:18', '2017-09-24 11:15:18'); +INSERT INTO `blog_content` VALUES ('110', 'spring boot 图片上传后的图片读取路径在win与linux环境配置的差别', null, null, null, '
  1. win

    [java] view plain copy
    1. @Component  
    2. class WebConfigurer extends WebMvcConfigurerAdapter {  
    3.     @Override  
    4.     public void addResourceHandlers(ResourceHandlerRegistry registry) {  
    5.         registry.addResourceHandler(\"/files/**\").addResourceLocations(\"file:///E:/var/spring/uploaded_files/\");  
    6.     }  
    7.   
    8. }  
    linux
    [java] view plain copy
    1. @Component  
    2. class WebConfigurer extends WebMvcConfigurerAdapter {  
    3.     @Override  
    4.     public void addResourceHandlers(ResourceHandlerRegistry registry) {  
    5.         registry.addResourceHandler(\"/files/**\").addResourceLocations(\"file:///var/spring/uploaded_files\");  
    6.     }  
    7.   
    8. }  
', 'article', null, null, null, null, '1', null, '1', '1', 'bootdo', '2017-09-24 09:15:35', '2017-09-24 09:15:35'); +INSERT INTO `blog_content` VALUES ('111', 'Springmvc提交日期类型参数', null, null, null, '
  1. 背景介绍 
    在springmvc框架中,前台传入到后台的form会经过springmvc自动封装到pojo类中,后台接受的时候可以在参数内直接接受这个java类。

  2. 传参 
    通常情况下,前台的表单的类型诸如int,string等,都会根据pojo中字段的类型自动转换。所以为我们省去了不少麻烦,但很可惜其中不包括日期类型。

  3. 原因 
    因为日期的格式多种多样,spring自身不适合对其进行封装。好在spring给出了便捷的方法给我们自己转换数据类型。

  4. 具体实现

在controller层中,加入以下代码段

@InitBinder\r\npublic void initBinder(WebDataBinder binder) {\r\n    SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n    dateFormat.setLenient(false);\r\n    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));//true:允许输入空值,false:不能为空值\r\n}

可以解决这个问题。但是这个时候Date类型的参数是null的话,还是会报错。采用另外一种方式则更好,为null也不会报错,就是把请求参数封装为一个vo类,在对应的类属性上加上注解,这样

@DateTimeFormat(iso = ISO.DATE_TIME, pattern = \"w:yyyy\")\r\nprivate Date startTime;\r\n或者\r\n@DateTimeFormat(pattern=\"yyyy-MM-dd HH:mm:ss\")\r\nprivate Date lastLoginDate;

另外如果使用验证框架,方法参数这样写(@Valid XxxParam param, BindingResult binding) ,就能直接通过BindingResult得到验证结果了。

', 'article', null, null, null, null, '1', null, '1', '1', 'bootdo', '2017-09-25 21:34:51', '2017-09-25 21:34:51'); +INSERT INTO `blog_content` VALUES ('112', ' SpringBoot 在启动时运行代码', null, null, null, '

在Spring boot项目的实际开发中,我们有时需要项目服务启动时加载一些数据或预先完成某些动作。为了解决这样的问题,Spring boot 为我们提供了一个方法:通过实现接口 CommandLineRunner 来实现这样的需求。

实现方式:只需要一个类即可,无需其他配置。 

实现步骤:

1.创建实现接口 CommandLineRunner 的类 MyStartupRunnerTest

[java] view plain copy
  1. package com.energy;  
  2.   
  3. import org.springframework.boot.CommandLineRunner;  
  4. import org.springframework.core.annotation.Order;  
  5. import org.springframework.stereotype.Component;  
  6.   
  7. /** 
  8.  * Created by CavanLiu on 2017/2/28 0028. 
  9.  */  
  10. @Component  
  11. @Order(value=1)
  12. public class MyStartupRunnerTest implements CommandLineRunner  
  13. {  
  14.     @Override  
  15.     public void run(String... args) throws Exception  
  16.     {  
  17.         System.out.println(\">>>>This is MyStartupRunnerTest Order=1. Only testing CommandLineRunner...<<<<\");  
  18.     }  
  19. }  

2.创建实现接口CommandLineRunner 的类 MyStartupRunnerTest2

[java] view plain copy
  1. package com.energy;  
  2.   
  3. import org.springframework.boot.CommandLineRunner;  
  4. import org.springframework.core.annotation.Order;  
  5. import org.springframework.stereotype.Component;  
  6.   
  7. /** 
  8.  * Created by CavanLiu on 2017/2/28 0028. 
  9.  */  
  10. @Component  
  11. @Order(value=2)
  12. public class MyStartupRunnerTest2 implements CommandLineRunner  
  13. {  
  14.     @Override  
  15.     public void run(String... args) throws Exception  
  16.     {  
  17.         System.out.println(\">>>>This is MyStartupRunnerTest Order=2. Only testing CommandLineRunner...<<<<\");  
  18.     }  
  19. }  

3.启动Spring boot后查看控制台输出信息,如下所示:

[plain] view plain copy
  1. >>>>This is MyStartupRunnerTest Order=1. Only testing CommandLineRunner...<<<<  
  2. >>>>This is MyStartupRunnerTest2 Order=2. Only testing CommandLineRunner...<<<<  

4.Application启动类代码略。

说明:CommandLineRunner接口的运行顺序是依据@Order注解的value由小到大执行,即value值越小优先级越高。

', 'article', null, null, null, null, '1', null, '1', '1', 'bootdo', '2017-09-26 15:18:15', '2017-09-26 15:18:15'); +INSERT INTO `blog_content` VALUES ('115', 'communication', null, null, null, '

qq群 669039323

', null, null, 'communication', null, null, '1', null, '0', '1', 'bootdo', '2017-09-30 14:43:30', '2017-09-30 14:43:30'); +INSERT INTO `blog_content` VALUES ('116', 'ablout', null, null, null, '

BootDo 面向学习型的开源框架

平台简介

BootDo是高效率,低封装,面向学习型,面向微服的开源Java EE开发框架。

BootDo是在SpringBoot基础上搭建的一个Java基础开发平台,MyBatis为数据访问层,ApacheShiro为权限授权层,Ehcahe对常用数据进行缓存。

BootDo主要定位于后台管理系统学习交流,已内置后台管理系统的基础功能和高效的代码生成工具, 包括:系统权限组件、数据权限组件、数据字典组件、核心工具组件、视图操作组件、工作流组件、代码生成等。 前端界面风格采用了结构简单、性能优良、页面美观大气的Twitter Bootstrap页面展示框架。 采用分层设计、双重验证、提交数据安全编码、密码加密、访问验证、数据权限验证。 使用Maven做项目管理,提高项目的易开发性、扩展性。

BootDo目前包括以下四大模块,系统管理(SYS)模块、 内容管理(CMS)模块、在线办公(OA)模块、代码生成(GEN)模块。 系统管理模块 ,包括企业组织架构(用户管理、机构管理、区域管理)、 菜单管理、角色权限管理、字典管理等功能; 内容管理模块 ,包括内容管理(文章、链接),栏目管理、站点管理、 公共留言、文件管理、前端网站展示等功能; 在线办公模块 ,提供简单的请假流程实例;代码生成模块 ,完成重复的工作。

BootDo 提供了常用工具进行封装,包括日志工具、缓存工具、服务器端验证、数据字典、当前组织机构数据 (用户、机构、区域)以及其它常用小工具等。另外还提供一个强大的在线 代码生成 工具。

内置功能

  1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
  2. 机构管理:配置系统组织机构(公司、部门、小组),树结构展现,可随意调整上下级。
  3. 区域管理:系统城市区域模型,如:国家、省市、地市、区县的维护。
  4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
  5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
  6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护,如:是否、男女、类别、级别等。
  7. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
  8. 连接池监视:监视当期系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
  9. 工作流引擎:实现业务工单流转、在线流程设计器。

技术选型

1、后端

2、前端

4、平台

安全考虑

  1. 开发语言:系统采用Java 语言开发,具有卓越的通用性、高效性、平台移植性和安全性。
  2. 分层设计:(数据库层,数据访问层,业务逻辑层,展示层)层次清楚,低耦合,各层必须通过接口才能接入并进行参数校验(如:在展示层不可直接操作数据库),保证数据操作的安全。
  3. 双重验证:用户表单提交双验证:包括服务器端验证及客户端验证,防止用户通过浏览器恶意修改(如不可写文本域、隐藏变量篡改、上传非法文件等),跳过客户端验证操作数据库。
  4. 安全编码:用户表单提交所有数据,在服务器端都进行安全编码,防止用户提交非法脚本及SQL注入获取敏感数据等,确保数据安全。
  5. 密码加密:登录用户密码进行SHA1散列加密,此加密方法是不可逆的。保证密文泄露后的安全问题。
  6. 强制访问:系统对所有管理端链接都进行用户身份权限验证,防止用户直接填写url进行访问。

演示地址

布嘟开源www.bootdo.com

交流反馈

QQ群 669039323

版权声明

本软件使用 Apache License 2.0 协议,请严格遵照协议内容

', null, null, 'about', null, null, '1', null, '0', '1', 'bootdo', '2017-09-30 14:43:09', '2017-09-30 14:43:09'); +INSERT INTO `blog_content` VALUES ('117', '页面加载速度优化建议', null, null, null, '

1、合并Js文件和CSS

将JS代码和CSS样式分别合并到一个共享的文件,这样不仅能简化代码,而且在执行JS文件的时候,如果JS文件比较多,就需要进行多次“Get”请求,延长加载速度,将JS文件合并在一起后,自然就减少了Get请求次数,提高了加载速度。

2、Sprites图片技术

Spriting是一种网页图片应用处理方式,它是将一个页面涉及到的所有零星图片都包含到一张大图中去,然后利用CSS技术展现出来。这样一来,当访问该页面时,载入的图片就不会像以前那样一幅一幅地慢慢显示出来了,可以减少了整个网页的图片大小,并且利用CSSSprites能很好地减少网页的http请求,从而大大的提高页面的性能。CSSSprites在国内很多人叫css精灵,很早就有了,在很多大型网站都有用到,特别是一些所有页面都存在的图标用得比较多,很好的提升加载速度。

3、压缩文本和图片

压缩技术如gzip可以有效减少页面加载的时间。包括HTML,XML,JSON(JavaScript对象符号),JavaScript和CSS等,压缩率都可以在大小70%左右。文本压缩用得比较多,一般直接在空间开启就行,而图片的压缩就比较随意,很多都是直接上传,其实还有很大的压缩空间。

4、延迟显示可见区域外的内容

为了确保用户可以更快地看见可见区域的网页可以延迟加载或展现可见区域外的内容,为了避免页面变形,可以使用占位符标签制定正确的高度和宽度。比如WP的jQueryImage LazyLoad插件就可以在用户停留在第一屏的时候,不加载任何第一屏以下的图片信息,只有当用户把鼠标往下滚动的时候,这些图片才开始加载。这样很明显提升可见区域的加载速度,提高用户体验。

5、确保功能图片优先加载

网站主要考虑可用性的重要性,一个功能按钮要提前加载出来,用户进入下载页,一个只需要8s时间的下载花了5s在等待、寻找下载按钮图片,谁能忍受?

6、重新布置Call-to-Action按钮

其实这个和上面一条是差不多的,都是从用户体验速度着手,跳过了网页的整体加载速度。速度没变,只是让一些行为按钮提前,Call-to-Action按钮一般习惯设计在页面底部,这样的习惯对于用户来说并不总是好的,购买用户需要等到最下面加载出来才能点击下一步操作。可以调整CTA按钮的位置或使用滑动的图片按钮。很多大型购物网站的加入购物车就是这种类型。

7、图片格式优化

不恰当的图像格式是一种极为常见的减慢加载速度的罪魁祸首。正确的图片格式可以让图片缩小数倍,如果保存为最佳格式。可以节省大量带宽,减少处理时间时间,大大加快页面加载速度,这是一种很常见的做法。

8、使用 Progressive JPEGs

ProgressiveJPEGs图片是JPEG格式的一个特殊变种,名为“高级JPEG”。在创建高级JPEG文件时,数据是这样安排的:在装入图像时,开始只显示一个模糊的图像,随着数据的装入,图像逐步变得清晰。它相当于交织的GIF格式的图片。高级JPEG主要是考虑到使用调制解调器的慢速网络而设计的,快速网络的使用者通常不会体会到它和正常JPEG格式图片的区别。对于网速比较慢的用户,这无疑有很好的体验。

9、精简代码

这个可以说是最直接的一个方法,也是用得比较多的,对网页代码进行瘦身,删除不必要的沉冗代码,比如不必要的空格、换行符、注释等,包括JS代码中的无用代码也需要清除。其中对于注释代码的清除可能有些人存在误区,甚至有的在里面堆砌关键词。

10、延迟加载和执行非必要脚本

网页中有很多脚本是在页面完全加载完前都不需要执行的,可以延迟加载和执行非必要脚本。这些脚本可以在onload事件之后执行,避免对网页上重要内容的呈现造成影响。这些脚本可能是你自己网页的甲苯,往往更多的是一些第三方脚本,这样的有很多,比如评论、广告、智能推荐、百度云图、分享等等,这些完全可以等主体内容加载完后再执行。

11、使用AJAX

AJAX即“Asynchronous Javascript +XML“,是指一种创建交互式网页应用的网页开发技术。通过在后台与服务器进行少量数据交换,AJAX可以使网页实现异步更新。这意味着可以在不重新加载整个网页的情况下,对网页的某部分进行更新。传统的网页(不使用AJAX)如果需要更新内容,必须重载整个网页面。

', null, null, '', null, null, '1', null, '0', '1', 'bootdo', '2017-09-30 16:13:35', '2017-09-30 16:13:35'); +INSERT INTO `blog_content` VALUES ('118', 'elementUI select组件使用详解', null, null, null, '

elementUI select组件使用详解

  • 动态生成option选项
  • option选项绑定对应的文本值和value值
  • 作为表单项目,新增、编辑功能
  • 对选项改变后触发相关事件
<div id=\"app\">\r\n    <el-form :model=\"form\"  ref=\"form\" label-width=\"100px\" class=\"demo-ruleForm\">\r\n        <el-form-item label=\"姓名选择\" prop=\"typeId\">\r\n            <el-select v-model=\"form.typeId\" placeholder=\"请选择\" @change=\"change\">\r\n                <el-option v-for=\"item in items\" :label=\"item.name\" :value=\"item.id\"></el-option>\r\n            </el-select>\r\n        </el-form-item>\r\n        <el-form-item>\r\n            <el-button type=\"primary\" @click=\"add()\">新增</el-button>\r\n            <el-button type=\"primary\" @click=\"edit()\">编辑</el-button>\r\n            <el-button @click=\"cancel()\">取消</el-button>\r\n        </el-form-item>\r\n    </el-form>\r\n</div>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
<script>\r\n    var vm = new Vue({\r\n        el:\"#app\",\r\n        mounted(){\r\n            this.getData();\r\n        },\r\n        data:{\r\n            form:{\r\n                typeId:\'\'\r\n            },\r\n            items:[],\r\n            datas:[{name:\"senbo\",id:\'1\'},{name:\"muse\",id:\'2\'},{name:\"bobo\",id:\'3\'}]\r\n        },\r\n        methods:{\r\n            getData:function(){\r\n                this.items = this.datas; \r\n\r\n            },\r\n            add:function(){\r\n                this.form.typeId = \"\";\r\n            },\r\n            cancel(){\r\n                 this.form.typeId = \"\";   \r\n            },\r\n            change:function(){\r\n                console.log(this.form.typeId)\r\n            },\r\n            edit:function(){\r\n                this.form.typeId =\"1\";\r\n            }\r\n        }\r\n    })\r\n</script>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
转自http://blog.csdn.net/museions/article/details/77824361
', 'article', null, '', null, null, '1', null, '0', '1', 'bootdo', '2017-10-12 10:41:07', '2017-10-12 10:41:07'); +INSERT INTO `blog_content` VALUES ('119', 'Java程序员秋招面经大合集(BAT美团网易小米华为中兴等)', null, null, null, '

Java程序员秋招面经大合集(BAT美团网易小米华为中兴等)

Cvte提前批

一面(电话)

  1. 自我介绍
  2. 介绍你的项目
  3. 加密解密了解么?几种算法,讲一下你了解的
  4. 多线程了解么?什么是线程安全?
  5. 说一个你最熟悉的设计模式
  6. 讲一下你项目中用到了哪些设计模式
  7. Java的hashmap的原理
  8. Hashmap的线程安全性,什么是线程安全的?如何实现线程安全

二面(视频)

  1. 自我介绍
  2. 介绍项目
  3. Mysql的数据库引擎,区别特点
  4. 设计模式了解?讲一下最熟悉的
  5. 写一个单例模式,答主写的是双检查锁单例,问了为什么用Volatile,synchronize移到方法最外面会怎么样?
  6. 单例模式在你项目里哪些应用?
  7. 数据连接池
  8. 对高负载有了解么
  9. 你意向的技术方向是哪块?(答主回答的高并发,然后面试官说他是做高负载的)
  10. 对高并发有了解么?

阿里内推

一面(电话)

  1. 听说你有博客,博客里大概有什么内容?
  2. 项目介绍,最复杂的表
  3. Hashmap的原理
  4. Hashmap为什么大小是2的幂次
  5. 介绍一下红黑树
  6. Arraylist的原理
  7. 场景题:设计判断论文抄袭的系统
  8. 堆排序的原理
  9. 抽象工厂和工厂方法模式的区别
  10. 工厂模式的思想
  11. object类你知道的方法
  12. 哪里用到了工厂模式
  13. Forward和redirect的区别

二面(视频)

1, 自我介绍
2, 项目介绍
3, 项目架构
4, 项目难点
5, Synchronize关键字为什么jdk1.5后效率提高了
6, 线程池的使用时的注意事项
7, Spring中autowire和resourse关键字的区别
8, Hashmap的原理
9, Hashmap的大小为什么指定为2的幂次
10, 讲一下线程状态转移图
11, 消息队列了解么
12, 分布式了解么

便利蜂内推

一面(电话)

  1. 自我介绍
  2. 项目介绍
  3. volatile和synchronized
  4. 来个算法题:一个无序数组,其中一个数字出现的次数大于其他数字之和,求这个数字 (主元素)
  5. 答完再来一个:一个数组,有正有负,不改变顺序的情况下,求和最大的最长子序列
  6. 项目用到什么数据库?隔离级别?每个隔离级别各做了什么
  7. 数据库的索引?mysql不同引擎索引的区别
  8. 垃圾回收算法的过程
  9. 你了解的垃圾收集器? Cms收集器的过程
  10. 怎样进入老年代?
  11. 平时用到了什么设计模式?
  12. 讲一下你最熟的两个设计模式
  13. 用过什么系统?shell写过脚本吗?

小米内推

一面(电话)

  1. 自我介绍
  2. 看你最近博客写的是redis,介绍redis和mysql的区别
  3. Redis的应用场景
  4. Hashmap的原理
  5. Hashmap中jdk1.8之后做了哪些优化
  6. 垃圾回收的过程
  7. Jvm的参数设置
  8. 项目中的优化

金山wps内推

一面(电话)

  1. 自我介绍
  2. 项目介绍
  3. 对Java的面向对象的理解
  4. 对java多线程的理解
  5. 数据库的索引
  6. 数据库的隔离级别
  7. 设计模式的理解
  8. 讲几个设计模式
  9. 对算法有什么了解?答主先回答了动态规划,解释了一下dp的思想
  10. 快排的思想讲一下

二面(电话)

  1. 自我介绍
  2. 项目介绍
  3. Tcp怎么保证可靠传输(中间穿插了好多小问题)
  4. Tcp的拥塞控制
  5. 让你设计一个即时聊天的系统
  6. 支付宝转账,是如何实现,几个小时通知转账成功的(面试官想让回答长连接,答主一直没get到点)
  7. 解释一下长连接

多益网络

一面(视频)

  1. 自我介绍
  2. 对面向对象的理解
  3. 介绍多态
  4. Java新建线程有哪几种方式
  5. 线程池的作用
  6. 看过框架源码么

拼多多学霸批

一面(现场面)

  1. 自我介绍
  2. 项目介绍
  3. 手撕算法:一棵二叉排序树,给定一个数,找到与给定数差值最小的数
  4. 场景题:设计一个系统,解决抢购时所需要的大量的短链接的功能,如何保证高并发,如何设计短链接

二面(现场面)

  1. 代码量多少
  2. 给了一张纸,各种名词,会的写出来
  3. 然后给它解释那些会的
  4. 设计题:设计一个系统,记录qq用户前一天的登录状态,提供16g内存和2tb的硬盘,要做到查询指定qq号的前一天的登录状态,快速查询O(1)复杂度

搜狗校招

一面(现场):

  1. 自我介绍
  2. 项目介绍
  3. 手撕算法:两个排序的数组A和B分别含有m和n个数,找到两个排序数组的中位数,答主用的二分,时间复杂度为O(log (m+n))。结果面试官不满意,让用归并的思想做,时间复杂度其实更高了
  4. 介绍网络编程

涂鸦移动

一面(现场)

  1. 自我介绍
  2. 项目介绍
  3. 数据库的索引原理
  4. 索引使用的注意事项
  5. 数据库的引擎
  6. Java垃圾回收机制
  7. Java的finalize,finally,final三个关键字的区别和应用场景
  8. String类可以被继承么
    手撕算法:假设你是一个专业的窃贼,准备沿着一条街打劫房屋。每个房子都存放着特定金额的钱。你面临的唯一约束条件是:相邻的房子装着相互联系的防盗系统,且 当相邻的两个房子同一天被打劫时,该系统会自动报警。
    给定一个非负整数列表,表示每个房子中存放的钱, 算一算,如果今晚去打劫,你最多可以得到多少钱 在不触动报警装置的情况下。

二面(电话)

  1. 自我介绍
  2. 对游戏的了解
  3. 项目介绍
  4. 算法题:给一个整数数组,找到两个数使得他们的和等于一个给定的数 target。
  5. 红黑树
  6. Redis的应用

中国电信it研发中心

一面(现场)

  1. 自我介绍
  2. 项目介绍
  3. 项目里用的什么服务器
  4. 自己写一个tomcat服务器,你会怎么写
  5. 分布式服务器会出现哪些问题
  6. 怎么解决session一致性缓存的问题
  7. Redis的优势和特点
  8. 一千万用户并发抢购,怎么设计
  9. 如果成功的用户有10万,redis存不下怎么处理
  10. 你项目中的难点

二面(现场)

  1. 自我介绍
  2. 项目介绍
  3. 介绍spring中的熟悉的注解
  4. 让你实现autowire注解的功能你会如何实现
  5. Redis和mysql的区别
  6. Redis的持久化有哪些方式,具体原理

中兴

专业面(现场)

  1. 自我介绍
  2. 项目介绍
  3. 你了解的设计模式,讲两个
  4. Java collection类,集合,讲两个你了解的,说实现原理
  5. Java线程池的作用
  6. 你觉得你在你实验室处于什么水平

综合面试(现场)

说好的综合面试纯聊天呢?
1. 自我介绍
2. 项目介绍
3. 说一下你知道的设计模式
4. 画一个策略模式的uml图
5. Java多线程的理解
6. 内存屏障是什么
7. 数据库索引
8. 项目中的优化
9. 然后开始聊人生
10. 你的缺点,你最不喜欢什么样的人,你的家庭等等

华为

一面(现场)

  1. 自我介绍
  2. 项目介绍
  3. 项目架构
  4. 项目一个完整的执行流程(由于我是搞java的,而面试官是搞c的,所以全程尬聊)
  5. 项目优化

二面(现场)

  1. 自我介绍
  2. 项目介绍
  3. 怎么管理项目进度
  4. 平常的爱好
  5. 感觉面试官也不是搞java的,所以又是一阵尬聊

苏宁内推

一面(现场)

  1. 自我介绍
  2. 项目介绍
  3. 面过哪些公司了
  4. 有哪些offer了
  5. 聊到多益,于是开始聊最近微博上很火的多益老板
  6. 得出结论,我和面试官都觉得多益老板三观有问题,但做游戏就是要偏执的人
  7. 你博客主要哪方面的
  8. 多线程并发包了解么
  9. 讲一下countDownLatch

苏宁聊了20分钟八卦就面完了,一轮技术面

美团内推

一面(电话)

  1. 自我介绍
  2. 项目介绍
  3. Redis介绍
  4. 了解redis源码么
  5. 了解redis集群么
  6. Hashmap的原理
  7. hashmap容量为什么是2的幂次
  8. hashset的源码
  9. object类你知道的方法
  10. hashcode和equals
  11. 你重写过hashcode和equals么,要注意什么
  12. 假设现在一个学生类,有学号和姓名,我现在hashcode方法重写的时候,只将学号参与计算,会出现什么情况?
  13. 往set里面put一个学生对象,然后将这个学生对象的学号改了,再put进去,可以放进set么?并讲出为什么
  14. Redis的持久化?有哪些方式,原理是什么?
  15. 讲一下稳定的排序算法和不稳定的排序算法
  16. 讲一下快速排序的思想

二面(现场)

  1. 自我介绍
  2. 讲一下数据的acid
  3. 什么是一致性
  4. 什么是隔离性
  5. Mysql的隔离级别
  6. 每个隔离级别是如何解决
  7. Mysql要加上nextkey锁,语句该怎么写
  8. Java的内存模型,垃圾回收
  9. 线程池的参数
  10. 每个参数解释一遍
  11. 然后面试官设置了每个参数,给了是个线程,让描述出完整的线程池执行的流程
  12. Nio和IO有什么区别
  13. Nio和aio的区别
  14. Spring的aop怎么实现
  15. Spring的aop有哪些实现方式
  16. 动态代理的实现方式和区别
  17. Linux了解么
  18. 怎么查看系统负载
  19. Cpu load的参数如果为4,描述一下现在系统处于什么情况
  20. Linux,查找磁盘上最大的文件的命令
  21. Linux,如何查看系统日志文件
  22. 手撕算法:leeetcode原题 22,Generate Parentheses,给定 n 对括号,请写一个函数以将其生成新的括号组合,并返回所有组合结果。

三面(现场)

三面没怎么问技术,问了很多技术管理方面的问题

  1. 自我介绍
  2. 项目介绍
  3. 怎么管理项目成员
  4. 当意见不一致时,如何沟通并说服开发成员,并举个例子
  5. 怎么保证项目的进度
  6. 数据库的索引原理
  7. 非聚簇索引和聚簇索引
  8. 索引的使用注意事项
  9. 联合索引
  10. 从底层解释最左匹配原则
  11. Mysql对联合索引有优化么?会自动调整顺序么?哪个版本开始优化?
  12. Redis的应用
  13. Redis的持久化的方式和原理
  14. 技术选型,一个新技术和一个稳定的旧技术,你会怎么选择,选择的考虑有哪些
  15. 说你印象最深的美团点评技术团队的三篇博客
  16. 最近在学什么新技术
  17. 你是怎么去接触一门新技术的
  18. 会看哪些书
  19. 怎么选择要看的书

百度

一面(现场)

  1. 自我介绍
  2. Java中的多态
  3. Object类下的方法
  4. Finalize的作用和使用场景
  5. Hashcode和equals
  6. 为什么要同时重写hashcode和equals
  7. 不同时重写会出现哪些问题
  8. Hashmap的原理
  9. Hashmap如何变线程安全,每种方式的优缺点
  10. 垃圾回收机制
  11. Jvm的参数你知道的说一下
  12. 设计模式了解的说一下啊
  13. 手撕一个单例模式
  14. 快速排序的思想讲一下
  15. 给个数组,模拟快排的过程
  16. 手写快排
  17. 设计题,一个图书馆管理系统,数据库怎么设计,需求自己定

二面(现场)

  1. 自我介绍
  2. 项目介绍
  3. Redis的特点
  4. 分布式事务了解么
  5. 反爬虫的机制,有哪些方式
  6. 手撕算法:反转单链表
  7. 手撕算法:实现类似微博子结构的数据结构,输入一系列父子关系,输出一个类似微博评论的父子结构图
  8. 手写java多线程
  9. 手写java的soeket编程,服务端和客户端
  10. 进程间的通信方式
  11. 手撕算法: 爬楼梯,写出状态转移方程
  12. 智力题:时针分针什么时候重合

三面(现场)

由于三面面试官不懂java,我不熟c加加,所以全程尬聊

  1. 自我介绍
  2. 项目介绍
  3. 手撕算法:给定一个数字三角形,找到从顶部到底部的最小路径和。每一步可以移动到下面一行的相邻数字上。
  4. 然后继续在这个问题上扩展
  5. 求出最短那条的路径
  6. 递归求出所有的路径
  7. 设计模式讲一下熟悉的
  8. 会不会滥用设计模式
  9. 多线程条件变量为什么要在while体里
  10. 你遇到什么挫折

腾讯

一面(现场)

  1. 自我介绍
  2. 项目介绍
  3. Hibernate的作用,你的理解
  4. 多线程的理解,如何保证线程安全
  5. mysql数据库的引擎和区别
  6. 场景题:千万用户抢购,如何处理高并发,并且有一个链接,指向前一天抢购成功的用户,如何设计这个系统和数据库
  7. 如果后台处理抢购请求的服务器,每次最多承受200的负载,系统该怎么设计
  8. 手撕算法:最小公倍数和最大公约数

二面

  1. 自我介绍
  2. 项目介绍
  3. 项目里一个完整请求的流程
  4. 项目的优化
  5. Hibernate和mybatis的区别
  6. 为什么用ssh框架
  7. Mysql的容灾备份
  8. Redis和memcache 的区别
  9. 为什么选择redis
  10. Java的full gc
  11. Full gc会导致什么问题

招商银行信用卡

一面

  1. 自我介绍
  2. 分布式事务
  3. 设计模式
  4. 访问者模式
  5. 装饰者模式
  6. 有哪些offer
  7. 为什么还来我们这

招银网络科技

一面

  1. 自我介绍
  2. 写一个两个有序链表合并成一个有序链表
  3. 死锁是什么呢
  4. 怎么解决死锁
  5. http请求流程
  6. 为什么负载均衡
  7. 怎么实现负载均衡
  8. 数据库挂了怎么办?除了热备份还有什么方法
  9. 讲讲你对spring的理解,不要把ioc和aop背给我听

二面

  1. 自我介绍
  2. 项目介绍
  3. 算法:找出两个数组相等的数,不能用其他数据结构
  4. 算法:给定一个数字,一个数组,找出数组中相加等于这两个数的和,不能用数据结构
  5. 算法:如何判断一个树是不是另一颗树的子树
  6. 如何解决并发访问的错误

网易

一面(现场)

  1. 自我介绍
  2. 项目介绍
  3. I++操作怎么保证线程安全
  4. 场景题:设计一个下单系统,下单成功后可以给用户发优惠券
  5. 接上面场景题:服务器挂了,优惠券还没发怎么办
  6. 数据库挂了怎么怎么办
  7. 怎么保证一致性
  8. 分布式事务知道么
  9. 介绍分布式事务
  10. 你的职业规划

二面

  1. 自我介绍
  2. 项目介绍
  3. Nio的原理
  4. Channel和buffer
  5. directBuffer和buffer的区别
  6. nio和aio的区别
  7. 锁的实现原理
  8. 怎么解决缓存和主存的一致性问题
  9. 缓存还没更新到主存,服务器挂了怎么办
  10. 数据库挂了怎么办

Vivo

一面

  1. 自我介绍
  2. 项目介绍
  3. Hibernate的batch有数量限制么
  4. Jquery用过么
  5. Extjs的优缺点
  6. 有没有扩展过extjs
  7. 读写锁
  8. 什么时候用读锁
  9. 什么时候用写锁
  10. Cas的原理,使用场景
  11. 数据库的瓶颈


转自http://www.jianshu.com//p/72712546648b
', 'article', null, '', null, null, '1', null, '0', '1', 'Bootdo', '2017-10-13 13:45:20', '2017-10-13 13:45:20'); +INSERT INTO `blog_content` VALUES ('121', 'Spring Cloud下微服务权限方案', null, null, null, '


写文章
\"Spring

Spring Cloud下微服务权限方案

\"老A\"老A

背景

从传统的单体应用转型Spring Cloud的朋友都在问我,Spring Cloud下的微服务权限怎么管?怎么设计比较合理?从大层面讲叫服务权限,往小处拆分,分别为三块:用户认证、用户权限、服务校验。

用户认证

传统的单体应用可能习惯了session的存在,而到了Spring cloud的微服务化后,session虽然可以采取分布式会话来解决,但终究不是上上策。开始有人推行Spring Cloud Security结合很好的OAuth2,后面为了优化OAuth 2中Access Token的存储问题,提高后端服务的可用性和扩展性,有了更好Token验证方式JWT(JSON Web Token)。这里要强调一点的是,OAuth2和JWT这两个根本没有可比性,是两个完全不同的东西。 OAuth2是一种授权框架,而JWT是一种认证协议

OAuth2认证框架

OAuth2中包含四个角色:

OAuth2包含4种授权模式

其中,OAuth2的运行流程如下图,摘自RFC 6749:

+--------+                               +---------------+\r\n|        |--(A)- Authorization Request ->|   Resource    |\r\n|        |                               |     Owner     |\r\n|        |<-(B)-- Authorization Grant ---|               |\r\n|        |                               +---------------+\r\n|        |\r\n|        |                               +---------------+\r\n|        |--(C)-- Authorization Grant -->| Authorization |\r\n| Client |                               |     Server    |\r\n|        |<-(D)----- Access Token -------|               |\r\n|        |                               +---------------+\r\n|        |\r\n|        |                               +---------------+\r\n|        |--(E)----- Access Token ------>|    Resource   |\r\n|        |                               |     Server    |\r\n|        |<-(F)--- Protected Resource ---|               |\r\n+--------+                               +---------------+\r\n

我们在Spring Cloud OAuth2中,所有访问微服务资源的请求都在Http Header中携带Token,被访问的服务接下来再去请求授权服务器验证Token的有效性,目前这种方式,我们需要两次或者更多次的请求,所有的Token有效性校验都落在的授权服务器上,对于我们系统的水平扩展成为一个非常大的瓶颈。

JWT认证协议

授权服务器将用户信息和授权范围序列化后放入一个JSON字符串,然后使用Base64进行编码,最终在授权服务器用私钥对这个字符串进行签名,得到一个JSON Web Token。

假设其他所有的资源服务器都将持有一个RSA公钥,当资源服务器接收到这个在Http Header中存有Token的请求,资源服务器就可以拿到这个Token,并验证它是否使用正确的私钥签名(是否经过授权服务器签名,也就是验签)。验签通过,反序列化后就拿到Toekn中包含的有效验证信息。

其中,主体运作流程图如下:

+-----------+                                     +-------------+\r\n|           |       1-Request Authorization       |             |\r\n|           |------------------------------------>|             |\r\n|           |     grant_type&username&password    |             |--+\r\n|           |                                     |Authorization|  | 2-Gen\r\n|           |                                     |Service      |  |   JWT\r\n|           |       3-Response Authorization      |             |<-+\r\n|           |<------------------------------------| Private Key |\r\n|           |    access_token / refresh_token     |             |\r\n|           |    token_type / expire_in           |             |\r\n|  Client   |                                     +-------------+\r\n|           |                                 \r\n|           |                                     +-------------+\r\n|           |       4-Request Resource            |             |\r\n|           |-----------------------------------> |             |\r\n|           | Authorization: bearer Access Token  |             |--+\r\n|           |                                     | Resource    |  | 5-Verify\r\n|           |                                     | Service     |  |  Token\r\n|           |       6-Response Resource           |             |<-+\r\n|           |<----------------------------------- | Public Key  |\r\n+-----------+                                     +-------------+\r\n

通过上述的方式,我们可以很好地完成服务化后的用户认证。

用户权限

传统的单体应用的权限拦截,大家都喜欢shiro,而且用的颇为顺手。可是一旦拆分后,这权限开始分散在各个API了,shiro还好使吗?笔者在项目中,并没有用shiro。前后端分离后,交互都是token,后端的服务无状态化,前端按钮资源化,权限放哪儿管好使?

抽象与设计

在介绍灵活的核心设计前,先给大家普及一个入门的概念:RBAC(Role-Based Access Control,基于角色的访问控制),就是用户通过角色与权限进行关联。简单地说,一个用户拥有若干角色,每一个角色拥有若干权限。

RBAC其实是一种分析模型,主要分为:基本模型RBAC0(Core RBAC)、角色分层模型RBAC1(Hierarchal RBAC)、角色限制模型RBAC2(Constraint RBAC)和统一模型RBAC3(Combines RBAC)。

更多详情大家可以了解:RBAC权限模型

核心UML


这是笔者通过多种业务场景后抽象的RBAC关系图

类说明

群或组,拥有一定数量权限的集合,亦可以是权限的载体。

子类:User(用户)、Role(角色)、Position(岗位)、Unit(部门),通过用户的特定构成,形成不同业务场景的群或组,而通过对群或组的父类授权,完成了用户的权限获取。

权限,拥有一定数量资源的集成,亦可以是资源的载体。

权限下有资源,资源的来源有:Menu(菜单)、Button(动作权限)、页面元素(按钮、tab等)、数据权限等

程序,相关权限控制的呈现载体,可以在多个菜单中挂载。



模型与微服务的关系

如果把Spring Cloud服务化后的所有api接口都定义为上文的Resources,那么我们可以看到这么一个情况。

比如一个用户的增删改查,我们的页面会这么做


页面元素资源编码资源URI资源请求方式查询user_btn_get/api/user/{id}GET增加user_btn_add/api/userPOST编辑user_btn_edit/api/user/{id}PUT删除user_btn_del/api/user/{id}DELETE

在抽象成上述的映射关系后,我们的前后端的资源有了参照,我们对于用户组的权限授权就容易了。比如我授予一个用户增加、删除权限。在前端我们只需要检验该资源编码的有无就可以控制按钮的显示和隐藏,而在后端我们只需要统一拦截判断该用户是否具有URI和对应请求方式即可。

至于权限的统一拦截是放置在Zuul这个网关上,还是落在具体的后端服务的拦截器上(Filter、Inteceptor),都可以轻而易举地实现。不在局限于代码的侵入性。放置Zuul流程图如下:


要是权限的统一拦截放置在Zuul上,会有一个问题,那就是后端服务安不安全,服务只需要通过注册中心,即可对其他服务进行调用。这里就涉及到后面的第三个模块,服务之间的鉴权。

服务之间的鉴权

因为我们都知道服务之间开源通过注册中心寻到客户端后,直接远程过程调用的。对于生产上的各个服务,一个个敏感性的接口,我们更是需要加以保护。主题的流程如下图:


笔者的实现方式是基于Spring Cloud的FeignClient Inteceprot(自动申请服务token、传递当前上下文)和Mvc Inteceptor(服务token校验、更新当前上下文)来实现,从而对服务的安全性做进一步保护。

结合Spring Cloud的特性后,整体流程图如下:


优化点

虽然通过上述的用户合法性检验、用户权限拦截以及服务之间的鉴权,保证了Api接口的安全性,但是其间的Http访问频率是比较高的,请求数量上来的时候,慢的问题是就会特别明显。可以考虑一定的优化策略,比如用户权限缓存、服务授权信息的派发与混存、定时刷新服务鉴权Token等。

结语

上述是笔者在项目里的大体思路,有兴趣的朋友可以借鉴我的开源项目,欢迎star:

', 'article', null, '', null, null, '1', null, '0', '1', 'bootdo', '2017-10-25 12:28:19', '2017-10-25 12:28:19'); + +-- ---------------------------- +-- Table structure for `oa_notify` +-- ---------------------------- +DROP TABLE IF EXISTS `oa_notify`; +CREATE TABLE `oa_notify` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', + `type` char(1) COLLATE utf8_bin DEFAULT NULL COMMENT '类型', + `title` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '标题', + `content` varchar(2000) COLLATE utf8_bin DEFAULT NULL COMMENT '内容', + `files` varchar(2000) COLLATE utf8_bin DEFAULT NULL COMMENT '附件', + `status` char(1) COLLATE utf8_bin DEFAULT NULL COMMENT '状态', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建者', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '更新者', + `update_date` datetime DEFAULT NULL COMMENT '更新时间', + `remarks` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '备注信息', + `del_flag` char(1) COLLATE utf8_bin DEFAULT '0' COMMENT '删除标记', + PRIMARY KEY (`id`), + KEY `oa_notify_del_flag` (`del_flag`) +) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='通知通告'; + +-- ---------------------------- +-- Records of oa_notify +-- ---------------------------- +INSERT INTO `oa_notify` VALUES ('41', '3', '十九大召开了', '十九大召开了,竟然没邀请我', '', '1', '1', null, null, '2017-10-10 17:21:11', '', null); +INSERT INTO `oa_notify` VALUES ('42', '3', '苹果发布新手机了', '有全面屏的iphoneX', '', '1', '1', null, null, '2017-10-10 18:51:14', '', null); +INSERT INTO `oa_notify` VALUES ('43', '3', '十九大要消灭贫困人口', '我还只有两三年的活头了', '', '1', '1', null, null, '2017-10-11 09:56:35', '', null); +INSERT INTO `oa_notify` VALUES ('44', '3', '骑士又输了', '捉急', '', '1', '1', null, null, '2017-10-26 13:59:34', '', null); +INSERT INTO `oa_notify` VALUES ('45', '3', '火箭5连败', '没有保罗不行呀', '', '1', '1', null, null, '2017-12-30 12:10:20', '', null); + +-- ---------------------------- +-- Table structure for `oa_notify_record` +-- ---------------------------- +DROP TABLE IF EXISTS `oa_notify_record`; +CREATE TABLE `oa_notify_record` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', + `notify_id` bigint(20) DEFAULT NULL COMMENT '通知通告ID', + `user_id` bigint(20) DEFAULT NULL COMMENT '接受人', + `is_read` tinyint(1) DEFAULT '0' COMMENT '阅读标记', + `read_date` date DEFAULT NULL COMMENT '阅读时间', + PRIMARY KEY (`id`), + KEY `oa_notify_record_notify_id` (`notify_id`), + KEY `oa_notify_record_user_id` (`user_id`), + KEY `oa_notify_record_read_flag` (`is_read`) +) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='通知通告发送记录'; + +-- ---------------------------- +-- Records of oa_notify_record +-- ---------------------------- +INSERT INTO `oa_notify_record` VALUES ('18', '41', '1', '1', '2017-10-26'); +INSERT INTO `oa_notify_record` VALUES ('19', '42', '1', '1', '2017-10-26'); +INSERT INTO `oa_notify_record` VALUES ('20', '43', '136', '0', null); +INSERT INTO `oa_notify_record` VALUES ('21', '43', '133', '0', null); +INSERT INTO `oa_notify_record` VALUES ('22', '43', '130', '0', null); +INSERT INTO `oa_notify_record` VALUES ('23', '43', '1', '1', '2017-10-26'); +INSERT INTO `oa_notify_record` VALUES ('24', '44', '1', '1', '2017-12-29'); +INSERT INTO `oa_notify_record` VALUES ('25', '45', '1', '1', '2018-01-02'); +INSERT INTO `oa_notify_record` VALUES ('26', '45', '135', '0', null); + +-- ---------------------------- +-- Table structure for `salary` +-- ---------------------------- +DROP TABLE IF EXISTS `salary`; +CREATE TABLE `salary` ( + `id` varchar(64) COLLATE utf8_bin NOT NULL COMMENT '编号', + `PROC_INS_ID` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '流程实例ID', + `USER_ID` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '变动用户', + `OFFICE_ID` varchar(64) COLLATE utf8_bin DEFAULT NULL COMMENT '归属部门', + `POST` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '岗位', + `AGE` char(1) COLLATE utf8_bin DEFAULT NULL COMMENT '性别', + `EDU` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '学历', + `CONTENT` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '调整原因', + `OLDA` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '现行标准 薪酬档级', + `OLDB` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '现行标准 月工资额', + `OLDC` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '现行标准 年薪总额', + `NEWA` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '调整后标准 薪酬档级', + `NEWB` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '调整后标准 月工资额', + `NEWC` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '调整后标准 年薪总额', + `ADD_NUM` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '月增资', + `EXE_DATE` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '执行时间', + `HR_TEXT` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '人力资源部门意见', + `LEAD_TEXT` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '分管领导意见', + `MAIN_LEAD_TEXT` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '集团主要领导意见', + `create_by` varchar(64) COLLATE utf8_bin NOT NULL COMMENT '创建者', + `create_date` datetime NOT NULL COMMENT '创建时间', + `update_by` varchar(64) COLLATE utf8_bin NOT NULL COMMENT '更新者', + `update_date` datetime NOT NULL COMMENT '更新时间', + `remarks` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '备注信息', + `del_flag` char(1) COLLATE utf8_bin NOT NULL DEFAULT '0' COMMENT '删除标记', + PRIMARY KEY (`id`), + KEY `OA_TEST_AUDIT_del_flag` (`del_flag`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='审批流程测试表'; + +-- ---------------------------- +-- Records of salary +-- ---------------------------- +INSERT INTO `salary` VALUES ('825693cd6c1c4f6b86699fc3f1a54887', '', '136', '', '', '', '', '技能提高', '', '', '', '', '100', '', '', '', '同意', '同意', '总经理审批', '1', '2017-12-15 22:01:41', '1', '2017-12-15 22:01:41', null, '1'); +INSERT INTO `salary` VALUES ('a80e1d9ef35a4502bd65b0e5ba7eafff', '', 'cccc', 'ccc', 'ccccc', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '2017-11-30 16:35:15', '', '2017-11-30 16:35:15', '', ''); +INSERT INTO `salary` VALUES ('b5d228f729f74833883917825749f0d5', '', '', '', '', '', '', '', '', '', '', '', '', '防守打法', '', '', '', '', '', '', '2017-11-30 19:58:36', '', '2017-11-30 19:58:36', '', ''); +INSERT INTO `salary` VALUES ('cc2e8083f9d8478f831b2ea852e5c17b', '', '', 'cc', 'cc', '', '', 'xxx', '', '', '', '', '', '', '', '', '', '', '', '', '2017-11-30 19:18:59', '', '2017-11-30 19:18:59', '', ''); +INSERT INTO `salary` VALUES ('cebdb316794b48be87d93dd4dbfb7d4b', '', '', '', '发的顺丰', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '2017-11-30 19:58:43', '', '2017-11-30 19:58:43', '', ''); + +-- ---------------------------- +-- Table structure for `sys_dept` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dept`; +CREATE TABLE `sys_dept` ( + `dept_id` bigint(20) NOT NULL AUTO_INCREMENT, + `parent_id` bigint(20) DEFAULT NULL COMMENT '上级部门ID,一级部门为0', + `name` varchar(50) DEFAULT NULL COMMENT '部门名称', + `order_num` int(11) DEFAULT NULL COMMENT '排序', + `del_flag` tinyint(4) DEFAULT '0' COMMENT '是否删除 -1:已删除 0:正常', + PRIMARY KEY (`dept_id`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='部门管理'; + +-- ---------------------------- +-- Records of sys_dept +-- ---------------------------- +INSERT INTO `sys_dept` VALUES ('6', '0', '研发部', '1', '1'); +INSERT INTO `sys_dept` VALUES ('7', '6', '研發一部', '1', '1'); +INSERT INTO `sys_dept` VALUES ('8', '6', '研发二部', '2', '1'); +INSERT INTO `sys_dept` VALUES ('9', '0', '销售部', '2', '1'); +INSERT INTO `sys_dept` VALUES ('10', '9', '销售一部', '1', '1'); +INSERT INTO `sys_dept` VALUES ('11', '0', '产品部', '3', '1'); +INSERT INTO `sys_dept` VALUES ('12', '11', '产品一部', '1', '1'); +INSERT INTO `sys_dept` VALUES ('13', '0', '测试部', '5', '1'); +INSERT INTO `sys_dept` VALUES ('14', '13', '测试一部', '1', '1'); +INSERT INTO `sys_dept` VALUES ('15', '13', '测试二部', '2', '1'); + +-- ---------------------------- +-- Table structure for `sys_dict` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_dict`; +CREATE TABLE `sys_dict` ( + `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '编号', + `name` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '标签名', + `value` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '数据值', + `type` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '类型', + `description` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '描述', + `sort` decimal(10,0) DEFAULT NULL COMMENT '排序(升序)', + `parent_id` bigint(64) DEFAULT '0' COMMENT '父级编号', + `create_by` int(64) DEFAULT NULL COMMENT '创建者', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(64) DEFAULT NULL COMMENT '更新者', + `update_date` datetime DEFAULT NULL COMMENT '更新时间', + `remarks` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '备注信息', + `del_flag` char(1) COLLATE utf8_bin DEFAULT '0' COMMENT '删除标记', + PRIMARY KEY (`id`), + KEY `sys_dict_value` (`value`), + KEY `sys_dict_label` (`name`), + KEY `sys_dict_del_flag` (`del_flag`) +) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='字典表'; + +-- ---------------------------- +-- Records of sys_dict +-- ---------------------------- +INSERT INTO `sys_dict` VALUES ('1', '正常', '0', 'del_flag', '删除标记', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('3', '显示', '1', 'show_hide', '显示/隐藏', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('4', '隐藏', '0', 'show_hide', '显示/隐藏', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('5', '是', '1', 'yes_no', '是/否', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('6', '否', '0', 'yes_no', '是/否', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('7', '红色', 'red', 'color', '颜色值', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('8', '绿色', 'green', 'color', '颜色值', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('9', '蓝色', 'blue', 'color', '颜色值', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('10', '黄色', 'yellow', 'color', '颜色值', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('11', '橙色', 'orange', 'color', '颜色值', '50', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('12', '默认主题', 'default', 'theme', '主题方案', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('13', '天蓝主题', 'cerulean', 'theme', '主题方案', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('14', '橙色主题', 'readable', 'theme', '主题方案', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('15', '红色主题', 'united', 'theme', '主题方案', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('16', 'Flat主题', 'flat', 'theme', '主题方案', '60', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('17', '国家', '1', 'sys_area_type', '区域类型', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('18', '省份、直辖市', '2', 'sys_area_type', '区域类型', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('19', '地市', '3', 'sys_area_type', '区域类型', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('20', '区县', '4', 'sys_area_type', '区域类型', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('21', '公司', '1', 'sys_office_type', '机构类型', '60', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('22', '部门', '2', 'sys_office_type', '机构类型', '70', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('23', '小组', '3', 'sys_office_type', '机构类型', '80', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('24', '其它', '4', 'sys_office_type', '机构类型', '90', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('25', '综合部', '1', 'sys_office_common', '快捷通用部门', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('26', '开发部', '2', 'sys_office_common', '快捷通用部门', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('27', '人力部', '3', 'sys_office_common', '快捷通用部门', '50', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('28', '一级', '1', 'sys_office_grade', '机构等级', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('29', '二级', '2', 'sys_office_grade', '机构等级', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('30', '三级', '3', 'sys_office_grade', '机构等级', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('31', '四级', '4', 'sys_office_grade', '机构等级', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('32', '所有数据', '1', 'sys_data_scope', '数据范围', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('33', '所在公司及以下数据', '2', 'sys_data_scope', '数据范围', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('34', '所在公司数据', '3', 'sys_data_scope', '数据范围', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('35', '所在部门及以下数据', '4', 'sys_data_scope', '数据范围', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('36', '所在部门数据', '5', 'sys_data_scope', '数据范围', '50', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('37', '仅本人数据', '8', 'sys_data_scope', '数据范围', '90', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('38', '按明细设置', '9', 'sys_data_scope', '数据范围', '100', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('39', '系统管理', '1', 'sys_user_type', '用户类型', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('40', '部门经理', '2', 'sys_user_type', '用户类型', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('41', '普通用户', '3', 'sys_user_type', '用户类型', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('42', '基础主题', 'basic', 'cms_theme', '站点主题', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('43', '蓝色主题', 'blue', 'cms_theme', '站点主题', '20', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('44', '红色主题', 'red', 'cms_theme', '站点主题', '30', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('45', '文章模型', 'article', 'cms_module', '栏目模型', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('46', '图片模型', 'picture', 'cms_module', '栏目模型', '20', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('47', '下载模型', 'download', 'cms_module', '栏目模型', '30', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('48', '链接模型', 'link', 'cms_module', '栏目模型', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('49', '专题模型', 'special', 'cms_module', '栏目模型', '50', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('50', '默认展现方式', '0', 'cms_show_modes', '展现方式', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('51', '首栏目内容列表', '1', 'cms_show_modes', '展现方式', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('52', '栏目第一条内容', '2', 'cms_show_modes', '展现方式', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('53', '发布', '0', 'cms_del_flag', '内容状态', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('54', '删除', '1', 'cms_del_flag', '内容状态', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('55', '审核', '2', 'cms_del_flag', '内容状态', '15', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('56', '首页焦点图', '1', 'cms_posid', '推荐位', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('57', '栏目页文章推荐', '2', 'cms_posid', '推荐位', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('58', '咨询', '1', 'cms_guestbook', '留言板分类', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('59', '建议', '2', 'cms_guestbook', '留言板分类', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('60', '投诉', '3', 'cms_guestbook', '留言板分类', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('61', '其它', '4', 'cms_guestbook', '留言板分类', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('62', '公休', '1', 'oa_leave_type', '请假类型', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('63', '病假', '2', 'oa_leave_type', '请假类型', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('64', '事假', '3', 'oa_leave_type', '请假类型', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('65', '调休', '4', 'oa_leave_type', '请假类型', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('66', '婚假', '5', 'oa_leave_type', '请假类型', '60', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('67', '接入日志', '1', 'sys_log_type', '日志类型', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('68', '异常日志', '2', 'sys_log_type', '日志类型', '40', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('69', '请假流程', 'leave', 'act_type', '流程类型', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('70', '审批测试流程', 'test_audit', 'act_type', '流程类型', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('71', '分类1', '1', 'act_category', '流程分类', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('72', '分类2', '2', 'act_category', '流程分类', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('73', '增删改查', 'crud', 'gen_category', '代码生成分类', '10', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('74', '增删改查(包含从表)', 'crud_many', 'gen_category', '代码生成分类', '20', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('75', '树结构', 'tree', 'gen_category', '代码生成分类', '30', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('76', '=', '=', 'gen_query_type', '查询方式', '10', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('77', '!=', '!=', 'gen_query_type', '查询方式', '20', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('78', '>', '>', 'gen_query_type', '查询方式', '30', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('79', '<', '<', 'gen_query_type', '查询方式', '40', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('80', 'Between', 'between', 'gen_query_type', '查询方式', '50', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('81', 'Like', 'like', 'gen_query_type', '查询方式', '60', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('82', 'Left Like', 'left_like', 'gen_query_type', '查询方式', '70', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('83', 'Right Like', 'right_like', 'gen_query_type', '查询方式', '80', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('84', '文本框', 'input', 'gen_show_type', '字段生成方案', '10', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('85', '文本域', 'textarea', 'gen_show_type', '字段生成方案', '20', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('86', '下拉框', 'select', 'gen_show_type', '字段生成方案', '30', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('87', '复选框', 'checkbox', 'gen_show_type', '字段生成方案', '40', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('88', '单选框', 'radiobox', 'gen_show_type', '字段生成方案', '50', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('89', '日期选择', 'dateselect', 'gen_show_type', '字段生成方案', '60', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('90', '人员选择', 'userselect', 'gen_show_type', '字段生成方案', '70', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('91', '部门选择', 'officeselect', 'gen_show_type', '字段生成方案', '80', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('92', '区域选择', 'areaselect', 'gen_show_type', '字段生成方案', '90', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('93', 'String', 'String', 'gen_java_type', 'Java类型', '10', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('94', 'Long', 'Long', 'gen_java_type', 'Java类型', '20', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('95', '仅持久层', 'dao', 'gen_category', '代码生成分类', '40', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('96', '男', '1', 'sex', '性别', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('97', '女', '2', 'sex', '性别', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('98', 'Integer', 'Integer', 'gen_java_type', 'Java类型', '30', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('99', 'Double', 'Double', 'gen_java_type', 'Java类型', '40', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('100', 'Date', 'java.util.Date', 'gen_java_type', 'Java类型', '50', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('104', 'Custom', 'Custom', 'gen_java_type', 'Java类型', '90', '0', '1', null, '1', null, null, '1'); +INSERT INTO `sys_dict` VALUES ('105', '会议通告', '1', 'oa_notify_type', '通知通告类型', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('106', '奖惩通告', '2', 'oa_notify_type', '通知通告类型', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('107', '活动通告', '3', 'oa_notify_type', '通知通告类型', '30', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('108', '草稿', '0', 'oa_notify_status', '通知通告状态', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('109', '发布', '1', 'oa_notify_status', '通知通告状态', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('110', '未读', '0', 'oa_notify_read', '通知通告状态', '10', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('111', '已读', '1', 'oa_notify_read', '通知通告状态', '20', '0', '1', null, '1', null, null, '0'); +INSERT INTO `sys_dict` VALUES ('112', '草稿', '0', 'oa_notify_status', '通知通告状态', '10', '0', '1', null, '1', null, '', '0'); +INSERT INTO `sys_dict` VALUES ('113', '删除', '0', 'del_flag', '删除标记', null, null, null, null, null, null, '', ''); +INSERT INTO `sys_dict` VALUES ('118', '关于', 'about', 'blog_type', '博客类型', null, null, null, null, null, null, '全url是:/blog/open/page/about', ''); +INSERT INTO `sys_dict` VALUES ('119', '交流', 'communication', 'blog_type', '博客类型', null, null, null, null, null, null, '', ''); +INSERT INTO `sys_dict` VALUES ('120', '文章', 'article', 'blog_type', '博客类型', null, null, null, null, null, null, '', ''); +INSERT INTO `sys_dict` VALUES ('121', '编码', 'code', 'hobby', '爱好', null, null, null, null, null, null, '', ''); +INSERT INTO `sys_dict` VALUES ('122', '绘画', 'painting', 'hobby', '爱好', null, null, null, null, null, null, '', ''); + +-- ---------------------------- +-- Table structure for `sys_file` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_file`; +CREATE TABLE `sys_file` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` int(11) DEFAULT NULL COMMENT '文件类型', + `url` varchar(200) DEFAULT NULL COMMENT 'URL地址', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=141 DEFAULT CHARSET=utf8 COMMENT='文件上传'; + +-- ---------------------------- +-- Records of sys_file +-- ---------------------------- +INSERT INTO `sys_file` VALUES ('110', '0', '/files/d64a62e3-6821-48f1-bac6-a1b9945f4afb.jpg', '2017-10-14 16:20:17'); +INSERT INTO `sys_file` VALUES ('111', '0', '/files/aa2c3dc6-495f-48cc-8e12-446eceb2535e.jpg', '2017-10-14 16:20:21'); +INSERT INTO `sys_file` VALUES ('114', '0', '/files/84c29777-11bc-44b9-818d-859f2d04d417.jpg', '2017-10-20 09:27:18'); +INSERT INTO `sys_file` VALUES ('118', '0', '/files/a973499e-3ec7-4d43-8a52-b6f6517c77e3.jpg', '2017-10-20 11:53:52'); +INSERT INTO `sys_file` VALUES ('132', '0', '/files/e6f13526-e31c-4ebe-a3cf-5fd88dd10be6.jpg', '2017-12-18 20:19:51'); +INSERT INTO `sys_file` VALUES ('134', '0', '/files/cd016e72-77f7-4425-afe2-b79dfbdc3ae9.jpeg', '2017-12-18 22:44:07'); +INSERT INTO `sys_file` VALUES ('138', '0', '/files/9ec12ee7-65b5-4cc5-9900-d2ec6185b336.jpg', '2017-12-19 19:55:27'); +INSERT INTO `sys_file` VALUES ('139', '0', '/files/f6aab9d4-00a1-4bc8-a695-40fc472d4ea9.jpg', '2018-01-02 19:53:24'); + +-- ---------------------------- +-- Table structure for `sys_log` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_log`; +CREATE TABLE `sys_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) DEFAULT NULL COMMENT '用户id', + `username` varchar(50) DEFAULT NULL COMMENT '用户名', + `operation` varchar(50) DEFAULT NULL COMMENT '用户操作', + `time` int(11) DEFAULT NULL COMMENT '响应时间', + `method` varchar(200) DEFAULT NULL COMMENT '请求方法', + `params` varchar(5000) DEFAULT NULL COMMENT '请求参数', + `ip` varchar(64) DEFAULT NULL COMMENT 'IP地址', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=372 DEFAULT CHARSET=utf8 COMMENT='系统日志'; + +-- ---------------------------- +-- Records of sys_log +-- ---------------------------- +INSERT INTO `sys_log` VALUES ('1', '2', 'test', '登录', '0', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 11:33:58'); +INSERT INTO `sys_log` VALUES ('2', '2', 'test', '请求访问主页', '286', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 11:33:59'); +INSERT INTO `sys_log` VALUES ('3', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 11:55:59'); +INSERT INTO `sys_log` VALUES ('4', '1', 'admin', '请求访问主页', '32', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 11:55:59'); +INSERT INTO `sys_log` VALUES ('5', '1', 'admin', '请求访问主页', '11', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 11:56:56'); +INSERT INTO `sys_log` VALUES ('6', '2', 'test', '登录', '22', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 12:00:43'); +INSERT INTO `sys_log` VALUES ('7', '2', 'test', '请求访问主页', '79', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 12:00:43'); +INSERT INTO `sys_log` VALUES ('8', '2', 'test', '请求访问主页', '15', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 12:00:52'); +INSERT INTO `sys_log` VALUES ('9', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 12:01:03'); +INSERT INTO `sys_log` VALUES ('10', '1', 'admin', '请求访问主页', '17', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 12:01:03'); +INSERT INTO `sys_log` VALUES ('11', '1', 'admin', '请求访问主页', '17', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 12:01:22'); +INSERT INTO `sys_log` VALUES ('12', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 12:16:26'); +INSERT INTO `sys_log` VALUES ('13', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 12:23:19'); +INSERT INTO `sys_log` VALUES ('14', '1', 'admin', '请求访问主页', '32', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 12:23:20'); +INSERT INTO `sys_log` VALUES ('15', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 12:34:03'); +INSERT INTO `sys_log` VALUES ('16', '1', 'admin', '请求访问主页', '81', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 12:34:04'); +INSERT INTO `sys_log` VALUES ('17', '-1', '获取用户信息为空', '登录', '16', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 20:26:22'); +INSERT INTO `sys_log` VALUES ('18', '1', 'admin', '登录', '4', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-26 20:26:28'); +INSERT INTO `sys_log` VALUES ('19', '1', 'admin', '请求访问主页', '52', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-26 20:26:29'); +INSERT INTO `sys_log` VALUES ('20', '1', 'admin', '登录', '47', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 15:33:29'); +INSERT INTO `sys_log` VALUES ('21', '1', 'admin', '请求访问主页', '86', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 15:33:30'); +INSERT INTO `sys_log` VALUES ('22', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 15:35:01'); +INSERT INTO `sys_log` VALUES ('23', '1', 'admin', '请求访问主页', '282', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 15:35:01'); +INSERT INTO `sys_log` VALUES ('24', '2', 'test', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 16:54:20'); +INSERT INTO `sys_log` VALUES ('25', '2', 'test', '请求访问主页', '53', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 16:54:21'); +INSERT INTO `sys_log` VALUES ('26', '2', 'test', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:11:16'); +INSERT INTO `sys_log` VALUES ('27', '2', 'test', '请求访问主页', '30', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:11:17'); +INSERT INTO `sys_log` VALUES ('28', '2', 'test', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:13:38'); +INSERT INTO `sys_log` VALUES ('29', '2', 'test', '请求访问主页', '33', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:13:38'); +INSERT INTO `sys_log` VALUES ('30', '2', 'test', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:14:54'); +INSERT INTO `sys_log` VALUES ('31', '2', 'test', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:14:54'); +INSERT INTO `sys_log` VALUES ('32', '2', 'test', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:17:54'); +INSERT INTO `sys_log` VALUES ('33', '2', 'test', '请求访问主页', '40', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:17:55'); +INSERT INTO `sys_log` VALUES ('34', '2', 'test', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:22:06'); +INSERT INTO `sys_log` VALUES ('35', '2', 'test', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:23:57'); +INSERT INTO `sys_log` VALUES ('36', '2', 'test', '请求访问主页', '30', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:23:57'); +INSERT INTO `sys_log` VALUES ('37', '2', 'test', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:26:31'); +INSERT INTO `sys_log` VALUES ('38', '2', 'test', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:27:11'); +INSERT INTO `sys_log` VALUES ('39', '2', 'test', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:29:24'); +INSERT INTO `sys_log` VALUES ('40', '2', 'test', '请求访问主页', '307', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:29:25'); +INSERT INTO `sys_log` VALUES ('41', '2', 'test', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:31:18'); +INSERT INTO `sys_log` VALUES ('42', '2', 'test', '请求访问主页', '40', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:31:18'); +INSERT INTO `sys_log` VALUES ('43', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:31:57'); +INSERT INTO `sys_log` VALUES ('44', '1', 'admin', '请求访问主页', '22', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:31:57'); +INSERT INTO `sys_log` VALUES ('45', '2', 'test', '登录', '2', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:32:08'); +INSERT INTO `sys_log` VALUES ('46', '2', 'test', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:32:09'); +INSERT INTO `sys_log` VALUES ('47', '2', 'test', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:33:14'); +INSERT INTO `sys_log` VALUES ('48', '2', 'test', '请求访问主页', '331', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:33:14'); +INSERT INTO `sys_log` VALUES ('49', '2', 'test', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:41:30'); +INSERT INTO `sys_log` VALUES ('50', '2', 'test', '请求访问主页', '33', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:41:31'); +INSERT INTO `sys_log` VALUES ('51', '2', 'test', '登录', '11', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-29 17:42:26'); +INSERT INTO `sys_log` VALUES ('52', '2', 'test', '请求访问主页', '37', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-29 17:42:26'); +INSERT INTO `sys_log` VALUES ('53', '2', 'test', '登录', '31', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 11:04:28'); +INSERT INTO `sys_log` VALUES ('54', '2', 'test', '请求访问主页', '288', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 11:04:28'); +INSERT INTO `sys_log` VALUES ('55', '2', 'test', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 11:32:25'); +INSERT INTO `sys_log` VALUES ('56', '2', 'test', '请求访问主页', '79', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 11:32:26'); +INSERT INTO `sys_log` VALUES ('57', '2', 'test', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 11:42:41'); +INSERT INTO `sys_log` VALUES ('58', '2', 'test', '请求访问主页', '35', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 11:42:41'); +INSERT INTO `sys_log` VALUES ('59', '2', 'test', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 11:46:15'); +INSERT INTO `sys_log` VALUES ('60', '2', 'test', '请求访问主页', '32', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 11:46:16'); +INSERT INTO `sys_log` VALUES ('61', '2', 'test', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 11:47:04'); +INSERT INTO `sys_log` VALUES ('62', '2', 'test', '请求访问主页', '38', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 11:47:04'); +INSERT INTO `sys_log` VALUES ('63', '2', 'test', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 12:09:16'); +INSERT INTO `sys_log` VALUES ('64', '2', 'test', '请求访问主页', '37', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:09:17'); +INSERT INTO `sys_log` VALUES ('65', '1', 'admin', '登录', '4', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 12:09:26'); +INSERT INTO `sys_log` VALUES ('66', '1', 'admin', '请求访问主页', '46', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:09:27'); +INSERT INTO `sys_log` VALUES ('67', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 12:17:40'); +INSERT INTO `sys_log` VALUES ('68', '1', 'admin', '请求访问主页', '26', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:17:40'); +INSERT INTO `sys_log` VALUES ('69', '2', 'test', '登录', '4', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 12:21:06'); +INSERT INTO `sys_log` VALUES ('70', '2', 'test', '请求访问主页', '36', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:21:06'); +INSERT INTO `sys_log` VALUES ('71', '1', 'admin', '登录', '5', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 12:21:17'); +INSERT INTO `sys_log` VALUES ('72', '1', 'admin', '请求访问主页', '29', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:21:17'); +INSERT INTO `sys_log` VALUES ('73', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 12:28:04'); +INSERT INTO `sys_log` VALUES ('74', '1', 'admin', '请求访问主页', '40', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:28:05'); +INSERT INTO `sys_log` VALUES ('75', '1', 'admin', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:36:22'); +INSERT INTO `sys_log` VALUES ('76', '1', 'admin', '请求访问主页', '11', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:36:27'); +INSERT INTO `sys_log` VALUES ('77', '2', 'test', '登录', '0', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 12:43:18'); +INSERT INTO `sys_log` VALUES ('78', '2', 'test', '请求访问主页', '29', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 12:43:18'); +INSERT INTO `sys_log` VALUES ('79', '2', 'test', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 16:24:41'); +INSERT INTO `sys_log` VALUES ('80', '2', 'test', '请求访问主页', '32', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 16:24:41'); +INSERT INTO `sys_log` VALUES ('81', '1', 'admin', '登录', '4', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 16:24:52'); +INSERT INTO `sys_log` VALUES ('82', '1', 'admin', '请求访问主页', '22', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 16:24:52'); +INSERT INTO `sys_log` VALUES ('83', '1', 'admin', '登录', '49', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 19:34:39'); +INSERT INTO `sys_log` VALUES ('84', '1', 'admin', '请求访问主页', '181', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 19:34:40'); +INSERT INTO `sys_log` VALUES ('85', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 19:36:22'); +INSERT INTO `sys_log` VALUES ('86', '1', 'admin', '请求访问主页', '18', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 19:39:39'); +INSERT INTO `sys_log` VALUES ('87', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 19:48:54'); +INSERT INTO `sys_log` VALUES ('88', '1', 'admin', '请求访问主页', '17', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 19:48:54'); +INSERT INTO `sys_log` VALUES ('89', '1', 'admin', '请求访问主页', '9', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 19:49:43'); +INSERT INTO `sys_log` VALUES ('90', '1', 'admin', '登录', '4', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-30 21:05:22'); +INSERT INTO `sys_log` VALUES ('91', '1', 'admin', '请求访问主页', '16', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 21:05:22'); +INSERT INTO `sys_log` VALUES ('92', '1', 'admin', '请求访问主页', '8', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-30 21:05:39'); +INSERT INTO `sys_log` VALUES ('93', '2', 'test', '登录', '2', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-31 14:56:37'); +INSERT INTO `sys_log` VALUES ('94', '2', 'test', '请求访问主页', '44', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-31 14:56:38'); +INSERT INTO `sys_log` VALUES ('95', '1', 'admin', '登录', '1', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-31 14:58:39'); +INSERT INTO `sys_log` VALUES ('96', '1', 'admin', '请求访问主页', '4', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-31 14:58:40'); +INSERT INTO `sys_log` VALUES ('97', '1', 'admin', '请求访问主页', '5', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-31 14:59:26'); +INSERT INTO `sys_log` VALUES ('98', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2017-12-31 15:03:53'); +INSERT INTO `sys_log` VALUES ('99', '1', 'admin', '请求访问主页', '41', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2017-12-31 15:03:53'); +INSERT INTO `sys_log` VALUES ('100', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 08:57:50'); +INSERT INTO `sys_log` VALUES ('101', '1', 'admin', '请求访问主页', '71', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 08:57:50'); +INSERT INTO `sys_log` VALUES ('102', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 09:45:46'); +INSERT INTO `sys_log` VALUES ('103', '1', 'admin', '请求访问主页', '42', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 09:45:46'); +INSERT INTO `sys_log` VALUES ('104', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 15:42:15'); +INSERT INTO `sys_log` VALUES ('105', '1', 'admin', '请求访问主页', '140', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 15:42:15'); +INSERT INTO `sys_log` VALUES ('106', '1', 'admin', '登录', '4', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 15:53:54'); +INSERT INTO `sys_log` VALUES ('107', '1', 'admin', '请求访问主页', '23', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 15:53:54'); +INSERT INTO `sys_log` VALUES ('108', '1', 'admin', '请求访问主页', '15', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 16:14:20'); +INSERT INTO `sys_log` VALUES ('109', '1', 'admin', '登录', '13', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 16:29:03'); +INSERT INTO `sys_log` VALUES ('110', '1', 'admin', '请求访问主页', '44', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 16:29:04'); +INSERT INTO `sys_log` VALUES ('111', '1', 'admin', '请求访问主页', '27', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 16:30:30'); +INSERT INTO `sys_log` VALUES ('112', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 17:09:49'); +INSERT INTO `sys_log` VALUES ('113', '1', 'admin', '请求访问主页', '44', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 17:09:49'); +INSERT INTO `sys_log` VALUES ('114', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 17:11:05'); +INSERT INTO `sys_log` VALUES ('115', '1', 'admin', '请求访问主页', '45', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 17:11:05'); +INSERT INTO `sys_log` VALUES ('116', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 17:15:11'); +INSERT INTO `sys_log` VALUES ('117', '1', 'admin', '请求访问主页', '36', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 17:15:11'); +INSERT INTO `sys_log` VALUES ('118', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 17:25:34'); +INSERT INTO `sys_log` VALUES ('119', '1', 'admin', '请求访问主页', '33', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 17:25:35'); +INSERT INTO `sys_log` VALUES ('120', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 17:28:02'); +INSERT INTO `sys_log` VALUES ('121', '1', 'admin', '请求访问主页', '41', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 17:28:02'); +INSERT INTO `sys_log` VALUES ('122', '1', 'admin', '登录', '2', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 17:46:12'); +INSERT INTO `sys_log` VALUES ('123', '1', 'admin', '请求访问主页', '7', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 17:46:12'); +INSERT INTO `sys_log` VALUES ('124', '1', 'admin', '请求访问主页', '9', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 17:56:30'); +INSERT INTO `sys_log` VALUES ('125', '1', 'admin', '登录', '62', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 18:00:55'); +INSERT INTO `sys_log` VALUES ('126', '1', 'admin', '请求访问主页', '155', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 18:00:55'); +INSERT INTO `sys_log` VALUES ('127', '1', 'admin', '登录', '64', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 19:15:24'); +INSERT INTO `sys_log` VALUES ('128', '1', 'admin', '请求访问主页', '193', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 19:15:24'); +INSERT INTO `sys_log` VALUES ('129', '1', 'admin', '登录', '29', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 19:25:39'); +INSERT INTO `sys_log` VALUES ('130', '1', 'admin', '请求访问主页', '177', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 19:25:40'); +INSERT INTO `sys_log` VALUES ('131', '1', 'admin', '请求访问主页', '24', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 19:33:21'); +INSERT INTO `sys_log` VALUES ('132', '1', 'admin', '登录', '5', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-02 19:43:32'); +INSERT INTO `sys_log` VALUES ('133', '1', 'admin', '请求访问主页', '44', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-02 19:43:33'); +INSERT INTO `sys_log` VALUES ('134', '1', 'admin', '登录', '0', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 08:55:21'); +INSERT INTO `sys_log` VALUES ('135', '1', 'admin', '请求访问主页', '42', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 08:55:21'); +INSERT INTO `sys_log` VALUES ('136', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 09:22:30'); +INSERT INTO `sys_log` VALUES ('137', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 09:22:30'); +INSERT INTO `sys_log` VALUES ('138', '1', 'admin', '登录', '7', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 09:34:05'); +INSERT INTO `sys_log` VALUES ('139', '1', 'admin', '请求访问主页', '36', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 09:34:06'); +INSERT INTO `sys_log` VALUES ('140', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 10:20:52'); +INSERT INTO `sys_log` VALUES ('141', '1', 'admin', '请求访问主页', '38', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 10:20:52'); +INSERT INTO `sys_log` VALUES ('142', '1', 'admin', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 10:25:21'); +INSERT INTO `sys_log` VALUES ('143', '1', 'admin', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 10:35:33'); +INSERT INTO `sys_log` VALUES ('144', '1', 'admin', '登录', '5', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 10:39:20'); +INSERT INTO `sys_log` VALUES ('145', '1', 'admin', '请求访问主页', '21', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 10:39:20'); +INSERT INTO `sys_log` VALUES ('146', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 10:41:47'); +INSERT INTO `sys_log` VALUES ('147', '1', 'admin', '请求访问主页', '11', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 10:46:26'); +INSERT INTO `sys_log` VALUES ('148', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 11:07:24'); +INSERT INTO `sys_log` VALUES ('149', '1', 'admin', '请求访问主页', '39', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 11:07:25'); +INSERT INTO `sys_log` VALUES ('153', '1', 'admin', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 13:05:49'); +INSERT INTO `sys_log` VALUES ('154', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 14:07:26'); +INSERT INTO `sys_log` VALUES ('155', '1', 'admin', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 14:07:26'); +INSERT INTO `sys_log` VALUES ('156', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 14:36:07'); +INSERT INTO `sys_log` VALUES ('157', '1', 'admin', '请求访问主页', '39', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 14:36:07'); +INSERT INTO `sys_log` VALUES ('158', '1', 'admin', '请求访问主页', '11', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 14:37:38'); +INSERT INTO `sys_log` VALUES ('159', '1', 'admin', '请求访问主页', '303', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 14:37:39'); +INSERT INTO `sys_log` VALUES ('160', '-1', '获取用户信息为空', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 17:02:50'); +INSERT INTO `sys_log` VALUES ('161', '-1', '获取用户信息为空', '登录', '2', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 17:03:16'); +INSERT INTO `sys_log` VALUES ('162', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 17:58:43'); +INSERT INTO `sys_log` VALUES ('163', '1', 'admin', '请求访问主页', '43', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 17:58:43'); +INSERT INTO `sys_log` VALUES ('164', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 18:06:50'); +INSERT INTO `sys_log` VALUES ('165', '1', 'admin', '请求访问主页', '62', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 18:06:50'); +INSERT INTO `sys_log` VALUES ('166', '1', 'admin', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 18:08:49'); +INSERT INTO `sys_log` VALUES ('167', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 18:10:41'); +INSERT INTO `sys_log` VALUES ('168', '1', 'admin', '请求访问主页', '29', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 18:10:41'); +INSERT INTO `sys_log` VALUES ('169', '1', 'admin', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 18:10:47'); +INSERT INTO `sys_log` VALUES ('170', '1', 'admin', '登录', '15', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 19:18:39'); +INSERT INTO `sys_log` VALUES ('171', '1', 'admin', '请求访问主页', '176', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 19:18:40'); +INSERT INTO `sys_log` VALUES ('172', '1', 'admin', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 19:18:49'); +INSERT INTO `sys_log` VALUES ('173', '1', 'admin', '登录', '20', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 19:44:49'); +INSERT INTO `sys_log` VALUES ('174', '1', 'admin', '登录', '24', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 19:50:12'); +INSERT INTO `sys_log` VALUES ('175', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 19:51:38'); +INSERT INTO `sys_log` VALUES ('176', '1', 'admin', '登录', '16', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 19:53:33'); +INSERT INTO `sys_log` VALUES ('177', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 19:55:04'); +INSERT INTO `sys_log` VALUES ('178', '1', 'admin', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 19:58:54'); +INSERT INTO `sys_log` VALUES ('179', '1', 'admin', '登录', '47', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 20:54:38'); +INSERT INTO `sys_log` VALUES ('180', '1', 'admin', '请求访问主页', '28', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 20:54:39'); +INSERT INTO `sys_log` VALUES ('181', '1', 'admin', '登录', '20', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 21:36:56'); +INSERT INTO `sys_log` VALUES ('182', '1', 'admin', '请求访问主页', '24', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 21:36:56'); +INSERT INTO `sys_log` VALUES ('183', '1', 'admin', '请求访问主页', '11', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 21:37:15'); +INSERT INTO `sys_log` VALUES ('184', '1', 'admin', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 21:39:07'); +INSERT INTO `sys_log` VALUES ('185', '1', 'admin', '请求访问主页', '16', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 21:39:07'); +INSERT INTO `sys_log` VALUES ('186', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 21:46:18'); +INSERT INTO `sys_log` VALUES ('187', '1', 'admin', '登录', '15', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:00:38'); +INSERT INTO `sys_log` VALUES ('188', '1', 'admin', '登录', '20', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:01:53'); +INSERT INTO `sys_log` VALUES ('189', '1', 'admin', '登录', '16', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:04:27'); +INSERT INTO `sys_log` VALUES ('190', '1', 'admin', '登录', '13', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:10:23'); +INSERT INTO `sys_log` VALUES ('191', '1', 'admin', '登录', '13', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:13:25'); +INSERT INTO `sys_log` VALUES ('192', '1', 'admin', '登录', '15', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:16:08'); +INSERT INTO `sys_log` VALUES ('193', '1', 'admin', '登录', '31', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:16:10'); +INSERT INTO `sys_log` VALUES ('194', '1', 'admin', '登录', '13', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:23:23'); +INSERT INTO `sys_log` VALUES ('195', '1', 'admin', '请求访问主页', '1951', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 22:23:27'); +INSERT INTO `sys_log` VALUES ('196', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:36:21'); +INSERT INTO `sys_log` VALUES ('197', '1', 'admin', '登录', '20', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:36:21'); +INSERT INTO `sys_log` VALUES ('198', '1', 'admin', '登录', '28', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-03 22:36:21'); +INSERT INTO `sys_log` VALUES ('199', '1', 'admin', '请求访问主页', '60', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 22:36:21'); +INSERT INTO `sys_log` VALUES ('200', '1', 'admin', '请求访问主页', '56', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 22:36:21'); +INSERT INTO `sys_log` VALUES ('201', '1', 'admin', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-03 22:38:04'); +INSERT INTO `sys_log` VALUES ('202', '1', 'admin', '登录', '7', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 08:46:15'); +INSERT INTO `sys_log` VALUES ('203', '1', 'admin', '请求访问主页', '36', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 08:46:15'); +INSERT INTO `sys_log` VALUES ('204', '1', 'admin', '登录', '18', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 08:48:50'); +INSERT INTO `sys_log` VALUES ('205', '1', 'admin', '请求访问主页', '43', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 08:48:50'); +INSERT INTO `sys_log` VALUES ('206', '1', 'admin', '登录', '0', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 08:50:17'); +INSERT INTO `sys_log` VALUES ('207', '1', 'admin', '请求访问主页', '42', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 08:50:17'); +INSERT INTO `sys_log` VALUES ('208', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 08:51:11'); +INSERT INTO `sys_log` VALUES ('209', '1', 'admin', '请求访问主页', '33', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 08:51:11'); +INSERT INTO `sys_log` VALUES ('210', '1', 'admin', '登录', '0', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 08:53:49'); +INSERT INTO `sys_log` VALUES ('211', '1', 'admin', '请求访问主页', '96', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 08:53:49'); +INSERT INTO `sys_log` VALUES ('212', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 08:59:24'); +INSERT INTO `sys_log` VALUES ('213', '1', 'admin', '请求访问主页', '35', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 08:59:24'); +INSERT INTO `sys_log` VALUES ('214', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:04:28'); +INSERT INTO `sys_log` VALUES ('215', '1', 'admin', '请求访问主页', '23', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:04:28'); +INSERT INTO `sys_log` VALUES ('216', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:06:22'); +INSERT INTO `sys_log` VALUES ('217', '1', 'admin', '请求访问主页', '20', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:06:22'); +INSERT INTO `sys_log` VALUES ('218', '1', 'admin', '登录', '7', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:07:43'); +INSERT INTO `sys_log` VALUES ('219', '1', 'admin', '请求访问主页', '29', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:07:44'); +INSERT INTO `sys_log` VALUES ('220', '1', 'admin', '登录', '0', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:09:31'); +INSERT INTO `sys_log` VALUES ('221', '1', 'admin', '请求访问主页', '38', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:09:31'); +INSERT INTO `sys_log` VALUES ('222', '1', 'admin', '登录', '7', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:17:12'); +INSERT INTO `sys_log` VALUES ('223', '1', 'admin', '请求访问主页', '34', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:17:12'); +INSERT INTO `sys_log` VALUES ('224', '1', 'admin', '登录', '0', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:17:48'); +INSERT INTO `sys_log` VALUES ('225', '1', 'admin', '请求访问主页', '45', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:17:48'); +INSERT INTO `sys_log` VALUES ('226', '1', 'admin', '请求访问主页', '17', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:19:20'); +INSERT INTO `sys_log` VALUES ('227', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:19:22'); +INSERT INTO `sys_log` VALUES ('228', '1', 'admin', '登录', '25', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:20:33'); +INSERT INTO `sys_log` VALUES ('229', '1', 'admin', '登录', '17', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:23:46'); +INSERT INTO `sys_log` VALUES ('230', '1', 'admin', '登录', '11', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:24:47'); +INSERT INTO `sys_log` VALUES ('231', '1', 'admin', '请求访问主页', '30', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:24:47'); +INSERT INTO `sys_log` VALUES ('232', '1', 'admin', '登录', '22', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:30:08'); +INSERT INTO `sys_log` VALUES ('233', '1', 'admin', '请求访问主页', '41', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:30:08'); +INSERT INTO `sys_log` VALUES ('234', '1', 'admin', '登录', '7', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:34:03'); +INSERT INTO `sys_log` VALUES ('235', '1', 'admin', '请求访问主页', '24', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:34:04'); +INSERT INTO `sys_log` VALUES ('236', '1', 'admin', '登录', '19', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 09:35:51'); +INSERT INTO `sys_log` VALUES ('237', '1', 'admin', '请求访问主页', '40', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 09:35:52'); +INSERT INTO `sys_log` VALUES ('238', '1', 'admin', '登录', '34', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:20'); +INSERT INTO `sys_log` VALUES ('239', '1', 'admin', '请求访问主页', '75', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:20'); +INSERT INTO `sys_log` VALUES ('240', '1', 'admin', '登录', '20', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:23'); +INSERT INTO `sys_log` VALUES ('241', '1', 'admin', '请求访问主页', '63', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:24'); +INSERT INTO `sys_log` VALUES ('242', '1', 'admin', '登录', '14', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:27'); +INSERT INTO `sys_log` VALUES ('243', '1', 'admin', '请求访问主页', '26', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:27'); +INSERT INTO `sys_log` VALUES ('244', '1', 'admin', '登录', '11', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:28'); +INSERT INTO `sys_log` VALUES ('245', '1', 'admin', '请求访问主页', '22', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:28'); +INSERT INTO `sys_log` VALUES ('246', '1', 'admin', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:31'); +INSERT INTO `sys_log` VALUES ('247', '1', 'admin', '请求访问主页', '25', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:32'); +INSERT INTO `sys_log` VALUES ('248', '1', 'admin', '登录', '13', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:35'); +INSERT INTO `sys_log` VALUES ('249', '1', 'admin', '请求访问主页', '21', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:35'); +INSERT INTO `sys_log` VALUES ('250', '1', 'admin', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:39'); +INSERT INTO `sys_log` VALUES ('251', '1', 'admin', '请求访问主页', '23', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:39'); +INSERT INTO `sys_log` VALUES ('252', '1', 'admin', '登录', '16', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:32:52'); +INSERT INTO `sys_log` VALUES ('253', '1', 'admin', '请求访问主页', '32', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:32:52'); +INSERT INTO `sys_log` VALUES ('254', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:33:08'); +INSERT INTO `sys_log` VALUES ('255', '1', 'admin', '请求访问主页', '21', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:33:08'); +INSERT INTO `sys_log` VALUES ('256', '1', 'admin', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:34:30'); +INSERT INTO `sys_log` VALUES ('257', '1', 'admin', '请求访问主页', '23', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:34:30'); +INSERT INTO `sys_log` VALUES ('258', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:34:31'); +INSERT INTO `sys_log` VALUES ('259', '1', 'admin', '请求访问主页', '40', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:34:32'); +INSERT INTO `sys_log` VALUES ('260', '1', 'admin', '登录', '14', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:34:35'); +INSERT INTO `sys_log` VALUES ('261', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:34:35'); +INSERT INTO `sys_log` VALUES ('262', '1', 'admin', '登录', '30', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:34:35'); +INSERT INTO `sys_log` VALUES ('263', '1', 'admin', '请求访问主页', '47', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:34:35'); +INSERT INTO `sys_log` VALUES ('264', '1', 'admin', '请求访问主页', '25', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:34:35'); +INSERT INTO `sys_log` VALUES ('265', '1', 'admin', '登录', '20', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:35:46'); +INSERT INTO `sys_log` VALUES ('266', '1', 'admin', '请求访问主页', '36', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:35:46'); +INSERT INTO `sys_log` VALUES ('267', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:35:51'); +INSERT INTO `sys_log` VALUES ('268', '1', 'admin', '请求访问主页', '26', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:35:51'); +INSERT INTO `sys_log` VALUES ('269', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:36:11'); +INSERT INTO `sys_log` VALUES ('270', '1', 'admin', '请求访问主页', '17', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:36:11'); +INSERT INTO `sys_log` VALUES ('271', '1', 'admin', '登录', '15', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:36:14'); +INSERT INTO `sys_log` VALUES ('272', '1', 'admin', '请求访问主页', '23', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:36:14'); +INSERT INTO `sys_log` VALUES ('273', '1', 'admin', '登录', '12', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:36:17'); +INSERT INTO `sys_log` VALUES ('274', '1', 'admin', '请求访问主页', '17', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:36:17'); +INSERT INTO `sys_log` VALUES ('275', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:36:19'); +INSERT INTO `sys_log` VALUES ('276', '1', 'admin', '请求访问主页', '28', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:36:20'); +INSERT INTO `sys_log` VALUES ('277', '1', 'admin', '登录', '14', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:36:21'); +INSERT INTO `sys_log` VALUES ('278', '1', 'admin', '请求访问主页', '19', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:36:21'); +INSERT INTO `sys_log` VALUES ('279', '1', 'admin', '登录', '20', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:38:21'); +INSERT INTO `sys_log` VALUES ('280', '1', 'admin', '请求访问主页', '32', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:38:22'); +INSERT INTO `sys_log` VALUES ('281', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:38:23'); +INSERT INTO `sys_log` VALUES ('282', '1', 'admin', '请求访问主页', '27', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:38:23'); +INSERT INTO `sys_log` VALUES ('283', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:38:27'); +INSERT INTO `sys_log` VALUES ('284', '1', 'admin', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:38:27'); +INSERT INTO `sys_log` VALUES ('285', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:38:32'); +INSERT INTO `sys_log` VALUES ('286', '1', 'admin', '请求访问主页', '20', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:38:32'); +INSERT INTO `sys_log` VALUES ('287', '1', 'admin', '登录', '7', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:38:37'); +INSERT INTO `sys_log` VALUES ('288', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:38:37'); +INSERT INTO `sys_log` VALUES ('289', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:38:42'); +INSERT INTO `sys_log` VALUES ('290', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:38:42'); +INSERT INTO `sys_log` VALUES ('291', '1', 'admin', '登录', '19', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:39:24'); +INSERT INTO `sys_log` VALUES ('292', '1', 'admin', '请求访问主页', '29', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:39:24'); +INSERT INTO `sys_log` VALUES ('293', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:39:27'); +INSERT INTO `sys_log` VALUES ('294', '1', 'admin', '请求访问主页', '20', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:39:27'); +INSERT INTO `sys_log` VALUES ('295', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:39:32'); +INSERT INTO `sys_log` VALUES ('296', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:39:34'); +INSERT INTO `sys_log` VALUES ('297', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:39:34'); +INSERT INTO `sys_log` VALUES ('298', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:39:37'); +INSERT INTO `sys_log` VALUES ('299', '1', 'admin', '请求访问主页', '7', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:39:37'); +INSERT INTO `sys_log` VALUES ('300', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:39:38'); +INSERT INTO `sys_log` VALUES ('301', '1', 'admin', '请求访问主页', '9', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:39:38'); +INSERT INTO `sys_log` VALUES ('302', '1', 'admin', '登录', '19', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:40:07'); +INSERT INTO `sys_log` VALUES ('303', '1', 'admin', '请求访问主页', '31', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:40:07'); +INSERT INTO `sys_log` VALUES ('304', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:40:11'); +INSERT INTO `sys_log` VALUES ('305', '1', 'admin', '请求访问主页', '14', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:40:12'); +INSERT INTO `sys_log` VALUES ('306', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:40:13'); +INSERT INTO `sys_log` VALUES ('307', '1', 'admin', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:40:14'); +INSERT INTO `sys_log` VALUES ('308', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:40:16'); +INSERT INTO `sys_log` VALUES ('309', '1', 'admin', '请求访问主页', '18', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:40:17'); +INSERT INTO `sys_log` VALUES ('310', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:40:19'); +INSERT INTO `sys_log` VALUES ('311', '1', 'admin', '请求访问主页', '13', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:40:20'); +INSERT INTO `sys_log` VALUES ('312', '1', 'admin', '登录', '11', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:41:35'); +INSERT INTO `sys_log` VALUES ('313', '1', 'admin', '请求访问主页', '16', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:41:35'); +INSERT INTO `sys_log` VALUES ('314', '1', 'admin', '登录', '15', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:48:25'); +INSERT INTO `sys_log` VALUES ('315', '1', 'admin', '请求访问主页', '26', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:48:25'); +INSERT INTO `sys_log` VALUES ('316', '1', 'admin', '登录', '17', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 10:49:37'); +INSERT INTO `sys_log` VALUES ('317', '1', 'admin', '请求访问主页', '34', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 10:49:38'); +INSERT INTO `sys_log` VALUES ('318', '1', 'admin', '登录', '107', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 11:39:55'); +INSERT INTO `sys_log` VALUES ('319', '1', 'admin', '请求访问主页', '52', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 11:39:55'); +INSERT INTO `sys_log` VALUES ('320', '1', 'admin', '登录', '45', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 11:44:27'); +INSERT INTO `sys_log` VALUES ('321', '1', 'admin', '请求访问主页', '77', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 11:44:27'); +INSERT INTO `sys_log` VALUES ('322', '1', 'admin', '登录', '11', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 11:51:26'); +INSERT INTO `sys_log` VALUES ('323', '1', 'admin', '请求访问主页', '39', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 11:51:26'); +INSERT INTO `sys_log` VALUES ('324', '1', 'admin', '更新用户', '266', 'com.bootdo.system.controller.UserController.updatePeronal()', null, '127.0.0.1', '2018-01-04 11:52:15'); +INSERT INTO `sys_log` VALUES ('325', '1', 'admin', '登录', '16', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 11:54:09'); +INSERT INTO `sys_log` VALUES ('326', '1', 'admin', '请求访问主页', '65', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 11:54:09'); +INSERT INTO `sys_log` VALUES ('327', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 11:58:28'); +INSERT INTO `sys_log` VALUES ('328', '1', 'admin', '请求访问主页', '24', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 11:58:28'); +INSERT INTO `sys_log` VALUES ('329', '1', 'admin', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 12:37:42'); +INSERT INTO `sys_log` VALUES ('330', '1', 'admin', '请求访问主页', '34', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 12:37:42'); +INSERT INTO `sys_log` VALUES ('331', '1', 'admin', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 12:38:46'); +INSERT INTO `sys_log` VALUES ('332', '1', 'admin', '请求访问主页', '14', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 12:41:28'); +INSERT INTO `sys_log` VALUES ('333', '1', 'admin', '登录', '3', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 12:48:37'); +INSERT INTO `sys_log` VALUES ('334', '1', 'admin', '请求访问主页', '10', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 12:48:37'); +INSERT INTO `sys_log` VALUES ('335', '1', 'admin', '登录', '17', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:09:47'); +INSERT INTO `sys_log` VALUES ('336', '1', 'admin', '请求访问主页', '67', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:09:47'); +INSERT INTO `sys_log` VALUES ('337', '2', 'test', '登录', '22', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:16:42'); +INSERT INTO `sys_log` VALUES ('338', '2', 'test', '请求访问主页', '65', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:16:42'); +INSERT INTO `sys_log` VALUES ('339', '2', 'test', '请求访问主页', '20', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:16:56'); +INSERT INTO `sys_log` VALUES ('340', '2', 'test', '登录', '8', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:20:53'); +INSERT INTO `sys_log` VALUES ('341', '2', 'test', '请求访问主页', '42', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:20:53'); +INSERT INTO `sys_log` VALUES ('342', '2', 'test', '登录', '22', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:23:23'); +INSERT INTO `sys_log` VALUES ('343', '2', 'test', '请求访问主页', '77', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:23:24'); +INSERT INTO `sys_log` VALUES ('344', '2', 'test', '登录', '19', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:29:52'); +INSERT INTO `sys_log` VALUES ('345', '2', 'test', '请求访问主页', '66', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:29:53'); +INSERT INTO `sys_log` VALUES ('346', '-1', '获取用户信息为空', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:37:51'); +INSERT INTO `sys_log` VALUES ('347', '1', 'admin', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:37:55'); +INSERT INTO `sys_log` VALUES ('348', '1', 'admin', '请求访问主页', '24', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:37:55'); +INSERT INTO `sys_log` VALUES ('349', '1', 'admin', '批量删除角色', '144', 'com.bootdo.system.controller.RoleController.batchRemove()', null, '127.0.0.1', '2018-01-04 13:38:20'); +INSERT INTO `sys_log` VALUES ('350', '1', 'admin', '登录', '10', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:48:13'); +INSERT INTO `sys_log` VALUES ('351', '1', 'admin', '请求访问主页', '24', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:48:13'); +INSERT INTO `sys_log` VALUES ('352', '1', 'admin', '添加角色', '0', 'com.bootdo.system.controller.RoleController.add()', null, '127.0.0.1', '2018-01-04 13:48:18'); +INSERT INTO `sys_log` VALUES ('353', '1', 'admin', '保存角色', '155', 'com.bootdo.system.controller.RoleController.save()', null, '127.0.0.1', '2018-01-04 13:48:24'); +INSERT INTO `sys_log` VALUES ('354', '1', 'admin', '添加角色', '0', 'com.bootdo.system.controller.RoleController.add()', null, '127.0.0.1', '2018-01-04 13:48:25'); +INSERT INTO `sys_log` VALUES ('355', '1', 'admin', '保存角色', '160', 'com.bootdo.system.controller.RoleController.save()', null, '127.0.0.1', '2018-01-04 13:48:29'); +INSERT INTO `sys_log` VALUES ('356', '1', 'admin', '批量删除角色', '127', 'com.bootdo.system.controller.RoleController.batchRemove()', null, '127.0.0.1', '2018-01-04 13:48:35'); +INSERT INTO `sys_log` VALUES ('357', '1', 'admin', '提交更改用户密码', '3', 'com.bootdo.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2018-01-04 13:51:24'); +INSERT INTO `sys_log` VALUES ('358', '1', 'admin', '提交更改用户密码', '4', 'com.bootdo.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2018-01-04 13:51:30'); +INSERT INTO `sys_log` VALUES ('359', '1', 'admin', '提交更改用户密码', '4', 'com.bootdo.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2018-01-04 13:51:46'); +INSERT INTO `sys_log` VALUES ('360', '1', 'admin', '提交更改用户密码', '3', 'com.bootdo.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2018-01-04 13:52:19'); +INSERT INTO `sys_log` VALUES ('361', '1', 'admin', '请求更改用户密码', '0', 'com.bootdo.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2018-01-04 13:54:39'); +INSERT INTO `sys_log` VALUES ('362', '1', 'admin', 'admin提交更改用户密码', '7', 'com.bootdo.system.controller.UserController.adminResetPwd()', null, '127.0.0.1', '2018-01-04 13:54:47'); +INSERT INTO `sys_log` VALUES ('363', '1', 'admin', '登录', '9', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:55:32'); +INSERT INTO `sys_log` VALUES ('364', '1', 'admin', '请求访问主页', '31', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:55:32'); +INSERT INTO `sys_log` VALUES ('365', '1', 'admin', '提交更改用户密码', '23782', 'com.bootdo.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2018-01-04 13:56:09'); +INSERT INTO `sys_log` VALUES ('366', '-1', '获取用户信息为空', '登录', '6', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:57:18'); +INSERT INTO `sys_log` VALUES ('367', '1', 'admin', '登录', '5', 'com.bootdo.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2018-01-04 13:57:22'); +INSERT INTO `sys_log` VALUES ('368', '1', 'admin', '请求访问主页', '29', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:57:22'); +INSERT INTO `sys_log` VALUES ('369', '1', 'admin', '提交更改用户密码', '147', 'com.bootdo.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2018-01-04 13:57:35'); +INSERT INTO `sys_log` VALUES ('370', '1', 'admin', '请求访问主页', '12', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:57:39'); +INSERT INTO `sys_log` VALUES ('371', '1', 'admin', '请求访问主页', '15', 'com.bootdo.system.controller.LoginController.index()', null, '127.0.0.1', '2018-01-04 13:57:40'); + +-- ---------------------------- +-- Table structure for `sys_menu` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_menu`; +CREATE TABLE `sys_menu` ( + `menu_id` bigint(20) NOT NULL AUTO_INCREMENT, + `parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单ID,一级菜单为0', + `name` varchar(50) DEFAULT NULL COMMENT '菜单名称', + `url` varchar(200) DEFAULT NULL COMMENT '菜单URL', + `perms` varchar(500) DEFAULT NULL COMMENT '授权(多个用逗号分隔,如:user:list,user:create)', + `type` int(11) DEFAULT NULL COMMENT '类型 0:目录 1:菜单 2:按钮', + `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标', + `order_num` int(11) DEFAULT NULL COMMENT '排序', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + PRIMARY KEY (`menu_id`) +) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8 COMMENT='菜单管理'; + +-- ---------------------------- +-- Records of sys_menu +-- ---------------------------- +INSERT INTO `sys_menu` VALUES ('1', '0', '基础管理', '', '', '0', 'fa fa-bars', '0', '2017-08-09 22:49:47', null); +INSERT INTO `sys_menu` VALUES ('2', '3', '系统菜单', 'sys/menu/', 'sys:menu:menu', '1', 'fa fa-th-list', '2', '2017-08-09 22:55:15', null); +INSERT INTO `sys_menu` VALUES ('3', '0', '系统管理', null, null, '0', 'fa fa-desktop', '1', '2017-08-09 23:06:55', '2017-08-14 14:13:43'); +INSERT INTO `sys_menu` VALUES ('6', '3', '用户管理', 'sys/user/', 'sys:user:user', '1', 'fa fa-user', '0', '2017-08-10 14:12:11', null); +INSERT INTO `sys_menu` VALUES ('7', '3', '角色管理', 'sys/role', 'sys:role:role', '1', 'fa fa-paw', '1', '2017-08-10 14:13:19', null); +INSERT INTO `sys_menu` VALUES ('12', '6', '新增', '', 'sys:user:add', '2', '', '0', '2017-08-14 10:51:35', null); +INSERT INTO `sys_menu` VALUES ('13', '6', '编辑', '', 'sys:user:edit', '2', '', '0', '2017-08-14 10:52:06', null); +INSERT INTO `sys_menu` VALUES ('14', '6', '删除', null, 'sys:user:remove', '2', null, '0', '2017-08-14 10:52:24', null); +INSERT INTO `sys_menu` VALUES ('15', '7', '新增', '', 'sys:role:add', '2', '', '0', '2017-08-14 10:56:37', null); +INSERT INTO `sys_menu` VALUES ('20', '2', '新增', '', 'sys:menu:add', '2', '', '0', '2017-08-14 10:59:32', null); +INSERT INTO `sys_menu` VALUES ('21', '2', '编辑', '', 'sys:menu:edit', '2', '', '0', '2017-08-14 10:59:56', null); +INSERT INTO `sys_menu` VALUES ('22', '2', '删除', '', 'sys:menu:remove', '2', '', '0', '2017-08-14 11:00:26', null); +INSERT INTO `sys_menu` VALUES ('24', '6', '批量删除', '', 'sys:user:batchRemove', '2', '', '0', '2017-08-14 17:27:18', null); +INSERT INTO `sys_menu` VALUES ('25', '6', '停用', null, 'sys:user:disable', '2', null, '0', '2017-08-14 17:27:43', null); +INSERT INTO `sys_menu` VALUES ('26', '6', '重置密码', '', 'sys:user:resetPwd', '2', '', '0', '2017-08-14 17:28:34', null); +INSERT INTO `sys_menu` VALUES ('27', '91', '系统日志', 'common/log', 'common:log', '1', 'fa fa-warning', '0', '2017-08-14 22:11:53', null); +INSERT INTO `sys_menu` VALUES ('28', '27', '刷新', null, 'sys:log:list', '2', null, '0', '2017-08-14 22:30:22', null); +INSERT INTO `sys_menu` VALUES ('29', '27', '删除', null, 'sys:log:remove', '2', null, '0', '2017-08-14 22:30:43', null); +INSERT INTO `sys_menu` VALUES ('30', '27', '清空', null, 'sys:log:clear', '2', null, '0', '2017-08-14 22:31:02', null); +INSERT INTO `sys_menu` VALUES ('48', '77', '代码生成', 'common/generator', 'common:generator', '1', 'fa fa-code', '3', null, null); +INSERT INTO `sys_menu` VALUES ('49', '0', '博客管理', '', '', '0', 'fa fa-rss', '6', null, null); +INSERT INTO `sys_menu` VALUES ('50', '49', '文章列表', 'blog/bContent', 'blog:bContent:bContent', '1', 'fa fa-file-image-o', '1', null, null); +INSERT INTO `sys_menu` VALUES ('51', '50', '新增', '', 'blog:bContent:add', '2', '', null, null, null); +INSERT INTO `sys_menu` VALUES ('55', '7', '编辑', '', 'sys:role:edit', '2', '', null, null, null); +INSERT INTO `sys_menu` VALUES ('56', '7', '删除', '', 'sys:role:remove', '2', null, null, null, null); +INSERT INTO `sys_menu` VALUES ('57', '91', '运行监控', '/druid/index.html', '', '1', 'fa fa-caret-square-o-right', '1', null, null); +INSERT INTO `sys_menu` VALUES ('58', '50', '编辑', '', 'blog:bContent:edit', '2', null, null, null, null); +INSERT INTO `sys_menu` VALUES ('59', '50', '删除', '', 'blog:bContent:remove', '2', null, null, null, null); +INSERT INTO `sys_menu` VALUES ('60', '50', '批量删除', '', 'blog:bContent:batchRemove', '2', null, null, null, null); +INSERT INTO `sys_menu` VALUES ('61', '2', '批量删除', '', 'sys:menu:batchRemove', '2', null, null, null, null); +INSERT INTO `sys_menu` VALUES ('62', '7', '批量删除', '', 'sys:role:batchRemove', '2', null, null, null, null); +INSERT INTO `sys_menu` VALUES ('68', '49', '发布文章', '/blog/bContent/add', 'blog:bContent:add', '1', 'fa fa-edit', '0', null, null); +INSERT INTO `sys_menu` VALUES ('71', '1', '文件管理', '/common/sysFile', 'common:sysFile:sysFile', '1', 'fa fa-folder-open', '2', null, null); +INSERT INTO `sys_menu` VALUES ('72', '77', '计划任务', 'common/job', 'common:taskScheduleJob', '1', 'fa fa-hourglass-1', '4', null, null); +INSERT INTO `sys_menu` VALUES ('73', '3', '部门管理', '/system/sysDept', 'system:sysDept:sysDept', '1', 'fa fa-users', '3', null, null); +INSERT INTO `sys_menu` VALUES ('74', '73', '增加', '/system/sysDept/add', 'system:sysDept:add', '2', null, '1', null, null); +INSERT INTO `sys_menu` VALUES ('75', '73', '刪除', 'system/sysDept/remove', 'system:sysDept:remove', '2', null, '2', null, null); +INSERT INTO `sys_menu` VALUES ('76', '73', '编辑', '/system/sysDept/edit', 'system:sysDept:edit', '2', null, '3', null, null); +INSERT INTO `sys_menu` VALUES ('77', '0', '系统工具', '', '', '0', 'fa fa-gear', '4', null, null); +INSERT INTO `sys_menu` VALUES ('78', '1', '数据字典', '/common/sysDict', 'common:sysDict:sysDict', '1', 'fa fa-book', '1', null, null); +INSERT INTO `sys_menu` VALUES ('79', '78', '增加', '/common/sysDict/add', 'common:sysDict:add', '2', null, '2', null, null); +INSERT INTO `sys_menu` VALUES ('80', '78', '编辑', '/common/sysDict/edit', 'common:sysDict:edit', '2', null, '2', null, null); +INSERT INTO `sys_menu` VALUES ('81', '78', '删除', '/common/sysDict/remove', 'common:sysDict:remove', '2', '', '3', null, null); +INSERT INTO `sys_menu` VALUES ('83', '78', '批量删除', '/common/sysDict/batchRemove', 'common:sysDict:batchRemove', '2', '', '4', null, null); +INSERT INTO `sys_menu` VALUES ('84', '0', '办公管理', '', '', '0', 'fa fa-laptop', '5', null, null); +INSERT INTO `sys_menu` VALUES ('85', '84', '通知公告', 'oa/notify', 'oa:notify:notify', '1', 'fa fa-pencil-square', null, null, null); +INSERT INTO `sys_menu` VALUES ('86', '85', '新增', 'oa/notify/add', 'oa:notify:add', '2', 'fa fa-plus', '1', null, null); +INSERT INTO `sys_menu` VALUES ('87', '85', '编辑', 'oa/notify/edit', 'oa:notify:edit', '2', 'fa fa-pencil-square-o', '2', null, null); +INSERT INTO `sys_menu` VALUES ('88', '85', '删除', 'oa/notify/remove', 'oa:notify:remove', '2', 'fa fa-minus', null, null, null); +INSERT INTO `sys_menu` VALUES ('89', '85', '批量删除', 'oa/notify/batchRemove', 'oa:notify:batchRemove', '2', '', null, null, null); +INSERT INTO `sys_menu` VALUES ('90', '84', '我的通知', 'oa/notify/selfNotify', '', '1', 'fa fa-envelope-square', null, null, null); +INSERT INTO `sys_menu` VALUES ('91', '0', '系统监控', '', '', '0', 'fa fa-video-camera', '5', null, null); +INSERT INTO `sys_menu` VALUES ('92', '91', '在线用户', 'sys/online', '', '1', 'fa fa-user', null, null, null); +INSERT INTO `sys_menu` VALUES ('93', '0', '工作流程', '', '', '0', 'fa fa-print', '6', null, null); +INSERT INTO `sys_menu` VALUES ('94', '93', '模型管理', 'activiti/model', '', '1', 'fa fa-sort-amount-asc', null, null, null); +INSERT INTO `sys_menu` VALUES ('95', '94', '全部权限', '', 'activiti:model', '2', '', null, null, null); +INSERT INTO `sys_menu` VALUES ('96', '93', '流程管理', 'activiti/process', '', '1', 'fa fa-flag', null, null, null); +INSERT INTO `sys_menu` VALUES ('97', '0', '图表管理', '', '', '0', 'fa fa-bar-chart', '7', null, null); +INSERT INTO `sys_menu` VALUES ('98', '97', '百度chart', '/chart/graph_echarts.html', '', '1', 'fa fa-area-chart', null, null, null); +INSERT INTO `sys_menu` VALUES ('99', '96', '所有权限', '', 'act:process', '2', '', null, null, null); +INSERT INTO `sys_menu` VALUES ('101', '93', '待办任务', 'activiti/task/todo', '', '1', '', null, null, null); + +-- ---------------------------- +-- Table structure for `sys_role` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role`; +CREATE TABLE `sys_role` ( + `role_id` bigint(20) NOT NULL AUTO_INCREMENT, + `role_name` varchar(100) DEFAULT NULL COMMENT '角色名称', + `role_sign` varchar(100) DEFAULT NULL COMMENT '角色标识', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `user_id_create` bigint(255) DEFAULT NULL COMMENT '创建用户id', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`role_id`) +) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT='角色'; + +-- ---------------------------- +-- Records of sys_role +-- ---------------------------- +INSERT INTO `sys_role` VALUES ('1', '超级用户角色', 'admin', '拥有最高权限', '2', '2017-08-12 00:43:52', '2017-08-12 19:14:59'); + +-- ---------------------------- +-- Table structure for `sys_role_menu` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_role_menu`; +CREATE TABLE `sys_role_menu` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID', + `menu_id` bigint(20) DEFAULT NULL COMMENT '菜单ID', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2988 DEFAULT CHARSET=utf8 COMMENT='角色与菜单对应关系'; + +-- ---------------------------- +-- Records of sys_role_menu +-- ---------------------------- +INSERT INTO `sys_role_menu` VALUES ('367', '44', '1'); +INSERT INTO `sys_role_menu` VALUES ('368', '44', '32'); +INSERT INTO `sys_role_menu` VALUES ('369', '44', '33'); +INSERT INTO `sys_role_menu` VALUES ('370', '44', '34'); +INSERT INTO `sys_role_menu` VALUES ('371', '44', '35'); +INSERT INTO `sys_role_menu` VALUES ('372', '44', '28'); +INSERT INTO `sys_role_menu` VALUES ('373', '44', '29'); +INSERT INTO `sys_role_menu` VALUES ('374', '44', '30'); +INSERT INTO `sys_role_menu` VALUES ('375', '44', '38'); +INSERT INTO `sys_role_menu` VALUES ('376', '44', '4'); +INSERT INTO `sys_role_menu` VALUES ('377', '44', '27'); +INSERT INTO `sys_role_menu` VALUES ('378', '45', '38'); +INSERT INTO `sys_role_menu` VALUES ('379', '46', '3'); +INSERT INTO `sys_role_menu` VALUES ('380', '46', '20'); +INSERT INTO `sys_role_menu` VALUES ('381', '46', '21'); +INSERT INTO `sys_role_menu` VALUES ('382', '46', '22'); +INSERT INTO `sys_role_menu` VALUES ('383', '46', '23'); +INSERT INTO `sys_role_menu` VALUES ('384', '46', '11'); +INSERT INTO `sys_role_menu` VALUES ('385', '46', '12'); +INSERT INTO `sys_role_menu` VALUES ('386', '46', '13'); +INSERT INTO `sys_role_menu` VALUES ('387', '46', '14'); +INSERT INTO `sys_role_menu` VALUES ('388', '46', '24'); +INSERT INTO `sys_role_menu` VALUES ('389', '46', '25'); +INSERT INTO `sys_role_menu` VALUES ('390', '46', '26'); +INSERT INTO `sys_role_menu` VALUES ('391', '46', '15'); +INSERT INTO `sys_role_menu` VALUES ('392', '46', '2'); +INSERT INTO `sys_role_menu` VALUES ('393', '46', '6'); +INSERT INTO `sys_role_menu` VALUES ('394', '46', '7'); +INSERT INTO `sys_role_menu` VALUES ('598', '50', '38'); +INSERT INTO `sys_role_menu` VALUES ('632', '38', '42'); +INSERT INTO `sys_role_menu` VALUES ('737', '51', '38'); +INSERT INTO `sys_role_menu` VALUES ('738', '51', '39'); +INSERT INTO `sys_role_menu` VALUES ('739', '51', '40'); +INSERT INTO `sys_role_menu` VALUES ('740', '51', '41'); +INSERT INTO `sys_role_menu` VALUES ('741', '51', '4'); +INSERT INTO `sys_role_menu` VALUES ('742', '51', '32'); +INSERT INTO `sys_role_menu` VALUES ('743', '51', '33'); +INSERT INTO `sys_role_menu` VALUES ('744', '51', '34'); +INSERT INTO `sys_role_menu` VALUES ('745', '51', '35'); +INSERT INTO `sys_role_menu` VALUES ('746', '51', '27'); +INSERT INTO `sys_role_menu` VALUES ('747', '51', '28'); +INSERT INTO `sys_role_menu` VALUES ('748', '51', '29'); +INSERT INTO `sys_role_menu` VALUES ('749', '51', '30'); +INSERT INTO `sys_role_menu` VALUES ('750', '51', '1'); +INSERT INTO `sys_role_menu` VALUES ('1064', '54', '53'); +INSERT INTO `sys_role_menu` VALUES ('1095', '55', '2'); +INSERT INTO `sys_role_menu` VALUES ('1096', '55', '6'); +INSERT INTO `sys_role_menu` VALUES ('1097', '55', '7'); +INSERT INTO `sys_role_menu` VALUES ('1098', '55', '3'); +INSERT INTO `sys_role_menu` VALUES ('1099', '55', '50'); +INSERT INTO `sys_role_menu` VALUES ('1100', '55', '49'); +INSERT INTO `sys_role_menu` VALUES ('1101', '55', '1'); +INSERT INTO `sys_role_menu` VALUES ('1856', '53', '28'); +INSERT INTO `sys_role_menu` VALUES ('1857', '53', '29'); +INSERT INTO `sys_role_menu` VALUES ('1858', '53', '30'); +INSERT INTO `sys_role_menu` VALUES ('1859', '53', '27'); +INSERT INTO `sys_role_menu` VALUES ('1860', '53', '57'); +INSERT INTO `sys_role_menu` VALUES ('1861', '53', '71'); +INSERT INTO `sys_role_menu` VALUES ('1862', '53', '48'); +INSERT INTO `sys_role_menu` VALUES ('1863', '53', '72'); +INSERT INTO `sys_role_menu` VALUES ('1864', '53', '1'); +INSERT INTO `sys_role_menu` VALUES ('1865', '53', '7'); +INSERT INTO `sys_role_menu` VALUES ('1866', '53', '55'); +INSERT INTO `sys_role_menu` VALUES ('1867', '53', '56'); +INSERT INTO `sys_role_menu` VALUES ('1868', '53', '62'); +INSERT INTO `sys_role_menu` VALUES ('1869', '53', '15'); +INSERT INTO `sys_role_menu` VALUES ('1870', '53', '2'); +INSERT INTO `sys_role_menu` VALUES ('1871', '53', '61'); +INSERT INTO `sys_role_menu` VALUES ('1872', '53', '20'); +INSERT INTO `sys_role_menu` VALUES ('1873', '53', '21'); +INSERT INTO `sys_role_menu` VALUES ('1874', '53', '22'); +INSERT INTO `sys_role_menu` VALUES ('2084', '56', '68'); +INSERT INTO `sys_role_menu` VALUES ('2085', '56', '60'); +INSERT INTO `sys_role_menu` VALUES ('2086', '56', '59'); +INSERT INTO `sys_role_menu` VALUES ('2087', '56', '58'); +INSERT INTO `sys_role_menu` VALUES ('2088', '56', '51'); +INSERT INTO `sys_role_menu` VALUES ('2089', '56', '50'); +INSERT INTO `sys_role_menu` VALUES ('2090', '56', '49'); +INSERT INTO `sys_role_menu` VALUES ('2243', '48', '72'); +INSERT INTO `sys_role_menu` VALUES ('2247', '63', '-1'); +INSERT INTO `sys_role_menu` VALUES ('2248', '63', '84'); +INSERT INTO `sys_role_menu` VALUES ('2249', '63', '85'); +INSERT INTO `sys_role_menu` VALUES ('2250', '63', '88'); +INSERT INTO `sys_role_menu` VALUES ('2251', '63', '87'); +INSERT INTO `sys_role_menu` VALUES ('2252', '64', '84'); +INSERT INTO `sys_role_menu` VALUES ('2253', '64', '89'); +INSERT INTO `sys_role_menu` VALUES ('2254', '64', '88'); +INSERT INTO `sys_role_menu` VALUES ('2255', '64', '87'); +INSERT INTO `sys_role_menu` VALUES ('2256', '64', '86'); +INSERT INTO `sys_role_menu` VALUES ('2257', '64', '85'); +INSERT INTO `sys_role_menu` VALUES ('2258', '65', '89'); +INSERT INTO `sys_role_menu` VALUES ('2259', '65', '88'); +INSERT INTO `sys_role_menu` VALUES ('2260', '65', '86'); +INSERT INTO `sys_role_menu` VALUES ('2262', '67', '48'); +INSERT INTO `sys_role_menu` VALUES ('2263', '68', '88'); +INSERT INTO `sys_role_menu` VALUES ('2264', '68', '87'); +INSERT INTO `sys_role_menu` VALUES ('2265', '69', '89'); +INSERT INTO `sys_role_menu` VALUES ('2266', '69', '88'); +INSERT INTO `sys_role_menu` VALUES ('2267', '69', '86'); +INSERT INTO `sys_role_menu` VALUES ('2268', '69', '87'); +INSERT INTO `sys_role_menu` VALUES ('2269', '69', '85'); +INSERT INTO `sys_role_menu` VALUES ('2270', '69', '84'); +INSERT INTO `sys_role_menu` VALUES ('2271', '70', '85'); +INSERT INTO `sys_role_menu` VALUES ('2272', '70', '89'); +INSERT INTO `sys_role_menu` VALUES ('2273', '70', '88'); +INSERT INTO `sys_role_menu` VALUES ('2274', '70', '87'); +INSERT INTO `sys_role_menu` VALUES ('2275', '70', '86'); +INSERT INTO `sys_role_menu` VALUES ('2276', '70', '84'); +INSERT INTO `sys_role_menu` VALUES ('2277', '71', '87'); +INSERT INTO `sys_role_menu` VALUES ('2278', '72', '59'); +INSERT INTO `sys_role_menu` VALUES ('2279', '73', '48'); +INSERT INTO `sys_role_menu` VALUES ('2280', '74', '88'); +INSERT INTO `sys_role_menu` VALUES ('2281', '74', '87'); +INSERT INTO `sys_role_menu` VALUES ('2282', '75', '88'); +INSERT INTO `sys_role_menu` VALUES ('2283', '75', '87'); +INSERT INTO `sys_role_menu` VALUES ('2284', '76', '85'); +INSERT INTO `sys_role_menu` VALUES ('2285', '76', '89'); +INSERT INTO `sys_role_menu` VALUES ('2286', '76', '88'); +INSERT INTO `sys_role_menu` VALUES ('2287', '76', '87'); +INSERT INTO `sys_role_menu` VALUES ('2288', '76', '86'); +INSERT INTO `sys_role_menu` VALUES ('2289', '76', '84'); +INSERT INTO `sys_role_menu` VALUES ('2292', '78', '88'); +INSERT INTO `sys_role_menu` VALUES ('2293', '78', '87'); +INSERT INTO `sys_role_menu` VALUES ('2294', '78', null); +INSERT INTO `sys_role_menu` VALUES ('2295', '78', null); +INSERT INTO `sys_role_menu` VALUES ('2296', '78', null); +INSERT INTO `sys_role_menu` VALUES ('2308', '80', '87'); +INSERT INTO `sys_role_menu` VALUES ('2309', '80', '86'); +INSERT INTO `sys_role_menu` VALUES ('2310', '80', '-1'); +INSERT INTO `sys_role_menu` VALUES ('2311', '80', '84'); +INSERT INTO `sys_role_menu` VALUES ('2312', '80', '85'); +INSERT INTO `sys_role_menu` VALUES ('2328', '79', '72'); +INSERT INTO `sys_role_menu` VALUES ('2329', '79', '48'); +INSERT INTO `sys_role_menu` VALUES ('2330', '79', '77'); +INSERT INTO `sys_role_menu` VALUES ('2331', '79', '84'); +INSERT INTO `sys_role_menu` VALUES ('2332', '79', '89'); +INSERT INTO `sys_role_menu` VALUES ('2333', '79', '88'); +INSERT INTO `sys_role_menu` VALUES ('2334', '79', '87'); +INSERT INTO `sys_role_menu` VALUES ('2335', '79', '86'); +INSERT INTO `sys_role_menu` VALUES ('2336', '79', '85'); +INSERT INTO `sys_role_menu` VALUES ('2337', '79', '-1'); +INSERT INTO `sys_role_menu` VALUES ('2338', '77', '89'); +INSERT INTO `sys_role_menu` VALUES ('2339', '77', '88'); +INSERT INTO `sys_role_menu` VALUES ('2340', '77', '87'); +INSERT INTO `sys_role_menu` VALUES ('2341', '77', '86'); +INSERT INTO `sys_role_menu` VALUES ('2342', '77', '85'); +INSERT INTO `sys_role_menu` VALUES ('2343', '77', '84'); +INSERT INTO `sys_role_menu` VALUES ('2344', '77', '72'); +INSERT INTO `sys_role_menu` VALUES ('2345', '77', '-1'); +INSERT INTO `sys_role_menu` VALUES ('2346', '77', '77'); +INSERT INTO `sys_role_menu` VALUES ('2911', '1', '98'); +INSERT INTO `sys_role_menu` VALUES ('2912', '1', '100'); +INSERT INTO `sys_role_menu` VALUES ('2913', '1', '99'); +INSERT INTO `sys_role_menu` VALUES ('2914', '1', '95'); +INSERT INTO `sys_role_menu` VALUES ('2915', '1', '92'); +INSERT INTO `sys_role_menu` VALUES ('2916', '1', '57'); +INSERT INTO `sys_role_menu` VALUES ('2917', '1', '30'); +INSERT INTO `sys_role_menu` VALUES ('2918', '1', '29'); +INSERT INTO `sys_role_menu` VALUES ('2919', '1', '28'); +INSERT INTO `sys_role_menu` VALUES ('2920', '1', '90'); +INSERT INTO `sys_role_menu` VALUES ('2921', '1', '89'); +INSERT INTO `sys_role_menu` VALUES ('2922', '1', '88'); +INSERT INTO `sys_role_menu` VALUES ('2923', '1', '87'); +INSERT INTO `sys_role_menu` VALUES ('2924', '1', '86'); +INSERT INTO `sys_role_menu` VALUES ('2925', '1', '72'); +INSERT INTO `sys_role_menu` VALUES ('2926', '1', '48'); +INSERT INTO `sys_role_menu` VALUES ('2927', '1', '68'); +INSERT INTO `sys_role_menu` VALUES ('2928', '1', '60'); +INSERT INTO `sys_role_menu` VALUES ('2929', '1', '59'); +INSERT INTO `sys_role_menu` VALUES ('2930', '1', '58'); +INSERT INTO `sys_role_menu` VALUES ('2931', '1', '51'); +INSERT INTO `sys_role_menu` VALUES ('2932', '1', '76'); +INSERT INTO `sys_role_menu` VALUES ('2933', '1', '75'); +INSERT INTO `sys_role_menu` VALUES ('2934', '1', '74'); +INSERT INTO `sys_role_menu` VALUES ('2935', '1', '62'); +INSERT INTO `sys_role_menu` VALUES ('2936', '1', '56'); +INSERT INTO `sys_role_menu` VALUES ('2937', '1', '55'); +INSERT INTO `sys_role_menu` VALUES ('2938', '1', '15'); +INSERT INTO `sys_role_menu` VALUES ('2939', '1', '26'); +INSERT INTO `sys_role_menu` VALUES ('2940', '1', '25'); +INSERT INTO `sys_role_menu` VALUES ('2941', '1', '24'); +INSERT INTO `sys_role_menu` VALUES ('2942', '1', '14'); +INSERT INTO `sys_role_menu` VALUES ('2943', '1', '13'); +INSERT INTO `sys_role_menu` VALUES ('2944', '1', '12'); +INSERT INTO `sys_role_menu` VALUES ('2945', '1', '61'); +INSERT INTO `sys_role_menu` VALUES ('2946', '1', '22'); +INSERT INTO `sys_role_menu` VALUES ('2947', '1', '21'); +INSERT INTO `sys_role_menu` VALUES ('2948', '1', '20'); +INSERT INTO `sys_role_menu` VALUES ('2949', '1', '83'); +INSERT INTO `sys_role_menu` VALUES ('2950', '1', '81'); +INSERT INTO `sys_role_menu` VALUES ('2951', '1', '80'); +INSERT INTO `sys_role_menu` VALUES ('2952', '1', '79'); +INSERT INTO `sys_role_menu` VALUES ('2953', '1', '71'); +INSERT INTO `sys_role_menu` VALUES ('2954', '1', '97'); +INSERT INTO `sys_role_menu` VALUES ('2955', '1', '96'); +INSERT INTO `sys_role_menu` VALUES ('2956', '1', '94'); +INSERT INTO `sys_role_menu` VALUES ('2957', '1', '27'); +INSERT INTO `sys_role_menu` VALUES ('2958', '1', '91'); +INSERT INTO `sys_role_menu` VALUES ('2959', '1', '85'); +INSERT INTO `sys_role_menu` VALUES ('2960', '1', '84'); +INSERT INTO `sys_role_menu` VALUES ('2961', '1', '77'); +INSERT INTO `sys_role_menu` VALUES ('2962', '1', '50'); +INSERT INTO `sys_role_menu` VALUES ('2963', '1', '49'); +INSERT INTO `sys_role_menu` VALUES ('2964', '1', '73'); +INSERT INTO `sys_role_menu` VALUES ('2965', '1', '7'); +INSERT INTO `sys_role_menu` VALUES ('2966', '1', '6'); +INSERT INTO `sys_role_menu` VALUES ('2967', '1', '2'); +INSERT INTO `sys_role_menu` VALUES ('2968', '1', '3'); +INSERT INTO `sys_role_menu` VALUES ('2969', '1', '78'); +INSERT INTO `sys_role_menu` VALUES ('2970', '1', '1'); +INSERT INTO `sys_role_menu` VALUES ('2971', '1', '101'); +INSERT INTO `sys_role_menu` VALUES ('2972', '1', '93'); +INSERT INTO `sys_role_menu` VALUES ('2973', '1', '-1'); +INSERT INTO `sys_role_menu` VALUES ('2974', '57', '93'); +INSERT INTO `sys_role_menu` VALUES ('2975', '57', '99'); +INSERT INTO `sys_role_menu` VALUES ('2976', '57', '95'); +INSERT INTO `sys_role_menu` VALUES ('2977', '57', '101'); +INSERT INTO `sys_role_menu` VALUES ('2978', '57', '96'); +INSERT INTO `sys_role_menu` VALUES ('2979', '57', '94'); +INSERT INTO `sys_role_menu` VALUES ('2980', '57', '-1'); +INSERT INTO `sys_role_menu` VALUES ('2981', '58', '93'); +INSERT INTO `sys_role_menu` VALUES ('2982', '58', '99'); +INSERT INTO `sys_role_menu` VALUES ('2983', '58', '95'); +INSERT INTO `sys_role_menu` VALUES ('2984', '58', '101'); +INSERT INTO `sys_role_menu` VALUES ('2985', '58', '96'); +INSERT INTO `sys_role_menu` VALUES ('2986', '58', '94'); +INSERT INTO `sys_role_menu` VALUES ('2987', '58', '-1'); + +-- ---------------------------- +-- Table structure for `sys_task` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_task`; +CREATE TABLE `sys_task` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `cron_expression` varchar(255) DEFAULT NULL COMMENT 'cron表达式', + `method_name` varchar(255) DEFAULT NULL COMMENT '任务调用的方法名', + `is_concurrent` varchar(255) DEFAULT NULL COMMENT '任务是否有状态', + `description` varchar(255) DEFAULT NULL COMMENT '任务描述', + `update_by` varchar(64) DEFAULT NULL COMMENT '更新者', + `bean_class` varchar(255) DEFAULT NULL COMMENT '任务执行时调用哪个类的方法 包名+类名', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `job_status` varchar(255) DEFAULT NULL COMMENT '任务状态', + `job_group` varchar(255) DEFAULT NULL COMMENT '任务分组', + `update_date` datetime DEFAULT NULL COMMENT '更新时间', + `create_by` varchar(64) DEFAULT NULL COMMENT '创建者', + `spring_bean` varchar(255) DEFAULT NULL COMMENT 'Spring bean', + `job_name` varchar(255) DEFAULT NULL COMMENT '任务名', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of sys_task +-- ---------------------------- +INSERT INTO `sys_task` VALUES ('2', '0/10 * * * * ?', 'run1', '1', '', '4028ea815a3d2a8c015a3d2f8d2a0002', 'com.bootdo.common.task.WelcomeJob', '2017-05-19 18:30:56', '0', 'group1', '2017-05-19 18:31:07', null, '', 'welcomJob'); + +-- ---------------------------- +-- Table structure for `sys_user` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user`; +CREATE TABLE `sys_user` ( + `user_id` bigint(20) NOT NULL AUTO_INCREMENT, + `username` varchar(50) DEFAULT NULL COMMENT '用户名', + `name` varchar(100) DEFAULT NULL, + `password` varchar(50) DEFAULT NULL COMMENT '密码', + `dept_id` bigint(20) DEFAULT NULL, + `email` varchar(100) DEFAULT NULL COMMENT '邮箱', + `mobile` varchar(100) DEFAULT NULL COMMENT '手机号', + `status` tinyint(255) DEFAULT NULL COMMENT '状态 0:禁用,1:正常', + `user_id_create` bigint(255) DEFAULT NULL COMMENT '创建用户id', + `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', + `gmt_modified` datetime DEFAULT NULL COMMENT '修改时间', + `sex` bigint(32) DEFAULT NULL COMMENT '性别', + `birth` datetime DEFAULT NULL COMMENT '出身日期', + `pic_id` bigint(32) DEFAULT NULL, + `live_address` varchar(500) DEFAULT NULL COMMENT '现居住地', + `hobby` varchar(255) DEFAULT NULL COMMENT '爱好', + `province` varchar(255) DEFAULT NULL COMMENT '省份', + `city` varchar(255) DEFAULT NULL COMMENT '所在城市', + `district` varchar(255) DEFAULT NULL COMMENT '所在地区', + PRIMARY KEY (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of sys_user +-- ---------------------------- +INSERT INTO `sys_user` VALUES ('1', 'admin', '超级管理员', '27bd386e70f280e24c2f4f2a549b82cf', '6', 'admin@example.com', '17699999999', '1', '1', '2017-08-15 21:40:39', '2017-08-15 21:41:00', '96', '2017-12-14 00:00:00', '138', 'ccc', '121;', '北京市', '北京市市辖区', '东城区'); +INSERT INTO `sys_user` VALUES ('2', 'test', '临时用户', '6cf3bb3deba2aadbd41ec9a22511084e', '6', 'test@bootdo.com', null, '1', '1', '2017-08-14 13:43:05', '2017-08-14 21:15:36', null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('36', 'ldh', '刘德华', 'bfd9394475754fbe45866eba97738c36', '7', 'ldh@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('123', 'zxy', '张学友', '35174ba93f5fe7267f1fb3c1bf903781', '6', 'zxy@bootdo', null, '0', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('124', 'wyf', '吴亦凡', 'e179e6f687bbd57b9d7efc4746c8090a', '6', 'wyf@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('130', 'lh', '鹿晗', '7924710cd673f68967cde70e188bb097', '9', 'lh@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('131', 'lhc', '令狐冲', 'd515538e17ecb570ba40344b5618f5d4', '6', 'lhc@bootdo.com', null, '0', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('132', 'lyf', '刘亦菲', '7fdb1d9008f45950c1620ba0864e5fbd', '13', 'lyf@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('134', 'lyh', '李彦宏', 'dc26092b3244d9d432863f2738180e19', '8', 'lyh@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('135', 'wjl', '王健林', '3967697dfced162cf6a34080259b83aa', '6', 'wjl@bootod.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('136', 'gdg', '郭德纲', '3bb1bda86bc02bf6478cd91e42135d2f', '9', 'gdg@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); +INSERT INTO `sys_user` VALUES ('137', 'test2', '测试用户2', '649169898e69272c0e5bc899baf1e904', '12', 'test2@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null); + +-- ---------------------------- +-- Table structure for `sys_user_plus` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_plus`; +CREATE TABLE `sys_user_plus` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) NOT NULL, + `payment` double DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of sys_user_plus +-- ---------------------------- + +-- ---------------------------- +-- Table structure for `sys_user_role` +-- ---------------------------- +DROP TABLE IF EXISTS `sys_user_role`; +CREATE TABLE `sys_user_role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', + `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=134 DEFAULT CHARSET=utf8 COMMENT='用户与角色对应关系'; + +-- ---------------------------- +-- Records of sys_user_role +-- ---------------------------- +INSERT INTO `sys_user_role` VALUES ('73', '30', '48'); +INSERT INTO `sys_user_role` VALUES ('74', '30', '49'); +INSERT INTO `sys_user_role` VALUES ('75', '30', '50'); +INSERT INTO `sys_user_role` VALUES ('76', '31', '48'); +INSERT INTO `sys_user_role` VALUES ('77', '31', '49'); +INSERT INTO `sys_user_role` VALUES ('78', '31', '52'); +INSERT INTO `sys_user_role` VALUES ('79', '32', '48'); +INSERT INTO `sys_user_role` VALUES ('80', '32', '49'); +INSERT INTO `sys_user_role` VALUES ('81', '32', '50'); +INSERT INTO `sys_user_role` VALUES ('82', '32', '51'); +INSERT INTO `sys_user_role` VALUES ('83', '32', '52'); +INSERT INTO `sys_user_role` VALUES ('84', '33', '38'); +INSERT INTO `sys_user_role` VALUES ('85', '33', '49'); +INSERT INTO `sys_user_role` VALUES ('86', '33', '52'); +INSERT INTO `sys_user_role` VALUES ('87', '34', '50'); +INSERT INTO `sys_user_role` VALUES ('88', '34', '51'); +INSERT INTO `sys_user_role` VALUES ('89', '34', '52'); +INSERT INTO `sys_user_role` VALUES ('106', '124', '1'); +INSERT INTO `sys_user_role` VALUES ('110', '1', '1'); +INSERT INTO `sys_user_role` VALUES ('111', '2', '1'); +INSERT INTO `sys_user_role` VALUES ('113', '131', '48'); +INSERT INTO `sys_user_role` VALUES ('117', '135', '1'); +INSERT INTO `sys_user_role` VALUES ('120', '134', '1'); +INSERT INTO `sys_user_role` VALUES ('121', '134', '48'); +INSERT INTO `sys_user_role` VALUES ('123', '130', '1'); +INSERT INTO `sys_user_role` VALUES ('124', null, '48'); +INSERT INTO `sys_user_role` VALUES ('125', '132', '52'); +INSERT INTO `sys_user_role` VALUES ('126', '132', '49'); +INSERT INTO `sys_user_role` VALUES ('127', '123', '48'); +INSERT INTO `sys_user_role` VALUES ('132', '36', '48'); +INSERT INTO `sys_user_role` VALUES ('133', '137', '56'); diff --git a/bootdo/pom.xml b/bootdo/pom.xml index e005db7b82cbcb4c5d0ac2fe33ea47f5ef76dad7..2a2a84cbde93e5211cf842d7e90e1d2c94fe42e1 100644 --- a/bootdo/pom.xml +++ b/bootdo/pom.xml @@ -5,7 +5,7 @@ com.bootdo bootdo - 1.5.0 + 1.6.3 jar bootdo @@ -136,6 +136,10 @@ net.sf.ehcache ehcache + + + + org.quartz-scheduler @@ -157,11 +161,11 @@ org.springframework spring-context-support - - org.springframework.boot - spring-boot-devtools - true - + + + + + org.activiti @@ -197,12 +201,24 @@ 2.6.1 + + + org.springframework.boot + spring-boot-starter-data-redis + + org.jsoup jsoup 1.9.2 + + + + + + diff --git a/bootdo/src/main/java/com/bootdo/activiti/controller/ModelController.java b/bootdo/src/main/java/com/bootdo/activiti/controller/ModelController.java index 18c2c9dfbb82e2aa119f63f593232e365ce20024..4572e80d9bbea50db10ff1e8c587bcb3a1331fb7 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/controller/ModelController.java +++ b/bootdo/src/main/java/com/bootdo/activiti/controller/ModelController.java @@ -1,5 +1,7 @@ package com.bootdo.activiti.controller; +import com.bootdo.common.config.Constant; +import com.bootdo.common.controller.BaseController; import com.bootdo.common.utils.PageUtils; import com.bootdo.common.utils.R; import com.fasterxml.jackson.databind.JsonNode; @@ -32,9 +34,12 @@ import java.util.List; import static org.activiti.editor.constants.ModelDataJsonConstants.*; +/** + * @author bootdo 1992lcg@163.com + */ @RequestMapping("/activiti") @RestController -public class ModelController { +public class ModelController extends BaseController{ protected static final Logger LOGGER = LoggerFactory.getLogger(ModelEditorJsonRestResource.class); @Autowired @@ -50,7 +55,6 @@ public class ModelController { @GetMapping("/model/list") PageUtils list(int offset, int limit) { - List list = repositoryService.createModelQuery().listPage(offset , limit); int total = (int) repositoryService.createModelQuery().count(); @@ -60,9 +64,9 @@ public class ModelController { @RequestMapping("/model/add") public void newModel(HttpServletResponse response) throws UnsupportedEncodingException { + //初始化一个空模型 Model model = repositoryService.newModel(); - //设置一些默认信息 String name = "new-process"; String description = ""; @@ -99,11 +103,8 @@ public class ModelController { @GetMapping(value = "/model/{modelId}/json") public ObjectNode getEditorJson(@PathVariable String modelId) { - System.out.println("------------------------------------+++++++++++++++++++++"); ObjectNode modelNode = null; - Model model = repositoryService.getModel(modelId); - if (model != null) { try { if (StringUtils.isNotEmpty(model.getMetaInfo())) { @@ -151,8 +152,10 @@ public class ModelController { } @PostMapping("/model/deploy/{id}") - public Object deploy(@PathVariable("id") String id) throws Exception { - + public R deploy(@PathVariable("id") String id) throws Exception { + if (Constant.DEMO_ACCOUNT.equals(getUsername())) { + return R.error(1, "演示系统不允许修改,完整体验请部署程序"); + } //获取模型 Model modelData = repositoryService.getModel(id); byte[] bytes = repositoryService.getModelEditorSource(modelData.getId()); @@ -228,8 +231,9 @@ public class ModelController { throw new ActivitiException("Error saving model", e); } } + @GetMapping("/model/export/{id}") - public void exportToXml(@PathVariable("id") String id, HttpServletResponse response){ + public void exportToXml(@PathVariable("id") String id, HttpServletResponse response) { try { org.activiti.engine.repository.Model modelData = repositoryService.getModel(id); BpmnJsonConverter jsonConverter = new BpmnJsonConverter(); @@ -244,7 +248,7 @@ public class ModelController { response.setHeader("Content-Disposition", "attachment; filename=" + filename); response.flushBuffer(); } catch (Exception e) { - throw new ActivitiException("导出model的xml文件失败,模型ID="+id, e); + throw new ActivitiException("导出model的xml文件失败,模型ID=" + id, e); } } } diff --git a/bootdo/src/main/java/com/bootdo/activiti/controller/ProcessController.java b/bootdo/src/main/java/com/bootdo/activiti/controller/ProcessController.java index e497deccefd52fc3f95512dbcb9a5b6cd9df4a81..056808ac8fb5c296afc763544c15641bb6ba835f 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/controller/ProcessController.java +++ b/bootdo/src/main/java/com/bootdo/activiti/controller/ProcessController.java @@ -2,6 +2,8 @@ package com.bootdo.activiti.controller; import com.bootdo.activiti.service.ProcessService; import com.bootdo.activiti.vo.ProcessVO; +import com.bootdo.common.config.Constant; +import com.bootdo.common.controller.BaseController; import com.bootdo.common.utils.PageUtils; import com.bootdo.common.utils.R; import org.activiti.engine.ActivitiException; @@ -27,7 +29,7 @@ import java.util.zip.ZipInputStream; @RequestMapping("activiti/process") @RestController -public class ProcessController { +public class ProcessController extends BaseController{ @Autowired private RepositoryService repositoryService; @@ -64,14 +66,8 @@ public class ProcessController { @PostMapping("/save") @Transactional(readOnly = false) public R deploy(String exportDir, String category, MultipartFile file) { - - String message = ""; - - System.out.println(file.getSize()); - String fileName = file.getOriginalFilename(); - try { InputStream fileInputStream = file.getInputStream(); Deployment deployment = null; @@ -120,6 +116,9 @@ public class ProcessController { */ @RequestMapping(value = "/convertToModel/{procDefId}") public R convertToModel(@PathVariable("procDefId") String procDefId, RedirectAttributes redirectAttributes) throws UnsupportedEncodingException, XMLStreamException { + if (Constant.DEMO_ACCOUNT.equals(getUsername())) { + return R.error(1, "演示系统不允许修改,完整体验请部署程序"); + } org.activiti.engine.repository.Model modelData = null; try { modelData = processService.convertToModel(procDefId); @@ -143,6 +142,9 @@ public class ProcessController { @PostMapping("/remove") public R remove(String id){ + if (Constant.DEMO_ACCOUNT.equals(getUsername())) { + return R.error(1, "演示系统不允许修改,完整体验请部署程序"); + } repositoryService.deleteDeployment(id,true); return R.ok(); } diff --git a/bootdo/src/main/java/com/bootdo/activiti/controller/SalaryController.java b/bootdo/src/main/java/com/bootdo/activiti/controller/SalaryController.java index c1881a6c4d7c5c146b62420e2634053a5c5bf730..83c42c9f01784fd43b8b5f2c729fbe2688a33aec 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/controller/SalaryController.java +++ b/bootdo/src/main/java/com/bootdo/activiti/controller/SalaryController.java @@ -33,16 +33,13 @@ public class SalaryController { ActivitiUtils activitiUtils; @GetMapping() - //@RequiresPermissions("activiti:salary:salary") String Salary() { return "activiti/salary/salary"; } @ResponseBody @GetMapping("/list") - //@RequiresPermissions("activiti:salary:salary") public PageUtils list(@RequestParam Map params) { - //查询列表数据 Query query = new Query(params); List salaryList = salaryService.list(query); int total = salaryService.count(query); @@ -51,14 +48,11 @@ public class SalaryController { } @GetMapping("/form") - //@RequiresPermissions("activiti:salary:add") String add() { - return "act/salary/add"; } @GetMapping("/form/{taskId}") - //@RequiresPermissions("activiti:salary:edit") String edit(@PathVariable("taskId") String taskId, Model model) { SalaryDO salary = salaryService.get(activitiUtils.getBusinessKeyByTaskId(taskId)); salary.setTaskId(taskId); @@ -71,7 +65,6 @@ public class SalaryController { */ @ResponseBody @PostMapping("/save") - //@RequiresPermissions("activiti:salary:add") public R saveOrUpdate(SalaryDO salary) { salary.setCreateDate(new Date()); salary.setUpdateDate(new Date()); @@ -89,7 +82,6 @@ public class SalaryController { */ @ResponseBody @RequestMapping("/update") - //@RequiresPermissions("activiti:salary:edit") public R update(SalaryDO salary) { String taskKey = activitiUtils.getTaskByTaskId(salary.getTaskId()).getTaskDefinitionKey(); if ("audit2".equals(taskKey)) { @@ -110,7 +102,6 @@ public class SalaryController { */ @PostMapping("/remove") @ResponseBody - //@RequiresPermissions("activiti:salary:remove") public R remove(String id) { if (salaryService.remove(id) > 0) { return R.ok(); @@ -123,7 +114,6 @@ public class SalaryController { */ @PostMapping("/batchRemove") @ResponseBody - //@RequiresPermissions("activiti:salary:batchRemove") public R remove(@RequestParam("ids[]") String[] ids) { salaryService.batchRemove(ids); return R.ok(); diff --git a/bootdo/src/main/java/com/bootdo/activiti/controller/TaskController.java b/bootdo/src/main/java/com/bootdo/activiti/controller/TaskController.java index e80a7634de2c94c01c4661b785eabeee1b9100eb..03a13bf30e963e34772024189c5354809f0458db 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/controller/TaskController.java +++ b/bootdo/src/main/java/com/bootdo/activiti/controller/TaskController.java @@ -73,7 +73,7 @@ public class TaskController { @GetMapping("/todo") ModelAndView todo(){ - return new ModelAndView("/act/task/todoTask"); + return new ModelAndView("act/task/todoTask"); } @GetMapping("/todoList") diff --git a/bootdo/src/main/java/com/bootdo/activiti/domain/TaskDO.java b/bootdo/src/main/java/com/bootdo/activiti/domain/TaskDO.java index 662e8f2d50668c9d71cace4456a61c705f4985c1..86bf1d00c3c80662a7e33097e7987541626437f2 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/domain/TaskDO.java +++ b/bootdo/src/main/java/com/bootdo/activiti/domain/TaskDO.java @@ -1,11 +1,15 @@ package com.bootdo.activiti.domain; -/** +import java.util.Map; +/** + * @author bootdo 1992lcg@163.com */ public class TaskDO { private String taskId; private String taskComment; + private String taskPass; + private Map vars; public String getTaskId() { return taskId; @@ -22,4 +26,22 @@ public class TaskDO { public void setTaskComment(String taskComment) { this.taskComment = taskComment; } + + public String getTaskPass() { + return taskPass; + } + + public void setTaskPass(String taskPass) { + this.taskPass = taskPass; + } + + public Map getVars() { + return vars; + } + + public void setVars(Map vars) { + this.vars = vars; + } + + } diff --git a/bootdo/src/main/java/com/bootdo/activiti/service/ActTaskService.java b/bootdo/src/main/java/com/bootdo/activiti/service/ActTaskService.java index d14c0bc4114064244caa7868714b7b7631876114..e7fc20d1d00a955789a80cd86ddce5b8eb6cd0e1 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/service/ActTaskService.java +++ b/bootdo/src/main/java/com/bootdo/activiti/service/ActTaskService.java @@ -13,7 +13,7 @@ public interface ActTaskService { void complete(String taskId, String procInsId, String comment, String title, Map vars); - void complete(String taskId); + void complete(String taskId,Map vars); String startProcess(String procDefKey, String businessTable, String businessId, String title, Map vars); diff --git a/bootdo/src/main/java/com/bootdo/activiti/service/impl/ActTaskServiceImpl.java b/bootdo/src/main/java/com/bootdo/activiti/service/impl/ActTaskServiceImpl.java index f12f3451307864e128525d6e13f184d00ee1b7bc..387e87841704e02640e9c9525a8ca387ddd15892 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/service/impl/ActTaskServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/activiti/service/impl/ActTaskServiceImpl.java @@ -6,9 +6,16 @@ import com.bootdo.common.utils.ShiroUtils; import com.bootdo.common.utils.StringUtils; import org.activiti.bpmn.model.BpmnModel; import org.activiti.engine.*; +import org.activiti.engine.history.HistoricActivityInstance; +import org.activiti.engine.history.HistoricProcessInstance; +import org.activiti.engine.impl.RepositoryServiceImpl; import org.activiti.engine.impl.context.Context; +import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; +import org.activiti.engine.impl.pvm.PvmTransition; +import org.activiti.engine.impl.pvm.process.ActivityImpl; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; +import org.activiti.image.ProcessDiagramGenerator; import org.activiti.spring.ProcessEngineFactoryBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -41,6 +48,9 @@ public class ActTaskServiceImpl implements ActTaskService { @Autowired private ProcessEngine processEngine; + @Autowired + private HistoryService historyService; + @Override public List listTodo(ActivitiDO act) { String userId = String.valueOf(ShiroUtils.getUserId()); @@ -50,26 +60,27 @@ public class ActTaskServiceImpl implements ActTaskService { /** * 提交任务, 并保存意见 - * @param taskId 任务ID + * + * @param taskId 任务ID * @param procInsId 流程实例ID,如果为空,则不保存任务提交意见 - * @param comment 任务提交意见的内容 - * @param title 流程标题,显示在待办任务标题 - * @param vars 任务变量 + * @param comment 任务提交意见的内容 + * @param title 流程标题,显示在待办任务标题 + * @param vars 任务变量 */ @Override - public void complete(String taskId, String procInsId, String comment, String title, Map vars){ + public void complete(String taskId, String procInsId, String comment, String title, Map vars) { // 添加意见 - if (StringUtils.isNotBlank(procInsId) && StringUtils.isNotBlank(comment)){ + if (StringUtils.isNotBlank(procInsId) && StringUtils.isNotBlank(comment)) { taskService.addComment(taskId, procInsId, comment); } // 设置流程变量 - if (vars == null){ + if (vars == null) { vars = new HashMap<>(); } // 设置流程标题 - if (StringUtils.isNotBlank(title)){ + if (StringUtils.isNotBlank(title)) { vars.put("title", title); } @@ -78,28 +89,29 @@ public class ActTaskServiceImpl implements ActTaskService { } @Override - public void complete(String taskId){ + public void complete(String taskId, Map vars) { // 2.1根据人物ID查询流程实力ID Task task = taskService.createTaskQuery() .taskId(taskId).singleResult(); // 获取流程实例ID String processInstance = task.getProcessInstanceId(); // 2.2根据流程实例ID,人物ID,评论的消息,保存教师或者学术对与该学生申请的评论信息 - taskService.addComment(taskId, - processInstance, ""); - Map vars = new HashMap<>(); - vars.put("pass", "1" ); - vars.put("title",""); - taskService.complete(taskId,vars); +// taskService.addComment(taskId, +// processInstance, ""); +// Map vars = new HashMap<>(); +// vars.put("pass", "1" ); +// vars.put("title",""); + taskService.complete(taskId, vars); } /** * 启动流程 - * @param procDefKey 流程定义KEY + * + * @param procDefKey 流程定义KEY * @param businessTable 业务表表名 - * @param businessId 业务表编号 - * @param title 流程标题,显示在待办任务标题 - * @param vars 流程变量 + * @param businessId 业务表编号 + * @param title 流程标题,显示在待办任务标题 + * @param vars 流程变量 * @return 流程实例ID */ @Override @@ -110,12 +122,12 @@ public class ActTaskServiceImpl implements ActTaskService { identityService.setAuthenticatedUserId(userId); // 设置流程变量 - if (vars == null){ + if (vars == null) { vars = new HashMap(); } // 设置流程标题 - if (StringUtils.isNotBlank(title)){ + if (StringUtils.isNotBlank(title)) { vars.put("title", title); } @@ -127,23 +139,24 @@ public class ActTaskServiceImpl implements ActTaskService { /** * 获取流程表单(首先获取任务节点表单KEY,如果没有则取流程开始节点表单KEY) + * * @return */ @Override - public String getFormKey(String procDefId, String taskDefKey){ + public String getFormKey(String procDefId, String taskDefKey) { String formKey = ""; - if (StringUtils.isNotBlank(procDefId)){ - if (StringUtils.isNotBlank(taskDefKey)){ - try{ + if (StringUtils.isNotBlank(procDefId)) { + if (StringUtils.isNotBlank(taskDefKey)) { + try { formKey = formService.getTaskFormKey(procDefId, taskDefKey); - }catch (Exception e) { + } catch (Exception e) { formKey = ""; } } - if (StringUtils.isBlank(formKey)){ + if (StringUtils.isBlank(formKey)) { formKey = formService.getStartFormKey(procDefId); } - if (StringUtils.isBlank(formKey)){ + if (StringUtils.isBlank(formKey)) { formKey = "/404"; } } @@ -151,23 +164,116 @@ public class ActTaskServiceImpl implements ActTaskService { } @Override - public InputStream tracePhoto(String processDefinitionId, String executionId) { -// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(executionId).singleResult(); - BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); + public InputStream tracePhoto(String xx, String pProcessInstanceId) { +//// ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(executionId).singleResult(); +// BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); +// +// List activeActivityIds = new ArrayList(); +// if (runtimeService.createExecutionQuery().executionId(executionId).count() > 0){ +// activeActivityIds = runtimeService.getActiveActivityIds(executionId); +// } +// +// // 不使用spring请使用下面的两行代码 +// // ProcessEngineImpl defaultProcessEngine = (ProcessEngineImpl)ProcessEngines.getDefaultProcessEngine(); +// // Context.setProcessEngineConfiguration(defaultProcessEngine.getProcessEngineConfiguration()); +// +// // 使用spring注入引擎请使用下面的这行代码 +// Context.setProcessEngineConfiguration(processEngineFactory.getProcessEngineConfiguration()); +//// return ProcessDiagramGenerator.generateDiagram(bpmnModel, "png", activeActivityIds); +// return processEngine.getProcessEngineConfiguration().getProcessDiagramGenerator() +// .generateDiagram(bpmnModel, "png", activeActivityIds); + + // 获取历史流程实例 + HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() + .processInstanceId(pProcessInstanceId).singleResult(); + + if (historicProcessInstance != null) { + // 获取流程定义 + ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) + .getDeployedProcessDefinition(historicProcessInstance.getProcessDefinitionId()); + + // 获取流程历史中已执行节点,并按照节点在流程中执行先后顺序排序 + List historicActivityInstanceList = historyService.createHistoricActivityInstanceQuery() + .processInstanceId(pProcessInstanceId).orderByHistoricActivityInstanceId().asc().list(); - List activeActivityIds = new ArrayList(); - if (runtimeService.createExecutionQuery().executionId(executionId).count() > 0){ - activeActivityIds = runtimeService.getActiveActivityIds(executionId); + // 已执行的节点ID集合 + List executedActivityIdList = new ArrayList(); + int index = 1; + //获取已经执行的节点ID + for (HistoricActivityInstance activityInstance : historicActivityInstanceList) { + executedActivityIdList.add(activityInstance.getActivityId()); + index++; + } + + // 已执行的线集合 + List flowIds = new ArrayList(); + // 获取流程走过的线 + flowIds = getHighLightedFlows(processDefinition, historicActivityInstanceList); + + + BpmnModel bpmnModel = repositoryService + .getBpmnModel(historicProcessInstance.getProcessDefinitionId()); + // 获取流程图图像字符流 + ProcessDiagramGenerator pec = processEngine.getProcessEngineConfiguration().getProcessDiagramGenerator(); + //配置字体 + + InputStream imageStream = pec.generateDiagram(bpmnModel, "png", executedActivityIdList, flowIds, "宋体", "微软雅黑", "黑体", null, 2.0); + return imageStream; } + return null; + } - // 不使用spring请使用下面的两行代码 - // ProcessEngineImpl defaultProcessEngine = (ProcessEngineImpl)ProcessEngines.getDefaultProcessEngine(); - // Context.setProcessEngineConfiguration(defaultProcessEngine.getProcessEngineConfiguration()); - // 使用spring注入引擎请使用下面的这行代码 - Context.setProcessEngineConfiguration(processEngineFactory.getProcessEngineConfiguration()); -// return ProcessDiagramGenerator.generateDiagram(bpmnModel, "png", activeActivityIds); - return processEngine.getProcessEngineConfiguration().getProcessDiagramGenerator() - .generateDiagram(bpmnModel, "png", activeActivityIds); + /** + * 获取需要高亮的线 + * @param processDefinitionEntity + * @param historicActivityInstances + * @return + */ + private List getHighLightedFlows( + ProcessDefinitionEntity processDefinitionEntity, + List historicActivityInstances) { + List highFlows = new ArrayList();// 用以保存高亮的线flowId + for (int i = 0; i < historicActivityInstances.size() - 1; i++) {// 对历史流程节点进行遍历 + ActivityImpl activityImpl = processDefinitionEntity + .findActivity(historicActivityInstances.get(i) + .getActivityId());// 得到节点定义的详细信息 + List sameStartTimeNodes = new ArrayList();// 用以保存后需开始时间相同的节点 + ActivityImpl sameActivityImpl1 = processDefinitionEntity + .findActivity(historicActivityInstances.get(i + 1) + .getActivityId()); + // 将后面第一个节点放在时间相同节点的集合里 + sameStartTimeNodes.add(sameActivityImpl1); + for (int j = i + 1; j < historicActivityInstances.size() - 1; j++) { + HistoricActivityInstance activityImpl1 = historicActivityInstances + .get(j);// 后续第一个节点 + HistoricActivityInstance activityImpl2 = historicActivityInstances + .get(j + 1);// 后续第二个节点 + if (activityImpl1.getStartTime().equals( + activityImpl2.getStartTime())) { + // 如果第一个节点和第二个节点开始时间相同保存 + ActivityImpl sameActivityImpl2 = processDefinitionEntity + .findActivity(activityImpl2.getActivityId()); + sameStartTimeNodes.add(sameActivityImpl2); + } else { + // 有不相同跳出循环 + break; + } + } + List pvmTransitions = activityImpl + .getOutgoingTransitions();// 取出节点的所有出去的线 + for (PvmTransition pvmTransition : pvmTransitions) { + // 对所有的线进行遍历 + ActivityImpl pvmActivityImpl = (ActivityImpl) pvmTransition + .getDestination(); + // 如果取出的线的目标节点存在时间相同的节点里,保存该线的id,进行高亮显示 + if (sameStartTimeNodes.contains(pvmActivityImpl)) { + highFlows.add(pvmTransition.getId()); + } + } + } + return highFlows; } + } + diff --git a/bootdo/src/main/java/com/bootdo/activiti/service/impl/SalaryServiceImpl.java b/bootdo/src/main/java/com/bootdo/activiti/service/impl/SalaryServiceImpl.java index ffbedcc0acff6f5610055e34de6bc99dea48c6ac..ba2ee90b5800e1faff6f4ef16ddbea2a4e27a5f8 100644 --- a/bootdo/src/main/java/com/bootdo/activiti/service/impl/SalaryServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/activiti/service/impl/SalaryServiceImpl.java @@ -49,8 +49,10 @@ public class SalaryServiceImpl implements SalaryService { @Transactional(rollbackFor=Exception.class) @Override public int update(SalaryDO salary){ - System.out.println(salary.getTaskId()); - actTaskService.complete(salary.getTaskId()); + Map vars = new HashMap<>(16); + vars.put("pass", salary.getTaskPass() ); + vars.put("title",""); + actTaskService.complete(salary.getTaskId(),vars); return salaryDao.update(salary); } diff --git a/bootdo/src/main/java/com/bootdo/blog/controller/BlogController.java b/bootdo/src/main/java/com/bootdo/blog/controller/BlogController.java index 69622f93466b16e3b1d46297a860503be4951948..91839318ca972260735c6ef4c90542aeac037468 100644 --- a/bootdo/src/main/java/com/bootdo/blog/controller/BlogController.java +++ b/bootdo/src/main/java/com/bootdo/blog/controller/BlogController.java @@ -14,6 +14,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +/** + * @author bootdo 1992lcg@163.com + */ @RequestMapping("/blog") @Controller public class BlogController { @@ -28,14 +31,10 @@ public class BlogController { @ResponseBody @GetMapping("/open/list") public PageUtils opentList(@RequestParam Map params) { - // 查询列表数据 Query query = new Query(params); - List bContentList = bContentService.list(query); int total = bContentService.count(query); - PageUtils pageUtils = new PageUtils(bContentList, total); - return pageUtils; } @@ -50,7 +49,10 @@ public class BlogController { String about(@PathVariable("categories") String categories, Model model) { Map map = new HashMap<>(16); map.put("categories", categories); - ContentDO bContentDO = bContentService.list(map).get(0); + ContentDO bContentDO =null; + if(bContentService.list(map).size()>0){ + bContentDO = bContentService.list(map).get(0); + } model.addAttribute("bContent", bContentDO); return "blog/index/post"; } diff --git a/bootdo/src/main/java/com/bootdo/common/aspect/LogAspect.java b/bootdo/src/main/java/com/bootdo/common/aspect/LogAspect.java index 5d2bc92aea021ad982ddab18e95434d3a5e9f911..b0a01febc89e399120ad03321baf59a205c41c49 100644 --- a/bootdo/src/main/java/com/bootdo/common/aspect/LogAspect.java +++ b/bootdo/src/main/java/com/bootdo/common/aspect/LogAspect.java @@ -2,9 +2,13 @@ package com.bootdo.common.aspect; import java.lang.reflect.Method; import java.util.Date; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; import javax.servlet.http.HttpServletRequest; +import com.bootdo.system.domain.UserToken; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -39,8 +43,9 @@ public class LogAspect { Object result = point.proceed(); // 执行时长(毫秒) long time = System.currentTimeMillis() - beginTime; - // 保存日志 + //异步保存日志 saveLog(point, time); + return result; } diff --git a/bootdo/src/main/java/com/bootdo/common/config/CacheConfiguration.java b/bootdo/src/main/java/com/bootdo/common/config/CacheConfiguration.java deleted file mode 100644 index bebbca9654c86fe4f16a2cd49077b8d6f0375098..0000000000000000000000000000000000000000 --- a/bootdo/src/main/java/com/bootdo/common/config/CacheConfiguration.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.bootdo.common.config; - -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.cache.ehcache.EhCacheCacheManager; -import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.ClassPathResource; - -@Configuration -@EnableCaching -public class CacheConfiguration { - - @Bean - public EhCacheCacheManager ehCacheCacheManager(EhCacheManagerFactoryBean bean) { - return new EhCacheCacheManager(bean.getObject()); - } - - @Bean - public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() { - EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean(); - cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("config/ehcache.xml")); - cacheManagerFactoryBean.setShared(true); - return cacheManagerFactoryBean; - } -} \ No newline at end of file diff --git a/bootdo/src/main/java/com/bootdo/common/config/Constant.java b/bootdo/src/main/java/com/bootdo/common/config/Constant.java index f1e8aba8e6c8f821f743ecd3f2410a457c638c3c..be17bed00f5fd8e95ab162c4b03f99122eb079d1 100644 --- a/bootdo/src/main/java/com/bootdo/common/config/Constant.java +++ b/bootdo/src/main/java/com/bootdo/common/config/Constant.java @@ -15,5 +15,8 @@ public class Constant { public static int OA_NOTIFY_READ_YES = 1; //部门根节点id public static Long DEPT_ROOT_ID = 0l; + //缓存方式 + public static String CACHE_TYPE_REDIS ="redis"; + } diff --git a/bootdo/src/main/java/com/bootdo/common/controller/BaseController.java b/bootdo/src/main/java/com/bootdo/common/controller/BaseController.java index c9cd162e8f82a0db7c5c38201463420951794ea2..8394c75cf2665ac4d6f6de4c144c476bcae4a915 100644 --- a/bootdo/src/main/java/com/bootdo/common/controller/BaseController.java +++ b/bootdo/src/main/java/com/bootdo/common/controller/BaseController.java @@ -1,5 +1,6 @@ package com.bootdo.common.controller; +import com.bootdo.system.domain.UserToken; import org.springframework.stereotype.Controller; import com.bootdo.common.utils.ShiroUtils; import com.bootdo.system.domain.UserDO; diff --git a/bootdo/src/main/java/com/bootdo/common/redis/JedisConfiguration.java b/bootdo/src/main/java/com/bootdo/common/redis/JedisConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..c6efb3ce39d435324b54b6f04ee0af9a8dd69da8 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/common/redis/JedisConfiguration.java @@ -0,0 +1,39 @@ +package com.bootdo.common.redis; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import redis.clients.jedis.JedisPool; +import redis.clients.jedis.JedisPoolConfig; + +@Configuration +@EnableCaching +public class JedisConfiguration { + @Value("${spring.redis.host}") + private String host; + + @Value("${spring.redis.port}") + private int port; + + @Value("${spring.redis.timeout}") + private int timeout; + + @Value("${spring.redis.pool.max-idle}") + private int maxIdle; + + @Value("${spring.redis.pool.max-wait}") + private long maxWaitMillis; + + @Value("${spring.redis.password}") + private String password; + @Bean + public JedisPool redisPoolFactory() { + JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); + jedisPoolConfig.setMaxIdle(maxIdle); + jedisPoolConfig.setMaxWaitMillis(maxWaitMillis); + JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout, password); + return jedisPool; + } +} diff --git a/bootdo/src/main/java/com/bootdo/common/redis/JedisUtil.java b/bootdo/src/main/java/com/bootdo/common/redis/JedisUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..a970bef2ee9af685064571cd79a213cdc96f2e60 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/common/redis/JedisUtil.java @@ -0,0 +1,133 @@ +package com.bootdo.common.redis; + +import java.util.Set; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +import redis.clients.jedis.Jedis; +import redis.clients.jedis.JedisPool; + +@Component +public class JedisUtil implements ApplicationContextAware { + private static ApplicationContext applicationContext = null; + + private static JedisPool jedisPool = null; + + private static volatile Jedis jedis = null; + public JedisUtil(){} + + public static Jedis getJedis(){ + if (jedis ==null){ + synchronized (Jedis.class){ + if (jedis ==null){ + jedis = getJedisPool().getResource(); + } + } + } + return jedis; + } + + public static JedisPool getJedisPool(){ + if (jedisPool ==null){ + synchronized (JedisPool.class){ + if (jedisPool==null){ + jedisPool = applicationContext.getBean(JedisPool.class); + } + } + } + return jedisPool; + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + if(JedisUtil.applicationContext == null){ + JedisUtil.applicationContext = applicationContext; //初始化 spring applicationContext + } + } + + /** + * 根据key查看是否存在 + * @param key + * @return + */ + public static boolean hasKey(String key){ + return getJedis().exists(key); + } + + /** + * 设置key -value 形式数据 + * @param key + * @param value + * @return + */ + public static String set(String key,String value){ + String result = getJedis().set(key,value); + return result; + } + + /** + * 设置 一个过期时间 + * @param key + * @param value + * @param timeOut 单位秒 + * @return + */ + public static String set(String key,String value,int timeOut){ + return getJedis().setex(key,timeOut,value); + } + + /** + * 根据key获取value + * @param key + * @return + */ + public static String getByKey(String key){ + return getJedis().get(key); + } + + /** + * 根据通配符获取所有匹配的key + * @param pattern + * @return + */ + public static Set getKesByPattern(String pattern){ + return getJedis().keys(pattern); + } + + /** + * 根据key删除 + * @param key + */ + public static void delByKey(String key){ + getJedis().del(key); + } + + /** + * 根据key获取过期时间 + * @param key + * @return + */ + public static long getTimeOutByKey(String key){ + return getJedis().ttl(key); + } + + /** + * 清空数据 【慎用啊!】 + */ + public static void flushDB(){ + getJedis().flushDB(); + } + + /** + * 刷新过期时间 + * @param key + * @param timeOut + * @return + */ + public static long refreshLiveTime(String key,int timeOut){ + return getJedis().expire(key,timeOut); + } +} diff --git a/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisCache.java b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisCache.java new file mode 100644 index 0000000000000000000000000000000000000000..f0bcea12cf316d68e4cbd8afd28dc2b5c4a4ebf3 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisCache.java @@ -0,0 +1,194 @@ +package com.bootdo.common.redis.shiro; + +/** + * @author bootdo 1992lcg@163.com + * @version V1.0 + */ +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.apache.shiro.cache.Cache; +import org.apache.shiro.cache.CacheException; +import org.apache.shiro.util.CollectionUtils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RedisCache implements Cache { + + private Logger logger = LoggerFactory.getLogger(this.getClass()); + + /** + * The wrapped Jedis instance. + */ + private RedisManager cache; + + /** + * The Redis key prefix for the sessions + */ + private String keyPrefix = "shiro_redis_session:"; + + /** + * Returns the Redis session keys + * prefix. + * @return The prefix + */ + public String getKeyPrefix() { + return keyPrefix; + } + + /** + * Sets the Redis sessions key + * prefix. + * @param keyPrefix The prefix + */ + public void setKeyPrefix(String keyPrefix) { + this.keyPrefix = keyPrefix; + } + + /** + * 通过一个JedisManager实例构造RedisCache + */ + public RedisCache(RedisManager cache){ + if (cache == null) { + throw new IllegalArgumentException("Cache argument cannot be null."); + } + this.cache = cache; + } + + /** + * Constructs a cache instance with the specified + * Redis manager and using a custom key prefix. + * @param cache The cache manager instance + * @param prefix The Redis key prefix + */ + public RedisCache(RedisManager cache, + String prefix){ + + this( cache ); + + // set the prefix + this.keyPrefix = prefix; + } + + /** + * 获得byte[]型的key + * @param key + * @return + */ + private byte[] getByteKey(K key){ + if(key instanceof String){ + String preKey = this.keyPrefix + key; + return preKey.getBytes(); + }else{ + return SerializeUtils.serialize(key); + } + } + + @Override + public V get(K key) throws CacheException { + logger.debug("根据key从Redis中获取对象 key [" + key + "]"); + try { + if (key == null) { + return null; + }else{ + byte[] rawValue = cache.get(getByteKey(key)); + @SuppressWarnings("unchecked") + V value = (V)SerializeUtils.deserialize(rawValue); + return value; + } + } catch (Throwable t) { + throw new CacheException(t); + } + + } + + @Override + public V put(K key, V value) throws CacheException { + logger.debug("根据key从存储 key [" + key + "]"); + try { + cache.set(getByteKey(key), SerializeUtils.serialize(value)); + return value; + } catch (Throwable t) { + throw new CacheException(t); + } + } + + @Override + public V remove(K key) throws CacheException { + logger.debug("从redis中删除 key [" + key + "]"); + try { + V previous = get(key); + cache.del(getByteKey(key)); + return previous; + } catch (Throwable t) { + throw new CacheException(t); + } + } + + @Override + public void clear() throws CacheException { + logger.debug("从redis中删除所有元素"); + try { + cache.flushDB(); + } catch (Throwable t) { + throw new CacheException(t); + } + } + + @Override + public int size() { + try { + Long longSize = new Long(cache.dbSize()); + return longSize.intValue(); + } catch (Throwable t) { + throw new CacheException(t); + } + } + + @SuppressWarnings("unchecked") + @Override + public Set keys() { + try { + Set keys = cache.keys(this.keyPrefix + "*"); + if (CollectionUtils.isEmpty(keys)) { + return Collections.emptySet(); + }else{ + Set newKeys = new HashSet(); + for(byte[] key:keys){ + newKeys.add((K)key); + } + return newKeys; + } + } catch (Throwable t) { + throw new CacheException(t); + } + } + + @Override + public Collection values() { + try { + Set keys = cache.keys(this.keyPrefix + "*"); + if (!CollectionUtils.isEmpty(keys)) { + List values = new ArrayList(keys.size()); + for (byte[] key : keys) { + @SuppressWarnings("unchecked") + V value = get((K)key); + if (value != null) { + values.add(value); + } + } + return Collections.unmodifiableList(values); + } else { + return Collections.emptyList(); + } + } catch (Throwable t) { + throw new CacheException(t); + } + } + +} diff --git a/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisCacheManager.java b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisCacheManager.java new file mode 100644 index 0000000000000000000000000000000000000000..d4542303afcbd326c8404bf55a7d8239fd3bbe84 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisCacheManager.java @@ -0,0 +1,77 @@ +package com.bootdo.common.redis.shiro; + +/** + * @author bootdo 1992lcg@163.com + * @version V1.0 + */ +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import org.apache.shiro.cache.Cache; +import org.apache.shiro.cache.CacheException; +import org.apache.shiro.cache.CacheManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RedisCacheManager implements CacheManager { + + private static final Logger logger = LoggerFactory + .getLogger(RedisCacheManager.class); + + // fast lookup by name map + private final ConcurrentMap caches = new ConcurrentHashMap(); + + private RedisManager redisManager; + + /** + * The Redis key prefix for caches + */ + private String keyPrefix = "shiro_redis_cache:"; + + /** + * Returns the Redis session keys + * prefix. + * @return The prefix + */ + public String getKeyPrefix() { + return keyPrefix; + } + + /** + * Sets the Redis sessions key + * prefix. + * @param keyPrefix The prefix + */ + public void setKeyPrefix(String keyPrefix) { + this.keyPrefix = keyPrefix; + } + + @Override + public Cache getCache(String name) throws CacheException { + logger.debug("获取名称为: " + name + " 的RedisCache实例"); + + Cache c = caches.get(name); + + if (c == null) { + + // initialize the Redis manager instance + redisManager.init(); + + // create a new cache instance + c = new RedisCache(redisManager, keyPrefix); + + // add it to the cache collection + caches.put(name, c); + } + return c; + } + + public RedisManager getRedisManager() { + return redisManager; + } + + public void setRedisManager(RedisManager redisManager) { + this.redisManager = redisManager; + } + +} diff --git a/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisManager.java b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisManager.java new file mode 100644 index 0000000000000000000000000000000000000000..39834d0b69c26389c63e9ca93cb18dce5e13a7ce --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisManager.java @@ -0,0 +1,204 @@ +package com.bootdo.common.redis.shiro; + +/** + * @author bootdo 1992lcg@163.com + * @version V1.0 + */ +import java.util.Set; + +import redis.clients.jedis.Jedis; +import redis.clients.jedis.JedisPool; +import redis.clients.jedis.JedisPoolConfig; + +/** + * + */ +public class RedisManager { + + private String host = "127.0.0.1"; + + private int port = 6379; + + // 0 - never expire + private int expire = 0; + + //timeout for jedis try to connect to redis server, not expire time! In milliseconds + private int timeout = 0; + + private String password = ""; + + private static JedisPool jedisPool = null; + + public RedisManager(){ + + } + + /** + * 初始化方法 + */ + public void init(){ + if(jedisPool == null){ + if(password != null && !"".equals(password)){ + jedisPool = new JedisPool(new JedisPoolConfig(), host, port, timeout, password); + }else if(timeout != 0){ + jedisPool = new JedisPool(new JedisPoolConfig(), host, port,timeout); + }else{ + jedisPool = new JedisPool(new JedisPoolConfig(), host, port); + } + + } + } + + /** + * get value from redis + * @param key + * @return + */ + public byte[] get(byte[] key){ + byte[] value = null; + Jedis jedis = jedisPool.getResource(); + try{ + value = jedis.get(key); + }finally{ + jedisPool.returnResource(jedis); + } + return value; + } + + /** + * set + * @param key + * @param value + * @return + */ + public byte[] set(byte[] key,byte[] value){ + Jedis jedis = jedisPool.getResource(); + try{ + jedis.set(key,value); + if(this.expire != 0){ + jedis.expire(key, this.expire); + } + }finally{ + jedisPool.returnResource(jedis); + } + return value; + } + + /** + * set + * @param key + * @param value + * @param expire + * @return + */ + public byte[] set(byte[] key,byte[] value,int expire){ + Jedis jedis = jedisPool.getResource(); + try{ + jedis.set(key,value); + if(expire != 0){ + jedis.expire(key, expire); + } + }finally{ + jedisPool.returnResource(jedis); + } + return value; + } + + /** + * del + * @param key + */ + public void del(byte[] key){ + Jedis jedis = jedisPool.getResource(); + try{ + jedis.del(key); + }finally{ + jedisPool.returnResource(jedis); + } + } + + /** + * flush + */ + public void flushDB(){ + Jedis jedis = jedisPool.getResource(); + try{ + jedis.flushDB(); + }finally{ + jedisPool.returnResource(jedis); + } + } + + /** + * size + */ + public Long dbSize(){ + Long dbSize = 0L; + Jedis jedis = jedisPool.getResource(); + try{ + dbSize = jedis.dbSize(); + }finally{ + jedisPool.returnResource(jedis); + } + return dbSize; + } + + /** + * keys + * @param regex + * @return + */ + public Set keys(String pattern){ + Set keys = null; + Jedis jedis = jedisPool.getResource(); + try{ + keys = jedis.keys(pattern.getBytes()); + }finally{ + jedisPool.returnResource(jedis); + } + return keys; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public int getExpire() { + return expire; + } + + public void setExpire(int expire) { + this.expire = expire; + } + + public int getTimeout() { + return timeout; + } + + public void setTimeout(int timeout) { + this.timeout = timeout; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + + +} diff --git a/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisSessionDAO.java b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisSessionDAO.java new file mode 100644 index 0000000000000000000000000000000000000000..86e3e81dc2c6865c6d63f810fd43a69b07d704b5 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/common/redis/shiro/RedisSessionDAO.java @@ -0,0 +1,139 @@ +package com.bootdo.common.redis.shiro; + +import org.apache.shiro.session.Session; +import org.apache.shiro.session.UnknownSessionException; +import org.apache.shiro.session.mgt.eis.AbstractSessionDAO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.Serializable; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +/** + * @author bootdo 1992lcg@163.com + * @version V1.0 + */ +public class RedisSessionDAO extends AbstractSessionDAO { + + private static Logger logger = LoggerFactory.getLogger(RedisSessionDAO.class); + /** + * shiro-redis的session对象前缀 + */ + private RedisManager redisManager; + + /** + * The Redis key prefix for the sessions + */ + private String keyPrefix = "shiro_redis_session:"; + + @Override + public void update(Session session) throws UnknownSessionException { + this.saveSession(session); + } + + /** + * save session + * @param session + * @throws UnknownSessionException + */ + private void saveSession(Session session) throws UnknownSessionException{ + if(session == null || session.getId() == null){ + logger.error("session or session id is null"); + return; + } + + byte[] key = getByteKey(session.getId()); + byte[] value = SerializeUtils.serialize(session); + session.setTimeout(redisManager.getExpire()*1000); + this.redisManager.set(key, value, redisManager.getExpire()); + } + + @Override + public void delete(Session session) { + if(session == null || session.getId() == null){ + logger.error("session or session id is null"); + return; + } + redisManager.del(this.getByteKey(session.getId())); + + } + + @Override + public Collection getActiveSessions() { + Set sessions = new HashSet(); + + Set keys = redisManager.keys(this.keyPrefix + "*"); + if(keys != null && keys.size()>0){ + for(byte[] key:keys){ + Session s = (Session)SerializeUtils.deserialize(redisManager.get(key)); + sessions.add(s); + } + } + + return sessions; + } + + @Override + protected Serializable doCreate(Session session) { + Serializable sessionId = this.generateSessionId(session); + this.assignSessionId(session, sessionId); + this.saveSession(session); + return sessionId; + } + + @Override + protected Session doReadSession(Serializable sessionId) { + if(sessionId == null){ + logger.error("session id is null"); + return null; + } + + Session s = (Session)SerializeUtils.deserialize(redisManager.get(this.getByteKey(sessionId))); + return s; + } + + /** + * 获得byte[]型的key + * @param key + * @return + */ + private byte[] getByteKey(Serializable sessionId){ + String preKey = this.keyPrefix + sessionId; + return preKey.getBytes(); + } + + public RedisManager getRedisManager() { + return redisManager; + } + + public void setRedisManager(RedisManager redisManager) { + this.redisManager = redisManager; + + /** + * 初始化redisManager + */ + this.redisManager.init(); + } + + /** + * Returns the Redis session keys + * prefix. + * @return The prefix + */ + public String getKeyPrefix() { + return keyPrefix; + } + + /** + * Sets the Redis sessions key + * prefix. + * @param keyPrefix The prefix + */ + public void setKeyPrefix(String keyPrefix) { + this.keyPrefix = keyPrefix; + } + + +} \ No newline at end of file diff --git a/bootdo/src/main/java/com/bootdo/common/redis/shiro/SerializeUtils.java b/bootdo/src/main/java/com/bootdo/common/redis/shiro/SerializeUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..68db5a99d7d646c5d27d19bb820b6f391303ac23 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/common/redis/shiro/SerializeUtils.java @@ -0,0 +1,89 @@ +package com.bootdo.common.redis.shiro; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author bootdo 1992lcg@163.com + * @version V1.0 + */ +public class SerializeUtils { + + private static Logger logger = LoggerFactory.getLogger(SerializeUtils.class); + + /** + * 反序列化 + * @param bytes + * @return + */ + public static Object deserialize(byte[] bytes) { + + Object result = null; + + if (isEmpty(bytes)) { + return null; + } + + try { + ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes); + try { + ObjectInputStream objectInputStream = new ObjectInputStream(byteStream); + try { + result = objectInputStream.readObject(); + } + catch (ClassNotFoundException ex) { + throw new Exception("Failed to deserialize object type", ex); + } + } + catch (Throwable ex) { + throw new Exception("Failed to deserialize", ex); + } + } catch (Exception e) { + logger.error("Failed to deserialize",e); + } + return result; + } + + public static boolean isEmpty(byte[] data) { + return (data == null || data.length == 0); + } + + /** + * 序列化 + * @param object + * @return + */ + public static byte[] serialize(Object object) { + + byte[] result = null; + + if (object == null) { + return new byte[0]; + } + try { + ByteArrayOutputStream byteStream = new ByteArrayOutputStream(128); + try { + if (!(object instanceof Serializable)) { + throw new IllegalArgumentException(SerializeUtils.class.getSimpleName() + " requires a Serializable payload " + + "but received an object of type [" + object.getClass().getName() + "]"); + } + ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteStream); + objectOutputStream.writeObject(object); + objectOutputStream.flush(); + result = byteStream.toByteArray(); + } + catch (Throwable ex) { + throw new Exception("Failed to serialize", ex); + } + } catch (Exception ex) { + logger.error("Failed to serialize",ex); + } + return result; + } +} \ No newline at end of file diff --git a/bootdo/src/main/java/com/bootdo/common/service/DictService.java b/bootdo/src/main/java/com/bootdo/common/service/DictService.java index f29f0fe526334aeeb54f19468fd2620fd9f91632..5d0778edabc1a38eee4dd02fb2aae8b91cb941b4 100644 --- a/bootdo/src/main/java/com/bootdo/common/service/DictService.java +++ b/bootdo/src/main/java/com/bootdo/common/service/DictService.java @@ -46,4 +46,11 @@ public interface DictService { */ List getSexList(); + /** + * 根据type获取数据 + * @param map + * @return + */ + List listByType(String type); + } diff --git a/bootdo/src/main/java/com/bootdo/common/service/impl/DictServiceImpl.java b/bootdo/src/main/java/com/bootdo/common/service/impl/DictServiceImpl.java index 1b1f37ab75136e76fda288f571af19ab084d5c37..3ad53f3d81bfd48f0a9deeff25cee3f736e62b94 100644 --- a/bootdo/src/main/java/com/bootdo/common/service/impl/DictServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/common/service/impl/DictServiceImpl.java @@ -99,5 +99,11 @@ public class DictServiceImpl implements DictService { return dictDao.list(param); } + @Override + public List listByType(String type) { + Map param = new HashMap<>(16); + param.put("type", type); + return dictDao.list(param); + } } diff --git a/bootdo/src/main/java/com/bootdo/common/service/impl/LogServiceImpl.java b/bootdo/src/main/java/com/bootdo/common/service/impl/LogServiceImpl.java index 55813e19f08cfbcb99651338e421d904aed9a207..2431693fbed7f9862e74e84b6b78eb6a78be541b 100644 --- a/bootdo/src/main/java/com/bootdo/common/service/impl/LogServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/common/service/impl/LogServiceImpl.java @@ -19,13 +19,6 @@ public class LogServiceImpl implements LogService { @Override public PageDO queryList(Query query) { int total = logMapper.count(query); -// int limit = query.getLimit(); -// -// if(total<=query.getOffset()) { -// System.out.println(total +"-----"+query.getOffset()); -// query.setOffset((total/limit-1)*limit); -// System.out.println(query.getOffset()); -// } List logs = logMapper.list(query); PageDO page = new PageDO<>(); page.setTotal(total); diff --git a/bootdo/src/main/java/com/bootdo/common/task/WelcomeJob.java b/bootdo/src/main/java/com/bootdo/common/task/WelcomeJob.java index 41fbd44b29decce47e00c5c28e3d3fea0d7eb3c3..2ba86ed589453d4508505280b73fe363616f7830 100644 --- a/bootdo/src/main/java/com/bootdo/common/task/WelcomeJob.java +++ b/bootdo/src/main/java/com/bootdo/common/task/WelcomeJob.java @@ -9,6 +9,8 @@ import org.springframework.stereotype.Component; import com.bootdo.oa.domain.Response; +import java.security.Principal; + @Component public class WelcomeJob implements Job{ @Autowired @@ -17,6 +19,7 @@ public class WelcomeJob implements Job{ @Override public void execute(JobExecutionContext arg0) throws JobExecutionException { template.convertAndSend("/topic/getResponse", new Response("欢迎体验bootdo,这是一个任务计划,使用了websocket和quzrtz技术,可以在计划列表中取消,欢迎您加入qq群交流学习!" )); + } } \ No newline at end of file diff --git a/bootdo/src/main/java/com/bootdo/common/utils/MD5Utils.java b/bootdo/src/main/java/com/bootdo/common/utils/MD5Utils.java index a815bd99878c0e0b25e360001b27da17fdeaf814..0ad03d1c98a6d7436480a54801f971cf3deb9df6 100644 --- a/bootdo/src/main/java/com/bootdo/common/utils/MD5Utils.java +++ b/bootdo/src/main/java/com/bootdo/common/utils/MD5Utils.java @@ -22,7 +22,7 @@ public class MD5Utils { } public static void main(String[] args) { - System.out.println(MD5Utils.encrypt("admin", "1")); + //System.out.println(MD5Utils.encrypt("admin", "1")); } } diff --git a/bootdo/src/main/java/com/bootdo/common/utils/PageUtils.java b/bootdo/src/main/java/com/bootdo/common/utils/PageUtils.java index ff46ec507e2b45abca5ed5cac62c71d671015924..18e861e30b7d9533f7165fb29bd5fe4d611bb3f4 100644 --- a/bootdo/src/main/java/com/bootdo/common/utils/PageUtils.java +++ b/bootdo/src/main/java/com/bootdo/common/utils/PageUtils.java @@ -4,26 +4,13 @@ import java.io.Serializable; import java.util.List; /** + * @Author bootdo 1992lcg@163.com */ public class PageUtils implements Serializable { private static final long serialVersionUID = 1L; - // 总记录数 private int total; - // 列表数据 private List rows; - /** - * 分页 - * - * @param list - * 列表数据 - * @param totalCount - * 总记录数 - * @param pageSize - * 每页记录数 - * @param currPage - * 当前页数 - */ public PageUtils(List list, int total) { this.rows = list; this.total = total; diff --git a/bootdo/src/main/java/com/bootdo/common/utils/ShiroUtils.java b/bootdo/src/main/java/com/bootdo/common/utils/ShiroUtils.java index 723e68c974c47dc98c16180513a5f846813a7d4c..277eeae465ef40f31af0d4727bb453cc51d584ba 100644 --- a/bootdo/src/main/java/com/bootdo/common/utils/ShiroUtils.java +++ b/bootdo/src/main/java/com/bootdo/common/utils/ShiroUtils.java @@ -1,21 +1,41 @@ package com.bootdo.common.utils; +import com.bootdo.system.domain.UserToken; +import org.apache.commons.beanutils.BeanUtils; import org.apache.shiro.SecurityUtils; +import org.apache.shiro.session.Session; +import org.apache.shiro.session.mgt.eis.SessionDAO; import org.apache.shiro.subject.Subject; import com.bootdo.system.domain.UserDO; +import org.springframework.beans.factory.annotation.Autowired; + +import java.lang.reflect.InvocationTargetException; +import java.security.Principal; +import java.util.Collection; +import java.util.List; public class ShiroUtils { - public static Subject getSubjct() { - return SecurityUtils.getSubject(); - } - public static UserDO getUser() { - return (UserDO)getSubjct().getPrincipal(); - } - public static Long getUserId() { - return getUser().getUserId(); - } - public static void logout() { - getSubjct().logout(); - } + @Autowired + private static SessionDAO sessionDAO; + + public static Subject getSubjct() { + return SecurityUtils.getSubject(); + } + public static UserDO getUser() { + Object object = getSubjct().getPrincipal(); + return (UserDO)object; + } + public static Long getUserId() { + return getUser().getUserId(); + } + public static void logout() { + getSubjct().logout(); + } + + public static List getPrinciples() { + List principals = null; + Collection sessions = sessionDAO.getActiveSessions(); + return principals; + } } diff --git a/bootdo/src/main/java/com/bootdo/common/utils/TimeUtils.java b/bootdo/src/main/java/com/bootdo/common/utils/TimeUtils.java index 105b90d1977dba6d62ce75823a8d618a9b7ddc23..04cc494971e24eb3e4b8743aaa9510ae703c6fed 100644 --- a/bootdo/src/main/java/com/bootdo/common/utils/TimeUtils.java +++ b/bootdo/src/main/java/com/bootdo/common/utils/TimeUtils.java @@ -109,7 +109,6 @@ public class TimeUtils { */ public TimeUtils(String time) { this(time, null); -// System.out.println(time); } /** diff --git a/bootdo/src/main/java/com/bootdo/oa/config/WebSocketConfig.java b/bootdo/src/main/java/com/bootdo/oa/config/WebSocketConfig.java index 8fb8bc44f7b5f57ea00396ce32f7a70abc61866a..d83b1ba098e92ccd924d4ce89bb95df0b22f2b59 100644 --- a/bootdo/src/main/java/com/bootdo/oa/config/WebSocketConfig.java +++ b/bootdo/src/main/java/com/bootdo/oa/config/WebSocketConfig.java @@ -6,31 +6,46 @@ import org.springframework.web.socket.config.annotation.AbstractWebSocketMessage import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; -@Configuration -@EnableWebSocketMessageBroker /** * 通过EnableWebSocketMessageBroker 开启使用STOMP协议来传输基于代理(message broker)的消息,此时浏览器支持使用@MessageMapping 就像支持@RequestMapping一样。 */ +@Configuration +@EnableWebSocketMessageBroker +public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { -public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer{ - - /** - * endPoint 注册协议节点,并映射指定的URl - * @param registry - */ + // /** +// * endPoint 注册协议节点,并映射指定的URl +// * +// * @param registry +// */ +// @Override +// public void registerStompEndpoints(StompEndpointRegistry registry) { +// //注册一个Stomp 协议的endpoint,并指定 SockJS协议。 +// registry.addEndpoint("/endpointWisely").withSockJS(); +// } +// +// /** +// * 配置消息代理(message broker) +// * +// * @param registry +// */ +// @Override +// public void configureMessageBroker(MessageBrokerRegistry registry) { +// //广播式应配置一个/topic 消息代理 +// registry.enableSimpleBroker("/topic"); +// } @Override - public void registerStompEndpoints(StompEndpointRegistry registry) { - //注册一个Stomp 协议的endpoint,并指定 SockJS协议。 - registry.addEndpoint("/endpointWisely").withSockJS(); + public void registerStompEndpoints(StompEndpointRegistry registry) { //endPoint 注册协议节点,并映射指定的URl + + //注册一个名字为"endpointChat" 的endpoint,并指定 SockJS协议。 点对点-用 + registry.addEndpoint("/endpointChat").withSockJS(); } - /** - * 配置消息代理(message broker) - * @param registry - */ + @Override - public void configureMessageBroker(MessageBrokerRegistry registry) { - //广播式应配置一个/topic 消息代理 - registry.enableSimpleBroker("/topic"); + public void configureMessageBroker(MessageBrokerRegistry registry) {//配置消息代理(message broker) + //点对点式增加一个/queue 消息代理 + registry.enableSimpleBroker("/queue", "/topic"); + } } diff --git a/bootdo/src/main/java/com/bootdo/oa/controller/NotifyController.java b/bootdo/src/main/java/com/bootdo/oa/controller/NotifyController.java index d023e6347886fbb4bb9624ff787a02f1c6b78f75..2a3894cbefc9031e288cefdea7f37ca74d7be97c 100644 --- a/bootdo/src/main/java/com/bootdo/oa/controller/NotifyController.java +++ b/bootdo/src/main/java/com/bootdo/oa/controller/NotifyController.java @@ -2,6 +2,8 @@ package com.bootdo.oa.controller; import com.bootdo.common.config.Constant; import com.bootdo.common.controller.BaseController; +import com.bootdo.common.domain.DictDO; +import com.bootdo.common.service.DictService; import com.bootdo.common.utils.PageUtils; import com.bootdo.common.utils.Query; import com.bootdo.common.utils.R; @@ -15,6 +17,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; +import java.security.Principal; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -35,6 +38,8 @@ public class NotifyController extends BaseController { private NotifyService notifyService; @Autowired private NotifyRecordService notifyRecordService; + @Autowired + private DictService dictService; @GetMapping() @RequiresPermissions("oa:notify:notify") @@ -64,6 +69,14 @@ public class NotifyController extends BaseController { @RequiresPermissions("oa:notify:edit") String edit(@PathVariable("id") Long id, Model model) { NotifyDO notify = notifyService.get(id); + List dictDOS = dictService.listByType("oa_notify_type"); + String type = notify.getType(); + for (DictDO dictDO:dictDOS){ + if(type.equals(dictDO.getValue())){ + dictDO.setRemarks("checked"); + } + } + model.addAttribute("oaNotifyTypes",dictDOS); model.addAttribute("notify", notify); return "oa/notify/edit"; } @@ -169,4 +182,7 @@ public class NotifyController extends BaseController { model.addAttribute("notify", notify); return "oa/notify/read"; } + + + } diff --git a/bootdo/src/main/java/com/bootdo/oa/controller/WebSocketController.java b/bootdo/src/main/java/com/bootdo/oa/controller/WebSocketController.java index 69446cd363c0d91df268e12d1915fdf8cd910693..6f0ca6a70ea8a4e998b8619fdf67e513a4dc2cb2 100644 --- a/bootdo/src/main/java/com/bootdo/oa/controller/WebSocketController.java +++ b/bootdo/src/main/java/com/bootdo/oa/controller/WebSocketController.java @@ -1,48 +1,60 @@ -//package com.bootdo.oa.controller; -// -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.messaging.handler.annotation.MessageMapping; -//import org.springframework.messaging.handler.annotation.SendTo; -//import org.springframework.messaging.simp.SimpMessagingTemplate; -//import org.springframework.stereotype.Controller; -//import org.springframework.web.bind.annotation.GetMapping; -//import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.web.bind.annotation.ResponseBody; -// -//import com.bootdo.common.task.WelcomeTask; -//import com.bootdo.common.utils.R; -//import com.bootdo.oa.domain.Message; -//import com.bootdo.oa.domain.Response; -// -//@Controller -//public class WebSocketController { -// @Autowired -// SimpMessagingTemplate template; -// -// @Autowired -// WelcomeTask welcomeTask; -// -// @MessageMapping("/welcome") // 浏览器发送请求通过@messageMapping 映射/welcome 这个地址。 -// @SendTo("/topic/getResponse") // 服务器端有消息时,会订阅@SendTo 中的路径的浏览器发送消息。 -// public Response say(Message message) throws Exception { -// Thread.sleep(1000); -// return new Response("Welcome, " + message.getName() + "!"); -// } -// -// @GetMapping("/test") -// String test() { -// return "test"; -// } -// -// @RequestMapping("/welcome") -// @ResponseBody -// public R say02() { -// try { -// welcomeTask.sayWelcome(); -// } catch (Exception e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// return R.ok(); -// } -//} \ No newline at end of file +package com.bootdo.oa.controller; + +import com.bootdo.system.service.SessionService; +import org.apache.shiro.session.mgt.eis.SessionDAO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.messaging.handler.annotation.MessageMapping; +import org.springframework.messaging.handler.annotation.SendTo; +import org.springframework.messaging.simp.SimpMessagingTemplate; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.bootdo.common.utils.R; +import com.bootdo.oa.domain.Message; +import com.bootdo.oa.domain.Response; + +import java.security.Principal; + +@Controller +public class WebSocketController { + @Autowired + SimpMessagingTemplate template; + + @Autowired + SessionService sessionService; + + /*@Autowired + WelcomeTask welcomeTask; + + @MessageMapping("/welcome") // 浏览器发送请求通过@messageMapping 映射/welcome 这个地址。 + @SendTo("/topic/getResponse") // 服务器端有消息时,会订阅@SendTo 中的路径的浏览器发送消息。 + public Response say(Message message) throws Exception { + Thread.sleep(1000); + return new Response("Welcome, " + message.getName() + "!"); + } + + @GetMapping("/test") + String test() { + return "test"; + } + + @RequestMapping("/welcome") + @ResponseBody + public R say02() { + try { + welcomeTask.sayWelcome(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return R.ok(); + }*/ +// @ResponseBody +// @GetMapping("/chat") +// public String handleChat(Principal principal, String msg) { +// template.convertAndSendToUser(sessionService.listPrincipal().get(0).toString(), "/queue/notifications", principal.getName() + "给您发来了消息:" + msg); +// return sessionService.listPrincipal().get(0).toString(); +// } +} \ No newline at end of file diff --git a/bootdo/src/main/java/com/bootdo/oa/service/impl/NotifyServiceImpl.java b/bootdo/src/main/java/com/bootdo/oa/service/impl/NotifyServiceImpl.java index 6f6750612a6dc937a36ec9f286fc9e2f514b2179..cd22b86790f9cb7e51007259cf93fd02464073a4 100644 --- a/bootdo/src/main/java/com/bootdo/oa/service/impl/NotifyServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/oa/service/impl/NotifyServiceImpl.java @@ -1,14 +1,18 @@ package com.bootdo.oa.service.impl; +import com.bootdo.system.domain.UserDO; +import com.bootdo.system.service.SessionService; +import org.apache.shiro.session.Session; +import org.apache.shiro.session.mgt.eis.SessionDAO; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; import com.bootdo.common.service.DictService; import com.bootdo.common.utils.DateUtils; @@ -23,99 +27,104 @@ import com.bootdo.system.dao.UserDao; @Service public class NotifyServiceImpl implements NotifyService { - @Autowired - private NotifyDao notifyDao; - @Autowired - private NotifyRecordDao recordDao; - @Autowired - private UserDao userDao; - @Autowired - private DictService dictService; + @Autowired + private NotifyDao notifyDao; + @Autowired + private NotifyRecordDao recordDao; + @Autowired + private UserDao userDao; + @Autowired + private DictService dictService; + @Autowired + private SessionService sessionService; + @Autowired + private SimpMessagingTemplate template; - @Override - public NotifyDO get(Long id) { - NotifyDO rDO = notifyDao.get(id); - rDO.setType(dictService.getName("oa_notify_type", rDO.getType()) ); - return rDO; - } + @Override + public NotifyDO get(Long id) { + NotifyDO rDO = notifyDao.get(id); + rDO.setType(dictService.getName("oa_notify_type", rDO.getType())); + return rDO; + } - @Override - public List list(Map map) { - List notifys = notifyDao.list(map); - for (NotifyDO notifyDO : notifys) { - notifyDO.setType(dictService.getName("oa_notify_type", notifyDO.getType()) ); - } - return notifys; - } + @Override + public List list(Map map) { + List notifys = notifyDao.list(map); + for (NotifyDO notifyDO : notifys) { + notifyDO.setType(dictService.getName("oa_notify_type", notifyDO.getType())); + } + return notifys; + } - @Override - public int count(Map map) { - return notifyDao.count(map); - } + @Override + public int count(Map map) { + return notifyDao.count(map); + } - @Transactional(rollbackFor = Exception.class) - @Override - public int save(NotifyDO notify) { - notify.setUpdateDate(new Date()); - int r = notifyDao.save(notify); - // 保存到接受者列表中 - Long[] userIds = notify.getUserIds(); - Long notifyId = notify.getId(); - List records = new ArrayList<>(); - for (Long userId : userIds) { - NotifyRecordDO record = new NotifyRecordDO(); - record.setNotifyId(notifyId); - record.setUserId(userId); - record.setIsRead(0); - records.add(record); - } - recordDao.batchSave(records); - return r; + @Transactional(rollbackFor = Exception.class) + @Override + public int save(NotifyDO notify) { + notify.setUpdateDate(new Date()); + int r = notifyDao.save(notify); + // 保存到接受者列表中 + Long[] userIds = notify.getUserIds(); + Long notifyId = notify.getId(); + List records = new ArrayList<>(); + for (Long userId : userIds) { + NotifyRecordDO record = new NotifyRecordDO(); + record.setNotifyId(notifyId); + record.setUserId(userId); + record.setIsRead(0); + records.add(record); + } + recordDao.batchSave(records); + //给在线用户发送通知 + ThreadPoolExecutor executor = new ThreadPoolExecutor(1,1,0, TimeUnit.MILLISECONDS,new LinkedBlockingDeque<>()); + executor.execute(new Runnable() { + @Override + public void run() { + for (UserDO userDO : sessionService.listOnlineUser()) { + for (Long userId : userIds) { + if (userId.equals(userDO.getUserId())) { + template.convertAndSendToUser(userDO.toString(), "/queue/notifications", "新消息:" + notify.getTitle()); + } + } + } + } + }); + executor.shutdown(); + return r; + } - } + @Override + public int update(NotifyDO notify) { + return notifyDao.update(notify); + } - @Override - public int update(NotifyDO notify) { - return notifyDao.update(notify); - } + @Transactional + @Override + public int remove(Long id) { + recordDao.removeByNotifbyId(id); + return notifyDao.remove(id); + } - @Transactional - @Override - public int remove(Long id) { - recordDao.removeByNotifbyId(id); - return notifyDao.remove(id); - } + @Transactional + @Override + public int batchRemove(Long[] ids) { + recordDao.batchRemoveByNotifbyId(ids); + return notifyDao.batchRemove(ids); + } - @Transactional - @Override - public int batchRemove(Long[] ids) { - recordDao.batchRemoveByNotifbyId(ids); - return notifyDao.batchRemove(ids); - } -// @Override -// public Map message(Long userId) { -// Map param = new HashMap<>(16); -// Map map = new HashMap<>(16); -// param.put("userId", userId); -// param.put("isRead", 0); -// int messageNum = recordDao.count(param); -// Long[] notifyIds = recordDao.listNotifyIds(param); -// List messages = notifyDao.listByIds(notifyIds); -// map.put("messageNum", messageNum); -// map.put("messages", messages); -// return map; -// } - - @Override - public PageUtils selfList(Map map) { - List rows = notifyDao.listDTO(map); - for (NotifyDTO notifyDTO : rows) { - notifyDTO.setBefore(DateUtils.getTimeBefore(notifyDTO.getUpdateDate())); - notifyDTO.setSender(userDao.get(notifyDTO.getCreateBy()).getName()); - } - PageUtils page = new PageUtils(rows, notifyDao.countDTO(map)); - return page; - } + @Override + public PageUtils selfList(Map map) { + List rows = notifyDao.listDTO(map); + for (NotifyDTO notifyDTO : rows) { + notifyDTO.setBefore(DateUtils.getTimeBefore(notifyDTO.getUpdateDate())); + notifyDTO.setSender(userDao.get(notifyDTO.getCreateBy()).getName()); + } + PageUtils page = new PageUtils(rows, notifyDao.countDTO(map)); + return page; + } } diff --git a/bootdo/src/main/java/com/bootdo/system/config/RedisConfig.java b/bootdo/src/main/java/com/bootdo/system/config/RedisConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..7402faab2ed5ee7ea2e96324d138b0105736efd6 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/system/config/RedisConfig.java @@ -0,0 +1,44 @@ +package com.bootdo.system.config; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import redis.clients.jedis.JedisPool; +import redis.clients.jedis.JedisPoolConfig; + +/** + * Created by yangqj on 2017/4/30. + */ +@Configuration +@EnableCaching +public class RedisConfig extends CachingConfigurerSupport { + @Value("${spring.redis.host}") + private String host; + @Value("${spring.redis.password}") + private String password; + @Value("${spring.redis.port}") + private int port; + @Value("${spring.redis.timeout}") + private int timeout; + @Value("${spring.redis.pool.max-idle}") + private int maxIdle; + @Value("${spring.redis.pool.max-wait}") + private long maxWaitMillis; + + @Bean + public JedisPool redisPoolFactory() { + Logger.getLogger(getClass()).info("JedisPool注入成功!!"); + Logger.getLogger(getClass()).info("redis地址:" + host + ":" + port); + JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); + jedisPoolConfig.setMaxIdle(maxIdle); + jedisPoolConfig.setMaxWaitMillis(maxWaitMillis); + + JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout,password); + + return jedisPool; + } + +} diff --git a/bootdo/src/main/java/com/bootdo/system/config/ShiroConfig.java b/bootdo/src/main/java/com/bootdo/system/config/ShiroConfig.java index 18479967d45d582e91f3436ea6f2e75d89127643..aa956fd68614274b4755318c1cf243dab7252ac9 100644 --- a/bootdo/src/main/java/com/bootdo/system/config/ShiroConfig.java +++ b/bootdo/src/main/java/com/bootdo/system/config/ShiroConfig.java @@ -1,116 +1,184 @@ -package com.bootdo.system.config; - -import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; -import com.bootdo.system.shiro.UserRealm; -import org.apache.shiro.cache.ehcache.EhCacheManager; -import org.apache.shiro.mgt.SecurityManager; -import org.apache.shiro.session.SessionListener; -import org.apache.shiro.session.mgt.SessionManager; -import org.apache.shiro.session.mgt.eis.MemorySessionDAO; -import org.apache.shiro.session.mgt.eis.SessionDAO; -import org.apache.shiro.spring.LifecycleBeanPostProcessor; -import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; -import org.apache.shiro.spring.web.ShiroFilterFactoryBean; -import org.apache.shiro.web.mgt.DefaultWebSecurityManager; -import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; -import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashMap; - -@Configuration -public class ShiroConfig { - @Bean - public EhCacheManager getEhCacheManager() { - EhCacheManager em = new EhCacheManager(); - em.setCacheManagerConfigFile("classpath:config/ehcache.xml"); - return em; - } - - @Bean - UserRealm userRealm(EhCacheManager cacheManager) { - UserRealm userRealm = new UserRealm(); - userRealm.setCacheManager(cacheManager); - return userRealm; - } - @Bean - SessionDAO sessionDAO() { - MemorySessionDAO sessionDAO = new MemorySessionDAO(); - return sessionDAO; - } - - @Bean - public SessionManager sessionManager() { - DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); - Collection listeners = new ArrayList(); - listeners.add(new BDSessionListener()); - sessionManager.setSessionListeners(listeners); - sessionManager.setSessionDAO(sessionDAO()); - return sessionManager; - } - - @Bean - SecurityManager securityManager(UserRealm userRealm) { - DefaultWebSecurityManager manager = new DefaultWebSecurityManager(); - manager.setRealm(userRealm); - manager.setCacheManager(getEhCacheManager()); - manager.setSessionManager(sessionManager()); - return manager; - } - - @Bean - ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) { - ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); - shiroFilterFactoryBean.setSecurityManager(securityManager); - shiroFilterFactoryBean.setLoginUrl("/login"); - shiroFilterFactoryBean.setSuccessUrl("/index"); - shiroFilterFactoryBean.setUnauthorizedUrl("/403"); - LinkedHashMap filterChainDefinitionMap = new LinkedHashMap<>(); - filterChainDefinitionMap.put("/css/**", "anon"); - filterChainDefinitionMap.put("/js/**", "anon"); - filterChainDefinitionMap.put("/fonts/**", "anon"); - filterChainDefinitionMap.put("/img/**", "anon"); - filterChainDefinitionMap.put("/docs/**", "anon"); - filterChainDefinitionMap.put("/druid/**", "anon"); - filterChainDefinitionMap.put("/upload/**", "anon"); - filterChainDefinitionMap.put("/files/**", "anon"); - filterChainDefinitionMap.put("/logout", "logout"); - filterChainDefinitionMap.put("/", "anon"); - filterChainDefinitionMap.put("/blog", "anon"); - filterChainDefinitionMap.put("/blog/open/**", "anon"); - filterChainDefinitionMap.put("/**", "authc"); - - shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); - return shiroFilterFactoryBean; - } - - @Bean("lifecycleBeanPostProcessor") - public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() { - return new LifecycleBeanPostProcessor(); - } - - @Bean - public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() { - DefaultAdvisorAutoProxyCreator proxyCreator = new DefaultAdvisorAutoProxyCreator(); - proxyCreator.setProxyTargetClass(true); - return proxyCreator; - } - - @Bean - public ShiroDialect shiroDialect() { - return new ShiroDialect(); - } - - @Bean - public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor( - @Qualifier("securityManager") SecurityManager securityManager) { - AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor(); - authorizationAttributeSourceAdvisor.setSecurityManager(securityManager); - return authorizationAttributeSourceAdvisor; - } - -} +package com.bootdo.system.config; + +import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; +import com.bootdo.common.config.Constant; +import com.bootdo.common.redis.shiro.RedisCacheManager; +import com.bootdo.common.redis.shiro.RedisManager; +import com.bootdo.common.redis.shiro.RedisSessionDAO; +import com.bootdo.system.shiro.UserRealm; +import org.apache.shiro.cache.ehcache.EhCacheManager; +import org.apache.shiro.mgt.SecurityManager; +import org.apache.shiro.session.SessionListener; +import org.apache.shiro.session.mgt.eis.MemorySessionDAO; +import org.apache.shiro.session.mgt.eis.SessionDAO; +import org.apache.shiro.spring.LifecycleBeanPostProcessor; +import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; +import org.apache.shiro.spring.web.ShiroFilterFactoryBean; +import org.apache.shiro.web.mgt.DefaultWebSecurityManager; +import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; + +/** + * @author bootdo 1992lcg@163.com + */ +@Configuration +public class ShiroConfig { + @Value("${spring.redis.host}") + private String host; + @Value("${spring.redis.password}") + private String password; + @Value("${spring.redis.port}") + private int port; + @Value("${spring.redis.timeout}") + private int timeout; + + @Value("${cacheType}") + private String cacheType; + + @Bean + public static LifecycleBeanPostProcessor getLifecycleBeanPostProcessor() { + return new LifecycleBeanPostProcessor(); + } + + /** + * ShiroDialect,为了在thymeleaf里使用shiro的标签的bean + * @return + */ + @Bean + public ShiroDialect shiroDialect() { + return new ShiroDialect(); + } + + @Bean + ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) { + ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); + shiroFilterFactoryBean.setSecurityManager(securityManager); + shiroFilterFactoryBean.setLoginUrl("/login"); + shiroFilterFactoryBean.setSuccessUrl("/index"); + shiroFilterFactoryBean.setUnauthorizedUrl("/403"); + LinkedHashMap filterChainDefinitionMap = new LinkedHashMap<>(); + filterChainDefinitionMap.put("/css/**", "anon"); + filterChainDefinitionMap.put("/js/**", "anon"); + filterChainDefinitionMap.put("/fonts/**", "anon"); + filterChainDefinitionMap.put("/img/**", "anon"); + filterChainDefinitionMap.put("/docs/**", "anon"); + filterChainDefinitionMap.put("/druid/**", "anon"); + filterChainDefinitionMap.put("/upload/**", "anon"); + filterChainDefinitionMap.put("/files/**", "anon"); + filterChainDefinitionMap.put("/logout", "logout"); + filterChainDefinitionMap.put("/", "anon"); + filterChainDefinitionMap.put("/blog", "anon"); + filterChainDefinitionMap.put("/blog/open/**", "anon"); + filterChainDefinitionMap.put("/**", "authc"); + shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); + return shiroFilterFactoryBean; + } + + + @Bean + public SecurityManager securityManager(){ + DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); + //设置realm. + securityManager.setRealm(userRealm()); + // 自定义缓存实现 使用redis + if(Constant.CACHE_TYPE_REDIS.equals(cacheType)){ + securityManager.setCacheManager(cacheManager()); + }else { + securityManager.setCacheManager(ehCacheManager()); + } + securityManager.setSessionManager(sessionManager()); + return securityManager; + } + + @Bean + UserRealm userRealm() { + UserRealm userRealm = new UserRealm(); + return userRealm; + } + + /** + * 开启shiro aop注解支持. + * 使用代理方式;所以需要开启代码支持; + * @param securityManager + * @return + */ + @Bean + public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager){ + AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor(); + authorizationAttributeSourceAdvisor.setSecurityManager(securityManager); + return authorizationAttributeSourceAdvisor; + } + + /** + * 配置shiro redisManager + * @return + */ + @Bean + public RedisManager redisManager() { + RedisManager redisManager = new RedisManager(); + redisManager.setHost(host); + redisManager.setPort(port); + redisManager.setExpire(1800);// 配置缓存过期时间 + //redisManager.setTimeout(1800); + redisManager.setPassword(password); + return redisManager; + } + + /** + * cacheManager 缓存 redis实现 + * 使用的是shiro-redis开源插件 + * @return + */ + public RedisCacheManager cacheManager() { + RedisCacheManager redisCacheManager = new RedisCacheManager(); + redisCacheManager.setRedisManager(redisManager()); + return redisCacheManager; + } + + + /** + * RedisSessionDAO shiro sessionDao层的实现 通过redis + * 使用的是shiro-redis开源插件 + */ + @Bean + public RedisSessionDAO redisSessionDAO() { + RedisSessionDAO redisSessionDAO = new RedisSessionDAO(); + redisSessionDAO.setRedisManager(redisManager()); + return redisSessionDAO; + } + + @Bean + public SessionDAO sessionDAO(){ + if(Constant.CACHE_TYPE_REDIS.equals(cacheType)){ + return redisSessionDAO(); + }else { + return new MemorySessionDAO(); + } + } + + /** + * shiro session的管理 + */ + @Bean + public DefaultWebSessionManager sessionManager() { + DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); + sessionManager.setSessionDAO(sessionDAO()); + Collection listeners = new ArrayList(); + listeners.add(new BDSessionListener()); + sessionManager.setSessionListeners(listeners); + return sessionManager; + } + @Bean + public EhCacheManager ehCacheManager() { + EhCacheManager em = new EhCacheManager(); + em.setCacheManagerConfigFile("classpath:config/ehcache.xml"); + return em; + } + +} diff --git a/bootdo/src/main/java/com/bootdo/system/config/XssConfig.java b/bootdo/src/main/java/com/bootdo/system/config/XssConfig.java index cf7b0cc37fbb970833148c3c3941ec3c4d4752d2..1f23fa97ad58c1d3a02d00afb8c2b277020faf00 100644 --- a/bootdo/src/main/java/com/bootdo/system/config/XssConfig.java +++ b/bootdo/src/main/java/com/bootdo/system/config/XssConfig.java @@ -19,7 +19,7 @@ public class XssConfig{ FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(); filterRegistrationBean.setFilter(new XssFilter()); filterRegistrationBean.setOrder(1); - filterRegistrationBean.setEnabled(true); + filterRegistrationBean.setEnabled(false); filterRegistrationBean.addUrlPatterns("/*"); Map initParameters = Maps.newHashMap(); initParameters.put("excludes", "/favicon.ico,/img/*,/js/*,/css/*"); diff --git a/bootdo/src/main/java/com/bootdo/system/controller/DeptController.java b/bootdo/src/main/java/com/bootdo/system/controller/DeptController.java index 89e1011a9f01e78b05fac71894600e5de4730aea..def5958285603dc8b08fe772bcffe40bf1fd708d 100644 --- a/bootdo/src/main/java/com/bootdo/system/controller/DeptController.java +++ b/bootdo/src/main/java/com/bootdo/system/controller/DeptController.java @@ -6,8 +6,6 @@ import com.bootdo.common.domain.Tree; import com.bootdo.common.utils.R; import com.bootdo.system.domain.DeptDO; import com.bootdo.system.service.DeptService; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +39,6 @@ public class DeptController extends BaseController { } @ApiOperation(value="获取部门列表", notes="") - @RequestMapping(value={""}) @ResponseBody @GetMapping("/list") @RequiresPermissions("system:sysDept:sysDept") diff --git a/bootdo/src/main/java/com/bootdo/system/controller/SessionController.java b/bootdo/src/main/java/com/bootdo/system/controller/SessionController.java index b811d88dc4ca89e6d090f0bcbc666c8759351466..48e5a878a9f01210d354523a22492727819f232e 100644 --- a/bootdo/src/main/java/com/bootdo/system/controller/SessionController.java +++ b/bootdo/src/main/java/com/bootdo/system/controller/SessionController.java @@ -1,5 +1,6 @@ package com.bootdo.system.controller; +import java.security.Principal; import java.util.Collection; import java.util.List; @@ -51,4 +52,6 @@ public class SessionController { public Collection sessionList() { return sessionService.sessionList(); } + + } diff --git a/bootdo/src/main/java/com/bootdo/system/controller/UserController.java b/bootdo/src/main/java/com/bootdo/system/controller/UserController.java index d77b62ffd3a38f1eb88ca9528c7f1898a19e506e..0496048ca9f45bd7d96d06331ad91a988bee5444 100644 --- a/bootdo/src/main/java/com/bootdo/system/controller/UserController.java +++ b/bootdo/src/main/java/com/bootdo/system/controller/UserController.java @@ -184,7 +184,22 @@ public class UserController extends BaseController { } } - + @RequiresPermissions("sys:user:resetPwd") + @Log("admin提交更改用户密码") + @PostMapping("/adminResetPwd") + @ResponseBody + R adminResetPwd(UserVO userVO) { + if (Constant.DEMO_ACCOUNT.equals(getUsername())) { + return R.error(1, "演示系统不允许修改,完整体验请部署程序"); + } + try{ + userService.adminResetPwd(userVO); + return R.ok(); + }catch (Exception e){ + return R.error(1,e.getMessage()); + } + + } @GetMapping("/tree") @ResponseBody public Tree tree() { diff --git a/bootdo/src/main/java/com/bootdo/system/domain/UserDO.java b/bootdo/src/main/java/com/bootdo/system/domain/UserDO.java index 650b42696580c37e1faee3446637f6a1e3f1bd01..198b6632c69ba8bc1c3b7bdbd8e9e01f3f4e2847 100644 --- a/bootdo/src/main/java/com/bootdo/system/domain/UserDO.java +++ b/bootdo/src/main/java/com/bootdo/system/domain/UserDO.java @@ -1,6 +1,6 @@ package com.bootdo.system.domain; -import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; @@ -8,7 +8,6 @@ import java.util.List; public class UserDO implements Serializable { private static final long serialVersionUID = 1L; - // private Long userId; // 用户名 @@ -37,6 +36,7 @@ public class UserDO implements Serializable { //性别 private Long sex; //出身日期 + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date birth; //图片ID private Long picId; @@ -50,34 +50,22 @@ public class UserDO implements Serializable { private String city; //所在地区 private String district; - /** - * 设置: - */ - public void setUserId(Long userId) { - this.userId = userId; - } - /** - * 获取: - */ public Long getUserId() { return userId; } - /** - * 设置:用户名 - */ - public void setUsername(String username) { - this.username = username; + public void setUserId(Long userId) { + this.userId = userId; } - /** - * 获取:用户名 - */ public String getUsername() { return username; } + public void setUsername(String username) { + this.username = username; + } public String getName() { return name; @@ -87,20 +75,14 @@ public class UserDO implements Serializable { this.name = name; } - /** - * 设置:密码 - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * 获取:密码 - */ public String getPassword() { return password; } + public void setPassword(String password) { + this.password = password; + } + public Long getDeptId() { return deptId; } @@ -117,95 +99,59 @@ public class UserDO implements Serializable { this.deptName = deptName; } - /** - * 设置:邮箱 - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * 获取:邮箱 - */ public String getEmail() { return email; } - /** - * 设置:手机号 - */ - public void setMobile(String mobile) { - this.mobile = mobile; + public void setEmail(String email) { + this.email = email; } - /** - * 获取:手机号 - */ public String getMobile() { return mobile; } - /** - * 设置:状态 0:禁用,1:正常 - */ - public void setStatus(Integer status) { - this.status = status; + public void setMobile(String mobile) { + this.mobile = mobile; } - /** - * 获取:状态 0:禁用,1:正常 - */ public Integer getStatus() { return status; } - /** - * 设置:创建用户id - */ - public void setUserIdCreate(Long userIdCreate) { - this.userIdCreate = userIdCreate; + public void setStatus(Integer status) { + this.status = status; } - /** - * 获取:创建用户id - */ public Long getUserIdCreate() { return userIdCreate; } - /** - * 设置:创建时间 - */ - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; + public void setUserIdCreate(Long userIdCreate) { + this.userIdCreate = userIdCreate; } - /** - * 获取:创建时间 - */ public Date getGmtCreate() { return gmtCreate; } - /** - * 设置:修改时间 - */ - public void setGmtModified(Date gmtModified) { - this.gmtModified = gmtModified; + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; } - /** - * 获取:修改时间 - */ public Date getGmtModified() { return gmtModified; } - public List getroleIds() { + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + public List getRoleIds() { return roleIds; } - public void setroleIds(List roleIds) { + public void setRoleIds(List roleIds) { this.roleIds = roleIds; } diff --git a/bootdo/src/main/java/com/bootdo/system/domain/UserToken.java b/bootdo/src/main/java/com/bootdo/system/domain/UserToken.java new file mode 100644 index 0000000000000000000000000000000000000000..afe64fbf3607888372031b409cc539019e1d7263 --- /dev/null +++ b/bootdo/src/main/java/com/bootdo/system/domain/UserToken.java @@ -0,0 +1,56 @@ +package com.bootdo.system.domain; + +import java.io.Serializable; + +/** + * @author bootdo 1992lcg@163.com + * @version V1.0 + */ +public class UserToken implements Serializable { + private static final long serialVersionUID = 1L; + private Long userId; + private String username; + private String name; + private String password; + private Long deptId; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } +} diff --git a/bootdo/src/main/java/com/bootdo/system/service/SessionService.java b/bootdo/src/main/java/com/bootdo/system/service/SessionService.java index a46cf1c09d3ff1c4fde7c7decfa342f568357665..8e9172187d5c8477d1c97a6548e84c3e2e6f96d1 100644 --- a/bootdo/src/main/java/com/bootdo/system/service/SessionService.java +++ b/bootdo/src/main/java/com/bootdo/system/service/SessionService.java @@ -1,8 +1,11 @@ package com.bootdo.system.service; +import java.io.PrintStream; +import java.security.Principal; import java.util.Collection; import java.util.List; +import com.bootdo.system.domain.UserDO; import org.apache.shiro.session.Session; import org.springframework.stereotype.Service; @@ -12,6 +15,8 @@ import com.bootdo.system.domain.UserOnline; public interface SessionService { List list(); + List listOnlineUser(); + Collection sessionList(); boolean forceLogout(String sessionId); diff --git a/bootdo/src/main/java/com/bootdo/system/service/UserService.java b/bootdo/src/main/java/com/bootdo/system/service/UserService.java index 66987bec281d7ba80dc4f622e90834869aea1c91..a911db0926566586ed68e62529f28602c3d77557 100644 --- a/bootdo/src/main/java/com/bootdo/system/service/UserService.java +++ b/bootdo/src/main/java/com/bootdo/system/service/UserService.java @@ -33,7 +33,7 @@ public interface UserService { Set listRoles(Long userId); int resetPwd(UserVO userVO,UserDO userDO) throws Exception; - + int adminResetPwd(UserVO userVO) throws Exception; Tree getTree(); /** diff --git a/bootdo/src/main/java/com/bootdo/system/service/impl/RoleServiceImpl.java b/bootdo/src/main/java/com/bootdo/system/service/impl/RoleServiceImpl.java index 4559173af369f97dbb98d826579246ea03232983..75042de83ec847ae8a1106bbf6dbaa45f9e26d54 100644 --- a/bootdo/src/main/java/com/bootdo/system/service/impl/RoleServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/system/service/impl/RoleServiceImpl.java @@ -36,7 +36,6 @@ public class RoleServiceImpl implements RoleService { @Autowired UserRoleDao userRoleMapper; - @Cacheable(value = DEMO_CACHE_NAME, key = ROLE_ALL_KEY) @Override public List list() { List roles = roleMapper.list(new HashMap<>(16)); @@ -59,7 +58,6 @@ public class RoleServiceImpl implements RoleService { } return roles; } - @CacheEvict(value = DEMO_CACHE_NAME, key = ROLE_ALL_KEY) @Transactional @Override public int save(RoleDO role) { @@ -80,7 +78,6 @@ public class RoleServiceImpl implements RoleService { return count; } - @CacheEvict(value = DEMO_CACHE_NAME, key = ROLE_ALL_KEY) @Transactional @Override public int remove(Long id) { @@ -95,7 +92,6 @@ public class RoleServiceImpl implements RoleService { return roleDO; } - @CacheEvict(value = DEMO_CACHE_NAME, key = ROLE_ALL_KEY) @Override public int update(RoleDO role) { int r = roleMapper.update(role); diff --git a/bootdo/src/main/java/com/bootdo/system/service/impl/SessionServiceImpl.java b/bootdo/src/main/java/com/bootdo/system/service/impl/SessionServiceImpl.java index d472fc12a6ecf969169427e6b4806a52becc325d..9837901e3a66cdc27c45e7e9ba3a38acda2ebe69 100644 --- a/bootdo/src/main/java/com/bootdo/system/service/impl/SessionServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/system/service/impl/SessionServiceImpl.java @@ -2,6 +2,7 @@ package com.bootdo.system.service.impl; import com.bootdo.system.domain.UserDO; import com.bootdo.system.domain.UserOnline; +import com.bootdo.system.domain.UserToken; import com.bootdo.system.service.SessionService; import org.apache.shiro.session.Session; import org.apache.shiro.session.mgt.eis.SessionDAO; @@ -10,56 +11,77 @@ import org.apache.shiro.subject.support.DefaultSubjectContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.security.Principal; import java.util.ArrayList; import java.util.Collection; import java.util.List; /** * 待完善 - * - * @author bootdo * + * @author bootdo */ @Service public class SessionServiceImpl implements SessionService { - @Autowired - private SessionDAO sessionDAO; + private final SessionDAO sessionDAO; + + @Autowired + public SessionServiceImpl(SessionDAO sessionDAO) { + this.sessionDAO = sessionDAO; + } + + @Override + public List list() { + List list = new ArrayList<>(); + Collection sessions = sessionDAO.getActiveSessions(); + for (Session session : sessions) { + UserOnline userOnline = new UserOnline(); + if (session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY) == null) { + continue; + } else { + SimplePrincipalCollection principalCollection = (SimplePrincipalCollection) session + .getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY); + UserDO userDO = (UserDO) principalCollection.getPrimaryPrincipal(); + userOnline.setUsername(userDO.getUsername()); + } + userOnline.setId((String) session.getId()); + userOnline.setHost(session.getHost()); + userOnline.setStartTimestamp(session.getStartTimestamp()); + userOnline.setLastAccessTime(session.getLastAccessTime()); + userOnline.setTimeout(session.getTimeout()); + list.add(userOnline); + } + return list; + } - @Override - public List list() { - List list = new ArrayList<>(); - Collection sessions = sessionDAO.getActiveSessions(); - for (Session session : sessions) { - UserOnline userOnline = new UserOnline(); - UserDO userDO = new UserDO(); - SimplePrincipalCollection principalCollection = new SimplePrincipalCollection(); - if (session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY) == null) { - continue; - } else { - principalCollection = (SimplePrincipalCollection) session - .getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY); - userDO = (UserDO) principalCollection.getPrimaryPrincipal(); - userOnline.setUsername(userDO.getUsername()); - } - userOnline.setId((String) session.getId()); - userOnline.setHost(session.getHost()); - userOnline.setStartTimestamp(session.getStartTimestamp()); - userOnline.setLastAccessTime(session.getLastAccessTime()); - userOnline.setTimeout(session.getTimeout()); - list.add(userOnline); - } - return list; - } + @Override + public List listOnlineUser() { + List list = new ArrayList<>(); + UserDO userDO; + Collection sessions = sessionDAO.getActiveSessions(); + for (Session session : sessions) { + SimplePrincipalCollection principalCollection = new SimplePrincipalCollection(); + if (session.getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY) == null) { + continue; + } else { + principalCollection = (SimplePrincipalCollection) session + .getAttribute(DefaultSubjectContext.PRINCIPALS_SESSION_KEY); + userDO = (UserDO) principalCollection.getPrimaryPrincipal(); + list.add(userDO); + } + } + return list; + } - @Override - public Collection sessionList() { - return sessionDAO.getActiveSessions(); - } + @Override + public Collection sessionList() { + return sessionDAO.getActiveSessions(); + } - @Override - public boolean forceLogout(String sessionId) { - Session session = sessionDAO.readSession(sessionId); - session.setTimeout(0); - return true; - } + @Override + public boolean forceLogout(String sessionId) { + Session session = sessionDAO.readSession(sessionId); + session.setTimeout(0); + return true; + } } diff --git a/bootdo/src/main/java/com/bootdo/system/service/impl/UserServiceImpl.java b/bootdo/src/main/java/com/bootdo/system/service/impl/UserServiceImpl.java index b47ec08e2add8775e8c61371ad33ab87373a0391..4989a49f57a2d4a9cefb23166a78087935b804bc 100644 --- a/bootdo/src/main/java/com/bootdo/system/service/impl/UserServiceImpl.java +++ b/bootdo/src/main/java/com/bootdo/system/service/impl/UserServiceImpl.java @@ -48,7 +48,7 @@ public class UserServiceImpl implements UserService { List roleIds = userRoleMapper.listRoleId(id); UserDO user = userMapper.get(id); user.setDeptName(deptMapper.get(user.getDeptId()).getName()); - user.setroleIds(roleIds); + user.setRoleIds(roleIds); return user; } @@ -67,7 +67,7 @@ public class UserServiceImpl implements UserService { public int save(UserDO user) { int count = userMapper.save(user); Long userId = user.getUserId(); - List roles = user.getroleIds(); + List roles = user.getRoleIds(); userRoleMapper.removeByUserId(userId); List list = new ArrayList<>(); for (Long roleId : roles) { @@ -86,7 +86,7 @@ public class UserServiceImpl implements UserService { public int update(UserDO user) { int r = userMapper.update(user); Long userId = user.getUserId(); - List roles = user.getroleIds(); + List roles = user.getRoleIds(); userRoleMapper.removeByUserId(userId); List list = new ArrayList<>(); for (Long roleId : roles) { @@ -132,6 +132,17 @@ public class UserServiceImpl implements UserService { throw new Exception("你修改的不是你登录的账号!"); } } + @Override + public int adminResetPwd(UserVO userVO) throws Exception { + UserDO userDO =get(userVO.getUserDO().getUserId()); + if("admin".equals(userDO.getUsername())){ + throw new Exception("超级管理员的账号不允许直接重置!"); + } + userDO.setPassword(MD5Utils.encrypt(userDO.getUsername(), userVO.getPwdNew())); + return userMapper.update(userDO); + + + } @Transactional @Override diff --git a/bootdo/src/main/java/com/bootdo/system/shiro/UserRealm.java b/bootdo/src/main/java/com/bootdo/system/shiro/UserRealm.java index 22515b8add61d711a633ecb013c464c6c32e73e2..ef0999a158770572ffe993bb31ea6b74accdc85e 100644 --- a/bootdo/src/main/java/com/bootdo/system/shiro/UserRealm.java +++ b/bootdo/src/main/java/com/bootdo/system/shiro/UserRealm.java @@ -5,6 +5,7 @@ import java.util.Map; import java.util.Set; import com.bootdo.common.config.ApplicationContextRegister; +import com.bootdo.system.domain.UserToken; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; diff --git a/bootdo/src/main/resources/application-dev.yml b/bootdo/src/main/resources/application-dev.yml index df21d69c079a6e998b5d114eb7347a095b319d65..8b3abe142fd24fad71df6b0685c170057d3bc0af 100644 --- a/bootdo/src/main/resources/application-dev.yml +++ b/bootdo/src/main/resources/application-dev.yml @@ -31,4 +31,19 @@ spring: # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 # 合并多个DruidDataSource的监控数据 - #useGlobalDataSourceStat: true \ No newline at end of file + #useGlobalDataSourceStat: true + redis: + host: localhost + port: 6379 + password: + # 连接超时时间(毫秒) + timeout: 10000 + pool: + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池中的最小空闲连接 + min-idle: 10 + # 连接池最大连接数(使用负值表示没有限制) + max-active: 100 + # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1 \ No newline at end of file diff --git a/bootdo/src/main/resources/application-pro.yml b/bootdo/src/main/resources/application-pro.yml index a752ea3371c9ed653b86a3c8cc50c19a7be019aa..bb21eb0f3dac7b8cd73f22905c7db417bfd30e5b 100644 --- a/bootdo/src/main/resources/application-pro.yml +++ b/bootdo/src/main/resources/application-pro.yml @@ -31,4 +31,19 @@ spring: # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 # 合并多个DruidDataSource的监控数据 - #useGlobalDataSourceStat: true \ No newline at end of file + #useGlobalDataSourceStat: true + redis: + host: localhost + port: 6379 + password: + # 连接超时时间(毫秒) + timeout: 10000 + pool: + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池中的最小空闲连接 + min-idle: 10 + # 连接池最大连接数(使用负值表示没有限制) + max-active: 100 + # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1 \ No newline at end of file diff --git a/bootdo/src/main/resources/application.yml b/bootdo/src/main/resources/application.yml index 565b97ed93a44e025226f87ac6e5aeaa6a44a793..e6a166056b12f50db0640c79b08ed47c700cf23e 100644 --- a/bootdo/src/main/resources/application.yml +++ b/bootdo/src/main/resources/application.yml @@ -29,4 +29,6 @@ mybatis: configuration: map-underscore-to-camel-case: true mapper-locations: mybatis/**/*Mapper.xml - typeAliasesPackage: com.bootdo.**.domain \ No newline at end of file + typeAliasesPackage: com.bootdo.**.domain +#配置缓存和session存储方式,默认ehcache,可选redis +cacheType: ehcache \ No newline at end of file diff --git a/bootdo/src/main/resources/mybatis/oa/NotifyMapper.xml b/bootdo/src/main/resources/mybatis/oa/NotifyMapper.xml index 1756cba3503c7fd3e638fd4287357c39443e83ea..e223632c1e40f3a6bd040f53c801335cc06876c9 100644 --- a/bootdo/src/main/resources/mybatis/oa/NotifyMapper.xml +++ b/bootdo/src/main/resources/mybatis/oa/NotifyMapper.xml @@ -151,7 +151,7 @@ and r.user_id = #{userId} and r.read_date = #{readDate} - order by is_read ASC, create_date DESC + order by is_read ASC, update_date DESC limit #{offset}, #{limit} diff --git a/bootdo/src/main/resources/mybatis/system/UserMapper.xml b/bootdo/src/main/resources/mybatis/system/UserMapper.xml index 54379e09f224557ea6bd325146d378e928ef3c96..99a0e2a3aa2f5aa4c098d603185ce7e74a180e47 100644 --- a/bootdo/src/main/resources/mybatis/system/UserMapper.xml +++ b/bootdo/src/main/resources/mybatis/system/UserMapper.xml @@ -149,4 +149,7 @@ + \ No newline at end of file diff --git a/bootdo/src/main/resources/static/editor-app/configuration/toolbar-default-actions.js b/bootdo/src/main/resources/static/editor-app/configuration/toolbar-default-actions.js index 027c20d8c8d2f41c0c77af80b5b2611fd931f8e3..366c2bfc7d13ffedc27522e52b1a88417c76b8d3 100644 --- a/bootdo/src/main/resources/static/editor-app/configuration/toolbar-default-actions.js +++ b/bootdo/src/main/resources/static/editor-app/configuration/toolbar-default-actions.js @@ -264,6 +264,7 @@ KISBPM.TOOLBAR = { //window.location.href = "./"; var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引 parent.layer.close(index); + parent.reLoad(); }, /** @@ -331,6 +332,7 @@ var SaveModelCtrl = [ '$rootScope', '$scope', '$http', '$route', '$location', //window.location.href = "./"; var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引 parent.layer.close(index); + parent.reLoad(); }); }; $scope.save = function (successCallback) { diff --git a/bootdo/src/main/resources/static/js/appjs/act/model/model.js b/bootdo/src/main/resources/static/js/appjs/act/model/model.js index bc2f7ae8e225371f3957b8e383c61d7349f81a8f..75ed1b706e04e4c967e4dc3d21a9367fc5e7ac6f 100644 --- a/bootdo/src/main/resources/static/js/appjs/act/model/model.js +++ b/bootdo/src/main/resources/static/js/appjs/act/model/model.js @@ -100,17 +100,15 @@ function reLoad() { $('#exampleTable').bootstrapTable('refresh'); } function add() { - // iframe层 - // window.open(prefix + '/add'); - var page = parent.layer.open({ + var page = layer.open({ type : 2, title : '新建模型', maxmin : true, shadeClose : false, // 点击遮罩关闭层 area : [ '100%', '100%' ], - content : prefix + '/add' + content : prefix + '/add', + closeBtn: 0, //不显示关闭按钮 }); - layer.full(page); } function remove(id) { layer.confirm('确定要删除选中的记录?', { diff --git a/bootdo/src/main/resources/static/js/appjs/act/process/add.js b/bootdo/src/main/resources/static/js/appjs/act/process/add.js index 34e701509fadee86a234afad9d47364327eb4c72..52e44c9aa63a8f7f9d0188b28752c126baee8440 100644 --- a/bootdo/src/main/resources/static/js/appjs/act/process/add.js +++ b/bootdo/src/main/resources/static/js/appjs/act/process/add.js @@ -7,24 +7,17 @@ $.validator.setDefaults({ save(); } }); -function getCheckedRoles() { - var adIds = ""; - $("input:checkbox[name=role]:checked").each(function(i) { - if (0 == i) { - adIds = $(this).val(); - } else { - adIds += ("," + $(this).val()); - } - }); - return adIds; -} + function save() { - $.ajax({ - cache : true, + var formData = new FormData($("#signupForm")[0]); + $.ajax({ type : "POST", - url : "/act/process/save", - data : $('#signupForm').serialize(),// 你的formid - async : false, + url : "/activiti/process/save", + data: formData, + async: false, + cache: false, + contentType: false, + processData: false, error : function(request) { parent.layer.alert("Connection error"); }, diff --git a/bootdo/src/main/resources/static/js/appjs/act/process/process.js b/bootdo/src/main/resources/static/js/appjs/act/process/process.js index 88fa448963e2d511e7c8c4a99d4c2ee3551559eb..b001997806662846a2d2090af159871b95ae526c 100644 --- a/bootdo/src/main/resources/static/js/appjs/act/process/process.js +++ b/bootdo/src/main/resources/static/js/appjs/act/process/process.js @@ -137,10 +137,9 @@ function edit(id) { title : '修改模型', maxmin : true, shadeClose : false, - area : [ '800px', '520px' ], + area : [ '100%', '100%' ], content : prefix + '/edit/' + id }); - layer.full(page); } function covertToModel(id) { diff --git a/bootdo/src/main/resources/static/js/appjs/oa/notify/edit.js b/bootdo/src/main/resources/static/js/appjs/oa/notify/edit.js index f6a88d8d5dc556a248fe84301b51540885529249..3b110b7e8fd1909e0698d5df5802d63f9274e6de 100644 --- a/bootdo/src/main/resources/static/js/appjs/oa/notify/edit.js +++ b/bootdo/src/main/resources/static/js/appjs/oa/notify/edit.js @@ -1,5 +1,5 @@ $().ready(function() { - loadType(); + //loadType(); validateRule(); }); diff --git a/bootdo/src/main/resources/static/js/appjs/system/sysDept/sysDept.js b/bootdo/src/main/resources/static/js/appjs/system/sysDept/sysDept.js index ba3d9397727b1ec99d45332dc7ba864d8bfe19be..d8da7c37ac2816fd26fb9c267f7cc9fc927a0b8f 100644 --- a/bootdo/src/main/resources/static/js/appjs/system/sysDept/sysDept.js +++ b/bootdo/src/main/resources/static/js/appjs/system/sysDept/sysDept.js @@ -25,21 +25,27 @@ function load() { field : 'deptId', visible : false, align : 'center', - valign : 'middle', - width : '50px' + valign : 'center', + width : '50px', + checkbox : true }, { field : 'name', - title : '部门名称' + title : '部门名称', + valign : 'center', + witth :20 }, { field : 'orderNum', - title : '排序' + title : '排序', + align : 'center', + valign : 'center', }, { field : 'delFlag', title : '状态', align : 'center', + valign : 'center', formatter : function(item, index) { if (item.delFlag == '0') { return '禁用'; @@ -52,6 +58,7 @@ function load() { title : '操作', field : 'id', align : 'center', + valign : 'center', formatter : function(item, index) { var e = ''); + var td = $(''); // 增加formatter渲染 if (column.formatter) { td.html(column.formatter.call(this, item, index)); @@ -104,9 +104,9 @@ // 判断有没有选择列 if(i==0&&item.field=='selectItem'){ hasSelectItem = true; - th = $(''); + th = $(''); }else{ - th = $(''); + th = $(''); } th.text(item.title); thr.append(th); diff --git a/bootdo/src/main/resources/templates/act/model/model.html b/bootdo/src/main/resources/templates/act/model/model.html index 126c4c76483bb9b3710723fa63163bee2b799e8e..e4e659bf50b5f3f56ed845fe6f9e4acd0f8ec60b 100644 --- a/bootdo/src/main/resources/templates/act/model/model.html +++ b/bootdo/src/main/resources/templates/act/model/model.html @@ -26,7 +26,7 @@
+ placeholder="">
diff --git a/bootdo/src/main/resources/templates/act/process/add.html b/bootdo/src/main/resources/templates/act/process/add.html index 61c722dc0f2b77a18ddbd11f0e3dcac9b9ce6eef..49fa00732c9fe631d85392601f9e076cedece463 100644 --- a/bootdo/src/main/resources/templates/act/process/add.html +++ b/bootdo/src/main/resources/templates/act/process/add.html @@ -7,7 +7,7 @@
-
+
@@ -15,7 +15,7 @@
- +
@@ -42,12 +42,6 @@
-测试代码 - - - - -
diff --git a/bootdo/src/main/resources/templates/act/salary/add.html b/bootdo/src/main/resources/templates/act/salary/add.html index a9761e732f6668ba87e19ee5332da0fda769afc2..a0c49b3fd66838969532deae04e6978e0c46c78b 100644 --- a/bootdo/src/main/resources/templates/act/salary/add.html +++ b/bootdo/src/main/resources/templates/act/salary/add.html @@ -73,13 +73,13 @@
- +
-
- -
- -
-
+
diff --git a/bootdo/src/main/resources/templates/common/sysDict/edit.html b/bootdo/src/main/resources/templates/common/sysDict/edit.html index 9a19c2c1062dcb03b8a46317bad0a3b96f9b0e04..45e9d19fe5d069ce35d02d70da4f9e5899a32b62 100644 --- a/bootdo/src/main/resources/templates/common/sysDict/edit.html +++ b/bootdo/src/main/resources/templates/common/sysDict/edit.html @@ -63,13 +63,6 @@ th:value="${sysDict.remarks}" class="form-control" type="text">
-
- -
- -
-
diff --git a/bootdo/src/main/resources/templates/index_v1.html b/bootdo/src/main/resources/templates/index_v1.html index e5d65767e0a0f8f283b85e5fc79789d56ed7ba74..eef180c8663c70bcbe0e9135ca978939b618b934 100644 --- a/bootdo/src/main/resources/templates/index_v1.html +++ b/bootdo/src/main/resources/templates/index_v1.html @@ -306,11 +306,15 @@ }); function connect() { - var socket = new SockJS('/endpointWisely'); //链接SockJS 的endpoint 名称为"/endpointWisely" - stompClient = Stomp.over(socket);//使用stomp子协议的WebSocket 客户端 - stompClient.connect({}, function (frame) {//链接Web Socket的服务端。 - console.log('Connected: ' + frame); - stompClient.subscribe('/topic/getResponse', function (response) { //订阅/topic/getResponse 目标发送的消息。这个是在控制器的@SendTo中定义的。 + var sock = new SockJS("/endpointChat"); + var stomp = Stomp.over(sock); + stomp.connect('guest', 'guest', function(frame) { + + /**
 订阅了/user/queue/notifications 发送的消息,这里雨在控制器的 convertAndSendToUser 定义的地址保持一致,
 + * 这里多用了一个/user,并且这个user 是必须的,使用user 才会发送消息到指定的用户。
 + * */ + stomp.subscribe("/user/queue/notifications", handleNotification); + stomp.subscribe('/topic/getResponse', function (response) { //订阅/topic/getResponse 目标发送的消息。这个是在控制器的@SendTo中定义的。 toastr.options = { "closeButton": true, "debug": false, @@ -329,6 +333,10 @@ toastr.info(JSON.parse(response.body).responseMessage); }); }); + function handleNotification(message) { + wrapper.notify(); + toastr.info(message.body); + } } var wrapper = new Vue({ @@ -350,7 +358,7 @@ title: '个人设置', maxmin: true, shadeClose: false, - area: ['1024px', '720px'], + area: ['800px', '600px'], content: '/sys/user/personal' }); } diff --git a/bootdo/src/main/resources/templates/oa/notify/add.html b/bootdo/src/main/resources/templates/oa/notify/add.html index 14e4e7464d52c0429f1f0a4d730ad4cdc5793660..9c40b696dff9c02d02c6be78cd8f7d4b03cacff8 100644 --- a/bootdo/src/main/resources/templates/oa/notify/add.html +++ b/bootdo/src/main/resources/templates/oa/notify/add.html @@ -3,82 +3,81 @@ -
-
-
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
- -
-
-
-
- -
- -
-
-
-
- -
-
- -
-
-
-
-
-
- +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+ diff --git a/bootdo/src/main/resources/templates/oa/notify/edit.html b/bootdo/src/main/resources/templates/oa/notify/edit.html index a2caed3fd2ddd30fc86ccef2ba9d4e14527104dc..936dfb5dcbf895414a3688bbb95a575fb547a370 100644 --- a/bootdo/src/main/resources/templates/oa/notify/edit.html +++ b/bootdo/src/main/resources/templates/oa/notify/edit.html @@ -14,10 +14,10 @@
- + +
diff --git a/bootdo/src/main/resources/templates/system/dept/dept.html b/bootdo/src/main/resources/templates/system/dept/dept.html index 5749613b873b38dcc4c10f15d2fa2921100f25c5..fa8de5487c8a5adf332f4e9cc75c36980ab7af94 100644 --- a/bootdo/src/main/resources/templates/system/dept/dept.html +++ b/bootdo/src/main/resources/templates/system/dept/dept.html @@ -3,60 +3,67 @@ -
-
-
-
-
-
- -
- - - -
-
-
- - - - - -
- -
-
- -
-
- -
-
- -
-
- -
- -
- +
+
+
+
+
+
+ + +
+
+ +
+ +
+ +
+
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ \ No newline at end of file diff --git a/bootdo/src/main/resources/templates/system/user/reset_pwd.html b/bootdo/src/main/resources/templates/system/user/reset_pwd.html index 08ce46efb21504feec69822531f64776e030cb59..58683d4ee10573326aa409796a36cae5e9d36004 100644 --- a/bootdo/src/main/resources/templates/system/user/reset_pwd.html +++ b/bootdo/src/main/resources/templates/system/user/reset_pwd.html @@ -12,13 +12,13 @@
-
- +
@@ -63,7 +63,7 @@ $.ajax({ cache : true, type : "POST", - url : "/sys/user/resetPwd", + url : "/sys/user/adminResetPwd", data : $('#signupForm').serialize(),// 你的formid async : false, error : function(request) {