zhangzhenjun vor 4 Jahren
Commit
f81b033e4c
69 geänderte Dateien mit 3738 neuen und 0 gelöschten Zeilen
  1. 34 0
      .gitignore
  2. 48 0
      backend-admin/pom.xml
  3. 21 0
      backend-admin/src/main/java/com/ittim/admin/IttimBackendApplication.java
  4. 28 0
      backend-admin/src/main/java/com/ittim/admin/config/CommonFieldHandler.java
  5. 26 0
      backend-admin/src/main/java/com/ittim/admin/config/MybatisPlusConfig.java
  6. 44 0
      backend-admin/src/main/java/com/ittim/admin/config/RedisConfig.java
  7. 51 0
      backend-admin/src/main/java/com/ittim/admin/config/SwaggerConfig.java
  8. 37 0
      backend-admin/src/main/java/com/ittim/admin/config/TopicMessageListener.java
  9. 64 0
      backend-admin/src/main/java/com/ittim/admin/config/TwoRedisConfig.java
  10. 88 0
      backend-admin/src/main/java/com/ittim/admin/config/ZeroRedisConfig.java
  11. 57 0
      backend-admin/src/main/java/com/ittim/admin/controller/DemoController.java
  12. 105 0
      backend-admin/src/main/java/com/ittim/admin/controller/security/LoginController.java
  13. 85 0
      backend-admin/src/main/java/com/ittim/admin/entity/OauthToken.java
  14. 46 0
      backend-admin/src/main/java/com/ittim/admin/entity/OauthTokenKey.java
  15. 85 0
      backend-admin/src/main/java/com/ittim/admin/entity/Person.java
  16. 79 0
      backend-admin/src/main/java/com/ittim/admin/entity/SysAuthorities.java
  17. 106 0
      backend-admin/src/main/java/com/ittim/admin/entity/SysMenu.java
  18. 70 0
      backend-admin/src/main/java/com/ittim/admin/entity/SysRole.java
  19. 61 0
      backend-admin/src/main/java/com/ittim/admin/entity/SysRoleAuthorities.java
  20. 97 0
      backend-admin/src/main/java/com/ittim/admin/entity/SysUser.java
  21. 61 0
      backend-admin/src/main/java/com/ittim/admin/entity/SysUserRole.java
  22. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenKeyMapper.java
  23. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenMapper.java
  24. 28 0
      backend-admin/src/main/java/com/ittim/admin/mapper/PersonMapper.java
  25. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/SysAuthoritiesMapper.java
  26. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/SysMenuMapper.java
  27. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleAuthoritiesMapper.java
  28. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleMapper.java
  29. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/SysUserMapper.java
  30. 23 0
      backend-admin/src/main/java/com/ittim/admin/mapper/SysUserRoleMapper.java
  31. 21 0
      backend-admin/src/main/java/com/ittim/admin/service/OauthTokenKeyService.java
  32. 21 0
      backend-admin/src/main/java/com/ittim/admin/service/OauthTokenService.java
  33. 25 0
      backend-admin/src/main/java/com/ittim/admin/service/PersonService.java
  34. 21 0
      backend-admin/src/main/java/com/ittim/admin/service/SysAuthoritiesService.java
  35. 21 0
      backend-admin/src/main/java/com/ittim/admin/service/SysMenuService.java
  36. 21 0
      backend-admin/src/main/java/com/ittim/admin/service/SysRoleAuthoritiesService.java
  37. 21 0
      backend-admin/src/main/java/com/ittim/admin/service/SysRoleService.java
  38. 21 0
      backend-admin/src/main/java/com/ittim/admin/service/SysUserRoleService.java
  39. 22 0
      backend-admin/src/main/java/com/ittim/admin/service/SysUserService.java
  40. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenKeyServiceImpl.java
  41. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenServiceImpl.java
  42. 45 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/PersonServiceImpl.java
  43. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysAuthoritiesServiceImpl.java
  44. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysMenuServiceImpl.java
  45. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleAuthoritiesServiceImpl.java
  46. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleServiceImpl.java
  47. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserRoleServiceImpl.java
  48. 38 0
      backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserServiceImpl.java
  49. 83 0
      backend-admin/src/main/resources/application-dev.yml
  50. 0 0
      backend-admin/src/main/resources/application-pro.yml
  51. 0 0
      backend-admin/src/main/resources/application-test.yml
  52. 46 0
      backend-admin/src/main/resources/application.yml
  53. 27 0
      backend-admin/src/main/resources/banner.txt
  54. 79 0
      backend-admin/src/main/resources/logback-spring.xml
  55. 68 0
      backend-admin/src/main/resources/mappers/OauthTokenKeyMapper.xml
  56. 166 0
      backend-admin/src/main/resources/mappers/OauthTokenMapper.xml
  57. 109 0
      backend-admin/src/main/resources/mappers/PersonMapper.xml
  58. 108 0
      backend-admin/src/main/resources/mappers/SysAuthoritiesMapper.xml
  59. 150 0
      backend-admin/src/main/resources/mappers/SysMenuMapper.xml
  60. 81 0
      backend-admin/src/main/resources/mappers/SysRoleAuthoritiesMapper.xml
  61. 96 0
      backend-admin/src/main/resources/mappers/SysRoleMapper.xml
  62. 135 0
      backend-admin/src/main/resources/mappers/SysUserMapper.xml
  63. 82 0
      backend-admin/src/main/resources/mappers/SysUserRoleMapper.xml
  64. 27 0
      backend-common/pom.xml
  65. 27 0
      backend-common/src/main/java/com/ittim/common/bean/PageRequest.java
  66. 22 0
      backend-common/src/main/java/com/ittim/common/bean/RedisKeys.java
  67. 142 0
      backend-common/src/main/java/com/ittim/common/enums/Status.java
  68. 52 0
      backend-common/src/main/java/com/ittim/common/util/SpringContextUtil.java
  69. 190 0
      pom.xml

+ 34 - 0
.gitignore

@@ -0,0 +1,34 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+*.log

+ 48 - 0
backend-admin/pom.xml

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>backend</artifactId>
+        <groupId>com.ittim</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>backend-admin</artifactId>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <!--druid连接池-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.21</version>
+        </dependency>
+        <dependency>
+            <groupId>com.ittim</groupId>
+            <artifactId>backend-common</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <!-- 验证码-->
+        <dependency>
+            <groupId>com.github.whvcse</groupId>
+            <artifactId>easy-captcha</artifactId>
+            <version>1.6.2</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/IttimBackendApplication.java

@@ -0,0 +1,21 @@
+package com.ittim.admin;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.context.annotation.ComponentScan;
+import org.wf.jwtp.configuration.EnableJwtPermission;
+
+@Slf4j
+@EnableJwtPermission
+@ServletComponentScan
+@ComponentScan(value = "com.ittim.*")
+@SpringBootApplication
+public class IttimBackendApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(IttimBackendApplication.class, args);
+    }
+
+}

+ 28 - 0
backend-admin/src/main/java/com/ittim/admin/config/CommonFieldHandler.java

@@ -0,0 +1,28 @@
+package com.ittim.admin.config;
+
+import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.reflection.MetaObject;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * 通用字段填充
+ */
+@Slf4j
+@Component
+public class CommonFieldHandler implements MetaObjectHandler {
+
+    @Override
+    public void insertFill(MetaObject metaObject) {
+        log.info("start insert fill ....");
+        this.setFieldValByName("createTime", new Date(), metaObject);
+    }
+
+    @Override
+    public void updateFill(MetaObject metaObject) {
+        log.info("start update fill ....");
+        this.setFieldValByName("updateTime", new Date(), metaObject);
+    }
+}

+ 26 - 0
backend-admin/src/main/java/com/ittim/admin/config/MybatisPlusConfig.java

@@ -0,0 +1,26 @@
+package com.ittim.admin.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * 多个mapper包扫描,中间用逗号隔开
+ * mybatis-plus 配置
+ */
+@Configuration
+@MapperScan(basePackages = {"com.ittim.admin.mapper"})
+@EnableTransactionManagement
+public class MybatisPlusConfig {
+
+    /**
+     * 分页插件
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+
+}

+ 44 - 0
backend-admin/src/main/java/com/ittim/admin/config/RedisConfig.java

@@ -0,0 +1,44 @@
+package com.ittim.admin.config;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
+
+/**
+ * @author zzj
+ * @Description 设置Redis多实例的基类
+ * @date 2020/9/26
+ */
+@Data
+@EnableCaching
+@Configuration
+public class RedisConfig {
+
+    @Value("${spring.redis.jedis.pool.max-active}")
+    private int redisPoolMaxActive;
+
+    @Value("${spring.redis.jedis.pool.max-wait}")
+    private int redisPoolMaxWait;
+
+    @Value("${spring.redis.jedis.pool.max-idle}")
+    private int redisPoolMaxIdle;
+
+    @Value("${spring.redis.jedis.pool.min-idle}")
+    private int redisPoolMinIdle;
+
+    /**
+     * 创建redis连接工厂
+     */
+    public JedisConnectionFactory createJedisConnectionFactory(int dbIndex, String host, int port, String password, int timeout) {
+        RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration();
+        configuration.setDatabase(dbIndex);
+        configuration.setHostName(host);
+        configuration.setPort(port);
+        configuration.setPassword(password);
+        return new JedisConnectionFactory(configuration);
+    }
+
+}

+ 51 - 0
backend-admin/src/main/java/com/ittim/admin/config/SwaggerConfig.java

@@ -0,0 +1,51 @@
+package com.ittim.admin.config;
+
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+/**
+ * @author zzj
+ * @Description Swagger配置类
+ * @date 2020/9/28
+ */
+@Configuration
+@EnableSwagger2
+@EnableKnife4j
+@Import(BeanValidatorPluginsConfiguration.class)
+public class SwaggerConfig {
+
+    @Bean(value = "defaultApi2")
+    public Docket defaultApi2() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                //分组名称
+                .groupName("1.0版本")
+                .select()
+                //这里指定Controller扫描包路径
+                .apis(RequestHandlerSelectors.basePackage("com.ittim.admin.controller"))
+                .paths(PathSelectors.any())
+                .build();
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("ittim-backend-swagger-bootstrap-ui Restful Apis")
+                .description("swagger-bootstrap-ui")
+                .termsOfServiceUrl("http://localhost:8189/")
+                .contact(new Contact("ZhenJun.Zhang", "*", "zzjxxpro@163.com"))
+                .version("1.0")
+                .build();
+    }
+
+}

+ 37 - 0
backend-admin/src/main/java/com/ittim/admin/config/TopicMessageListener.java

@@ -0,0 +1,37 @@
+package com.ittim.admin.config;
+
+import com.ittim.common.bean.RedisKeys;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.data.redis.connection.Message;
+import org.springframework.data.redis.connection.MessageListener;
+import org.springframework.stereotype.Component;
+
+/**
+ * redis主题消息监听器
+ *
+ * @author zhangzhenjun wrote on 2020/6/15.
+ */
+@Slf4j
+@Component
+public class TopicMessageListener implements MessageListener {
+
+    /**
+     * 客户端监听订阅的topic,当有消息的时候,会触发该方法
+     */
+    @Override
+    public void onMessage(Message message, byte[] bytes) {
+        byte[] body = message.getBody();
+        byte[] channel = message.getChannel();
+        String topic = new String(channel);
+        String key = new String(body);
+        log.info("topic -> " + topic + ", key -> " + key);
+        try {
+            if (key.startsWith(RedisKeys.TEST_KEY)) {
+                //业务代码
+                //.................
+            }
+        } catch (Exception e) {
+            log.error("处理redis消息监听异常", e);
+        }
+    }
+}

+ 64 - 0
backend-admin/src/main/java/com/ittim/admin/config/TwoRedisConfig.java

@@ -0,0 +1,64 @@
+package com.ittim.admin.config;
+
+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 org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+/**
+ * @author zzj
+ * @Description 配置默认Redis操作实例到Spring中,连接Redis的1库
+ * @date 2020/9/26
+ */
+@Configuration
+@EnableCaching
+public class TwoRedisConfig extends RedisConfig {
+
+    @Value("${spring.redis2.database}")
+    private int dbIndex;
+
+    @Value("${spring.redis2.host}")
+    private String host;
+
+    @Value("${spring.redis2.port}")
+    private int port;
+
+    @Value("${spring.redis2.password}")
+    private String password;
+
+    @Value("${spring.redis2.timeout}")
+    private int timeout;
+
+    /**
+     * 配置redisTemplate 注入方式使用@Resource(name="") 方式注入
+     */
+    @Bean(name = "twoRedisTemplate")
+    public RedisTemplate<String, Object> twoRedisTemplate() {
+        /*
+         * Redis 序列化器.
+         *
+         * RedisTemplate 默认的系列化类是 JdkSerializationRedisSerializer,用JdkSerializationRedisSerializer序列化的话,
+         * 被序列化的对象必须实现Serializable接口。在存储内容时,除了属性的内容外还存了其它内容在里面,总长度长,且不容易阅读。
+         *
+         * Jackson2JsonRedisSerializer 和 GenericJackson2JsonRedisSerializer,两者都能系列化成 json,
+         * 但是后者会在 json 中加入 @class 属性,类的全路径包名,方便反系列化。前者如果存放了 List 则在反系列化的时候如果没指定
+         * TypeReference 则会报错 java.util.LinkedHashMap cannot be cast to
+         */
+        RedisSerializer<Object> genericJackson2JsonRedisSerializer = new GenericJackson2JsonRedisSerializer();
+        RedisSerializer<String> stringRedisSerializer = new StringRedisSerializer();
+
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setKeySerializer(stringRedisSerializer);
+        redisTemplate.setHashKeySerializer(stringRedisSerializer);
+        redisTemplate.setHashValueSerializer(genericJackson2JsonRedisSerializer);
+        redisTemplate.setValueSerializer(genericJackson2JsonRedisSerializer);
+        redisTemplate.setConnectionFactory(createJedisConnectionFactory(dbIndex, host, port, password, timeout));
+        redisTemplate.afterPropertiesSet();
+        return redisTemplate;
+    }
+
+}

+ 88 - 0
backend-admin/src/main/java/com/ittim/admin/config/ZeroRedisConfig.java

@@ -0,0 +1,88 @@
+package com.ittim.admin.config;
+
+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 org.springframework.context.annotation.Primary;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.listener.RedisMessageListenerContainer;
+import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.RedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+import java.util.Objects;
+
+/**
+ * @author zzj
+ * @Description 配置默认Redis操作实例到Spring中,连接Redis的0库
+ * @date 2020/9/26
+ */
+@Configuration
+@EnableCaching
+public class ZeroRedisConfig extends RedisConfig {
+    @Value("${spring.redis.database}")
+    private int dbIndex;
+
+    @Value("${spring.redis.host}")
+    private String host;
+
+    @Value("${spring.redis.port}")
+    private int port;
+
+    @Value("${spring.redis.password}")
+    private String password;
+
+    @Value("${spring.redis.timeout}")
+    private int timeout;
+
+//    private final TopicMessageListener topicMessageListener;
+//
+//    public ZeroRedisConfig(TopicMessageListener topicMessageListener) {
+//        this.topicMessageListener = topicMessageListener;
+//    }
+
+    /**
+     * 配置redisTemplate 注入方式使用@Resource(name="") 方式注入
+     */
+    @Primary
+    @Bean(name = "zeroRedisTemplate")
+    public RedisTemplate<String, Object> defaultRedisTemplate() {
+
+        /*
+         * Redis 序列化器.
+         *
+         * RedisTemplate 默认的系列化类是 JdkSerializationRedisSerializer,用JdkSerializationRedisSerializer序列化的话,
+         * 被序列化的对象必须实现Serializable接口。在存储内容时,除了属性的内容外还存了其它内容在里面,总长度长,且不容易阅读。
+         *
+         * Jackson2JsonRedisSerializer 和 GenericJackson2JsonRedisSerializer,两者都能系列化成 json,
+         * 但是后者会在 json 中加入 @class 属性,类的全路径包名,方便反系列化。前者如果存放了 List 则在反系列化的时候如果没指定
+         * TypeReference 则会报错 java.util.LinkedHashMap cannot be cast to
+         */
+        RedisSerializer<Object> genericJackson2JsonRedisSerializer = new GenericJackson2JsonRedisSerializer();
+        RedisSerializer<String> stringRedisSerializer = new StringRedisSerializer();
+
+        RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+        redisTemplate.setKeySerializer(stringRedisSerializer);
+        redisTemplate.setHashKeySerializer(stringRedisSerializer);
+        redisTemplate.setHashValueSerializer(genericJackson2JsonRedisSerializer);
+        redisTemplate.setValueSerializer(genericJackson2JsonRedisSerializer);
+        redisTemplate.setConnectionFactory(createJedisConnectionFactory(dbIndex, host, port, password, timeout));
+        redisTemplate.afterPropertiesSet();
+        return redisTemplate;
+    }
+
+    @Bean
+    public RedisMessageListenerContainer redisMessageListenerContainer() {
+        RedisMessageListenerContainer container = new RedisMessageListenerContainer();
+        // 设置Redis的连接工厂
+        container.setConnectionFactory(Objects.requireNonNull(defaultRedisTemplate().getConnectionFactory()));
+        // 设置监听的Topic-key过期
+        //ChannelTopic channelTopic = new ChannelTopic("__keyevent@0__:expired");
+        // 设置监听器
+        //container.addMessageListener(topicMessageListener, channelTopic);
+        return container;
+    }
+
+}
+

+ 57 - 0
backend-admin/src/main/java/com/ittim/admin/controller/DemoController.java

@@ -0,0 +1,57 @@
+package com.ittim.admin.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.api.R;
+import com.ittim.admin.entity.Person;
+import com.ittim.admin.service.PersonService;
+import com.ittim.common.bean.PageRequest;
+import com.ittim.common.enums.Status;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.wf.jwtp.annotation.Ignore;
+
+/**
+ * @author zzj
+ * @Description 测试控制器
+ * @date 2020/9/17
+ */
+@Slf4j
+@RestController
+@Api(value = "测试控制器",tags = "测试控制器")
+@RequestMapping("/api/demo")
+public class DemoController {
+
+    private final PersonService personService;
+
+    public DemoController(PersonService personService) {
+        this.personService = personService;
+    }
+
+    @Ignore
+    @GetMapping("/person")
+    @ApiOperation(value = "列表全查", notes = "列表全查")
+    public R<IPage<Person>> getPerson(PageRequest page) {
+        IPage<Person> personPage = personService.selectOrderByCreateTime(page);
+        return R.ok(personPage);
+    }
+
+    @Ignore
+    @GetMapping("/personNew")
+    @ApiOperation(value = "返回失败状态格式测试", notes = "返回失败状态格式测试")
+    public R<String> getPersonNew() {
+        return R.failed("这是测试失败");
+    }
+
+    @Ignore
+    @GetMapping("/personTwo")
+    @ApiOperation(value = "列表全查,自定义状态", notes = "列表全查,自定义状态")
+    public R<IPage<Person>> getPersonTwo(PageRequest page,Person person) {
+        IPage<Person> personPage = personService.selectByAll(page,person);
+        return R.restResult(personPage, Status.SUCCESS);
+    }
+
+}

+ 105 - 0
backend-admin/src/main/java/com/ittim/admin/controller/security/LoginController.java

@@ -0,0 +1,105 @@
+package com.ittim.admin.controller.security;
+
+import com.baomidou.mybatisplus.extension.api.R;
+import com.ittim.common.bean.RedisKeys;
+import com.ittim.common.enums.Status;
+import com.wf.captcha.SpecCaptcha;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.wf.jwtp.provider.Token;
+import org.wf.jwtp.provider.TokenStore;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@RestController
+@Api(tags = "登录模块")
+@RequestMapping("/auth")
+public class LoginController {
+
+    @Resource(name = "zeroRedisTemplate")
+    private RedisTemplate<String, Object> zeroRedisTemplate;
+
+    private final TokenStore tokenStore;
+
+    public LoginController(@Qualifier("jdbcTokenStore") TokenStore tokenStore) {
+        this.tokenStore = tokenStore;
+    }
+
+    /**
+     * 获取验证码
+     *
+     * @return 验证码Key 与 图片信息
+     */
+    @RequestMapping("/captcha")
+    @ApiOperation(value = "获取验证码", notes = "获取验证码(验证码Key 与 图片信息)")
+    public R<Map<String, String>> captcha() {
+        SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
+        String verCode = specCaptcha.text().toLowerCase();
+        // 存入redis并设置过期时间为30分钟
+        zeroRedisTemplate.opsForValue().set(RedisKeys.CAPTCHA_KEY, verCode, 30, TimeUnit.MINUTES);
+        // 将key和base64返回给前端
+        Map<String, String> resultMap = new HashMap<>(16);
+        resultMap.put("key", RedisKeys.CAPTCHA_KEY);
+        resultMap.put("image", specCaptcha.toBase64());
+        return R.ok(resultMap);
+    }
+
+    /**
+     * 用户登录
+     *
+     * @param username 用户名
+     * @param password 密码
+     * @param verCode  验证码
+     * @param verKey   验证码Key
+     * @return 返回登录状态
+     */
+    @PostMapping("/login")
+    @ApiOperation(value = "用户登录", notes = "用户登录(登录状态)")
+    public R<Object> login(String username, String password, String verCode, String verKey) {
+        // 获取redis中的验证码
+        String redisCode = (String) zeroRedisTemplate.opsForValue().get(RedisKeys.CAPTCHA_KEY);
+        // 判断验证码
+        if (verCode == null || !Objects.equals(redisCode, verCode.trim().toLowerCase())) {
+            return R.restResult("验证码不正确", Status.CAPTCHA_INCORRECT);
+        }
+
+        //未完成
+        // 签发token
+//        Token token = tokenStore.createNewToken(userId, permissions, roles, 60 * 60 * 24 * 30);
+
+        //返回访问令牌Token
+        Map<String, String> resultMap = new HashMap<>(16);
+//        String accessToken = token.getAccessToken();
+//        resultMap.put("access_token", accessToken);
+        return R.restResult(resultMap, Status.LOGIN);
+    }
+
+    /**
+     * 更新Token
+     *
+     * @param refreshToken 旧Token
+     * @return 新Token
+     */
+    @PostMapping("/token/refresh")
+    @ApiOperation(value = "更新Token", notes = "更新Token(新Token)")
+    public R<String> login(String refreshToken) {
+        Token token = tokenStore.refreshToken(refreshToken);
+        System.out.println("access_token:" + token.getAccessToken());
+        return R.ok(token.getAccessToken());
+    }
+
+}

+ 85 - 0
backend-admin/src/main/java/com/ittim/admin/entity/OauthToken.java

@@ -0,0 +1,85 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-OauthToken")
+@Data
+@TableName(value = "oauth_token")
+public class OauthToken implements Serializable {
+    @TableId(value = "token_id", type = IdType.INPUT)
+    @ApiModelProperty(value = "令牌ID")
+    private Integer tokenId;
+
+    @TableField(value = "user_id")
+    @ApiModelProperty(value = "用户ID")
+    private String userId;
+
+    @TableField(value = "access_token")
+    @ApiModelProperty(value = "访问令牌")
+    private String accessToken;
+
+    @TableField(value = "refresh_token")
+    @ApiModelProperty(value = "刷新令牌")
+    private String refreshToken;
+
+    @TableField(value = "expire_time")
+    @ApiModelProperty(value = "过期时间")
+    private Date expireTime;
+
+    @TableField(value = "refresh_token_expire_time")
+    @ApiModelProperty(value = "刷新令牌过期时间")
+    private Date refreshTokenExpireTime;
+
+    @TableField(value = "roles")
+    @ApiModelProperty(value = "角色")
+    private String roles;
+
+    @TableField(value = "permissions")
+    @ApiModelProperty(value = "权限")
+    private String permissions;
+
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    @TableField(value = "update_time")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_TOKEN_ID = "token_id";
+
+    public static final String COL_USER_ID = "user_id";
+
+    public static final String COL_ACCESS_TOKEN = "access_token";
+
+    public static final String COL_REFRESH_TOKEN = "refresh_token";
+
+    public static final String COL_EXPIRE_TIME = "expire_time";
+
+    public static final String COL_REFRESH_TOKEN_EXPIRE_TIME = "refresh_token_expire_time";
+
+    public static final String COL_ROLES = "roles";
+
+    public static final String COL_PERMISSIONS = "permissions";
+
+    public static final String COL_CREATE_TIME = "create_time";
+
+    public static final String COL_UPDATE_TIME = "update_time";
+}

+ 46 - 0
backend-admin/src/main/java/com/ittim/admin/entity/OauthTokenKey.java

@@ -0,0 +1,46 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-OauthTokenKey")
+@Data
+@TableName(value = "oauth_token_key")
+public class OauthTokenKey implements Serializable {
+    @TableId(value = "id", type = IdType.INPUT)
+    @ApiModelProperty(value = "主键ID")
+    private Integer id;
+
+    /**
+     * 生成token时的key
+     */
+    @TableField(value = "token_key")
+    @ApiModelProperty(value = "生成token时的key")
+    private String tokenKey;
+
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_ID = "id";
+
+    public static final String COL_TOKEN_KEY = "token_key";
+
+    public static final String COL_CREATE_TIME = "create_time";
+}

+ 85 - 0
backend-admin/src/main/java/com/ittim/admin/entity/Person.java

@@ -0,0 +1,85 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description 人员表
+ * @date 2020/9/28
+ */
+@ApiModel(value = "com-ittim-admin-entity-Person")
+@Data
+@TableName(value = "cnd_person")
+public class Person {
+
+    @TableId(value = "id", type = IdType.INPUT)
+    @ApiModelProperty(value = "主键ID")
+    private Integer id;
+
+    /**
+     * 人名
+     */
+    @TableField(value = "person_name")
+    @ApiModelProperty(value = "人名")
+    private String personName;
+
+    /**
+     * 年龄
+     */
+    @TableField(value = "person_age")
+    @ApiModelProperty(value = "年龄")
+    private Integer personAge;
+
+    /**
+     * 电话
+     */
+    @TableField(value = "person_phone")
+    @ApiModelProperty(value = "电话")
+    private Long personPhone;
+
+    /**
+     * 住址
+     */
+    @TableField(value = "person_address")
+    @ApiModelProperty(value = "住址")
+    private String personAddress;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField(value = "update_time")
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_ID = "id";
+
+    public static final String COL_PERSON_NAME = "person_name";
+
+    public static final String COL_PERSON_AGE = "person_age";
+
+    public static final String COL_PERSON_PHONE = "person_phone";
+
+    public static final String COL_PERSON_ADDRESS = "person_address";
+
+    public static final String COL_CREATE_TIME = "create_time";
+
+    public static final String COL_UPDATE_TIME = "update_time";
+}

+ 79 - 0
backend-admin/src/main/java/com/ittim/admin/entity/SysAuthorities.java

@@ -0,0 +1,79 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description 权限表
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-SysAuthorities")
+@Data
+@TableName(value = "sys_authorities")
+public class SysAuthorities implements Serializable {
+    /**
+     * (主键,自增)
+     */
+    @TableId(value = "id", type = IdType.INPUT)
+    @ApiModelProperty(value = "(主键,自增)")
+    private Integer id;
+
+    /**
+     * 授权标识
+     */
+    @TableField(value = "authority")
+    @ApiModelProperty(value = "授权标识")
+    private String authority;
+
+    /**
+     * 权限名称
+     */
+    @TableField(value = "authority_name")
+    @ApiModelProperty(value = "权限名称,")
+    private String authorityName;
+
+    /**
+     * 模块名称
+     */
+    @TableField(value = "parent_name")
+    @ApiModelProperty(value = "模块名称")
+    private String parentName;
+
+    /**
+     * 排序号
+     */
+    @TableField(value = "sort")
+    @ApiModelProperty(value = "排序号")
+    private Integer sort;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_ID = "id";
+
+    public static final String COL_AUTHORITY = "authority";
+
+    public static final String COL_AUTHORITY_NAME = "authority_name";
+
+    public static final String COL_PARENT_NAME = "parent_name";
+
+    public static final String COL_SORT = "sort";
+
+    public static final String COL_CREATE_TIME = "create_time";
+}

+ 106 - 0
backend-admin/src/main/java/com/ittim/admin/entity/SysMenu.java

@@ -0,0 +1,106 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description 菜单表
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-SysMenu")
+@Data
+@TableName(value = "sys_menu")
+public class SysMenu implements Serializable {
+    /**
+     * 菜单id(主键,自增)
+     */
+    @TableId(value = "menu_id", type = IdType.INPUT)
+    @ApiModelProperty(value = "菜单id(主键,自增)")
+    private Integer menuId;
+
+    /**
+     * 上级菜单id
+     */
+    @TableField(value = "parent_id")
+    @ApiModelProperty(value = "上级菜单id")
+    private Integer parentId;
+
+    /**
+     * 菜单名称
+     */
+    @TableField(value = "menu_name")
+    @ApiModelProperty(value = "菜单名称")
+    private String menuName;
+
+    /**
+     * 菜单hash地址(路由地址)
+     */
+    @TableField(value = "menu_url")
+    @ApiModelProperty(value = "菜单hash地址(路由地址)")
+    private String menuUrl;
+
+    /**
+     * 菜单图标
+     */
+    @TableField(value = "menu_icon")
+    @ApiModelProperty(value = "菜单图标")
+    private String menuIcon;
+
+    /**
+     * 排序号
+     */
+    @TableField(value = "sort_number")
+    @ApiModelProperty(value = "排序号")
+    private String sortNumber;
+
+    /**
+     * 对应的权限标识
+     */
+    @TableField(value = "authority")
+    @ApiModelProperty(value = "对应的权限标识")
+    private String authority;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @TableField(value = "update_time")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_MENU_ID = "menu_id";
+
+    public static final String COL_PARENT_ID = "parent_id";
+
+    public static final String COL_MENU_NAME = "menu_name";
+
+    public static final String COL_MENU_URL = "menu_url";
+
+    public static final String COL_MENU_ICON = "menu_icon";
+
+    public static final String COL_SORT_NUMBER = "sort_number";
+
+    public static final String COL_AUTHORITY = "authority";
+
+    public static final String COL_CREATE_TIME = "create_time";
+
+    public static final String COL_UPDATE_TIME = "update_time";
+}

+ 70 - 0
backend-admin/src/main/java/com/ittim/admin/entity/SysRole.java

@@ -0,0 +1,70 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description 角色表
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-SysRole")
+@Data
+@TableName(value = "sys_role")
+public class SysRole implements Serializable {
+    /**
+     * 角色id(主键,自增)
+     */
+    @TableId(value = "role_id", type = IdType.INPUT)
+    @ApiModelProperty(value = "角色id(主键,自增)")
+    private Integer roleId;
+
+    /**
+     * 角色名称
+     */
+    @TableField(value = "role_name")
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+
+    /**
+     * 备注
+     */
+    @TableField(value = "comments")
+    @ApiModelProperty(value = "备注")
+    private String comments;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @TableField(value = "update_time")
+    @ApiModelProperty(value = "修改时间")
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_ROLE_ID = "role_id";
+
+    public static final String COL_ROLE_NAME = "role_name";
+
+    public static final String COL_COMMENTS = "comments";
+
+    public static final String COL_CREATE_TIME = "create_time";
+
+    public static final String COL_UPDATE_TIME = "update_time";
+}

+ 61 - 0
backend-admin/src/main/java/com/ittim/admin/entity/SysRoleAuthorities.java

@@ -0,0 +1,61 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description 角色权限关联表
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-SysRoleAuthorities")
+@Data
+@TableName(value = "sys_role_authorities")
+public class SysRoleAuthorities implements Serializable {
+    /**
+     * (主键,自增)
+     */
+    @TableId(value = "id", type = IdType.INPUT)
+    @ApiModelProperty(value = "(主键,自增)")
+    private Integer id;
+
+    /**
+     * 角色id
+     */
+    @TableField(value = "role_id")
+    @ApiModelProperty(value = "角色id")
+    private Integer roleId;
+
+    /**
+     * 权限标识
+     */
+    @TableField(value = "authority")
+    @ApiModelProperty(value = "权限标识")
+    private String authority;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_ID = "id";
+
+    public static final String COL_ROLE_ID = "role_id";
+
+    public static final String COL_AUTHORITY = "authority";
+
+    public static final String COL_CREATE_TIME = "create_time";
+}

+ 97 - 0
backend-admin/src/main/java/com/ittim/admin/entity/SysUser.java

@@ -0,0 +1,97 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description 用户表
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-SysUser")
+@Data
+@TableName(value = "sys_user")
+public class SysUser implements Serializable {
+    /**
+     * 用户id(主键,自增)
+     */
+    @TableId(value = "user_id", type = IdType.INPUT)
+    @ApiModelProperty(value = "用户id(主键,自增)")
+    private Integer userId;
+
+    /**
+     * 账号
+     */
+    @TableField(value = "username")
+    @ApiModelProperty(value = "账号")
+    private String username;
+
+    /**
+     * 密码
+     */
+    @TableField(value = "`password`")
+    @ApiModelProperty(value = "密码")
+    private String password;
+
+    /**
+     * 昵称
+     */
+    @TableField(value = "nick_name")
+    @ApiModelProperty(value = "昵称")
+    private String nickName;
+
+    /**
+     * 性别
+     */
+    @TableField(value = "sex")
+    @ApiModelProperty(value = "性别")
+    private String sex;
+
+    /**
+     * 状态,0正常,1冻结
+     */
+    @TableField(value = "`state`")
+    @ApiModelProperty(value = "状态,0正常,1冻结")
+    private Integer state;
+
+    /**
+     * 注册时间
+     */
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "注册时间,")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @TableField(value = "update_time")
+    @ApiModelProperty(value = "修改时间,")
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_USER_ID = "user_id";
+
+    public static final String COL_USERNAME = "username";
+
+    public static final String COL_PASSWORD = "password";
+
+    public static final String COL_NICK_NAME = "nick_name";
+
+    public static final String COL_SEX = "sex";
+
+    public static final String COL_STATE = "state";
+
+    public static final String COL_CREATE_TIME = "create_time";
+
+    public static final String COL_UPDATE_TIME = "update_time";
+}

+ 61 - 0
backend-admin/src/main/java/com/ittim/admin/entity/SysUserRole.java

@@ -0,0 +1,61 @@
+package com.ittim.admin.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @author zzj
+ * @Description 用户角色关联表
+ * @date 2020/9/30
+ */
+@ApiModel(value = "com-ittim-admin-entity-SysUserRole")
+@Data
+@TableName(value = "sys_user_role")
+public class SysUserRole implements Serializable {
+    /**
+     * (主键,自增)
+     */
+    @TableId(value = "id", type = IdType.INPUT)
+    @ApiModelProperty(value = "(主键,自增)")
+    private Integer id;
+
+    /**
+     * 用户id
+     */
+    @TableField(value = "user_id")
+    @ApiModelProperty(value = "用户id")
+    private Integer userId;
+
+    /**
+     * 角色id
+     */
+    @TableField(value = "role_id")
+    @ApiModelProperty(value = "角色id,")
+    private Integer roleId;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "创建时间,")
+    private Date createTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String COL_ID = "id";
+
+    public static final String COL_USER_ID = "user_id";
+
+    public static final String COL_ROLE_ID = "role_id";
+
+    public static final String COL_CREATE_TIME = "create_time";
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenKeyMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.OauthTokenKey;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface OauthTokenKeyMapper extends BaseMapper<OauthTokenKey> {
+    int updateBatch(List<OauthTokenKey> list);
+
+    int updateBatchSelective(List<OauthTokenKey> list);
+
+    int batchInsert(@Param("list") List<OauthTokenKey> list);
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/OauthTokenMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.OauthToken;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface OauthTokenMapper extends BaseMapper<OauthToken> {
+    int updateBatch(List<OauthToken> list);
+
+    int updateBatchSelective(List<OauthToken> list);
+
+    int batchInsert(@Param("list") List<OauthToken> list);
+}

+ 28 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/PersonMapper.java

@@ -0,0 +1,28 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ittim.admin.entity.Person;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/28
+ */
+@Mapper
+public interface PersonMapper extends BaseMapper<Person> {
+
+    int updateBatch(List<Person> list);
+
+    int batchInsert(@Param("list") List<Person> list);
+
+    IPage<Person> selectOrderByCreateTime(IPage<Person> page);
+
+    IPage<Person> selectByAll(IPage<Person> page, @Param("person") Person person);
+
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/SysAuthoritiesMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.SysAuthorities;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface SysAuthoritiesMapper extends BaseMapper<SysAuthorities> {
+    int updateBatch(List<SysAuthorities> list);
+
+    int updateBatchSelective(List<SysAuthorities> list);
+
+    int batchInsert(@Param("list") List<SysAuthorities> list);
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/SysMenuMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.SysMenu;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface SysMenuMapper extends BaseMapper<SysMenu> {
+    int updateBatch(List<SysMenu> list);
+
+    int updateBatchSelective(List<SysMenu> list);
+
+    int batchInsert(@Param("list") List<SysMenu> list);
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleAuthoritiesMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.SysRoleAuthorities;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface SysRoleAuthoritiesMapper extends BaseMapper<SysRoleAuthorities> {
+    int updateBatch(List<SysRoleAuthorities> list);
+
+    int updateBatchSelective(List<SysRoleAuthorities> list);
+
+    int batchInsert(@Param("list") List<SysRoleAuthorities> list);
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/SysRoleMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.SysRole;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface SysRoleMapper extends BaseMapper<SysRole> {
+    int updateBatch(List<SysRole> list);
+
+    int updateBatchSelective(List<SysRole> list);
+
+    int batchInsert(@Param("list") List<SysRole> list);
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/SysUserMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.SysUser;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface SysUserMapper extends BaseMapper<SysUser> {
+    int updateBatch(List<SysUser> list);
+
+    int updateBatchSelective(List<SysUser> list);
+
+    int batchInsert(@Param("list") List<SysUser> list);
+}

+ 23 - 0
backend-admin/src/main/java/com/ittim/admin/mapper/SysUserRoleMapper.java

@@ -0,0 +1,23 @@
+package com.ittim.admin.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ittim.admin.entity.SysUserRole;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Mapper
+public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
+    int updateBatch(List<SysUserRole> list);
+
+    int updateBatchSelective(List<SysUserRole> list);
+
+    int batchInsert(@Param("list") List<SysUserRole> list);
+}

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/service/OauthTokenKeyService.java

@@ -0,0 +1,21 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.ittim.admin.entity.OauthTokenKey;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface OauthTokenKeyService extends IService<OauthTokenKey> {
+
+    int updateBatch(List<OauthTokenKey> list);
+
+    int updateBatchSelective(List<OauthTokenKey> list);
+
+    int batchInsert(List<OauthTokenKey> list);
+
+}

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/service/OauthTokenService.java

@@ -0,0 +1,21 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.ittim.admin.entity.OauthToken;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface OauthTokenService extends IService<OauthToken> {
+
+    int updateBatch(List<OauthToken> list);
+
+    int updateBatchSelective(List<OauthToken> list);
+
+    int batchInsert(List<OauthToken> list);
+
+}

+ 25 - 0
backend-admin/src/main/java/com/ittim/admin/service/PersonService.java

@@ -0,0 +1,25 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ittim.admin.entity.Person;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ittim.common.bean.PageRequest;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/28
+ */
+public interface PersonService extends IService<Person> {
+
+    int updateBatch(List<Person> list);
+
+    int batchInsert(List<Person> list);
+
+    IPage<Person> selectOrderByCreateTime(PageRequest page);
+
+    IPage<Person> selectByAll(PageRequest page,Person person);
+
+}

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/service/SysAuthoritiesService.java

@@ -0,0 +1,21 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.ittim.admin.entity.SysAuthorities;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface SysAuthoritiesService extends IService<SysAuthorities> {
+
+    int updateBatch(List<SysAuthorities> list);
+
+    int updateBatchSelective(List<SysAuthorities> list);
+
+    int batchInsert(List<SysAuthorities> list);
+
+}

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/service/SysMenuService.java

@@ -0,0 +1,21 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.ittim.admin.entity.SysMenu;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface SysMenuService extends IService<SysMenu> {
+
+    int updateBatch(List<SysMenu> list);
+
+    int updateBatchSelective(List<SysMenu> list);
+
+    int batchInsert(List<SysMenu> list);
+
+}

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/service/SysRoleAuthoritiesService.java

@@ -0,0 +1,21 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.ittim.admin.entity.SysRoleAuthorities;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface SysRoleAuthoritiesService extends IService<SysRoleAuthorities> {
+
+    int updateBatch(List<SysRoleAuthorities> list);
+
+    int updateBatchSelective(List<SysRoleAuthorities> list);
+
+    int batchInsert(List<SysRoleAuthorities> list);
+
+}

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/service/SysRoleService.java

@@ -0,0 +1,21 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.ittim.admin.entity.SysRole;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface SysRoleService extends IService<SysRole> {
+
+    int updateBatch(List<SysRole> list);
+
+    int updateBatchSelective(List<SysRole> list);
+
+    int batchInsert(List<SysRole> list);
+
+}

+ 21 - 0
backend-admin/src/main/java/com/ittim/admin/service/SysUserRoleService.java

@@ -0,0 +1,21 @@
+package com.ittim.admin.service;
+
+import java.util.List;
+
+import com.ittim.admin.entity.SysUserRole;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface SysUserRoleService extends IService<SysUserRole> {
+
+    int updateBatch(List<SysUserRole> list);
+
+    int updateBatchSelective(List<SysUserRole> list);
+
+    int batchInsert(List<SysUserRole> list);
+
+}

+ 22 - 0
backend-admin/src/main/java/com/ittim/admin/service/SysUserService.java

@@ -0,0 +1,22 @@
+package com.ittim.admin.service;
+
+import com.ittim.admin.entity.SysUser;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+public interface SysUserService extends IService<SysUser> {
+
+    int updateBatch(List<SysUser> list);
+
+    int updateBatchSelective(List<SysUser> list);
+
+    int batchInsert(List<SysUser> list);
+
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenKeyServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+
+import com.ittim.admin.mapper.OauthTokenKeyMapper;
+import com.ittim.admin.entity.OauthTokenKey;
+import com.ittim.admin.service.OauthTokenKeyService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class OauthTokenKeyServiceImpl extends ServiceImpl<OauthTokenKeyMapper, OauthTokenKey> implements OauthTokenKeyService {
+
+    @Override
+    public int updateBatch(List<OauthTokenKey> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<OauthTokenKey> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<OauthTokenKey> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/OauthTokenServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ittim.admin.mapper.OauthTokenMapper;
+
+import java.util.List;
+
+import com.ittim.admin.entity.OauthToken;
+import com.ittim.admin.service.OauthTokenService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class OauthTokenServiceImpl extends ServiceImpl<OauthTokenMapper, OauthToken> implements OauthTokenService {
+
+    @Override
+    public int updateBatch(List<OauthToken> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<OauthToken> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<OauthToken> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 45 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/PersonServiceImpl.java

@@ -0,0 +1,45 @@
+package com.ittim.admin.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ittim.common.bean.PageRequest;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ittim.admin.entity.Person;
+import com.ittim.admin.mapper.PersonMapper;
+import com.ittim.admin.service.PersonService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/28
+ */
+@Service
+public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person> implements PersonService {
+
+    @Override
+    public int updateBatch(List<Person> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int batchInsert(List<Person> list) {
+        return baseMapper.batchInsert(list);
+    }
+
+    @Override
+    public IPage<Person> selectOrderByCreateTime(PageRequest pageRequest) {
+        IPage<Person> page = new Page<>(pageRequest.getPage(), pageRequest.getPageSize());
+        return baseMapper.selectOrderByCreateTime(page);
+    }
+
+    @Override
+    public IPage<Person> selectByAll(PageRequest pageRequest, Person person) {
+        IPage<Person> page = new Page<>(pageRequest.getPage(), pageRequest.getPageSize());
+        return baseMapper.selectByAll(page, person);
+    }
+
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/SysAuthoritiesServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+
+import com.ittim.admin.entity.SysAuthorities;
+import com.ittim.admin.mapper.SysAuthoritiesMapper;
+import com.ittim.admin.service.SysAuthoritiesService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class SysAuthoritiesServiceImpl extends ServiceImpl<SysAuthoritiesMapper, SysAuthorities> implements SysAuthoritiesService {
+
+    @Override
+    public int updateBatch(List<SysAuthorities> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<SysAuthorities> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<SysAuthorities> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/SysMenuServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+
+import com.ittim.admin.entity.SysMenu;
+import com.ittim.admin.mapper.SysMenuMapper;
+import com.ittim.admin.service.SysMenuService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
+
+    @Override
+    public int updateBatch(List<SysMenu> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<SysMenu> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<SysMenu> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleAuthoritiesServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+
+import com.ittim.admin.mapper.SysRoleAuthoritiesMapper;
+import com.ittim.admin.entity.SysRoleAuthorities;
+import com.ittim.admin.service.SysRoleAuthoritiesService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class SysRoleAuthoritiesServiceImpl extends ServiceImpl<SysRoleAuthoritiesMapper, SysRoleAuthorities> implements SysRoleAuthoritiesService {
+
+    @Override
+    public int updateBatch(List<SysRoleAuthorities> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<SysRoleAuthorities> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<SysRoleAuthorities> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/SysRoleServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+
+import com.ittim.admin.mapper.SysRoleMapper;
+import com.ittim.admin.entity.SysRole;
+import com.ittim.admin.service.SysRoleService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
+
+    @Override
+    public int updateBatch(List<SysRole> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<SysRole> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<SysRole> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserRoleServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+
+import com.ittim.admin.mapper.SysUserRoleMapper;
+import com.ittim.admin.entity.SysUserRole;
+import com.ittim.admin.service.SysUserRoleService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService {
+
+    @Override
+    public int updateBatch(List<SysUserRole> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<SysUserRole> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<SysUserRole> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 38 - 0
backend-admin/src/main/java/com/ittim/admin/service/impl/SysUserServiceImpl.java

@@ -0,0 +1,38 @@
+package com.ittim.admin.service.impl;
+
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ittim.admin.entity.SysUser;
+
+import java.util.List;
+
+import com.ittim.admin.mapper.SysUserMapper;
+import com.ittim.admin.service.SysUserService;
+
+/**
+ * @author zzj
+ * @Description TODO
+ * @date 2020/9/30
+ */
+@Service
+public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
+
+    @Override
+    public int updateBatch(List<SysUser> list) {
+        return baseMapper.updateBatch(list);
+    }
+
+    @Override
+    public int updateBatchSelective(List<SysUser> list) {
+        return baseMapper.updateBatchSelective(list);
+    }
+
+    @Override
+    public int batchInsert(List<SysUser> list) {
+        return baseMapper.batchInsert(list);
+    }
+}

+ 83 - 0
backend-admin/src/main/resources/application-dev.yml

@@ -0,0 +1,83 @@
+spring:
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://localhost:3306/ittimbackend?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
+    username: root
+    password: root
+    druid:
+      initialSize: 5 #初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
+      minIdle: 5  #最小连接池数量
+      maxActive: 50 #最大连接池数量
+      maxWait: 60000 #获取连接时最大等待时间,单位毫秒。配置了maxWait之后,缺省启用公平锁,并发效率会有所下降,如果需要可以通过配置useUnfairLock属性为true使用非公平锁。
+      timeBetweenEvictionRunsMillis: 60000
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1
+      testWhileIdle: true
+      testOnBorrow: true
+      testOnReturn: false
+      poolPreparedStatements: true  #是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql5.5以下的版本中没有PSCache功能,建议关闭掉。5.5及以上版本有PSCache,建议开启。
+      maxPoolPreparedStatementPerConnectionSize: 20
+      filters: stat,wall  #属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有:监控统计用的filter:stat,日志用的filter:log4j, 防御sql注入的filter:wall
+      connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      stat-view-servlet:  # StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+        #allow: 127.0.0.1  #设置白名单
+        enabled: true #是否开启druid的数据统计界面 默认false
+        url-pattern: /druid/* #servlet映射规则,默认访问http:/127.0.0.1:端口号/项目名/druid/login.html
+        reset-enable: false #是否允许清空统计数据 默认false
+        login-username: ittimDruid
+        login-password: ittim@2020qqq...A
+      filter:
+        stat:
+          enabled: true
+
+  redis:
+    host: 124.70.140.103
+    password:
+    database: 0
+    port: 6379
+    timeout: 10000
+    jedis:
+      pool:
+        max-active: -1 # 连接池最大连接数(使用负值表示没有限制)
+        max-wait: -1  # 连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-idle: 8  # 连接池中的最大空闲连接
+        min-idle: 0 # 连接池中的最小空闲连接
+  redis2:
+    host: 124.70.140.103
+    password:
+    database: 1
+    port: 6379
+    timeout: 10000
+
+logging:
+  level:
+    org.wf.jwtp: DEBUG
+    com.xkcoding: DEBUG
+    com.xkcoding.orm.mybatis.plus.mapper: trace
+mybatis-plus:
+  mapper-locations: classpath:mappers/*.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.ittim.admin.entity,com.ittim.security.vo
+  global-config:
+    # 数据库相关配置
+    db-config:
+      #主键类型  AUTO:"数据库ID自增", INPUT:"用户输入ID",ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
+      id-type: auto
+      #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      table-underline: true
+      #是否开启大写命名,默认不开启
+      #capital-mode: true
+      #逻辑删除配置
+      #logic-delete-value: 1
+      #logic-not-delete-value: 0
+      db-type: mysql
+    #刷新mapper 调试神器
+    refresh: true
+  # 原生配置
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: true
+    # 开启sql打印
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

+ 0 - 0
backend-admin/src/main/resources/application-pro.yml


+ 0 - 0
backend-admin/src/main/resources/application-test.yml


+ 46 - 0
backend-admin/src/main/resources/application.yml

@@ -0,0 +1,46 @@
+server:
+  port: 8189
+  servlet:
+    context-path: /banckend
+  undertow:
+    #io-threads: 4
+    #worker-threads: 64
+    #设定堆外内存
+    direct-buffers: true
+    #设定buffer的大小.
+    buffer-size: 1024
+  compression:
+    #是否开启压缩,默认为false.
+    enabled: true
+    #执行压缩的阈值,默认为2048
+    min-response-size: 1
+
+spring:
+  profiles:
+    active: dev
+  jackson:
+    serialization:
+      INDENT_OUTPUT: true
+    date-format: yyyy-MM-dd HH:mm:ss
+    default-property-inclusion: non_null
+    time-zone: GMT+8
+  servlet:
+    multipart:
+      maxFileSize: "2MB"    #上传文件大小限制
+      maxRequestSize: "2MB"
+
+knife4j:
+  #markdowns: classpath:markdown/*
+  basic:
+    enable: true  #是否开启SwaggerApi页面访问验证
+    username: admin
+    password: ittimBackend
+
+jwtp:
+  store-type: 1   # 0是 redisTokenStore ,1是 jdbcTokenStore ,默认是0
+  path: /banckend/api  # 拦截路径,默认是/**
+  exclude-path: /doc.htm  # 排除拦截路径,默认无
+  max-token: 10   # 单个用户最大token数,默认-1不限制
+  url-perm-type: 0  # url自动对应权限方式,0 简易模式,1 RESTful模式
+  #find-permissions-sql: SELECT auth FROM user_auth WHERE user_id = ?  # 自定义查询用户权限的sql
+  #find-roles-sql: SELECT role_id FROM user_role WHERE user_id= ?  # 自定义查询用户角色的sql

+ 27 - 0
backend-admin/src/main/resources/banner.txt

@@ -0,0 +1,27 @@
+${AnsiColor.BRIGHT_YELLOW}
+////////////////////////////////////////////////////////////////////
+//                          _ooOoo_                               //
+//                         o8888888o                              //
+//                         88" . "88                              //
+//                         (| ^_^ |)                              //
+//                         O\  =  /O                              //
+//                      ____/`---'\____                           //
+//                    .'  \\|     |//  `.                         //
+//                   /  \\|||  :  |||//  \                        //
+//                  /  _||||| -:- |||||-  \                       //
+//                  |   | \\\  -  /// |   |                       //
+//                  | \_|  ''\---/''  |   |                       //
+//                  \  .-\__  `-`  ___/-. /                       //
+//                ___`. .'  /--.--\  `. . ___                     //
+//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
+//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
+//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
+//      ========`-.____`-.___\_____/___.-`____.-'========         //
+//                           `=---='                              //
+//             spring boot banner Dazer in tculture               //
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
+//                佛祖保佑       永不宕机     永无BUG                //
+////////////////////////////////////////////////////////////////////
+${AnsiColor.BRIGHT_RED}
+Application Version: ${application.version}${application.formatted-version}
+Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}

+ 79 - 0
backend-admin/src/main/resources/logback-spring.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <property name="FILE_ERROR_PATTERN"
+            value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %file:%line: %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+  <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
+	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>INFO</level>
+		</filter>
+		<encoder>
+			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
+			<charset>UTF-8</charset>
+		</encoder>
+	</appender>
+
+	<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!--如果只是想要 Info 级别的日志,只是过滤 info 还是会输出 Error 日志,因为 Error 的级别高, 所以我们使用下面的策略,可以避免输出 Error 的日志-->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<!--过滤 Error-->
+			<level>ERROR</level>
+			<!--匹配到就禁止-->
+			<onMatch>DENY</onMatch>
+			<!--没有匹配到就允许-->
+			<onMismatch>ACCEPT</onMismatch>
+		</filter>
+		<!--日志名称,如果没有File 属性,那么只会使用FileNamePattern的文件路径规则如果同时有<File>和<FileNamePattern>,那么当天日志是<File>,明天会自动把今天的日志改名为今天的日期。即,<File> 的日志都是当天的。-->
+		<!--<File>logs/info.spring-boot-demo-logback.log</File>-->
+		<!--滚动策略,按照时间滚动 TimeBasedRollingPolicy-->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间-->
+			<FileNamePattern>logs/spring-boot-demo-logback/info.created_on_%d{yyyy-MM-dd}.part_%i.log</FileNamePattern>
+			<!--只保留最近90天的日志-->
+			<maxHistory>30</maxHistory>
+			<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志-->
+			<!--<totalSizeCap>1GB</totalSizeCap>-->
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<!-- maxFileSize:这是活动文件的大小,默认值是10MB,本篇设置为1KB,只是为了演示 -->
+				<maxFileSize>200MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+		</rollingPolicy>
+		<!--<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">-->
+		<!--<maxFileSize>1KB</maxFileSize>-->
+		<!--</triggeringPolicy>-->
+		<encoder>
+			<pattern>${FILE_LOG_PATTERN}</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+	</appender>
+
+	<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!--如果只是想要 Error 级别的日志,那么需要过滤一下,默认是 info 级别的,ThresholdFilter-->
+		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+			<level>Error</level>
+		</filter>
+		<!--日志名称,如果没有File 属性,那么只会使用FileNamePattern的文件路径规则如果同时有<File>和<FileNamePattern>,那么当天日志是<File>,明天会自动把今天的日志改名为今天的日期。即,<File> 的日志都是当天的。-->
+		<!--<File>logs/error.spring-boot-demo-logback.log</File>-->
+		<!--滚动策略,按照时间滚动 TimeBasedRollingPolicy-->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间-->
+			<FileNamePattern>logs/spring-boot-demo-logback/error.created_on_%d{yyyy-MM-dd}.part_%i.log</FileNamePattern>
+			<!--只保留最近90天的日志-->
+			<maxHistory>30</maxHistory>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<!-- maxFileSize:这是活动文件的大小,默认值是10MB,本篇设置为1KB,只是为了演示 -->
+				<maxFileSize>200MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+		</rollingPolicy>
+		<encoder>
+			<pattern>${FILE_ERROR_PATTERN}</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+	</appender>
+
+	<root level="info">
+		<appender-ref ref="CONSOLE"/>
+		<appender-ref ref="FILE_INFO"/>
+		<appender-ref ref="FILE_ERROR"/>
+	</root>
+</configuration>

+ 68 - 0
backend-admin/src/main/resources/mappers/OauthTokenKeyMapper.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.OauthTokenKeyMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.OauthTokenKey">
+        <!--@mbg.generated-->
+        <!--@Table oauth_token_key-->
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="token_key" jdbcType="VARCHAR" property="tokenKey"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id, token_key, create_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update oauth_token_key
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="token_key = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.tokenKey,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update oauth_token_key
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="token_key = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.tokenKey != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.tokenKey,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into oauth_token_key
+                (token_key, create_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.tokenKey,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 166 - 0
backend-admin/src/main/resources/mappers/OauthTokenMapper.xml

@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.OauthTokenMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.OauthToken">
+        <!--@mbg.generated-->
+        <!--@Table oauth_token-->
+        <id column="token_id" jdbcType="INTEGER" property="tokenId"/>
+        <result column="user_id" jdbcType="VARCHAR" property="userId"/>
+        <result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
+        <result column="refresh_token" jdbcType="VARCHAR" property="refreshToken"/>
+        <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/>
+        <result column="refresh_token_expire_time" jdbcType="TIMESTAMP" property="refreshTokenExpireTime"/>
+        <result column="roles" jdbcType="VARCHAR" property="roles"/>
+        <result column="permissions" jdbcType="VARCHAR" property="permissions"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        token_id, user_id, access_token, refresh_token, expire_time, refresh_token_expire_time,
+        roles, permissions, create_time, update_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update oauth_token
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="user_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.userId,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="access_token = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.accessToken,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="refresh_token = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshToken,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="expire_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.expireTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+            <trim prefix="refresh_token_expire_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshTokenExpireTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+            <trim prefix="roles = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.roles,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="permissions = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.permissions,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where token_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.tokenId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update oauth_token
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="user_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.userId != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.userId,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="access_token = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.accessToken != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.accessToken,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="refresh_token = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.refreshToken != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshToken,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="expire_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.expireTime != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.expireTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="refresh_token_expire_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.refreshTokenExpireTime != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.refreshTokenExpireTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="roles = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.roles != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.roles,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="permissions = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.permissions != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.permissions,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.updateTime != null">
+                        when token_id = #{item.tokenId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where token_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.tokenId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" keyColumn="token_id" keyProperty="tokenId" parameterType="map" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into oauth_token
+                (user_id, access_token, refresh_token, expire_time, refresh_token_expire_time, roles,
+                 permissions, create_time, update_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.userId,jdbcType=VARCHAR}, #{item.accessToken,jdbcType=VARCHAR},
+             #{item.refreshToken,jdbcType=VARCHAR},
+             #{item.expireTime,jdbcType=TIMESTAMP}, #{item.refreshTokenExpireTime,jdbcType=TIMESTAMP},
+             #{item.roles,jdbcType=VARCHAR}, #{item.permissions,jdbcType=VARCHAR},
+             #{item.createTime,jdbcType=TIMESTAMP},
+             #{item.updateTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 109 - 0
backend-admin/src/main/resources/mappers/PersonMapper.xml

@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.PersonMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.Person">
+        <!--@mbg.generated-->
+        <!--@Table cnd_person-->
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="person_name" jdbcType="VARCHAR" property="personName"/>
+        <result column="person_age" jdbcType="INTEGER" property="personAge"/>
+        <result column="person_phone" jdbcType="BIGINT" property="personPhone"/>
+        <result column="person_address" jdbcType="VARCHAR" property="personAddress"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id, person_name, person_age, person_phone, person_address, create_time, update_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update cnd_person
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="person_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.personName,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="person_age = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.personAge,jdbcType=INTEGER}
+                </foreach>
+            </trim>
+            <trim prefix="person_phone = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.personPhone,jdbcType=BIGINT}
+                </foreach>
+            </trim>
+            <trim prefix="person_address = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.personAddress,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into cnd_person
+                (person_name, person_age, person_phone, person_address, create_time, update_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.personName,jdbcType=VARCHAR}, #{item.personAge,jdbcType=INTEGER},
+             #{item.personPhone,jdbcType=BIGINT},
+             #{item.personAddress,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
+             #{item.updateTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+
+    <!--auto generated by MybatisCodeHelper on 2020-09-28-->
+    <select id="selectOrderByCreateTime" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from cnd_person
+        order by create_time asc
+    </select>
+
+    <!--auto generated by MybatisCodeHelper on 2020-09-28-->
+    <select id="selectByAll" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from cnd_person
+        <where>
+            <if test="person.id != null">
+                and id = #{person.id,jdbcType=INTEGER}
+            </if>
+            <if test="person.personName != null">
+                and person_name = #{person.personName,jdbcType=VARCHAR}
+            </if>
+            <if test="person.personAge != null">
+                and person_age = #{person.personAge,jdbcType=INTEGER}
+            </if>
+            <if test="person.personPhone != null">
+                and person_phone = #{person.personPhone,jdbcType=BIGINT}
+            </if>
+            <if test="person.personAddress != null">
+                and person_address = #{person.personAddress,jdbcType=VARCHAR}
+            </if>
+            <if test="person.createTime != null">
+                and create_time = #{person.createTime,jdbcType=TIMESTAMP}
+            </if>
+            <if test="person.updateTime != null">
+                and update_time = #{person.updateTime,jdbcType=TIMESTAMP}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 108 - 0
backend-admin/src/main/resources/mappers/SysAuthoritiesMapper.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.SysAuthoritiesMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysAuthorities">
+        <!--@mbg.generated-->
+        <!--@Table sys_authorities-->
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="authority" jdbcType="VARCHAR" property="authority"/>
+        <result column="authority_name" jdbcType="VARCHAR" property="authorityName"/>
+        <result column="parent_name" jdbcType="VARCHAR" property="parentName"/>
+        <result column="sort" jdbcType="INTEGER" property="sort"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id, authority, authority_name, parent_name, sort, create_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_authorities
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="authority = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="authority_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.authorityName,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="parent_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.parentName,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="sort = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.sort,jdbcType=INTEGER}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_authorities
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="authority = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.authority != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="authority_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.authorityName != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.authorityName,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="parent_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.parentName != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.parentName,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="sort = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.sort != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.sort,jdbcType=INTEGER}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" parameterType="map">
+        <!--@mbg.generated-->
+        insert into sys_authorities
+                (id, authority, authority_name, parent_name, sort, create_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.id,jdbcType=INTEGER}, #{item.authority,jdbcType=VARCHAR}, #{item.authorityName,jdbcType=VARCHAR},
+             #{item.parentName,jdbcType=VARCHAR}, #{item.sort,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 150 - 0
backend-admin/src/main/resources/mappers/SysMenuMapper.xml

@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.SysMenuMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysMenu">
+        <!--@mbg.generated-->
+        <!--@Table sys_menu-->
+        <id column="menu_id" jdbcType="INTEGER" property="menuId"/>
+        <result column="parent_id" jdbcType="INTEGER" property="parentId"/>
+        <result column="menu_name" jdbcType="VARCHAR" property="menuName"/>
+        <result column="menu_url" jdbcType="VARCHAR" property="menuUrl"/>
+        <result column="menu_icon" jdbcType="VARCHAR" property="menuIcon"/>
+        <result column="sort_number" jdbcType="VARCHAR" property="sortNumber"/>
+        <result column="authority" jdbcType="VARCHAR" property="authority"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        menu_id, parent_id, menu_name, menu_url, menu_icon, sort_number, authority, create_time,
+        update_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_menu
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="parent_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.parentId,jdbcType=INTEGER}
+                </foreach>
+            </trim>
+            <trim prefix="menu_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuName,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="menu_url = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuUrl,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="menu_icon = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuIcon,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="sort_number = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.sortNumber,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="authority = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where menu_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.menuId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_menu
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="parent_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.parentId != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.parentId,jdbcType=INTEGER}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="menu_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.menuName != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuName,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="menu_url = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.menuUrl != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuUrl,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="menu_icon = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.menuIcon != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.menuIcon,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="sort_number = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.sortNumber != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.sortNumber,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="authority = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.authority != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.updateTime != null">
+                        when menu_id = #{item.menuId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where menu_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.menuId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" keyColumn="menu_id" keyProperty="menuId" parameterType="map" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into sys_menu
+                (parent_id, menu_name, menu_url, menu_icon, sort_number, authority, create_time,
+                 update_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.parentId,jdbcType=INTEGER}, #{item.menuName,jdbcType=VARCHAR}, #{item.menuUrl,jdbcType=VARCHAR},
+             #{item.menuIcon,jdbcType=VARCHAR}, #{item.sortNumber,jdbcType=VARCHAR}, #{item.authority,jdbcType=VARCHAR},
+             #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 81 - 0
backend-admin/src/main/resources/mappers/SysRoleAuthoritiesMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.SysRoleAuthoritiesMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysRoleAuthorities">
+        <!--@mbg.generated-->
+        <!--@Table sys_role_authorities-->
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="role_id" jdbcType="INTEGER" property="roleId"/>
+        <result column="authority" jdbcType="VARCHAR" property="authority"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id, role_id, authority, create_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_role_authorities
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="role_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
+                </foreach>
+            </trim>
+            <trim prefix="authority = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_role_authorities
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="role_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.roleId != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="authority = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.authority != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.authority,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into sys_role_authorities
+                (role_id, authority, create_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.roleId,jdbcType=INTEGER}, #{item.authority,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 96 - 0
backend-admin/src/main/resources/mappers/SysRoleMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.SysRoleMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysRole">
+        <!--@mbg.generated-->
+        <!--@Table sys_role-->
+        <id column="role_id" jdbcType="INTEGER" property="roleId"/>
+        <result column="role_name" jdbcType="VARCHAR" property="roleName"/>
+        <result column="comments" jdbcType="VARCHAR" property="comments"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        role_id, role_name, comments, create_time, update_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_role
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="role_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.roleName,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="comments = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.comments,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where role_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.roleId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_role
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="role_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.roleName != null">
+                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.roleName,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="comments = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.comments != null">
+                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.comments,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.updateTime != null">
+                        when role_id = #{item.roleId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where role_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.roleId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" keyColumn="role_id" keyProperty="roleId" parameterType="map" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into sys_role
+                (role_name, comments, create_time, update_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.roleName,jdbcType=VARCHAR}, #{item.comments,jdbcType=VARCHAR},
+             #{item.createTime,jdbcType=TIMESTAMP},
+             #{item.updateTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 135 - 0
backend-admin/src/main/resources/mappers/SysUserMapper.xml

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.SysUserMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysUser">
+        <!--@mbg.generated-->
+        <!--@Table sys_user-->
+        <id column="user_id" jdbcType="INTEGER" property="userId"/>
+        <result column="username" jdbcType="VARCHAR" property="username"/>
+        <result column="password" jdbcType="VARCHAR" property="password"/>
+        <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
+        <result column="sex" jdbcType="VARCHAR" property="sex"/>
+        <result column="state" jdbcType="INTEGER" property="state"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        user_id, username, `password`, nick_name, sex, `state`, create_time, update_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_user
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="username = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.username,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="`password` = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.password,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="nick_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.nickName,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="sex = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.sex,jdbcType=VARCHAR}
+                </foreach>
+            </trim>
+            <trim prefix="`state` = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.state,jdbcType=INTEGER}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when user_id = #{item.userId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where user_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.userId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_user
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="username = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.username != null">
+                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.username,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="`password` = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.password != null">
+                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.password,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="nick_name = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.nickName != null">
+                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.nickName,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="sex = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.sex != null">
+                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.sex,jdbcType=VARCHAR}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="`state` = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.state != null">
+                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.state,jdbcType=INTEGER}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="update_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.updateTime != null">
+                        when user_id = #{item.userId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where user_id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.userId,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" keyColumn="user_id" keyProperty="userId" parameterType="map" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into sys_user
+                (username, `password`, nick_name, sex, `state`, create_time, update_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.username,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}, #{item.nickName,jdbcType=VARCHAR},
+             #{item.sex,jdbcType=VARCHAR}, #{item.state,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
+             #{item.updateTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 82 - 0
backend-admin/src/main/resources/mappers/SysUserRoleMapper.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ittim.admin.mapper.SysUserRoleMapper">
+    <resultMap id="BaseResultMap" type="com.ittim.admin.entity.SysUserRole">
+        <!--@mbg.generated-->
+        <!--@Table sys_user_role-->
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="user_id" jdbcType="INTEGER" property="userId"/>
+        <result column="role_id" jdbcType="INTEGER" property="roleId"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id, user_id, role_id, create_time
+    </sql>
+    <update id="updateBatch" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_user_role
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="user_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.userId,jdbcType=INTEGER}
+                </foreach>
+            </trim>
+            <trim prefix="role_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <update id="updateBatchSelective" parameterType="java.util.List">
+        <!--@mbg.generated-->
+        update sys_user_role
+        <trim prefix="set" suffixOverrides=",">
+            <trim prefix="user_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.userId != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.userId,jdbcType=INTEGER}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="role_id = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.roleId != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.roleId,jdbcType=INTEGER}
+                    </if>
+                </foreach>
+            </trim>
+            <trim prefix="create_time = case" suffix="end,">
+                <foreach collection="list" index="index" item="item">
+                    <if test="item.createTime != null">
+                        when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
+                    </if>
+                </foreach>
+            </trim>
+        </trim>
+        where id in
+        <foreach close=")" collection="list" item="item" open="(" separator=", ">
+            #{item.id,jdbcType=INTEGER}
+        </foreach>
+    </update>
+    <insert id="batchInsert" parameterType="map">
+        <!--@mbg.generated-->
+        insert into sys_user_role
+                (id, user_id, role_id, create_time)
+                values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.id,jdbcType=INTEGER}, #{item.userId,jdbcType=INTEGER}, #{item.roleId,jdbcType=INTEGER},
+             #{item.createTime,jdbcType=TIMESTAMP})
+        </foreach>
+    </insert>
+</mapper>

+ 27 - 0
backend-common/pom.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>backend</artifactId>
+        <groupId>com.ittim</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>backend-common</artifactId>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
+
+</project>

+ 27 - 0
backend-common/src/main/java/com/ittim/common/bean/PageRequest.java

@@ -0,0 +1,27 @@
+package com.ittim.common.bean;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+
+/**
+ * @author zzj
+ * @Description 分页请求参数
+ * @date 2020/9/17
+ */
+@Builder
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class PageRequest {
+
+    @ApiModelProperty(value = "当前页")
+    private Integer page = 1;
+
+    @ApiModelProperty(value = "每页条数")
+    private Integer pageSize = 10;
+
+}

+ 22 - 0
backend-common/src/main/java/com/ittim/common/bean/RedisKeys.java

@@ -0,0 +1,22 @@
+package com.ittim.common.bean;
+
+import java.util.UUID;
+
+/**
+ * @author zzj
+ * @Description Redis所有Keys
+ * @date 2020/9/26
+ */
+public class RedisKeys {
+
+    /**
+     * 测试Key
+     */
+    public static String TEST_KEY = "test";
+
+    /**
+     * 验证码
+     */
+    public static String CAPTCHA_KEY = "auth:captcha:" + UUID.randomUUID().toString();
+
+}

+ 142 - 0
backend-common/src/main/java/com/ittim/common/enums/Status.java

@@ -0,0 +1,142 @@
+package com.ittim.common.enums;
+
+import com.baomidou.mybatisplus.extension.api.IErrorCode;
+import lombok.Getter;
+
+/**
+ * @author zzj
+ * @Description 通用状态码
+ * @date 2020/9/26
+ */
+@Getter
+public enum Status implements IErrorCode {
+    /**
+     * 操作成功!
+     */
+    SUCCESS(200, "操作成功!"),
+
+    /**
+     * 失败
+     */
+    FAILED(500, "操作失败"),
+
+    /**
+     * 操作异常!
+     */
+    ERROR(500, "操作异常!"),
+
+    /**
+     * 退出成功!
+     */
+    LOGIN(200, "登录成功!"),
+
+    /**
+     * 退出成功!
+     */
+    LOGOUT(200, "退出成功!"),
+
+    /**
+     * 请先登录!
+     */
+    UNAUTHORIZED(401, "请先登录!"),
+
+    /**
+     * 暂无权限访问!
+     */
+    ACCESS_DENIED(403, "权限不足!"),
+
+    /**
+     * 请求不存在!
+     */
+    REQUEST_NOT_FOUND(404, "请求不存在!"),
+
+    /**
+     * 请求方式不支持!
+     */
+    HTTP_BAD_METHOD(405, "请求方式不支持!"),
+
+    /**
+     * 请求异常!
+     */
+    BAD_REQUEST(400, "请求异常!"),
+
+    /**
+     * 参数不匹配!
+     */
+    PARAM_NOT_MATCH(400, "参数不匹配!"),
+
+    /**
+     * 参数不能为空!
+     */
+    PARAM_NOT_NULL(400, "参数不能为空!"),
+
+    /**
+     * 当前用户已被锁定,请联系管理员解锁!
+     */
+    USER_DISABLED(403, "当前用户已被锁定,请联系管理员解锁!"),
+
+    /**
+     * 用户名或密码错误!
+     */
+    USERNAME_PASSWORD_ERROR(5001, "用户名或密码错误!"),
+
+    /**
+     * token 已过期,请重新登录!
+     */
+    TOKEN_EXPIRED(5002, "token 已过期,请重新登录!"),
+
+    /**
+     * token 解析失败,请尝试重新登录!
+     */
+    TOKEN_PARSE_ERROR(5002, "token 解析失败,请尝试重新登录!"),
+
+    /**
+     * 当前用户已在别处登录,请尝试更改密码或重新登录!
+     */
+    TOKEN_OUT_OF_CTRL(5003, "当前用户已在别处登录,请尝试更改密码或重新登录!"),
+
+    /**
+     * 无法手动踢出自己,请尝试退出登录操作!
+     */
+    KICKOUT_SELF(5004, "无法手动踢出自己,请尝试退出登录操作!"),
+
+    /**
+     * 当前用户已在别处登录,请尝试更改密码或重新登录!
+     */
+    CAPTCHA_INCORRECT(5005, "验证码不正确!");
+
+    private final long code;
+
+    private final String msg;
+
+    Status(final long code, final String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public static Status fromCode(long code) {
+        Status[] ecs = Status.values();
+        for (Status ec : ecs) {
+            if (ec.getCode() == code) {
+                return ec;
+            }
+        }
+        return SUCCESS;
+    }
+
+    @Override
+    public long getCode() {
+        return code;
+    }
+
+    @Override
+    public String getMsg() {
+        return msg;
+    }
+
+    @Override
+    public String toString() {
+        return String.format(" ErrorCode:{code=%s, msg=%s} ", code, msg);
+    }
+
+}

+ 52 - 0
backend-common/src/main/java/com/ittim/common/util/SpringContextUtil.java

@@ -0,0 +1,52 @@
+package com.ittim.common.util;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author zzj
+ * @Description 获取Spring上下文
+ * @date 2020/9/26
+ */
+@Component
+public class SpringContextUtil implements ApplicationContextAware {
+    /**
+     * 上下文对象实例
+     */
+    private static ApplicationContext applicationContext;
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+        this.applicationContext = applicationContext;
+    }
+
+    /**
+     * 获取applicationContext
+     */
+    public static ApplicationContext getApplicationContext() {
+        return applicationContext;
+    }
+
+    /**
+     * 通过name获取 Bean.
+     */
+    public static Object getBean(String name) {
+        return getApplicationContext().getBean(name);
+    }
+
+    /**
+     * 通过class获取Bean.
+     */
+    public static <T> T getBean(Class<T> clazz) {
+        return getApplicationContext().getBean(clazz);
+    }
+
+    /**
+     * 通过name,以及Clazz返回指定的Bean
+     */
+    public static <T> T getBean(String name, Class<T> clazz) {
+        return getApplicationContext().getBean(name, clazz);
+    }
+}

+ 190 - 0
pom.xml

@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
+    <modules>
+        <module>backend-admin</module>
+        <module>backend-common</module>
+    </modules>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.3.RELEASE</version>
+        <relativePath/>
+    </parent>
+    <groupId>com.ittim</groupId>
+    <artifactId>backend</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>IttimBackend</name>
+    <description>Spring Boot backend framework for Ittim</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <jedis.version>2.9.0</jedis.version>
+        <mysql.version>8.0.21</mysql.version>
+        <hutool.version>5.4.1</hutool.version>
+        <guava.version>29.0-jre</guava.version>
+        <com.google.gson>2.8.3</com.google.gson>
+        <alibaba.fastjson>1.2.72</alibaba.fastjson>
+        <springfox.swagger>2.9.2</springfox.swagger>
+        <user.agent.version>1.20</user.agent.version>
+        <mybatis.plus.version>3.1.0</mybatis.plus.version>
+        <jakarta.validation.version>2.0.1</jakarta.validation.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <!-- 对象池,使用redis时必须引入 -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.kafka</groupId>
+            <artifactId>spring-kafka</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.junit.vintage</groupId>
+                    <artifactId>junit-vintage-engine</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.kafka</groupId>
+            <artifactId>spring-kafka-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.security</groupId>-->
+<!--            <artifactId>spring-security-test</artifactId>-->
+<!--            <scope>test</scope>-->
+<!--        </dependency>-->
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.version}</version>
+        </dependency>
+        <!-- hutool工具类 -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+        <!-- guava工具类 -->
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>${guava.version}</version>
+        </dependency>
+        <!-- 解析 UserAgent 信息 -->
+        <dependency>
+            <groupId>eu.bitwalker</groupId>
+            <artifactId>UserAgentUtils</artifactId>
+            <version>${user.agent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>jakarta.validation</groupId>
+            <artifactId>jakarta.validation-api</artifactId>
+            <version>${jakarta.validation.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+            <version>2.1.5.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis.plus.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.whvcse</groupId>
+            <artifactId>jwtp-spring-boot-starter</artifactId>
+            <version>3.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>redis.clients</groupId>
+            <artifactId>jedis</artifactId>
+            <version>${jedis.version}</version>
+        </dependency>
+        <!--fastjson-->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${alibaba.fastjson}</version>
+        </dependency>
+        <!--gson-->
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${com.google.gson}</version>
+        </dependency>
+        <!-- swagger -->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${springfox.swagger}</version>
+        </dependency>
+        <!-- swagger-ui -->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+            <!--在引用时请在maven中央仓库搜索最新版本号-->
+            <version>2.0.2</version>
+        </dependency>
+    </dependencies>
+
+    <!-- 阿里云maven仓库 -->
+    <repositories>
+        <repository>
+            <id>public</id>
+            <name>aliyun nexus</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+        </repository>
+    </repositories>
+    <pluginRepositories>
+        <pluginRepository>
+            <id>public</id>
+            <name>aliyun nexus</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+</project>