"...src/git@ustchcs.com:gujinli1118/springboot-plus.git" did not exist on "22b5a11db353efb40f5819f4f3072996888a0440"
Commit 4e39694e authored by zhengjie's avatar zhengjie
Browse files

v1.6 版本发布 ,详情查看版本说明

parent f63407fd
...@@ -109,7 +109,7 @@ eladmin-qt和eladmin-qd只是命名方式的区别,无其他区别 ...@@ -109,7 +109,7 @@ eladmin-qt和eladmin-qd只是命名方式的区别,无其他区别
<td><img src="https://i.loli.net/2018/12/22/5c1e10c7890ab.png"/></td> <td><img src="https://i.loli.net/2018/12/22/5c1e10c7890ab.png"/></td>
</tr> </tr>
<tr> <tr>
<td><img src="https://i.loli.net/2018/12/22/5c1e10c782a05.png"/></td> <td><img src="https://i.loli.net/2019/02/28/5c7795b707347.png"/></td>
<td><img src="https://i.loli.net/2018/12/22/5c1e10c7b089b.png"/></td> <td><img src="https://i.loli.net/2018/12/22/5c1e10c7b089b.png"/></td>
</tr> </tr>
<tr> <tr>
......
...@@ -7,10 +7,10 @@ import me.zhengjie.exception.EntityNotFoundException; ...@@ -7,10 +7,10 @@ import me.zhengjie.exception.EntityNotFoundException;
import me.zhengjie.utils.ThrowableUtil; import me.zhengjie.utils.ThrowableUtil;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.bind.annotation.RestControllerAdvice;
import java.nio.file.AccessDeniedException;
import static org.springframework.http.HttpStatus.*; import static org.springframework.http.HttpStatus.*;
/** /**
......
...@@ -94,10 +94,9 @@ public class RedisConfig extends CachingConfigurerSupport { ...@@ -94,10 +94,9 @@ public class RedisConfig extends CachingConfigurerSupport {
// 全局开启AutoType,不建议使用 // 全局开启AutoType,不建议使用
// ParserConfig.getGlobalInstance().setAutoTypeSupport(true); // ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
// 建议使用这种方式,小范围指定白名单 // 建议使用这种方式,小范围指定白名单
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.domain");
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.system.service.dto"); ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.system.service.dto");
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.test.service.dto");
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.system.domain"); ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.system.domain");
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.domain");
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.quartz.domain"); ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.quartz.domain");
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.monitor.domain"); ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.monitor.domain");
ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.security.security"); ParserConfig.getGlobalInstance().addAccept("me.zhengjie.modules.security.security");
......
...@@ -2,7 +2,6 @@ package me.zhengjie.swagger2; ...@@ -2,7 +2,6 @@ package me.zhengjie.swagger2;
import com.google.common.base.Predicates; import com.google.common.base.Predicates;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder; import springfox.documentation.builders.ParameterBuilder;
...@@ -13,25 +12,17 @@ import springfox.documentation.service.Parameter; ...@@ -13,25 +12,17 @@ import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* api页面 /swagger-ui.html * api页面 /swagger-ui.html
* 如controller在不同的包中,@ComponentScan(basePackages = {"me.aurora.app.rest","..."})
* @author jie * @author jie
* @date 2018-11-23 * @date 2018-11-23
*/ */
@Configuration @Configuration
@EnableSwagger2 @EnableSwagger2
@ComponentScan(basePackages = {
"me.zhengjie.rest",
"me.zhengjie.modules.system.rest",
"me.zhengjie.modules.monitor.rest",
"me.zhengjie.modules.monitor.rest",
"me.zhengjie.modules.quartz.rest"})
public class SwaggerConfig { public class SwaggerConfig {
@Bean @Bean
......
package me.zhengjie.utils; package me.zhengjie.utils;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.SecretKey; import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory; import javax.crypto.SecretKeyFactory;
......
...@@ -2,7 +2,6 @@ package me.zhengjie.utils; ...@@ -2,7 +2,6 @@ package me.zhengjie.utils;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.DecimalFormat; import java.text.DecimalFormat;
......
package me.zhengjie.utils;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* List按照指定字段排序工具类
* @author jie
* @date 2018/08/23 20:03:12
* @param <T>
*/
public class ListSortUtil<T> {
/**
* @param targetList 目标排序List
* @param sortField 排序字段(实体类属性名)
* @param sortMode 排序方式(asc or desc)
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public void sort(List<T> targetList, final String sortField, final String sortMode) {
Collections.sort(targetList, new Comparator() {
@Override
public int compare(Object obj1, Object obj2) {
int retVal = 0;
try {
//首字母转大写
String newStr=sortField.substring(0, 1).toUpperCase()+sortField.replaceFirst("\\w","");
String methodStr="get"+newStr;
Method method1 = ((T)obj1).getClass().getMethod(methodStr, new Class[0]);
Method method2 = ((T)obj2).getClass().getMethod(methodStr, new Class[0]);
if (sortMode != null && "desc".equals(sortMode)) {
// 倒序
retVal = method2.invoke(((T) obj2), new Object[0]).toString().compareTo(method1.invoke(((T) obj1), new Object[0]).toString());
} else {
// 正序
retVal = method1.invoke(((T) obj1), new Object[0]).toString().compareTo(method2.invoke(((T) obj2), new Object[0]).toString());
}
} catch (Exception e) {
throw new RuntimeException();
}
return retVal;
}
});
}
}
\ No newline at end of file
...@@ -21,6 +21,12 @@ ...@@ -21,6 +21,12 @@
<groupId>me.zhengjie</groupId> <groupId>me.zhengjie</groupId>
<artifactId>eladmin-generator</artifactId> <artifactId>eladmin-generator</artifactId>
<version>1.5</version> <version>1.5</version>
<exclusions>
<exclusion>
<groupId>me.zhengjie</groupId>
<artifactId>eladmin-common</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
......
/* /*
Navicat MySQL Data Transfer Navicat Premium Data Transfer
Source Server : 本地 Source Server : localhost
Source Server Type : MySQL Source Server Type : MySQL
Source Server Version : 50559 Source Server Version : 50562
Source Host : localhost:3306 Source Host : localhost:3306
Source Schema : eladmin Source Schema : eladmin
Target Server Type : MySQL Target Server Type : MySQL
Target Server Version : 50559 Target Server Version : 50562
File Encoding : 65001 File Encoding : 65001
Date: 20/01/2019 19:17:08 Date: 27/02/2019 13:15:23
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
...@@ -39,7 +39,7 @@ CREATE TABLE `alipay_config` ( ...@@ -39,7 +39,7 @@ CREATE TABLE `alipay_config` (
-- ---------------------------- -- ----------------------------
-- Records of alipay_config -- Records of alipay_config
-- ---------------------------- -- ----------------------------
INSERT INTO `alipay_config` VALUES (1, '2016091700532697', 'utf-8', 'JSON', 'https://openapi.alipaydev.com/gateway.do', 'http://api.auauz.net/api/aliPay/notify', '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', 'http://api.auauz.ne/api/aliPay/return', 'RSA2', '2088102176044281'); INSERT INTO `alipay_config` VALUES (1, '2016091700532697', 'utf-8', 'JSON', 'https://openapi.alipaydev.com/gateway.do', 'http://api.auauz.net/api/aliPay/notify', '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', 'http://api.auauz.net/api/aliPay/return', 'RSA2', '2088102176044281');
-- ---------------------------- -- ----------------------------
-- Table structure for email_config -- Table structure for email_config
...@@ -73,25 +73,7 @@ CREATE TABLE `gen_config` ( ...@@ -73,25 +73,7 @@ CREATE TABLE `gen_config` (
-- ---------------------------- -- ----------------------------
-- Records of gen_config -- Records of gen_config
-- ---------------------------- -- ----------------------------
INSERT INTO `gen_config` VALUES (1, 'jie', b'0', 'eladmin-system', 'me.zhengjie.modules.test', 'E:\\workspace\\my-workspace\\eladmin-qt\\src\\views\\system\\test', 'E:\\workspace\\my-workspace\\eladmin-qt\\src\\api'); INSERT INTO `gen_config` VALUES (1, 'jie', '0', 'eladmin-system', 'me.zhengjie.modules.test', 'E:\\workspace\\my-workspace\\eladmin-qt\\src\\views\\system\\test', 'E:\\workspace\\my-workspace\\eladmin-qt\\src\\api');
-- ----------------------------
-- Table structure for log
-- ----------------------------
DROP TABLE IF EXISTS `log`;
CREATE TABLE `log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '描述',
`exception_detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '异常详情',
`log_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日志类型',
`method` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方法名称',
`params` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '参数',
`request_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '请求ip',
`time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '耗时',
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作用户',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6327 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Table structure for menu -- Table structure for menu
...@@ -100,121 +82,46 @@ DROP TABLE IF EXISTS `menu`; ...@@ -100,121 +82,46 @@ DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` ( CREATE TABLE `menu` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
`i_frame` bit(1) NULL DEFAULT NULL COMMENT '是否外链',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称', `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单名称',
`component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件', `component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件',
`pid` bigint(20) NOT NULL COMMENT '上级菜单ID', `pid` bigint(20) NOT NULL COMMENT '上级菜单ID',
`sort` bigint(20) NOT NULL COMMENT '排序', `sort` bigint(20) NOT NULL COMMENT '排序',
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标', `icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
`path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接地址', `path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接地址',
`i_frame` bit(1) NULL DEFAULT NULL COMMENT '是否外链',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 36 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; ) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Records of menu -- Records of menu
-- ---------------------------- -- ----------------------------
INSERT INTO `menu` VALUES (1, '2018-12-18 15:11:29', '系统管理', NULL, 0, 1, 'system', 'system', b'0'); INSERT INTO `menu` VALUES (1, '2018-12-18 15:11:29', b'0', '系统管理', NULL, 0, 1, 'system', 'system');
INSERT INTO `menu` VALUES (2, '2018-12-18 15:14:44', '用户管理', 'system/user/index', 1, 2, 'peoples', 'user', b'0'); INSERT INTO `menu` VALUES (2, '2018-12-18 15:14:44', b'0', '用户管理', 'system/user/index', 1, 2, 'peoples', 'user');
INSERT INTO `menu` VALUES (3, '2018-12-18 15:16:07', '角色管理', 'system/role/index', 1, 3, 'role', 'role', b'0'); INSERT INTO `menu` VALUES (3, '2018-12-18 15:16:07', b'0', '角色管理', 'system/role/index', 1, 3, 'role', 'role');
INSERT INTO `menu` VALUES (4, '2018-12-18 15:16:45', '权限管理', 'system/permission/index', 1, 4, 'permission', 'permission', b'0'); INSERT INTO `menu` VALUES (4, '2018-12-18 15:16:45', b'0', '权限管理', 'system/permission/index', 1, 4, 'permission', 'permission');
INSERT INTO `menu` VALUES (5, '2018-12-18 15:17:28', '菜单管理', 'system/menu/index', 1, 5, 'menu', 'menu', b'0'); INSERT INTO `menu` VALUES (5, '2018-12-18 15:17:28', b'0', '菜单管理', 'system/menu/index', 1, 5, 'menu', 'menu');
INSERT INTO `menu` VALUES (6, '2018-12-18 15:17:48', '系统监控', NULL, 0, 10, 'monitor', 'monitor', b'0'); INSERT INTO `menu` VALUES (6, '2018-12-18 15:17:48', b'0', '系统监控', NULL, 0, 10, 'monitor', 'monitor');
INSERT INTO `menu` VALUES (7, '2018-12-18 15:18:26', '操作日志', 'monitor/log/index', 6, 11, 'log', 'logs', b'0'); INSERT INTO `menu` VALUES (7, '2018-12-18 15:18:26', b'0', '操作日志', 'monitor/log/index', 6, 11, 'log', 'logs');
INSERT INTO `menu` VALUES (8, '2018-12-18 15:19:01', '系统缓存', 'monitor/redis/index', 6, 13, 'redis', 'redis', b'0'); INSERT INTO `menu` VALUES (8, '2018-12-18 15:19:01', b'0', '系统缓存', 'monitor/redis/index', 6, 13, 'redis', 'redis');
INSERT INTO `menu` VALUES (9, '2018-12-18 15:19:34', 'SQL监控', NULL, 6, 14, 'sqlMonitor', 'http://localhost:8000/druid', b'1'); INSERT INTO `menu` VALUES (9, '2018-12-18 15:19:34', b'1', 'SQL监控', NULL, 6, 14, 'sqlMonitor', 'http://api.auauz.net/druid');
INSERT INTO `menu` VALUES (10, '2018-12-19 13:38:16', '组件管理', NULL, 0, 50, 'zujian', 'components', b'0'); INSERT INTO `menu` VALUES (10, '2018-12-19 13:38:16', b'0', '组件管理', NULL, 0, 50, 'zujian', 'components');
INSERT INTO `menu` VALUES (11, '2018-12-19 13:38:49', '图标库', 'components/IconSelect', 10, 51, 'icon', 'icon', b'0'); INSERT INTO `menu` VALUES (11, '2018-12-19 13:38:49', b'0', '图标库', 'components/IconSelect', 10, 51, 'icon', 'icon');
INSERT INTO `menu` VALUES (12, '2018-12-24 20:37:35', '实时控制台', 'monitor/log/msg', 6, 15, 'codeConsole', 'msg', b'0'); INSERT INTO `menu` VALUES (12, '2018-12-24 20:37:35', b'0', '实时控制台', 'monitor/log/msg', 6, 15, 'codeConsole', 'msg');
INSERT INTO `menu` VALUES (13, '2018-12-27 10:11:26', '三方工具', '', 0, 30, 'tools', 'tools', b'0'); INSERT INTO `menu` VALUES (13, '2018-12-27 10:11:26', b'0', '三方工具', '', 0, 30, 'tools', 'tools');
INSERT INTO `menu` VALUES (14, '2018-12-27 10:13:09', '邮件工具', 'tools/email/index', 13, 31, 'email', 'email', b'0'); INSERT INTO `menu` VALUES (14, '2018-12-27 10:13:09', b'0', '邮件工具', 'tools/email/index', 13, 31, 'email', 'email');
INSERT INTO `menu` VALUES (15, '2018-12-27 11:58:25', '富文本', 'components/Editor', 10, 52, 'fwb', 'tinymce', b'0'); INSERT INTO `menu` VALUES (15, '2018-12-27 11:58:25', b'0', '富文本', 'components/Editor', 10, 52, 'fwb', 'tinymce');
INSERT INTO `menu` VALUES (16, '2018-12-28 09:36:53', 'SM.MS图床', 'tools/picture/index', 13, 32, 'image', 'pictures', b'0'); INSERT INTO `menu` VALUES (16, '2018-12-28 09:36:53', b'0', 'SM.MS图床', 'tools/picture/index', 13, 32, 'image', 'pictures');
INSERT INTO `menu` VALUES (17, '2018-12-28 15:09:49', '项目地址', '', 0, 0, 'github', 'https://github.com/elunez/eladmin', b'1'); INSERT INTO `menu` VALUES (17, '2018-12-28 15:09:49', b'1', '项目地址', '', 0, 0, 'github', 'https://github.com/elunez/eladmin');
INSERT INTO `menu` VALUES (18, '2018-12-31 11:12:15', '七牛云存储', 'tools/qiniu/index', 13, 33, 'qiniu', 'qiniu', b'0'); INSERT INTO `menu` VALUES (18, '2018-12-31 11:12:15', b'0', '七牛云存储', 'tools/qiniu/index', 13, 33, 'qiniu', 'qiniu');
INSERT INTO `menu` VALUES (19, '2018-12-31 14:52:38', '支付宝工具', 'tools/aliPay/index', 13, 34, 'alipay', 'aliPay', b'0'); INSERT INTO `menu` VALUES (19, '2018-12-31 14:52:38', b'0', '支付宝工具', 'tools/aliPay/index', 13, 34, 'alipay', 'aliPay');
INSERT INTO `menu` VALUES (21, '2019-01-04 16:22:03', '多级菜单', '', 0, 900, 'menu', 'nested', b'0'); INSERT INTO `menu` VALUES (21, '2019-01-04 16:22:03', b'0', '多级菜单', '', 0, 900, 'menu', 'nested');
INSERT INTO `menu` VALUES (22, '2019-01-04 16:23:29', '二级菜单1', 'nested/menu1/index', 21, 999, 'menu', 'menu1', b'0'); INSERT INTO `menu` VALUES (22, '2019-01-04 16:23:29', b'0', '二级菜单1', 'nested/menu1/index', 21, 999, 'menu', 'menu1');
INSERT INTO `menu` VALUES (23, '2019-01-04 16:23:57', '二级菜单2', 'nested/menu2/index', 21, 999, 'menu', 'menu2', b'0'); INSERT INTO `menu` VALUES (23, '2019-01-04 16:23:57', b'0', '二级菜单2', 'nested/menu2/index', 21, 999, 'menu', 'menu2');
INSERT INTO `menu` VALUES (24, '2019-01-04 16:24:48', '三级菜单1', 'nested/menu1/menu1-1', 22, 999, 'menu', 'menu1-1', b'0'); INSERT INTO `menu` VALUES (24, '2019-01-04 16:24:48', b'0', '三级菜单1', 'nested/menu1/menu1-1', 22, 999, 'menu', 'menu1-1');
INSERT INTO `menu` VALUES (27, '2019-01-07 17:27:32', '三级菜单2', 'nested/menu1/menu1-2', 22, 999, 'menu', 'menu1-2', b'0'); INSERT INTO `menu` VALUES (27, '2019-01-07 17:27:32', b'0', '三级菜单2', 'nested/menu1/menu1-2', 22, 999, 'menu', 'menu1-2');
INSERT INTO `menu` VALUES (28, '2019-01-07 20:34:40', '定时任务', 'system/timing/index', 1, 6, 'timing', 'timing', b'0'); INSERT INTO `menu` VALUES (28, '2019-01-07 20:34:40', b'0', '定时任务', 'system/timing/index', 1, 6, 'timing', 'timing');
INSERT INTO `menu` VALUES (30, '2019-01-11 15:45:55', '代码生成', 'generator/index', 1, 8, 'dev', 'generator', b'0'); INSERT INTO `menu` VALUES (30, '2019-01-11 15:45:55', b'0', '代码生成', 'generator/index', 1, 8, 'dev', 'generator');
INSERT INTO `menu` VALUES (32, '2019-01-13 13:49:03', '异常日志', 'monitor/log/errorLog', 6, 12, 'error', 'errorLog', b'0'); INSERT INTO `menu` VALUES (32, '2019-01-13 13:49:03', b'0', '异常日志', 'monitor/log/errorLog', 6, 12, 'error', 'errorLog');
-- ----------------------------
-- Table structure for menus_roles
-- ----------------------------
DROP TABLE IF EXISTS `menus_roles`;
CREATE TABLE `menus_roles` (
`menu_id` bigint(20) NOT NULL COMMENT '菜单ID',
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`menu_id`, `role_id`) USING BTREE,
INDEX `FKcngg2qadojhi3a651a5adkvbq`(`role_id`) USING BTREE,
CONSTRAINT `FKcngg2qadojhi3a651a5adkvbq` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `FKq1knxf8ykt26we8k331naabjx` FOREIGN KEY (`menu_id`) REFERENCES `menu` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of menus_roles
-- ----------------------------
INSERT INTO `menus_roles` VALUES (1, 1);
INSERT INTO `menus_roles` VALUES (2, 1);
INSERT INTO `menus_roles` VALUES (3, 1);
INSERT INTO `menus_roles` VALUES (4, 1);
INSERT INTO `menus_roles` VALUES (5, 1);
INSERT INTO `menus_roles` VALUES (6, 1);
INSERT INTO `menus_roles` VALUES (7, 1);
INSERT INTO `menus_roles` VALUES (8, 1);
INSERT INTO `menus_roles` VALUES (9, 1);
INSERT INTO `menus_roles` VALUES (10, 1);
INSERT INTO `menus_roles` VALUES (11, 1);
INSERT INTO `menus_roles` VALUES (12, 1);
INSERT INTO `menus_roles` VALUES (13, 1);
INSERT INTO `menus_roles` VALUES (14, 1);
INSERT INTO `menus_roles` VALUES (15, 1);
INSERT INTO `menus_roles` VALUES (16, 1);
INSERT INTO `menus_roles` VALUES (17, 1);
INSERT INTO `menus_roles` VALUES (18, 1);
INSERT INTO `menus_roles` VALUES (19, 1);
INSERT INTO `menus_roles` VALUES (21, 1);
INSERT INTO `menus_roles` VALUES (22, 1);
INSERT INTO `menus_roles` VALUES (23, 1);
INSERT INTO `menus_roles` VALUES (24, 1);
INSERT INTO `menus_roles` VALUES (27, 1);
INSERT INTO `menus_roles` VALUES (28, 1);
INSERT INTO `menus_roles` VALUES (30, 1);
INSERT INTO `menus_roles` VALUES (32, 1);
INSERT INTO `menus_roles` VALUES (1, 2);
INSERT INTO `menus_roles` VALUES (2, 2);
INSERT INTO `menus_roles` VALUES (3, 2);
INSERT INTO `menus_roles` VALUES (4, 2);
INSERT INTO `menus_roles` VALUES (5, 2);
INSERT INTO `menus_roles` VALUES (6, 2);
INSERT INTO `menus_roles` VALUES (9, 2);
INSERT INTO `menus_roles` VALUES (12, 2);
INSERT INTO `menus_roles` VALUES (13, 2);
INSERT INTO `menus_roles` VALUES (14, 2);
INSERT INTO `menus_roles` VALUES (16, 2);
INSERT INTO `menus_roles` VALUES (17, 2);
INSERT INTO `menus_roles` VALUES (18, 2);
INSERT INTO `menus_roles` VALUES (19, 2);
INSERT INTO `menus_roles` VALUES (21, 2);
INSERT INTO `menus_roles` VALUES (22, 2);
INSERT INTO `menus_roles` VALUES (23, 2);
INSERT INTO `menus_roles` VALUES (24, 2);
INSERT INTO `menus_roles` VALUES (27, 2);
INSERT INTO `menus_roles` VALUES (28, 2);
-- ----------------------------
-- Table structure for my_test
-- ----------------------------
DROP TABLE IF EXISTS `my_test`;
CREATE TABLE `my_test` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Table structure for permission -- Table structure for permission
...@@ -283,9 +190,8 @@ CREATE TABLE `picture` ( ...@@ -283,9 +190,8 @@ CREATE TABLE `picture` (
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名称', `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名称',
`width` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片宽度', `width` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片宽度',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; ) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for qiniu_config -- Table structure for qiniu_config
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `qiniu_config`; DROP TABLE IF EXISTS `qiniu_config`;
...@@ -313,7 +219,7 @@ CREATE TABLE `qiniu_content` ( ...@@ -313,7 +219,7 @@ CREATE TABLE `qiniu_content` (
`update_time` datetime NULL DEFAULT NULL COMMENT '上传或同步的时间', `update_time` datetime NULL DEFAULT NULL COMMENT '上传或同步的时间',
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件url', `url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件url',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Table structure for quartz_job -- Table structure for quartz_job
...@@ -344,18 +250,18 @@ INSERT INTO `quartz_job` VALUES (3, 'testTask', '0/5 * * * * ?', b'1', '测试', ...@@ -344,18 +250,18 @@ INSERT INTO `quartz_job` VALUES (3, 'testTask', '0/5 * * * * ?', b'1', '测试',
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `quartz_log`; DROP TABLE IF EXISTS `quartz_log`;
CREATE TABLE `quartz_log` ( CREATE TABLE `quartz_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', `id` bigint(20) NOT NULL AUTO_INCREMENT,
`baen_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Spring Bean名称', `baen_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', `create_time` datetime NULL DEFAULT NULL,
`cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'cron 表达式', `cron_expression` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`exception_detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '异常详情', `exception_detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`is_success` bit(1) NULL DEFAULT NULL COMMENT '运行状态:1成功,0异常', `is_success` bit(1) NULL DEFAULT NULL,
`job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务名称', `job_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`method_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方法名称', `method_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数', `params` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`time` bigint(20) NULL DEFAULT NULL COMMENT '耗时', `time` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Table structure for role -- Table structure for role
...@@ -367,13 +273,72 @@ CREATE TABLE `role` ( ...@@ -367,13 +273,72 @@ CREATE TABLE `role` (
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ---------------------------- -- ----------------------------
-- Records of role -- Records of role
-- ---------------------------- -- ----------------------------
INSERT INTO `role` VALUES (1, '2018-11-23 11:04:37', '超级管理员', '超级管理员'); INSERT INTO `role` VALUES (1, '2018-11-23 11:04:37', '管理员', '系统所有权');
INSERT INTO `role` VALUES (2, '2018-11-23 13:09:06', '普通用户', '普通用户'); INSERT INTO `role` VALUES (2, '2018-11-23 13:09:06', '普通用户', '用于测试菜单与权限');
-- ----------------------------
-- Table structure for roles_menus
-- ----------------------------
DROP TABLE IF EXISTS `roles_menus`;
CREATE TABLE `roles_menus` (
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
`menu_id` bigint(20) NOT NULL COMMENT '菜单ID',
PRIMARY KEY (`menu_id`, `role_id`) USING BTREE,
INDEX `FKcngg2qadojhi3a651a5adkvbq`(`role_id`) USING BTREE,
CONSTRAINT `FKcngg2qadojhi3a651a5adkvbq` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `FKq1knxf8ykt26we8k331naabjx` FOREIGN KEY (`menu_id`) REFERENCES `menu` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of roles_menus
-- ----------------------------
INSERT INTO `roles_menus` VALUES (1, 1);
INSERT INTO `roles_menus` VALUES (1, 2);
INSERT INTO `roles_menus` VALUES (1, 3);
INSERT INTO `roles_menus` VALUES (1, 4);
INSERT INTO `roles_menus` VALUES (1, 5);
INSERT INTO `roles_menus` VALUES (1, 6);
INSERT INTO `roles_menus` VALUES (1, 7);
INSERT INTO `roles_menus` VALUES (1, 8);
INSERT INTO `roles_menus` VALUES (1, 9);
INSERT INTO `roles_menus` VALUES (1, 10);
INSERT INTO `roles_menus` VALUES (1, 11);
INSERT INTO `roles_menus` VALUES (1, 12);
INSERT INTO `roles_menus` VALUES (1, 13);
INSERT INTO `roles_menus` VALUES (1, 14);
INSERT INTO `roles_menus` VALUES (1, 15);
INSERT INTO `roles_menus` VALUES (1, 16);
INSERT INTO `roles_menus` VALUES (1, 17);
INSERT INTO `roles_menus` VALUES (1, 18);
INSERT INTO `roles_menus` VALUES (1, 19);
INSERT INTO `roles_menus` VALUES (1, 21);
INSERT INTO `roles_menus` VALUES (1, 22);
INSERT INTO `roles_menus` VALUES (1, 23);
INSERT INTO `roles_menus` VALUES (1, 24);
INSERT INTO `roles_menus` VALUES (1, 27);
INSERT INTO `roles_menus` VALUES (1, 28);
INSERT INTO `roles_menus` VALUES (1, 30);
INSERT INTO `roles_menus` VALUES (1, 32);
INSERT INTO `roles_menus` VALUES (2, 1);
INSERT INTO `roles_menus` VALUES (2, 2);
INSERT INTO `roles_menus` VALUES (2, 6);
INSERT INTO `roles_menus` VALUES (2, 10);
INSERT INTO `roles_menus` VALUES (2, 11);
INSERT INTO `roles_menus` VALUES (2, 12);
INSERT INTO `roles_menus` VALUES (2, 13);
INSERT INTO `roles_menus` VALUES (2, 15);
INSERT INTO `roles_menus` VALUES (2, 16);
INSERT INTO `roles_menus` VALUES (2, 17);
INSERT INTO `roles_menus` VALUES (2, 21);
INSERT INTO `roles_menus` VALUES (2, 22);
INSERT INTO `roles_menus` VALUES (2, 23);
INSERT INTO `roles_menus` VALUES (2, 24);
INSERT INTO `roles_menus` VALUES (2, 27);
-- ---------------------------- -- ----------------------------
-- Table structure for roles_permissions -- Table structure for roles_permissions
...@@ -392,13 +357,15 @@ CREATE TABLE `roles_permissions` ( ...@@ -392,13 +357,15 @@ CREATE TABLE `roles_permissions` (
-- Records of roles_permissions -- Records of roles_permissions
-- ---------------------------- -- ----------------------------
INSERT INTO `roles_permissions` VALUES (1, 1); INSERT INTO `roles_permissions` VALUES (1, 1);
INSERT INTO `roles_permissions` VALUES (2, 2);
INSERT INTO `roles_permissions` VALUES (2, 3); INSERT INTO `roles_permissions` VALUES (2, 3);
INSERT INTO `roles_permissions` VALUES (2, 8); INSERT INTO `roles_permissions` VALUES (2, 4);
INSERT INTO `roles_permissions` VALUES (2, 14); INSERT INTO `roles_permissions` VALUES (2, 5);
INSERT INTO `roles_permissions` VALUES (2, 19); INSERT INTO `roles_permissions` VALUES (2, 6);
INSERT INTO `roles_permissions` VALUES (2, 23); INSERT INTO `roles_permissions` VALUES (2, 23);
INSERT INTO `roles_permissions` VALUES (2, 30); INSERT INTO `roles_permissions` VALUES (2, 24);
INSERT INTO `roles_permissions` VALUES (2, 36); INSERT INTO `roles_permissions` VALUES (2, 25);
INSERT INTO `roles_permissions` VALUES (2, 26);
-- ---------------------------- -- ----------------------------
-- Table structure for user -- Table structure for user
...@@ -456,20 +423,4 @@ CREATE TABLE `verification_code` ( ...@@ -456,20 +423,4 @@ CREATE TABLE `verification_code` (
`value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '接收邮箱或者手机号码', `value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '接收邮箱或者手机号码',
`scenes` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务名称:如重置邮箱、重置密码等', `scenes` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务名称:如重置邮箱、重置密码等',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for visits
-- ----------------------------
DROP TABLE IF EXISTS `visits`;
CREATE TABLE `visits` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`date` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建日期:只存储年月日',
`ip_counts` bigint(20) NULL DEFAULT NULL COMMENT 'IP数',
`pv_counts` bigint(20) NULL DEFAULT NULL COMMENT '浏览量',
`week_day` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '星期',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 65 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;
...@@ -5,6 +5,7 @@ import lombok.Data; ...@@ -5,6 +5,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/** /**
* @author jie * @author jie
...@@ -13,7 +14,7 @@ import javax.validation.constraints.NotBlank; ...@@ -13,7 +14,7 @@ import javax.validation.constraints.NotBlank;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class RedisVo { public class RedisVo implements Serializable {
@NotBlank @NotBlank
private String key; private String key;
......
...@@ -5,6 +5,7 @@ import org.hibernate.annotations.UpdateTimestamp; ...@@ -5,6 +5,7 @@ import org.hibernate.annotations.UpdateTimestamp;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
...@@ -21,6 +22,7 @@ public class QuartzJob implements Serializable { ...@@ -21,6 +22,7 @@ public class QuartzJob implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@NotNull(groups = {Update.class})
private Long id; private Long id;
/** /**
...@@ -75,4 +77,6 @@ public class QuartzJob implements Serializable { ...@@ -75,4 +77,6 @@ public class QuartzJob implements Serializable {
@UpdateTimestamp @UpdateTimestamp
@Column(name = "update_time") @Column(name = "update_time")
private Timestamp updateTime; private Timestamp updateTime;
public interface Update{}
} }
\ No newline at end of file
...@@ -68,10 +68,7 @@ public class QuartzJobController { ...@@ -68,10 +68,7 @@ public class QuartzJobController {
@Log("修改定时任务") @Log("修改定时任务")
@PutMapping(value = "/jobs") @PutMapping(value = "/jobs")
@PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')") @PreAuthorize("hasAnyRole('ADMIN','JOB_ALL','JOB_EDIT')")
public ResponseEntity update(@Validated @RequestBody QuartzJob resources){ public ResponseEntity update(@Validated(QuartzJob.Update.class) @RequestBody QuartzJob resources){
if (resources.getId() == null) {
throw new BadRequestException(ENTITY_NAME +" ID Can not be empty");
}
quartzJobService.update(resources); quartzJobService.update(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT); return new ResponseEntity(HttpStatus.NO_CONTENT);
} }
......
...@@ -41,7 +41,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -41,7 +41,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
private String tokenHeader; private String tokenHeader;
@Value("${jwt.auth.path}") @Value("${jwt.auth.path}")
private String authenticationPath; private String loginPath;
@Autowired @Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
...@@ -74,9 +74,18 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -74,9 +74,18 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 不创建会话 // 不创建会话
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests()
.antMatchers("/auth/**").permitAll() // 过滤请求
.authorizeRequests()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js"
).permitAll()
.antMatchers( HttpMethod.POST,"/auth/"+loginPath).permitAll()
.antMatchers("/websocket/**").permitAll() .antMatchers("/websocket/**").permitAll()
.antMatchers("/druid/**").anonymous() .antMatchers("/druid/**").anonymous()
...@@ -91,33 +100,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -91,33 +100,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/*/api-docs").anonymous() .antMatchers("/*/api-docs").anonymous()
// swagger end // swagger end
// 接口限流测试
.antMatchers("/test/**").anonymous() .antMatchers("/test/**").anonymous()
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous() .antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
// 所有请求都需要认证 // 所有请求都需要认证
.anyRequest().authenticated(); .anyRequest().authenticated();
httpSecurity httpSecurity
.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class); .addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
} }
@Override
public void configure(WebSecurity web) throws Exception {
// AuthenticationTokenFilter will ignore the below paths
web.ignoring()
.antMatchers(
HttpMethod.POST,
authenticationPath
)
// allow anonymous resource requests
.and()
.ignoring()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js"
);
}
} }
...@@ -2,7 +2,7 @@ package me.zhengjie.modules.security.rest; ...@@ -2,7 +2,7 @@ package me.zhengjie.modules.security.rest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import me.zhengjie.aop.log.Log; import me.zhengjie.aop.log.Log;
import me.zhengjie.modules.security.security.AuthenticationToken; import me.zhengjie.modules.security.security.AuthenticationInfo;
import me.zhengjie.modules.security.security.AuthorizationUser; import me.zhengjie.modules.security.security.AuthorizationUser;
import me.zhengjie.modules.security.security.JwtUser; import me.zhengjie.modules.security.security.JwtUser;
import me.zhengjie.utils.EncryptUtils; import me.zhengjie.utils.EncryptUtils;
...@@ -47,21 +47,21 @@ public class AuthenticationController { ...@@ -47,21 +47,21 @@ public class AuthenticationController {
@PostMapping(value = "${jwt.auth.path}") @PostMapping(value = "${jwt.auth.path}")
public ResponseEntity login(@Validated @RequestBody AuthorizationUser authorizationUser){ public ResponseEntity login(@Validated @RequestBody AuthorizationUser authorizationUser){
final UserDetails userDetails = userDetailsService.loadUserByUsername(authorizationUser.getUsername()); final JwtUser jwtUser = (JwtUser) userDetailsService.loadUserByUsername(authorizationUser.getUsername());
if(!userDetails.getPassword().equals(EncryptUtils.encryptPassword(authorizationUser.getPassword()))){ if(!jwtUser.getPassword().equals(EncryptUtils.encryptPassword(authorizationUser.getPassword()))){
throw new AccountExpiredException("密码错误"); throw new AccountExpiredException("密码错误");
} }
if(!userDetails.isEnabled()){ if(!jwtUser.isEnabled()){
throw new AccountExpiredException("账号已停用,请联系管理员"); throw new AccountExpiredException("账号已停用,请联系管理员");
} }
// 生成令牌 // 生成令牌
final String token = jwtTokenUtil.generateToken(userDetails); final String token = jwtTokenUtil.generateToken(jwtUser);
// 返回 token // 返回 token
return ResponseEntity.ok(new AuthenticationToken(token)); return ResponseEntity.ok(new AuthenticationInfo(token,jwtUser));
} }
/** /**
......
package me.zhengjie.modules.security.security; package me.zhengjie.modules.security.security;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.io.Serializable;
import java.io.Serializable;
/**
/** * @author jie
* @author jie * @date 2018-11-23
* @date 2018-11-23 * 返回token
* 返回token */
*/ @Getter
@Getter @AllArgsConstructor
@AllArgsConstructor public class AuthenticationInfo implements Serializable {
public class AuthenticationToken implements Serializable {
private final String token;
private final String token;
} private final JwtUser user;
}
...@@ -4,12 +4,12 @@ import me.zhengjie.modules.system.domain.Permission; ...@@ -4,12 +4,12 @@ import me.zhengjie.modules.system.domain.Permission;
import me.zhengjie.modules.system.domain.Role; import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.domain.User; import me.zhengjie.modules.system.domain.User;
import me.zhengjie.exception.EntityNotFoundException; import me.zhengjie.exception.EntityNotFoundException;
import me.zhengjie.modules.system.repository.PermissionRepository;
import me.zhengjie.modules.system.repository.RoleRepository;
import me.zhengjie.modules.system.repository.UserRepository; import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.security.security.JwtUser; import me.zhengjie.modules.security.security.JwtUser;
import me.zhengjie.utils.ValidationUtil; import me.zhengjie.utils.ValidationUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
...@@ -33,6 +33,12 @@ public class JwtUserDetailsService implements UserDetailsService { ...@@ -33,6 +33,12 @@ public class JwtUserDetailsService implements UserDetailsService {
@Autowired @Autowired
private UserRepository userRepository; private UserRepository userRepository;
@Autowired
private RoleRepository roleRepository;
@Autowired
private PermissionRepository permissionRepository;
@Override @Override
public UserDetails loadUserByUsername(String username){ public UserDetails loadUserByUsername(String username){
...@@ -57,20 +63,20 @@ public class JwtUserDetailsService implements UserDetailsService { ...@@ -57,20 +63,20 @@ public class JwtUserDetailsService implements UserDetailsService {
user.getPassword(), user.getPassword(),
user.getAvatar(), user.getAvatar(),
user.getEmail(), user.getEmail(),
mapToGrantedAuthorities(user.getRoles()), mapToGrantedAuthorities(roleRepository.findByUsers_Id(user.getId()),permissionRepository),
user.getEnabled(), user.getEnabled(),
user.getCreateTime(), user.getCreateTime(),
user.getLastPasswordResetTime() user.getLastPasswordResetTime()
); );
} }
private static List<GrantedAuthority> mapToGrantedAuthorities(Set<Role> roles) { private static List<GrantedAuthority> mapToGrantedAuthorities(Set<Role> roles,PermissionRepository permissionRepository) {
Set<Permission> permissions = new HashSet<>(); Set<Permission> permissions = new HashSet<>();
for (Role role : roles) { for (Role role : roles) {
Set<Role> roleSet = new HashSet<>(); Set<Role> roleSet = new HashSet<>();
roleSet.add(role); roleSet.add(role);
permissions.addAll(role.getPermissions()); permissions.addAll(permissionRepository.findByRoles_Id(role.getId()));
} }
return permissions.stream() return permissions.stream()
......
package me.zhengjie.modules.system.domain; package me.zhengjie.modules.system.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Set; import java.util.Set;
...@@ -16,10 +19,11 @@ import java.util.Set; ...@@ -16,10 +19,11 @@ import java.util.Set;
@Getter @Getter
@Setter @Setter
@Table(name = "menu") @Table(name = "menu")
public class Menu { public class Menu implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@NotNull(groups = {Update.class})
private Long id; private Long id;
@NotBlank @NotBlank
...@@ -47,11 +51,13 @@ public class Menu { ...@@ -47,11 +51,13 @@ public class Menu {
@Column(name = "i_frame") @Column(name = "i_frame")
private Boolean iFrame; private Boolean iFrame;
@ManyToMany @ManyToMany(mappedBy = "menus")
@JoinTable(name = "menus_roles", joinColumns = {@JoinColumn(name = "menu_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}) @JsonIgnore
private Set<Role> roles; private Set<Role> roles;
@CreationTimestamp @CreationTimestamp
@Column(name = "create_time") @Column(name = "create_time")
private Timestamp createTime; private Timestamp createTime;
public interface Update{}
} }
...@@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; ...@@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
...@@ -24,6 +23,7 @@ public class Permission implements Serializable{ ...@@ -24,6 +23,7 @@ public class Permission implements Serializable{
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@NotNull(groups = {Update.class})
private Long id; private Long id;
@NotBlank @NotBlank
...@@ -57,4 +57,6 @@ public class Permission implements Serializable{ ...@@ -57,4 +57,6 @@ public class Permission implements Serializable{
", createTime=" + createTime + ", createTime=" + createTime +
'}'; '}';
} }
public interface Update{}
} }
...@@ -7,6 +7,7 @@ import org.hibernate.annotations.CreationTimestamp; ...@@ -7,6 +7,7 @@ import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Set; import java.util.Set;
...@@ -24,6 +25,7 @@ public class Role implements Serializable { ...@@ -24,6 +25,7 @@ public class Role implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@NotNull(groups = {Update.class})
private Long id; private Long id;
@Column(nullable = false) @Column(nullable = false)
...@@ -41,8 +43,8 @@ public class Role implements Serializable { ...@@ -41,8 +43,8 @@ public class Role implements Serializable {
@JoinTable(name = "roles_permissions", joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "permission_id",referencedColumnName = "id")}) @JoinTable(name = "roles_permissions", joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "permission_id",referencedColumnName = "id")})
private Set<Permission> permissions; private Set<Permission> permissions;
@JsonIgnore @ManyToMany
@ManyToMany(mappedBy = "roles") @JoinTable(name = "roles_menus", joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "menu_id",referencedColumnName = "id")})
private Set<Menu> menus; private Set<Menu> menus;
@CreationTimestamp @CreationTimestamp
...@@ -58,4 +60,6 @@ public class Role implements Serializable { ...@@ -58,4 +60,6 @@ public class Role implements Serializable {
", createDateTime=" + createTime + ", createDateTime=" + createTime +
'}'; '}';
} }
public interface Update{}
} }
...@@ -25,6 +25,7 @@ public class User implements Serializable { ...@@ -25,6 +25,7 @@ public class User implements Serializable {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@NotNull(groups = Update.class)
private Long id; private Long id;
@NotBlank @NotBlank
...@@ -65,4 +66,6 @@ public class User implements Serializable { ...@@ -65,4 +66,6 @@ public class User implements Serializable {
", lastPasswordResetTime=" + lastPasswordResetTime + ", lastPasswordResetTime=" + lastPasswordResetTime +
'}'; '}';
} }
public @interface Update {}
} }
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment