yshop3.0-alpha版本
This commit is contained in:
11
README.md
11
README.md
@ -56,14 +56,17 @@ CMS,CRM,OA等等本版本本身属于独立后台商城管理系统;
|
||||
|
||||
#### 项目结构
|
||||
项目采用分模块开发方式
|
||||
- yshop-api 移动端API模块
|
||||
- yshop-mp 微信相关模块
|
||||
- yshop-app 移动端API模块(H5+uniapp端的API)
|
||||
- yshop-admin 管理后台模块
|
||||
- yshop-weixin 微信相关模块
|
||||
- yshop-mall 商城公共模块
|
||||
- yshop-shop 后台商城模块
|
||||
- yshop-message 消息队列模块
|
||||
- yshop-common 公共模块
|
||||
- yshop-system 后台模块
|
||||
- yshop-logging 日志模块
|
||||
- yshop-tools 第三方工具模块
|
||||
- yshop-generator 代码生成模块
|
||||
- yshop-shop 商城模块
|
||||
- yshop-mproot mybatisPlus配置模块
|
||||
|
||||
#### 系统预览
|
||||
<table>
|
||||
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
27
pom.xml
27
pom.xml
@ -7,18 +7,20 @@
|
||||
<groupId>co.yixiang</groupId>
|
||||
<artifactId>yshop</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.2</version>
|
||||
<version>3.0-alpha</version>
|
||||
|
||||
<modules>
|
||||
<module>yshop-common</module>
|
||||
<module>yshop-logging</module>
|
||||
<module>yshop-system</module>
|
||||
<module>yshop-admin</module>
|
||||
<module>yshop-tools</module>
|
||||
<module>yshop-generator</module>
|
||||
<module>yshop-api</module>
|
||||
<module>yshop-mp</module>
|
||||
<module>yshop-app</module>
|
||||
<module>yshop-weixin</module>
|
||||
<module>yshop-shop</module>
|
||||
<module>yshop-mproot</module>
|
||||
<module>yshop-mall</module>
|
||||
<module>yshop-message</module>
|
||||
</modules>
|
||||
|
||||
<name>YSHOP商城管理系统</name>
|
||||
@ -54,10 +56,7 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@ -72,6 +71,18 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.lettuce</groupId>
|
||||
<artifactId>lettuce-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.9.1</version>
|
||||
</dependency>
|
||||
|
||||
<!--Spring boot end-->
|
||||
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
@ -1,79 +0,0 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50723
|
||||
Source Host : localhost:3306
|
||||
Source Schema : yshop
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50723
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 27/05/2020 20:55:47
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for yx_system_group_data
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `yx_system_group_data`;
|
||||
CREATE TABLE `yx_system_group_data` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '组合数据详情ID',
|
||||
`group_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '对应的数据名称',
|
||||
`value` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据组对应的数据值(json数据)',
|
||||
`add_time` int(10) NOT NULL DEFAULT 0 COMMENT '添加数据时间',
|
||||
`sort` int(11) NULL DEFAULT 0 COMMENT '数据排序',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态(1:开启;2:关闭;)',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 226 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '组合数据详情表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of yx_system_group_data
|
||||
-- ----------------------------
|
||||
INSERT INTO `yx_system_group_data` VALUES (177, 'yshop_home_banner', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\"],\"name\":\"banner2\",\"id\":177,\"pic\":\"https://image.dayouqiantu.cn/5c9f05aee5059.jpg\",\"sort\":1,\"url\":\"wwww\",\"status\":1}', 1571387677, 1, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (180, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e85bfa61251d.png\"],\"uniapp_url\":\"/pages/shop/GoodsList/index\",\"name\":\"全部商品\",\"id\":180,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa61251d.png\",\"sort\":9,\"url\":\"/goods_list\",\"wxapp_url\":\"/pages/shop/GoodsList/main\",\"status\":1}', 1571390842, 9, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (182, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":182,\"pic\":\"https://i.loli.net/2019/10/18/DqOUgNf7wjuFpPT.png\",\"sort\":2,\"title\":\"分销、拼团、商户功能上线啦!\",\"url\":\"/news_list\",\"info\":\"yshop2.0上线啦\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 0, 2, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (183, 'yshop_hot_search', '{\"id\":183,\"title\":\"照片\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (184, 'yshop_hot_search', '{\"id\":184,\"title\":\"springboot\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (187, 'yshop_home_roll_news', '{\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"id\":187,\"sort\":1,\"url\":\"/news_list\",\"info\":\"springboot2+JPA+Mybatisplus商城系统\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1572086163, 1, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (188, 'yshop_hot_search', '{\"id\":188,\"title\":\"打印\"}', 1572086172, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (189, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dec896eeb25a.png\"],\"uniapp_url\":\"/pages/user/UserVip/index\",\"name\":\"会员中心\",\"id\":189,\"pic\":\"https://image.dayouqiantu.cn/5dec896eeb25a.png\",\"sort\":9,\"url\":\"/user/vip\",\"wxapp_url\":\"/pages/user/UserVip/main\",\"status\":1}', 1572087722, 9, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (190, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428984d64d.png\"],\"uniapp_url\":\"/pages/user/coupon/UserCoupon/index\",\"name\":\"我的卡券\",\"id\":190,\"pic\":\"https://image.dayouqiantu.cn/5db428984d64d.png\",\"sort\":8,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/UserCoupon/main\",\"status\":1}', 0, 8, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (191, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"收藏商品\",\"id\":191,\"pic\":\"https://image.dayouqiantu.cn/5db428a8d3ab0.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 0, 7, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (192, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428bd61b73.png\"],\"uniapp_url\":\"/pages/user/address/AddressManagement/index\",\"name\":\"地址管理\",\"id\":192,\"pic\":\"https://image.dayouqiantu.cn/5db428bd61b73.png\",\"sort\":6,\"url\":\"/user/add_manage\",\"wxapp_url\":\"/pages/user/address/AddressManagement/main\",\"status\":1}', 0, 6, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (193, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428e28dd48.png\"],\"uniapp_url\":\"/pages/user/promotion/UserPromotion/index\",\"name\":\"我的推广\",\"id\":193,\"pic\":\"https://image.dayouqiantu.cn/5db428e28dd48.png\",\"sort\":5,\"url\":\"/user/user_promotion\",\"wxapp_url\":\"/pages/user/promotion/UserPromotion/main\",\"status\":1}', 0, 5, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (194, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db42a4208c55.png\"],\"uniapp_url\":\"/pages/user/UserAccount/index\",\"name\":\"我的余额\",\"id\":194,\"pic\":\"https://image.dayouqiantu.cn/5db42a4208c55.png\",\"sort\":4,\"url\":\"/user/account\",\"wxapp_url\":\"/pages/user/UserAccount/main\",\"status\":1}', 0, 4, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (195, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5db428f410462.png\"],\"uniapp_url\":\"/pages/user/signIn/Integral/index\",\"name\":\"我的积分\",\"id\":195,\"pic\":\"https://image.dayouqiantu.cn/5db428f410462.png\",\"sort\":3,\"url\":\"/user/integral\",\"wxapp_url\":\"/pages/user/signIn/Integral/main\",\"status\":1}', 0, 3, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (196, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93f004713.png\"],\"uniapp_url\":\"/pages/shop/news/NewsList/index\",\"name\":\"图文资讯\",\"id\":196,\"pic\":\"https://image.dayouqiantu.cn/5e85bfea151b7.png\",\"sort\":8,\"url\":\"/news_list\",\"wxapp_url\":\"/pages/shop/news/NewsList/main\",\"status\":1}', 1573109648, 8, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (197, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e939507b5e.png\"],\"uniapp_url\":\"/pages/shop/GoodsCollection/index\",\"name\":\"我的收藏\",\"id\":197,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa55f352.png\",\"sort\":7,\"url\":\"/collection\",\"wxapp_url\":\"/pages/shop/GoodsCollection/main\",\"status\":1}', 1573109723, 7, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (199, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93c9a8304.png\"],\"uniapp_url\":\"/pages/user/coupon/GetCoupon/index\",\"name\":\"我的卡券\",\"id\":199,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa6621ca.png\",\"sort\":6,\"url\":\"/user/get_coupon\",\"wxapp_url\":\"/pages/user/coupon/GetCoupon/main\",\"status\":1}', 1573387422, 6, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (200, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e925140b57.png\"],\"uniapp_url\":\"/pages/activity/GoodsGroup/index\",\"name\":\"拼团专区\",\"id\":200,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa4b273f.png\",\"sort\":5,\"url\":\"/activity/group\",\"wxapp_url\":\"/pages/activity/GoodsGroup/main\",\"status\":1}', 0, 5, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (201, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\"],\"uniapp_url\":\"/pages/orderAdmin/OrderIndex/index\",\"name\":\"商户管理\",\"id\":201,\"pic\":\"https://image.dayouqiantu.cn/5ddb7a37d58d9.png\",\"sort\":2,\"url\":\"/customer/index\",\"wxapp_url\":\"/pages/orderAdmin/OrderIndex/main\",\"status\":1}', 0, 2, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (202, 'yshop_sign_day_num', '{\"sign_num\":\"10\",\"id\":205,\"day\":\"第一天\"}', 0, 9, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (203, 'yshop_sign_day_num', '{\"sign_num\":\"20\",\"id\":\"\",\"day\":\"第二天\"}', 0, 8, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (204, 'yshop_sign_day_num', '{\"sign_num\":\"30\",\"id\":\"\",\"day\":\"第三天\"}', 0, 7, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (205, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"40\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第四天\",\"status\":\"\"}', 0, 6, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (206, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"50\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第五天\",\"status\":\"\"}', 0, 5, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (207, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"60\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"第六天\",\"status\":\"\"}', 0, 4, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (208, 'yshop_sign_day_num', '{\"addTime\":\"\",\"sign_num\":\"100\",\"id\":\"\",\"sort\":\"\",\"value\":\"\",\"day\":\"奖励\",\"status\":\"\"}', 0, 3, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (209, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e93010a248.png\"],\"uniapp_url\":\"/pages/user/signIn/Sign/index\",\"name\":\"积分签到\",\"id\":209,\"pic\":\"https://image.dayouqiantu.cn/5e85bf8e494f2.png\",\"sort\":4,\"url\":\"/user/sign\",\"wxapp_url\":\"/pages/user/signIn/Sign/main\",\"status\":1}', 0, 4, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (210, 'yshop_seckill_time', '{\"continued\":2,\"id\":\"\",\"time\":5}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (211, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"7\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (212, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"2\",\"id\":\"\",\"sort\":\"\",\"time\":\"10\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (213, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"3\",\"id\":\"\",\"sort\":\"\",\"time\":\"12\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (214, 'yshop_seckill_time', '{\"addTime\":\"\",\"continued\":\"4\",\"id\":\"\",\"sort\":\"\",\"time\":\"15\",\"value\":\"\",\"status\":\"\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (215, 'yshop_seckill_time', '{\"continued\":\"2\",\"id\":223,\"time\":\"19\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (216, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e929f9be59.png\"],\"uniapp_url\":\"/pages/activity/GoodsSeckill/index\",\"name\":\"秒杀专区\",\"id\":216,\"pic\":\"https://image.dayouqiantu.cn/5e85bfa5a9f85.png\",\"sort\":3,\"url\":\"/activity/goods_seckill\",\"wxapp_url\":\"/pages/activity/GoodsSeckill/main\",\"status\":1}', 0, 3, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (217, 'yshop_home_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e4e9276c608f.png\"],\"uniapp_url\":\"/pages/activity/GoodsBargain/index\",\"name\":\"砍价专区\",\"id\":217,\"pic\":\"https://image.dayouqiantu.cn/5e85bfe9b1da8.png\",\"sort\":2,\"url\":\"/activity/bargain\",\"wxapp_url\":\"/pages/activity/GoodsBargain/main\",\"status\":1}', 0, 2, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (218, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5dfd7b748e053.png\"],\"uniapp_url\":\"/pages/activity/BargainRecord/index\",\"name\":\"砍价记录\",\"id\":218,\"pic\":\"https://image.dayouqiantu.cn/5dfd7b748e053.png\",\"sort\":1,\"url\":\"/activity/bargain/record\",\"wxapp_url\":\"/pages/activity/BargainRecord/main\",\"status\":1}', 0, 1, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (219, 'yshop_home_banner', '{\"name\":\"222\",\"id\":\"\",\"pic\":\"https://image.dayouqiantu.cn/5c9f117f624ee.jpg\",\"sort\":\"\",\"url\":\"/\",\"status\":\"\"}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (221, 'yshop_my_menus', '{\"imageArr\":[\"https://image.dayouqiantu.cn/5e60da498cfdd.png\"],\"name\":\"订单核销\",\"id\":230,\"pic\":\"https://image.dayouqiantu.cn/5e60da498cfdd.png\",\"sort\":0,\"url\":\"/order/order_cancellation\",\"wxapp_url\":\"\",\"status\":1}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (222, 'yshop_recharge_price_ways', '{\"give_price\":\"10\",\"price\":\"100\",\"id\":\"\",\"sort\":0,\"status\":1}', 0, 1, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (223, 'yshop_recharge_price_ways', '{\"give_price\":\"1\",\"price\":1,\"id\":\"\",\"sort\":0,\"status\":1}', 0, 0, 1);
|
||||
INSERT INTO `yx_system_group_data` VALUES (224, 'yshop_home_banner', '{\"imageArr\":[\"https://image.dayouqiantu.cn/微信截图_20200505091325 - 副本 (2).png\"],\"uniapp_url\":\"11\",\"name\":\"11\",\"id\":\"\",\"pic\":\"https://image.dayouqiantu.cn/微信截图_20200505091325 - 副本 (2).png\",\"sort\":0,\"url\":\"11\",\"wxapp_url\":\"\",\"status\":1}', 1590571271, 0, 1);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
3118
sql/yxshop2.2.sql
3118
sql/yxshop2.2.sql
File diff suppressed because one or more lines are too long
3532
sql/yxshop3.0.sql
Normal file
3532
sql/yxshop3.0.sql
Normal file
File diff suppressed because one or more lines are too long
@ -5,11 +5,11 @@
|
||||
<parent>
|
||||
<artifactId>yshop</artifactId>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<version>2.2</version>
|
||||
<version>3.0-alpha</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yshop-system</artifactId>
|
||||
<artifactId>yshop-admin</artifactId>
|
||||
<name>后台管理模块</name>
|
||||
|
||||
<properties>
|
||||
@ -21,7 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<artifactId>yshop-generator</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>3.0-alpha</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>co.yixiang</groupId>
|
||||
@ -32,29 +32,14 @@
|
||||
<dependency>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<artifactId>yshop-shop</artifactId>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<artifactId>yshop-mproot</artifactId>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<artifactId>yshop-mp</artifactId>
|
||||
<version>2.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>co.yixiang</groupId>
|
||||
<artifactId>yshop-common</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<version>3.0-alpha</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--jwt-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
@ -1,7 +1,10 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang;
|
||||
|
||||
@ -26,7 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
@MapperScan(basePackages ={ "co.yixiang.*.mapper", "co.yixiang.config"})
|
||||
@MapperScan(basePackages ={"co.yixiang.modules.*.service.mapper", "co.yixiang.config"})
|
||||
public class AppRun {
|
||||
|
||||
public static void main(String[] args) {
|
36
yshop-admin/src/main/java/co/yixiang/handler/ApiErr.java
Normal file
36
yshop-admin/src/main/java/co/yixiang/handler/ApiErr.java
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.handler;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @since 2019-10-02
|
||||
*/
|
||||
@Data
|
||||
class ApiErr {
|
||||
|
||||
private Integer status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timestamp;
|
||||
private String msg;
|
||||
|
||||
private ApiErr() {
|
||||
timestamp = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public ApiErr(Integer status, String message) {
|
||||
this();
|
||||
this.status = status;
|
||||
this.msg = message;
|
||||
}
|
||||
}
|
||||
|
||||
|
43
yshop-admin/src/main/java/co/yixiang/handler/ApiError.java
Normal file
43
yshop-admin/src/main/java/co/yixiang/handler/ApiError.java
Normal file
@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.handler;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @date 2018-11-23
|
||||
*/
|
||||
@Data
|
||||
class ApiError {
|
||||
|
||||
private Integer status = 400;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime timestamp;
|
||||
private String message;
|
||||
|
||||
private ApiError() {
|
||||
timestamp = LocalDateTime.now();
|
||||
}
|
||||
|
||||
public static ApiError error(String message){
|
||||
ApiError apiError = new ApiError();
|
||||
apiError.setMessage(message);
|
||||
return apiError;
|
||||
}
|
||||
|
||||
public static ApiError error(Integer status, String message){
|
||||
ApiError apiError = new ApiError();
|
||||
apiError.setStatus(status);
|
||||
apiError.setMessage(message);
|
||||
return apiError;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,130 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.handler;
|
||||
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.exception.EntityExistException;
|
||||
import co.yixiang.exception.EntityNotFoundException;
|
||||
import co.yixiang.exception.ErrorRequestException;
|
||||
import co.yixiang.utils.ThrowableUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.springframework.http.HttpStatus.NOT_FOUND;
|
||||
import static org.springframework.http.HttpStatus.valueOf;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @date 2018-11-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
@SuppressWarnings("unchecked")
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
/**
|
||||
* 处理所有不可知的异常
|
||||
*/
|
||||
@ExceptionHandler(Throwable.class)
|
||||
public ResponseEntity<ApiError> handleException(Throwable e){
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
return buildResponseEntity(ApiError.error(e.getMessage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* BadCredentialsException
|
||||
*/
|
||||
@ExceptionHandler(BadCredentialsException.class)
|
||||
public ResponseEntity<ApiError> badCredentialsException(BadCredentialsException e){
|
||||
// 打印堆栈信息
|
||||
String message = "坏的凭证".equals(e.getMessage()) ? "用户名或密码不正确" : e.getMessage();
|
||||
log.error(message);
|
||||
return buildResponseEntity(ApiError.error(message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理自定义异常
|
||||
*/
|
||||
@ExceptionHandler(value = BadRequestException.class)
|
||||
public ResponseEntity<ApiError> badRequestException(BadRequestException e) {
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
return buildResponseEntity(ApiError.error(e.getStatus(),e.getMessage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理自定义异常
|
||||
* @param e
|
||||
* @return
|
||||
*/
|
||||
@ExceptionHandler(value = ErrorRequestException.class)
|
||||
public ResponseEntity<ApiErr> errorRequestException(ErrorRequestException e) {
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
ApiErr apiError = new ApiErr(e.getStatus(),e.getMessage());
|
||||
return buildResponseEntity2(apiError);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 EntityExist
|
||||
*/
|
||||
@ExceptionHandler(value = EntityExistException.class)
|
||||
public ResponseEntity<ApiError> entityExistException(EntityExistException e) {
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
return buildResponseEntity(ApiError.error(e.getMessage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 EntityNotFound
|
||||
*/
|
||||
@ExceptionHandler(value = EntityNotFoundException.class)
|
||||
public ResponseEntity<ApiError> entityNotFoundException(EntityNotFoundException e) {
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
return buildResponseEntity(ApiError.error(NOT_FOUND.value(),e.getMessage()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理所有接口数据验证异常
|
||||
*/
|
||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
public ResponseEntity<ApiError> handleMethodArgumentNotValidException(MethodArgumentNotValidException e){
|
||||
// 打印堆栈信息
|
||||
log.error(ThrowableUtil.getStackTrace(e));
|
||||
String[] str = Objects.requireNonNull(e.getBindingResult().getAllErrors().get(0).getCodes())[1].split("\\.");
|
||||
String message = e.getBindingResult().getAllErrors().get(0).getDefaultMessage();
|
||||
String msg = "不能为空";
|
||||
if(msg.equals(message)){
|
||||
message = str[1] + ":" + message;
|
||||
}
|
||||
return buildResponseEntity(ApiError.error(message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一返回
|
||||
*/
|
||||
private ResponseEntity<ApiError> buildResponseEntity(ApiError apiError) {
|
||||
return new ResponseEntity<>(apiError, valueOf(apiError.getStatus()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一返回
|
||||
* @param apiError
|
||||
* @return
|
||||
*/
|
||||
private ResponseEntity<ApiErr> buildResponseEntity2(ApiErr apiError) {
|
||||
return new ResponseEntity(apiError, HttpStatus.valueOf(apiError.getStatus()));
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package co.yixiang.modules.monitor.rest;
|
||||
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.monitor.domain.vo.RedisVo;
|
||||
import co.yixiang.modules.monitor.service.RedisService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -34,20 +35,20 @@ public class RedisController {
|
||||
return new ResponseEntity(redisService.findByKey(key,pageable), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除Redis缓存")
|
||||
@DeleteMapping(value = "/redis")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
|
||||
public ResponseEntity delete(@RequestBody RedisVo resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
redisService.delete(resources.getKey());
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("清空Redis缓存")
|
||||
@DeleteMapping(value = "/redis/all")
|
||||
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
|
||||
public ResponseEntity deleteAll(){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
redisService.flushdb();
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
@ -2,8 +2,8 @@ package co.yixiang.modules.monitor.service.impl;
|
||||
|
||||
import co.yixiang.modules.monitor.domain.vo.RedisVo;
|
||||
import co.yixiang.modules.monitor.service.RedisService;
|
||||
import co.yixiang.mp.config.ShopKeyUtils;
|
||||
import co.yixiang.utils.PageUtil;
|
||||
import co.yixiang.utils.ShopKeyUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
@ -7,11 +7,13 @@ package co.yixiang.modules.quartz.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
@ -22,8 +24,9 @@ import java.sql.Timestamp;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("quartz_job")
|
||||
public class QuartzJob implements Serializable {
|
||||
public class QuartzJob extends BaseDomain {
|
||||
|
||||
public static final String JOB_KEY = "JOB_KEY";
|
||||
|
||||
@ -60,9 +63,6 @@ public class QuartzJob implements Serializable {
|
||||
private String remark;
|
||||
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
public void copy(QuartzJob source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
@ -7,6 +7,7 @@ package co.yixiang.modules.quartz.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -23,7 +24,7 @@ import java.sql.Timestamp;
|
||||
|
||||
@Data
|
||||
@TableName("quartz_log")
|
||||
public class QuartzLog implements Serializable {
|
||||
public class QuartzLog extends BaseDomain {
|
||||
|
||||
/** 任务日志ID */
|
||||
@TableId
|
||||
@ -34,10 +35,6 @@ public class QuartzLog implements Serializable {
|
||||
private String baenName;
|
||||
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
/** cron表达式 */
|
||||
private String cronExpression;
|
@ -8,6 +8,7 @@ package co.yixiang.modules.quartz.rest;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.quartz.domain.QuartzJob;
|
||||
import co.yixiang.modules.quartz.service.QuartzJobService;
|
||||
import co.yixiang.modules.quartz.service.QuartzLogService;
|
||||
@ -94,55 +95,55 @@ public class QuartzJobController {
|
||||
return new ResponseEntity<>(quartzLogService.queryAll(criteria,pageable), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("新增定时任务")
|
||||
@ApiOperation("新增定时任务")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('admin','timing:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody QuartzJob resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
if (resources.getId() != null) {
|
||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||
}
|
||||
return new ResponseEntity<>(quartzJobService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改定时任务")
|
||||
@ApiOperation("修改定时任务")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('admin','timing:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody QuartzJob resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
quartzJobService.saveOrUpdate(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("更改定时任务状态")
|
||||
@ApiOperation("更改定时任务状态")
|
||||
@PutMapping(value = "/{id}")
|
||||
@PreAuthorize("@el.check('admin','timing:edit')")
|
||||
public ResponseEntity<Object> updateIsPause(@PathVariable Long id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
quartzJobService.updateIsPause(quartzJobService.getOne(new LambdaQueryWrapper<QuartzJob>()
|
||||
.eq(QuartzJob::getId,id)));
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("执行定时任务")
|
||||
@ApiOperation("执行定时任务")
|
||||
@PutMapping(value = "/exec/{id}")
|
||||
@PreAuthorize("@el.check('admin','timing:edit')")
|
||||
public ResponseEntity<Object> execution(@PathVariable Long id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
quartzJobService.execution(quartzJobService.getOne(new QueryWrapper<QuartzJob>().eq("id",id)));
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除定时任务")
|
||||
@ApiOperation("删除定时任务")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('admin','timing:del')")
|
||||
public ResponseEntity<Object> delete(@RequestBody Integer[] ids){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
quartzJobService.removeByIds(new ArrayList<>(Arrays.asList(ids)));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.modules.security.rest;
|
||||
|
@ -6,6 +6,7 @@
|
||||
package co.yixiang.modules.security.rest;
|
||||
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.security.service.OnlineUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -58,22 +59,22 @@ public class OnlineController {
|
||||
onlineUserService.download(onlineUserService.getAll(filter,type), response);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@ApiOperation("踢出用户")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check()")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> keys) throws Exception {
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
for (String key : keys) {
|
||||
onlineUserService.kickOut(key);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@ApiOperation("踢出移动端用户")
|
||||
@PostMapping("/delete" )
|
||||
@PreAuthorize("@el.check()")
|
||||
public ResponseEntity<Object> deletet(@RequestBody Set<String> keys) throws Exception {
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
for (String key : keys) {
|
||||
onlineUserService.kickOutT(key);
|
||||
}
|
@ -10,12 +10,14 @@ package co.yixiang.modules.system.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@ -27,8 +29,9 @@ import java.sql.Timestamp;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("dept")
|
||||
public class Dept implements Serializable {
|
||||
public class Dept extends BaseDomain {
|
||||
|
||||
/** ID */
|
||||
@TableId(value = "id",type= IdType.AUTO)
|
||||
@ -49,9 +52,6 @@ public class Dept implements Serializable {
|
||||
private Boolean enabled;
|
||||
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
public void copy(Dept source){
|
@ -10,11 +10,14 @@ package co.yixiang.modules.system.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.JsonSerializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
@ -25,8 +28,9 @@ import java.sql.Timestamp;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("dict")
|
||||
public class Dict implements Serializable {
|
||||
public class Dict extends BaseDomain {
|
||||
|
||||
/** 字典ID */
|
||||
@TableId
|
||||
@ -42,9 +46,6 @@ public class Dict implements Serializable {
|
||||
private String remark;
|
||||
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
public void copy(Dict source){
|
@ -10,6 +10,7 @@ package co.yixiang.modules.system.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -25,7 +26,7 @@ import java.sql.Timestamp;
|
||||
*/
|
||||
@Data
|
||||
@TableName("dict_detail")
|
||||
public class DictDetail implements Serializable {
|
||||
public class DictDetail extends BaseDomain {
|
||||
|
||||
/** 字典详细 */
|
||||
@TableId
|
||||
@ -51,9 +52,6 @@ public class DictDetail implements Serializable {
|
||||
private Dict dict;
|
||||
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
public void copy(DictDetail source){
|
@ -10,11 +10,13 @@ package co.yixiang.modules.system.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
@ -25,8 +27,9 @@ import java.sql.Timestamp;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("job")
|
||||
public class Job implements Serializable {
|
||||
public class Job extends BaseDomain {
|
||||
|
||||
/** 岗位ID */
|
||||
@TableId
|
||||
@ -51,9 +54,6 @@ public class Job implements Serializable {
|
||||
private Long deptId;
|
||||
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
public void copy(Job source){
|
@ -10,11 +10,13 @@ package co.yixiang.modules.system.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@ -26,8 +28,9 @@ import java.sql.Timestamp;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("menu")
|
||||
public class Menu implements Serializable {
|
||||
public class Menu extends BaseDomain {
|
||||
|
||||
/** ID */
|
||||
@TableId
|
||||
@ -77,9 +80,6 @@ public class Menu implements Serializable {
|
||||
private String componentName;
|
||||
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
/** 权限 */
|
@ -10,11 +10,13 @@ package co.yixiang.modules.system.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
@ -26,8 +28,9 @@ import java.util.Set;
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("role")
|
||||
public class Role implements Serializable {
|
||||
public class Role extends BaseDomain {
|
||||
|
||||
/** ID */
|
||||
@TableId
|
||||
@ -56,10 +59,6 @@ public class Role implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private Set<Dept> depts;
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
/** 功能权限 */
|
||||
private String permission;
|
@ -10,11 +10,15 @@ package co.yixiang.modules.system.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
@ -26,9 +30,10 @@ import java.util.Set;
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("user")
|
||||
public class User implements Serializable {
|
||||
public class User extends BaseDomain {
|
||||
|
||||
/** 系统用户ID */
|
||||
@TableId
|
||||
@ -84,10 +89,6 @@ public class User implements Serializable {
|
||||
private Long jobId;
|
||||
|
||||
|
||||
/** 创建日期 */
|
||||
@TableField(fill= FieldFill.INSERT)
|
||||
private Timestamp createTime;
|
||||
|
||||
|
||||
/** 最后修改密码的日期 */
|
||||
private Timestamp lastPasswordResetTime;
|
@ -10,6 +10,7 @@ import co.yixiang.config.DataScope;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.system.domain.Dept;
|
||||
import co.yixiang.modules.system.service.DeptService;
|
||||
import co.yixiang.modules.system.service.dto.DeptDto;
|
||||
@ -105,12 +106,12 @@ public class DeptController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除部门")
|
||||
@ApiOperation("删除部门")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('admin','dept:del')")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<Long> ids){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
List<Long> deptIds = new ArrayList<>();
|
||||
for (Long id : ids) {
|
||||
List<Dept> deptList = deptService.findByPid(id);
|
@ -8,6 +8,7 @@ package co.yixiang.modules.system.rest;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.system.domain.Dict;
|
||||
import co.yixiang.modules.system.service.DictService;
|
||||
import co.yixiang.modules.system.service.dto.DictDto;
|
||||
@ -85,22 +86,22 @@ public class DictController {
|
||||
return new ResponseEntity<>(dictService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改字典")
|
||||
@ApiOperation("修改字典")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('admin','dict:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Dict resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
dictService.saveOrUpdate(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除字典")
|
||||
@ApiOperation("删除字典")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
@PreAuthorize("@el.check('admin','dict:del')")
|
||||
public ResponseEntity<Object> delete(@PathVariable Long id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
dictService.removeById(id);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
@ -7,6 +7,7 @@ package co.yixiang.modules.system.rest;
|
||||
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.system.domain.DictDetail;
|
||||
import co.yixiang.modules.system.service.DictDetailService;
|
||||
import co.yixiang.modules.system.service.dto.DictDetailQueryCriteria;
|
||||
@ -81,22 +82,22 @@ public class DictDetailController {
|
||||
return new ResponseEntity<>(dictDetailService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改字典详情")
|
||||
@ApiOperation("修改字典详情")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('admin','dict:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody DictDetail resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
dictDetailService.saveOrUpdate(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除字典详情")
|
||||
@ApiOperation("删除字典详情")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
@PreAuthorize("@el.check('admin','dict:del')")
|
||||
public ResponseEntity<Object> delete(@PathVariable Long id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
dictDetailService.removeById(id);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
@ -9,6 +9,7 @@ import co.yixiang.config.DataScope;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.system.domain.Job;
|
||||
import co.yixiang.modules.system.service.JobService;
|
||||
import co.yixiang.modules.system.service.dto.JobDto;
|
||||
@ -85,23 +86,23 @@ public class JobController {
|
||||
return new ResponseEntity<>(jobService.save(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改岗位")
|
||||
@ApiOperation("修改岗位")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('admin','job:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Job resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
resources.setDeptId(resources.getDept().getId());
|
||||
jobService.saveOrUpdate(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除岗位")
|
||||
@ApiOperation("删除岗位")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('admin','job:del')")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<Long> ids){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
try {
|
||||
jobService.removeByIds(ids);
|
||||
}catch (Throwable e){
|
@ -8,6 +8,7 @@ package co.yixiang.modules.system.rest;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.system.domain.Menu;
|
||||
import co.yixiang.modules.system.service.MenuService;
|
||||
import co.yixiang.modules.system.service.RoleService;
|
||||
@ -64,12 +65,12 @@ public class MenuController {
|
||||
this.generator = generator;
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("导出菜单数据")
|
||||
@ApiOperation("导出菜单数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('menu:list')")
|
||||
public void download(HttpServletResponse response, MenuQueryCriteria criteria) throws IOException {
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
menuService.download(generator.convert(menuService.queryAll(criteria),MenuDto.class), response);
|
||||
}
|
||||
|
||||
@ -98,12 +99,12 @@ public class MenuController {
|
||||
return new ResponseEntity<>(menuService.buildTree(menuDtoList),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("新增菜单")
|
||||
@ApiOperation("新增菜单")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('menu:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Menu resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
if (resources.getId() != null) {
|
||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||
}
|
||||
@ -111,22 +112,22 @@ public class MenuController {
|
||||
return new ResponseEntity<>(menuService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改菜单")
|
||||
@ApiOperation("修改菜单")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('menu:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Menu resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
menuService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除菜单")
|
||||
@ApiOperation("删除菜单")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('menu:del')")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<Long> ids){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
Set<Menu> menuSet = new HashSet<>();
|
||||
for (Long id : ids) {
|
||||
List<Menu> menuList = menuService.findByPid(id);
|
@ -9,6 +9,7 @@ import cn.hutool.core.lang.Dict;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.system.domain.Role;
|
||||
import co.yixiang.modules.system.service.RoleService;
|
||||
import co.yixiang.modules.system.service.UserService;
|
||||
@ -99,12 +100,12 @@ public class RoleController {
|
||||
return new ResponseEntity<>(Dict.create().set("level", getLevels(null)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("新增角色")
|
||||
@ApiOperation("新增角色")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('roles:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Role resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
if (resources.getId() != null) {
|
||||
throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID");
|
||||
}
|
||||
@ -112,35 +113,35 @@ public class RoleController {
|
||||
return new ResponseEntity<>(roleService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改角色")
|
||||
@ApiOperation("修改角色")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('roles:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Role resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
getLevels(resources.getLevel());
|
||||
roleService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改角色菜单")
|
||||
@ApiOperation("修改角色菜单")
|
||||
@PutMapping(value = "/menu")
|
||||
@PreAuthorize("@el.check('roles:edit')")
|
||||
public ResponseEntity<Object> updateMenu(@RequestBody Role resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
RoleDto role = roleService.findById(resources.getId());
|
||||
getLevels(role.getLevel());
|
||||
roleService.updateMenu(resources,role);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除角色")
|
||||
@ApiOperation("删除角色")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('roles:del')")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<Long> ids){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
for (Long id : ids) {
|
||||
RoleDto role = roleService.findById(id);
|
||||
getLevels(role.getLevel());
|
@ -11,6 +11,7 @@ import co.yixiang.config.DataScope;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.exception.BadRequestException;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.aop.ForbidSubmit;
|
||||
import co.yixiang.modules.system.domain.User;
|
||||
import co.yixiang.modules.system.domain.vo.UserPassVo;
|
||||
import co.yixiang.modules.system.service.DeptService;
|
||||
@ -124,34 +125,34 @@ public class SysUserController {
|
||||
}
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("新增用户")
|
||||
@ApiOperation("新增用户")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('admin','user:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody User resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
checkLevel(resources);
|
||||
// 默认密码 123456
|
||||
resources.setPassword(passwordEncoder.encode("123456"));
|
||||
return new ResponseEntity<>(userService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改用户")
|
||||
@ApiOperation("修改用户")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('admin','user:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody User resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
checkLevel(resources);
|
||||
userService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改用户:个人中心")
|
||||
@ApiOperation("修改用户:个人中心")
|
||||
@PutMapping(value = "center")
|
||||
public ResponseEntity<Object> center(@Validated(User.Update.class) @RequestBody User resources){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
UserDto userDto = userService.findByName(SecurityUtils.getUsername());
|
||||
if(!resources.getId().equals(userDto.getId())){
|
||||
throw new BadRequestException("不能修改他人资料");
|
||||
@ -160,12 +161,12 @@ public class SysUserController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("删除用户")
|
||||
@ApiOperation("删除用户")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('admin','user:del')")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<Long> ids){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
UserDto user = userService.findByName(SecurityUtils.getUsername());
|
||||
for (Long id : ids) {
|
||||
Integer currentLevel = Collections.min(roleService.findByUsersId(user.getId()).stream().map(RoleSmallDto::getLevel).collect(Collectors.toList()));
|
||||
@ -178,10 +179,10 @@ public class SysUserController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@ApiOperation("修改密码")
|
||||
@PostMapping(value = "/updatePass")
|
||||
public ResponseEntity<Object> updatePass(@RequestBody UserPassVo passVo){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
// 密码解密
|
||||
RSA rsa = new RSA(privateKey, null);
|
||||
String oldPass = new String(rsa.decrypt(passVo.getOldPass(), KeyType.PrivateKey));
|
||||
@ -197,19 +198,19 @@ public class SysUserController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@ApiOperation("修改头像")
|
||||
@PostMapping(value = "/updateAvatar")
|
||||
public ResponseEntity<Object> updateAvatar(@RequestParam MultipartFile file){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
userService.updateAvatar(file);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ForbidSubmit
|
||||
@Log("修改邮箱")
|
||||
@ApiOperation("修改邮箱")
|
||||
@PostMapping(value = "/updateEmail/{code}")
|
||||
public ResponseEntity<Object> updateEmail(@PathVariable String code,@RequestBody User user){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
// 密码解密
|
||||
RSA rsa = new RSA(privateKey, null);
|
||||
String password = new String(rsa.decrypt(user.getPassword(), KeyType.PrivateKey));
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user