commit 36019cd0d1a2a8fc936ab50782618fd7ecf0dc52
Author: zyx <1029606625@qq.com>
Date: Wed Jun 14 19:56:33 2023 +0800
6/14 完成客户端页面整合及缓存控制
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..631d03f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,25 @@
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+target
+
+# Package Files #
+*.jar
+*.war
+*.ear
+*.zip
+*.tar.gz
+*.rar
+*.iml
+.idea
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..15625aa
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,191 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, "control" means (i) the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
+outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any
+Derivative Works that You distribute must include a readable copy of the
+attribution notices contained within such NOTICE file, excluding those notices
+that do not pertain to any part of the Derivative Works, in at least one of the
+following places: within a NOTICE text file distributed as part of the
+Derivative Works; within the Source form or documentation, if provided along
+with the Derivative Works; or, within a display generated by the Derivative
+Works, if and wherever such third-party notices normally appear. The contents of
+the NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative Works that
+You distribute, alongside or as an addendum to the NOTICE text from the Work,
+provided that such additional attribution notices cannot be construed as
+modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate
+notice, with the fields enclosed by brackets "{}" replaced with your own
+identifying information. (Don't include the brackets!) The text should be
+enclosed in the appropriate comment syntax for the file format. We also
+recommend that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier identification within
+third-party archives.
+
+ Copyright 2018 人人开源
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..50ca81b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,128 @@
+### 项目说明
+- renren-security是一个轻量级的,前后端分离的Java快速开发平台,能快速开发项目并交付【接私活利器】
+- 采用SpringBoot、Shiro、MyBatis-Plus框架,开发的一套权限系统,极低门槛,拿来即用。设计之初,就非常注重安全性,为企业系统保驾护航,让一切都变得如此简单。
+- 提供了代码生成器,只需编写30%左右代码,其余的代码交给系统自动生成,可快速完成开发任务
+- 支持MySQL、达梦、Oracle、SQL Server、PostgreSQL等主流数据库
+- 前端地址:https://gitee.com/renrenio/renren-ui
+- 演示地址:http://demo.open.renren.io/renren-security (账号密码:admin/admin)
+
+
+
+### 微信交流群
+我们提供了微信交流群,扫码下面的二维码,关注【人人开源】公众号,回复【加群】,即可根据提示加入微信群!
+
+![输入图片说明](renren-admin/src/main/resources/public/wechat.jpg)
+
+
+
+### 具有如下特点
+- 友好的代码结构及注释,便于阅读及二次开发
+- 实现前后端分离,通过token进行数据交互,前端再也不用关注后端技术
+- 灵活的权限控制,可控制到页面或按钮,满足绝大部分的权限需求
+- 提供CrudService接口,对增删改查进行封装,代码更简洁
+- 页面交互使用Vue2.x,极大的提高了开发效率
+- 完善的部门管理及数据权限,通过注解实现数据权限的控制
+- 完善的XSS防范及脚本过滤,彻底杜绝XSS攻击
+- 完善的代码生成机制,可在线生成entity、xml、dao、service、vue、sql代码,减少70%以上的开发任务
+- 引入quartz定时任务,可动态完成任务的添加、修改、删除、暂停、恢复及日志查看等功能
+- 引入Hibernate Validator校验框架,轻松实现后端校验
+- 引入云存储服务,已支持:七牛云、阿里云、腾讯云等
+- 引入swagger文档支持,方便编写API接口文档
+
+
+
+### 数据权限设计思想
+- 用户管理、角色管理、部门管理,可操作本部门及子部门数据
+- 菜单管理、定时任务、参数管理、字典管理、系统日志,没有数据权限
+- 业务功能,按照用户数据权限,查询、操作数据【没有本部门数据权限,也能查询本人数据】
+
+
+
+
+**项目结构**
+```
+renren-security
+├─renren-common 公共模块
+│
+├─renren-admin 管理后台
+│ ├─db 数据库SQL脚本
+│ │
+│ ├─modules 模块
+│ │ ├─job 定时任务
+│ │ ├─log 日志管理
+│ │ ├─oss 文件存储
+│ │ ├─security 安全模块
+│ │ └─sys 系统管理(核心)
+│ │
+│ └─resources
+│ ├─mapper MyBatis文件
+│ ├─public 静态资源
+│ └─application.yml 全局配置文件
+│
+│
+├─renren-api API服务
+│
+├─renren-generator 代码生成器
+│ └─resources
+│ ├─mapper MyBatis文件
+│ ├─template 代码生成器模板(可增加或修改相应模板)
+│ ├─application.yml 全局配置文件
+│ └─generator.properties 代码生成器,配置文件
+│
+```
+
+
+
+**技术选型:**
+- 核心框架:Spring Boot 2.7
+- 安全框架:Apache Shiro 1.10
+- 持久层框架:MyBatis 3.5
+- 定时器:Quartz 2.3
+- 数据库连接池:Druid 1.2
+- 日志管理:Logback
+- 页面交互:Vue2.x
+
+
+
+**软件需求**
+- JDK1.8
+- Maven3.0+
+- MySQL8.0
+- Oracle 11g+
+- SQL Server 2012+
+- PostgreSQL 9.4+
+- 达梦8
+
+
+
+**本地部署**
+- 通过git下载源码
+- idea、eclipse需安装lombok插件,不然会提示找不到entity的get set方法
+- 创建数据库renren_security,数据库编码为UTF-8
+- 执行db/mysql.sql文件,初始化数据
+- 修改application-dev.yml文件,更新MySQL账号和密码
+- 在renren-security目录下,执行mvn clean install
+- Eclipse、IDEA运行AdminApplication.java,则可启动项目【renren-admin】
+- renren-admin访问路径:http://localhost:8080/renren-admin
+- swagger文档路径:http://localhost:8080/renren-admin/doc.html
+- 再启动前端项目,前端地址:https://gitee.com/renrenio/renren-ui
+- 账号密码:admin/admin
+
+
+![输入图片说明](renren-admin/src/main/resources/public/1.png)
+
+
+
+![输入图片说明](renren-admin/src/main/resources/public/2.png)
+
+
+
+### 如何交流、反馈、参与贡献?
+- 开发文档:https://www.renren.io/guide/security
+- 官方社区:https://www.renren.io/community
+- Gitee仓库:https://gitee.com/renrenio/renren-security
+- [人人开源](https://www.renren.io):https://www.renren.io
+- 如需关注项目最新动态,请Watch、Star项目,同时也是对项目最好的支持
+- 技术讨论、二次开发等咨询、问题和建议,请移步到官方社区,我会在第一时间进行解答和回复!
+
+
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..f01e567
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,14 @@
+version: '2'
+services:
+ renren-admin:
+ image: renren/renren-admin
+ ports:
+ - "8080:8080"
+ environment:
+ - spring.profiles.active=dev
+ renren-api:
+ image: renren/renren-api
+ ports:
+ - "8081:8081"
+ environment:
+ - spring.profiles.active=dev
\ No newline at end of file
diff --git a/mt_db.sql b/mt_db.sql
new file mode 100644
index 0000000..8cd2539
--- /dev/null
+++ b/mt_db.sql
@@ -0,0 +1,1080 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server : MySQL80
+ Source Server Type : MySQL
+ Source Server Version : 80026
+ Source Host : localhost:3306
+ Source Schema : mt_db
+
+ Target Server Type : MySQL
+ Target Server Version : 80026
+ File Encoding : 65001
+
+ Date: 14/06/2023 15:38:46
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for address_book
+-- ----------------------------
+DROP TABLE IF EXISTS `address_book`;
+CREATE TABLE `address_book` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `user_id` bigint(0) NOT NULL COMMENT '用户id',
+ `consignee` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '收货人',
+ `gender` tinyint(0) NOT NULL COMMENT '性别 0 男 1 女',
+ `phone` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '手机号',
+ `province_code` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '省级区划编号',
+ `province_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '省级名称',
+ `city_code` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '市级区划编号',
+ `city_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '市级名称',
+ `district_code` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区级区划编号',
+ `district_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '区级名称',
+ `detail` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '详细地址',
+ `label` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签',
+ `is_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT '默认 0 否 1是',
+ `creator` bigint(0) NOT NULL COMMENT '创建人',
+ `create_date` datetime(0) NOT NULL COMMENT '创建时间',
+ `updater` bigint(0) NOT NULL COMMENT '修改人',
+ `update_date` datetime(0) NOT NULL COMMENT '更新时间',
+ `is_deleted` int(0) NOT NULL DEFAULT 0 COMMENT '是否删除',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '地址管理' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of address_book
+-- ----------------------------
+INSERT INTO `address_book` VALUES (1, 1668247645219012609, '1111', 1, '15625658458', NULL, NULL, NULL, NULL, NULL, NULL, '25', '公司', 1, 1668247645219012609, '2023-06-14 12:56:55', 1668247645219012609, '2023-06-14 13:34:19', 0);
+
+-- ----------------------------
+-- Table structure for category
+-- ----------------------------
+DROP TABLE IF EXISTS `category`;
+CREATE TABLE `category` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `type` int(0) NULL DEFAULT NULL COMMENT '类型 1 菜品分类 2 套餐分类',
+ `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '分类名称',
+ `sort` int(0) NOT NULL DEFAULT 0 COMMENT '顺序',
+ `creator` bigint(0) NOT NULL COMMENT '创建人',
+ `create_date` datetime(0) NOT NULL COMMENT '创建时间',
+ `updater` bigint(0) NOT NULL COMMENT '修改人',
+ `update_date` datetime(0) NOT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `idx_category_name`(`name`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜品及套餐分类' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of category
+-- ----------------------------
+INSERT INTO `category` VALUES (1523221549476327425, 1, '家常菜', 9, 1, '2022-05-08 16:41:32', 1, '2022-05-08 17:38:00');
+INSERT INTO `category` VALUES (1523221580623228930, 1, '盖饭', 8, 1, '2022-05-08 16:41:40', 1, '2022-05-08 17:38:08');
+INSERT INTO `category` VALUES (1523221607961702401, 1, '特色菜', 7, 1, '2022-05-08 16:41:46', 1, '2022-05-08 17:38:16');
+INSERT INTO `category` VALUES (1523221632653570050, 1, '干锅', 6, 1, '2022-05-08 16:41:52', 1, '2022-05-08 17:38:22');
+INSERT INTO `category` VALUES (1523221667613093889, 1, '家常菜系列', 5, 1, '2022-05-08 16:42:00', 1, '2022-05-08 16:42:00');
+INSERT INTO `category` VALUES (1523221692862803970, 1, '汤菜', 4, 1, '2022-05-08 16:42:06', 1, '2022-05-08 17:38:34');
+INSERT INTO `category` VALUES (1523223881484185602, 1, '素菜系', 3, 1, '2022-05-08 16:50:48', 1, '2022-05-08 17:38:46');
+INSERT INTO `category` VALUES (1523224049252151297, 2, '套餐', 2, 1, '2022-05-08 16:51:28', 1, '2022-05-08 17:39:08');
+INSERT INTO `category` VALUES (1523224111688560641, 1, '米饭', 8, 1, '2022-05-08 16:51:43', 1, '2022-05-08 16:51:43');
+INSERT INTO `category` VALUES (1523224134312636417, 1, '饮料', 1, 1, '2022-05-08 16:51:48', 1, '2022-05-08 17:39:13');
+
+-- ----------------------------
+-- Table structure for dish
+-- ----------------------------
+DROP TABLE IF EXISTS `dish`;
+CREATE TABLE `dish` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '菜品名称',
+ `category_id` bigint(0) NOT NULL COMMENT '菜品分类id',
+ `price` decimal(10, 2) NULL DEFAULT NULL COMMENT '菜品价格',
+ `code` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '商品码',
+ `image` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '图片',
+ `description` varchar(400) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述信息',
+ `status` int(0) NOT NULL DEFAULT 1 COMMENT '0 停售 1 起售',
+ `sort` int(0) NOT NULL DEFAULT 0 COMMENT '顺序',
+ `creator` bigint(0) NOT NULL COMMENT '创建人',
+ `create_date` datetime(0) NOT NULL COMMENT '创建时间',
+ `updater` bigint(0) NOT NULL COMMENT '修改人',
+ `update_date` datetime(0) NOT NULL COMMENT '更新时间',
+ `is_deleted` int(0) NOT NULL DEFAULT 0 COMMENT '是否删除',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `idx_dish_name`(`name`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜品管理' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of dish
+-- ----------------------------
+INSERT INTO `dish` VALUES (1523227188311207938, '三鲜肉炒莲白(米饭单点)', 1523221549476327425, 1488.00, '001', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0a3b3288-3446-4420-bbff-f263d0c02d8e.jpg', '原料:猪肉,白菜', 1, 0, 1, '2022-06-19 14:24:07', 1559815019674214402, '2022-08-21 12:33:20', 0);
+INSERT INTO `dish` VALUES (1523227597964685314, '土豆炒肉丝(米饭单点)', 1523221549476327425, 1388.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0f4bd884-dc9c-4cf9-b59e-7d5958fec3dd.jpg', '原料:土豆,猪肉', 1, 0, 1, '2022-06-19 14:24:44', 1, '2022-06-19 14:24:44', 0);
+INSERT INTO `dish` VALUES (1523227696245616641, '农家炒腊肉(米饭单点)', 1523221549476327425, 1688.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0f252364-a561-4e8d-8065-9a6797a6b1d3.jpg', '原料:腊肉', 1, 0, 1, '2022-06-19 14:23:55', 1, '2022-06-19 14:23:55', 0);
+INSERT INTO `dish` VALUES (1523229046501126146, '干烧鲫鱼(米饭单点)', 1523221549476327425, 1898.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/1fdbfbf3-1d86-4b29-a3fc-46345852f2f8.jpg', '原料:鲫鱼', 1, 0, 1, '2022-06-19 14:23:21', 1, '2022-06-19 14:23:21', 0);
+INSERT INTO `dish` VALUES (1523229349560561666, '小炒肉(米饭单点)', 1523221549476327425, 1380.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/02b533f2f4dd038058a9bb40827ab30a.jpeg', '原料:猪肉', 1, 0, 1, '2022-06-19 14:24:31', 1, '2022-06-19 14:24:31', 0);
+INSERT INTO `dish` VALUES (1523229489490931714, '尖椒鸡(米饭单点)', 1523221549476327425, 1398.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/2a2e9d66-b41d-4645-87bd-95f2cfeed218.jpg', '原料:辣椒,鸡肉', 1, 0, 1, '2022-06-19 14:23:02', 1, '2022-06-19 14:23:02', 0);
+INSERT INTO `dish` VALUES (1523229659871948801, '回锅肉(米饭单点)', 1523221549476327425, 1388.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/2a50628e-7758-4c51-9fbb-d37c61cdacad.jpg', '原料:猪肉', 1, 0, 1, '2022-06-19 14:22:43', 1, '2022-06-19 14:22:43', 0);
+INSERT INTO `dish` VALUES (1523229839321051137, '鱼香肉丝(米饭单点)', 1523221549476327425, 1398.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/2e96a7e3-affb-438e-b7c3-e1430df425c9.jpeg', '原料:胡罗卜、笋、木耳、猪肉', 1, 0, 1, '2022-06-19 14:21:32', 1, '2022-06-19 14:21:32', 0);
+INSERT INTO `dish` VALUES (1523230006640226306, '土豆肉丝+米饭', 1523221580623228930, 1500.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/3fabb83a-1c09-4fd9-892b-4ef7457daafa.jpeg', '原料:大米、土豆、猪肉', 1, 0, 1, '2022-06-19 14:21:00', 1, '2022-06-19 14:21:00', 0);
+INSERT INTO `dish` VALUES (1523230157148631041, '盐煎肉+米饭', 1523221580623228930, 1500.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/5b8d2da3-3744-4bb3-acdc-329056b8259d.jpeg', '原料:大米、猪肉、食盐', 1, 0, 1, '2022-06-19 14:20:48', 1, '2022-06-19 14:20:48', 0);
+INSERT INTO `dish` VALUES (1523230305597632513, '回锅肉+米饭', 1523221580623228930, 1500.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/8dcfda14-5712-4d28-82f7-ae905b3c2308.jpg', '原料:大米、猪肉', 1, 0, 1, '2022-06-19 14:20:34', 1, '2022-06-19 14:20:34', 0);
+INSERT INTO `dish` VALUES (1523230460363255810, '豆干肉丝+米饭', 1523221580623228930, 1500.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/9ec6fc2d-50d2-422e-b954-de87dcd04198.jpeg', '原料:大米、豆干、猪肉', 1, 0, 1, '2022-06-19 14:15:41', 1, '2022-06-19 14:15:41', 0);
+INSERT INTO `dish` VALUES (1523230566508507138, '鱼香肉丝+米饭', 1523221580623228930, 1500.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/057dd338-e487-4bbc-a74c-0384c44a9ca3.jpg', '原料:大米、猪肉', 1, 0, 1, '2022-06-19 14:21:45', 1, '2022-06-19 14:21:45', 0);
+INSERT INTO `dish` VALUES (1523230706002669569, '老盐菜炒回锅肉(米饭单点)', 1523221607961702401, 1398.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/583df4b7-a159-4cfc-9543-4f666120b25f.jpeg', '原料:猪肉', 1, 0, 1, '2022-06-19 14:14:49', 1, '2022-06-19 14:14:49', 0);
+INSERT INTO `dish` VALUES (1523230887100133378, '剁椒鲫鱼(米饭单点)', 1523221607961702401, 2198.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/646d357d11812f9479e50e41651e8946.jpeg', '原料:鲫鱼', 1, 0, 1, '2022-06-19 14:14:37', 1, '2022-06-19 14:14:37', 0);
+INSERT INTO `dish` VALUES (1523231074837180418, '泡椒儿肠(米饭单点)', 1523221607961702401, 1698.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/740c79ce-af29-41b8-b78d-5f49c96e38c4.jpg', '原料:猪小肠', 1, 0, 1, '2022-06-19 14:13:31', 1, '2022-06-19 14:13:31', 0);
+INSERT INTO `dish` VALUES (1523231271495512066, '干锅鸡+米饭', 1523221632653570050, 1980.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/1405081e-f545-42e1-86a2-f7559ae2e276.jpeg', '原料:鸡肉', 1, 0, 1, '2022-06-19 14:19:42', 1, '2022-06-19 14:19:42', 0);
+INSERT INTO `dish` VALUES (1523231432867164162, '豆花+油碟+米饭', 1523221667613093889, 980.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/a53a4e6a-3b83-4044-87f9-9d49b30a8fdc.jpg', '原料:豆腐脑', 1, 0, 1, '2022-06-19 14:11:32', 1, '2022-06-19 14:11:32', 0);
+INSERT INTO `dish` VALUES (1523231582276661250, '干烧鲫鱼(不含米饭)', 1523221667613093889, 1898.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/d2f61d70-ac85-4529-9b74-6d9a2255c6d7.jpg', '原料:鲫鱼', 1, 0, 1, '2022-06-19 14:14:14', 1, '2022-06-19 14:14:14', 0);
+INSERT INTO `dish` VALUES (1523231728100028417, '红烧肉(不含米饭)', 1523221667613093889, 1498.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/d1688fe2a91cda424852b88dd5f2679e.jpeg', '原料:土豆、猪肉', 1, 0, 1, '2022-06-19 14:18:42', 1, '2022-06-19 14:18:42', 0);
+INSERT INTO `dish` VALUES (1523231842168320002, '土豆烧鸡(不含米饭)', 1523221667613093889, 2000.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/e476f679-5c15-436b-87fa-8c4e9644bf33.jpeg', '原料:土豆、鸡肉', 1, 0, 1, '2022-06-19 14:18:20', 1, '2022-06-19 14:18:20', 0);
+INSERT INTO `dish` VALUES (1523231978755829761, '农家炒香肠(不含米饭)', 1523221667613093889, 1698.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/ef2b73f2-75d1-4d3a-beea-22da0e1421bd.jpg', '原料:香肠', 1, 0, 1, '2022-06-19 14:11:18', 1, '2022-06-19 14:11:18', 0);
+INSERT INTO `dish` VALUES (1523232102403911681, '三线莲白(不含米饭)', 1523221667613093889, 1398.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/f966a38e-0780-40be-bb52-5699d13cb3d9.jpg', '原料:大白菜', 1, 0, 1, '2022-06-19 14:18:03', 1, '2022-06-19 14:18:03', 0);
+INSERT INTO `dish` VALUES (1523232185912504321, '紫菜蛋花汤(不含米饭)', 1523221692862803970, 880.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0a3b3288-3446-4420-bbff-f263d0c02d8e.jpg', '原料:紫菜、鸡蛋', 1, 0, 1, '2022-06-19 14:08:47', 1, '2022-06-19 14:08:47', 0);
+INSERT INTO `dish` VALUES (1523232325142425601, '酸菜粉丝汤(不含米饭)', 1523221692862803970, 780.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0f4bd884-dc9c-4cf9-b59e-7d5958fec3dd.jpg', '原料:粉丝、酸菜', 1, 0, 1, '2022-06-19 14:08:17', 1, '2022-06-19 14:08:17', 0);
+INSERT INTO `dish` VALUES (1523232409104003074, '肉片汤(不含米饭)', 1523221692862803970, 2200.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0f252364-a561-4e8d-8065-9a6797a6b1d3.jpg', '原料:猪肉', 1, 0, 1, '2022-06-19 14:08:07', 1, '2022-06-19 14:08:07', 0);
+INSERT INTO `dish` VALUES (1523232518197850114, '番茄鸡蛋汤(不含米饭)', 1523221692862803970, 880.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/1fdbfbf3-1d86-4b29-a3fc-46345852f2f8.jpg', '原料:番茄、 鸡蛋', 1, 0, 1, '2022-06-19 14:05:51', 1, '2022-06-19 14:05:51', 0);
+INSERT INTO `dish` VALUES (1523232652012924930, '红烧茄子(不含米饭)', 1523223881484185602, 856.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/02b533f2f4dd038058a9bb40827ab30a.jpeg', '原料:茄子', 1, 0, 1, '2022-06-19 14:16:27', 1, '2022-06-19 14:16:27', 0);
+INSERT INTO `dish` VALUES (1523232750734258177, '炒胡豆(不含米饭)', 1523223881484185602, 788.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/2a2e9d66-b41d-4645-87bd-95f2cfeed218.jpg', '原料:胡豆', 1, 0, 1, '2022-06-19 14:06:59', 1, '2022-06-19 14:06:59', 0);
+INSERT INTO `dish` VALUES (1523232846934814722, '干煸土豆丝(不含米饭)', 1523223881484185602, 1500.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/2a50628e-7758-4c51-9fbb-d37c61cdacad.jpg', '原料:土豆', 1, 0, 1, '2022-06-19 14:07:10', 1, '2022-06-19 14:07:10', 0);
+INSERT INTO `dish` VALUES (1523233237814587394, '红苕稀饭', 1523224111688560641, 168.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/ee04a05a-1230-46b6-8ad5-1a95b140fff3.png', '原料:大米', 1, 0, 1, '2022-06-19 14:07:19', 1067246875800000001, '2022-08-29 21:20:05', 0);
+INSERT INTO `dish` VALUES (1523233316415844354, '香肠炒饭', 1523224111688560641, 998.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/ee04a05a-1230-46b6-8ad5-1a95b140fff3.png', '原料:大米、香肠', 1, 0, 1, '2022-06-19 14:07:41', 1067246875800000001, '2022-08-29 21:20:05', 0);
+INSERT INTO `dish` VALUES (1523233498566078465, '鸡蛋炒饭', 1523224111688560641, 688.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/ee04a05a-1230-46b6-8ad5-1a95b140fff3.png', '原料:大米、鸡蛋', 1, 0, 1, '2022-06-19 14:07:54', 1067246875800000001, '2022-08-29 21:20:05', 0);
+INSERT INTO `dish` VALUES (1523233618137296897, '珍珠米饭', 1523224111688560641, 100.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/ee04a05a-1230-46b6-8ad5-1a95b140fff3.png', '原料:大米', 1, 0, 1, '2022-06-19 02:47:24', 1067246875800000001, '2022-08-29 21:20:05', 0);
+INSERT INTO `dish` VALUES (1523233739667255298, '怡宝', 1523224134312636417, 200.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/c99e0aab-3cb7-4eaa-80fd-f47d4ffea694.png', '原料:水', 1, 0, 1, '2022-06-19 14:04:00', 1067246875800000001, '2022-08-29 21:20:05', 0);
+INSERT INTO `dish` VALUES (1560651286804705282, 'test测试1', 1523221549476327425, 1980.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/057dd338-e487-4bbc-a74c-0384c44a9ca3.jpg', '测试测试', 1, 0, 1067246875800000001, '2022-08-19 23:33:57', 1067246875800000001, '2022-08-29 23:19:07', 0);
+INSERT INTO `dish` VALUES (1564251465613164545, '测试测试', 1523221549476327425, 1100.00, '', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/583df4b7-a159-4cfc-9543-4f666120b25f.jpeg', '', 1, 0, 1067246875800000001, '2022-08-29 21:59:46', 1067246875800000001, '2022-08-29 23:18:45', 0);
+
+-- ----------------------------
+-- Table structure for dish_flavor
+-- ----------------------------
+DROP TABLE IF EXISTS `dish_flavor`;
+CREATE TABLE `dish_flavor` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `dish_id` bigint(0) NOT NULL COMMENT '菜品',
+ `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '口味名称',
+ `value` varchar(500) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '口味数据list',
+ `creator` bigint(0) NOT NULL COMMENT '创建人',
+ `create_date` datetime(0) NOT NULL COMMENT '创建时间',
+ `updater` bigint(0) NOT NULL COMMENT '修改人',
+ `update_date` datetime(0) NOT NULL COMMENT '更新时间',
+ `is_deleted` int(0) NOT NULL DEFAULT 0 COMMENT '是否删除',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '菜品口味关系表' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of dish_flavor
+-- ----------------------------
+INSERT INTO `dish_flavor` VALUES (1397849417888346113, 1397849417854791681, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 09:37:27', 1, '2021-05-27 09:37:27', 0);
+INSERT INTO `dish_flavor` VALUES (1397849936421761025, 1397849936404983809, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-27 09:39:30', 1, '2021-05-27 09:39:30', 0);
+INSERT INTO `dish_flavor` VALUES (1397849936438538241, 1397849936404983809, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 09:39:30', 1, '2021-05-27 09:39:30', 0);
+INSERT INTO `dish_flavor` VALUES (1397850630734262274, 1397850630700707841, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-27 09:42:16', 1, '2021-05-27 09:42:16', 0);
+INSERT INTO `dish_flavor` VALUES (1397850630755233794, 1397850630700707841, '辣度', '[\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 09:42:16', 1, '2021-05-27 09:42:16', 0);
+INSERT INTO `dish_flavor` VALUES (1397853423486414850, 1397853423461249026, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 09:53:22', 1, '2021-05-27 09:53:22', 0);
+INSERT INTO `dish_flavor` VALUES (1397854133632413697, 1397854133603053569, '温度', '[\"热饮\",\"常温\",\"去冰\",\"少冰\",\"多冰\"]', 1, '2021-05-27 09:56:11', 1, '2021-05-27 09:56:11', 0);
+INSERT INTO `dish_flavor` VALUES (1397855742303186946, 1397855742273826817, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 10:02:35', 1, '2021-05-27 10:02:35', 0);
+INSERT INTO `dish_flavor` VALUES (1397855906497605633, 1397855906468245506, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-27 10:03:14', 1, '2021-05-27 10:03:14', 0);
+INSERT INTO `dish_flavor` VALUES (1397856190573621250, 1397856190540066818, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 10:04:21', 1, '2021-05-27 10:04:21', 0);
+INSERT INTO `dish_flavor` VALUES (1397859056709316609, 1397859056684150785, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 10:15:45', 1, '2021-05-27 10:15:45', 0);
+INSERT INTO `dish_flavor` VALUES (1397859277837217794, 1397859277812051969, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 10:16:37', 1, '2021-05-27 10:16:37', 0);
+INSERT INTO `dish_flavor` VALUES (1397859487502086146, 1397859487476920321, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 10:17:27', 1, '2021-05-27 10:17:27', 0);
+INSERT INTO `dish_flavor` VALUES (1397859757061615618, 1397859757036449794, '甜味', '[\"无糖\",\"少糖\",\"半躺\",\"多糖\",\"全糖\"]', 1, '2021-05-27 10:18:32', 1, '2021-05-27 10:18:32', 0);
+INSERT INTO `dish_flavor` VALUES (1397861135754506242, 1397861135733534722, '甜味', '[\"无糖\",\"少糖\",\"半躺\",\"多糖\",\"全糖\"]', 1, '2021-05-27 10:24:00', 1, '2021-05-27 10:24:00', 0);
+INSERT INTO `dish_flavor` VALUES (1397861370035744769, 1397861370010578945, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-27 10:24:56', 1, '2021-05-27 10:24:56', 0);
+INSERT INTO `dish_flavor` VALUES (1397861898467717121, 1397861898438356993, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-27 10:27:02', 1, '2021-05-27 10:27:02', 0);
+INSERT INTO `dish_flavor` VALUES (1398089545865015297, 1398089545676271617, '温度', '[\"热饮\",\"常温\",\"去冰\",\"少冰\",\"多冰\"]', 1, '2021-05-28 01:31:38', 1, '2021-05-28 01:31:38', 0);
+INSERT INTO `dish_flavor` VALUES (1398089782323097601, 1398089782285348866, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:32:34', 1, '2021-05-28 01:32:34', 0);
+INSERT INTO `dish_flavor` VALUES (1398090003262255106, 1398090003228700673, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-28 01:33:27', 1, '2021-05-28 01:33:27', 0);
+INSERT INTO `dish_flavor` VALUES (1398090264554811394, 1398090264517062657, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-28 01:34:29', 1, '2021-05-28 01:34:29', 0);
+INSERT INTO `dish_flavor` VALUES (1398090455399837698, 1398090455324340225, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:35:14', 1, '2021-05-28 01:35:14', 0);
+INSERT INTO `dish_flavor` VALUES (1398090685449023490, 1398090685419663362, '温度', '[\"热饮\",\"常温\",\"去冰\",\"少冰\",\"多冰\"]', 1, '2021-05-28 01:36:09', 1, '2021-05-28 01:36:09', 0);
+INSERT INTO `dish_flavor` VALUES (1398090825358422017, 1398090825329061889, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-28 01:36:43', 1, '2021-05-28 01:36:43', 0);
+INSERT INTO `dish_flavor` VALUES (1398091007051476993, 1398091007017922561, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:37:26', 1, '2021-05-28 01:37:26', 0);
+INSERT INTO `dish_flavor` VALUES (1398091296164851713, 1398091296131297281, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:38:35', 1, '2021-05-28 01:38:35', 0);
+INSERT INTO `dish_flavor` VALUES (1398091546531246081, 1398091546480914433, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2021-05-28 01:39:35', 1, '2021-05-28 01:39:35', 0);
+INSERT INTO `dish_flavor` VALUES (1398091729809747969, 1398091729788776450, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:40:18', 1, '2021-05-28 01:40:18', 0);
+INSERT INTO `dish_flavor` VALUES (1398091889499484161, 1398091889449152513, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:40:56', 1, '2021-05-28 01:40:56', 0);
+INSERT INTO `dish_flavor` VALUES (1398092095179763713, 1398092095142014978, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:41:45', 1, '2021-05-28 01:41:45', 0);
+INSERT INTO `dish_flavor` VALUES (1398092283877306370, 1398092283847946241, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:42:30', 1, '2021-05-28 01:42:30', 0);
+INSERT INTO `dish_flavor` VALUES (1398094018939236354, 1398094018893099009, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:49:24', 1, '2021-05-28 01:49:24', 0);
+INSERT INTO `dish_flavor` VALUES (1398094391494094850, 1398094391456346113, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2021-05-28 01:50:53', 1, '2021-05-28 01:50:53', 0);
+INSERT INTO `dish_flavor` VALUES (1399574026165727233, 1399305325713600514, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1399309715396669441, '2021-06-01 03:50:25', 1399309715396669441, '2021-06-01 03:50:25', 0);
+INSERT INTO `dish_flavor` VALUES (1523231271495512067, 1523231271495512066, '辣度', '[\"不辣\",\"微辣\",\"中辣\",\"重辣\"]', 1, '2022-06-19 14:19:42', 1, '2022-06-19 14:19:42', 0);
+INSERT INTO `dish_flavor` VALUES (1523231582276661251, 1523231582276661250, '忌口', '[\"不要葱\",\"不要蒜\",\"不要香菜\",\"不要辣\"]', 1, '2022-06-19 14:14:14', 1, '2022-06-19 14:14:14', 0);
+
+-- ----------------------------
+-- Table structure for order_detail
+-- ----------------------------
+DROP TABLE IF EXISTS `order_detail`;
+CREATE TABLE `order_detail` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '名字',
+ `image` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '图片',
+ `order_id` bigint(0) NOT NULL COMMENT '订单id',
+ `dish_id` bigint(0) NULL DEFAULT NULL COMMENT '菜品id',
+ `setmeal_id` bigint(0) NULL DEFAULT NULL COMMENT '套餐id',
+ `dish_flavor` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '口味',
+ `number` int(0) NOT NULL DEFAULT 1 COMMENT '数量',
+ `amount` decimal(10, 2) NOT NULL COMMENT '金额',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单明细表' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of order_detail
+-- ----------------------------
+INSERT INTO `order_detail` VALUES (4, '干煸土豆丝(不含米饭)', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/2a50628e-7758-4c51-9fbb-d37c61cdacad.jpg', 1668848038638575618, 1523232846934814722, NULL, NULL, 1, 15.00);
+INSERT INTO `order_detail` VALUES (5, '珍珠米饭', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/ee04a05a-1230-46b6-8ad5-1a95b140fff3.png', 1668848038638575618, 1523233618137296897, NULL, NULL, 1, 1.00);
+INSERT INTO `order_detail` VALUES (6, '怡宝', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/c99e0aab-3cb7-4eaa-80fd-f47d4ffea694.png', 1668848932419592194, 1523233739667255298, NULL, NULL, 1, 2.00);
+INSERT INTO `order_detail` VALUES (7, '怡宝', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/c99e0aab-3cb7-4eaa-80fd-f47d4ffea694.png', 1668849273609445377, 1523233739667255298, NULL, NULL, 1, 2.00);
+INSERT INTO `order_detail` VALUES (8, '怡宝', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/c99e0aab-3cb7-4eaa-80fd-f47d4ffea694.png', 1668850382742781953, 1523233739667255298, NULL, NULL, 1, 2.00);
+INSERT INTO `order_detail` VALUES (9, '珍珠米饭', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/ee04a05a-1230-46b6-8ad5-1a95b140fff3.png', 1668851197406683137, 1523233618137296897, NULL, NULL, 1, 1.00);
+INSERT INTO `order_detail` VALUES (11, '测试测试', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/e476f679-5c15-436b-87fa-8c4e9644bf33.jpeg', 1668854130919673858, NULL, 1564264362565296130, NULL, 1, 33.00);
+INSERT INTO `order_detail` VALUES (13, '豆花+油碟+米饭', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/a53a4e6a-3b83-4044-87f9-9d49b30a8fdc.jpg', 1668854130919673858, 1523231432867164162, NULL, NULL, 1, 9.80);
+
+-- ----------------------------
+-- Table structure for orders
+-- ----------------------------
+DROP TABLE IF EXISTS `orders`;
+CREATE TABLE `orders` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `number` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '订单号',
+ `status` int(0) NOT NULL DEFAULT 1 COMMENT '订单状态 1待付款,2待派送,3已派送,4已完成,5已取消',
+ `user_id` bigint(0) NOT NULL COMMENT '下单用户',
+ `address_book_id` bigint(0) NOT NULL COMMENT '地址id',
+ `order_time` datetime(0) NOT NULL COMMENT '下单时间',
+ `checkout_time` datetime(0) NULL DEFAULT NULL COMMENT '结账时间',
+ `pay_method` int(0) NOT NULL DEFAULT 1 COMMENT '支付方式 1微信,2支付宝',
+ `amount` decimal(10, 2) NOT NULL COMMENT '实收金额',
+ `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '备注',
+ `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+ `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+ `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+ `consignee` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单表' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of orders
+-- ----------------------------
+INSERT INTO `orders` VALUES (1, '1668845880056819713', 1, 1668247645219012609, 1, '2023-06-14 13:00:38', NULL, 2, 16.00, '123', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (2, '1668846627565678594', 1, 1668247645219012609, 1, '2023-06-14 13:03:36', NULL, 2, 16.00, '', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (3, '1668846813885034498', 1, 1668247645219012609, 1, '2023-06-14 13:05:26', NULL, 2, 16.00, '', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (4, '1668848038638575618', 1, 1668247645219012609, 1, '2023-06-14 13:09:13', NULL, 2, 16.00, '', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (5, '1668848932419592194', 1, 1668247645219012609, 1, '2023-06-14 13:12:46', NULL, 2, 2.00, '', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (6, '1668849273609445377', 1, 1668247645219012609, 1, '2023-06-14 13:14:07', NULL, 2, 2.00, '', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (7, '1668850382742781953', 2, 1668247645219012609, 1, '2023-06-14 13:18:32', '2023-06-14 13:18:50', 2, 2.00, '', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (8, '1668851197406683137', 2, 1668247645219012609, 1, '2023-06-14 13:21:46', '2023-06-14 13:22:00', 2, 1.00, 'test', '15625658458', '252', NULL, '1111');
+INSERT INTO `orders` VALUES (9, '1668854130919673858', 2, 1668247645219012609, 1, '2023-06-14 13:33:25', '2023-06-14 13:33:36', 2, 42.00, 'tttt', '15625658458', '252', NULL, '1111');
+
+-- ----------------------------
+-- Table structure for qrtz_blob_triggers
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_blob_triggers`;
+CREATE TABLE `qrtz_blob_triggers` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `BLOB_DATA` blob NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `SCHED_NAME`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for qrtz_calendars
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_calendars`;
+CREATE TABLE `qrtz_calendars` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `CALENDAR` blob NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `CALENDAR_NAME`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for qrtz_cron_triggers
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_cron_triggers`;
+CREATE TABLE `qrtz_cron_triggers` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `CRON_EXPRESSION` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TIME_ZONE_ID` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of qrtz_cron_triggers
+-- ----------------------------
+INSERT INTO `qrtz_cron_triggers` VALUES ('RenrenScheduler', 'TASK_1067246875800000076', 'DEFAULT', '0 0/30 * * * ?', 'Asia/Shanghai');
+
+-- ----------------------------
+-- Table structure for qrtz_fired_triggers
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_fired_triggers`;
+CREATE TABLE `qrtz_fired_triggers` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `ENTRY_ID` varchar(95) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `FIRED_TIME` bigint(0) NOT NULL,
+ `SCHED_TIME` bigint(0) NOT NULL,
+ `PRIORITY` int(0) NOT NULL,
+ `STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `ENTRY_ID`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_TRIG_INST_NAME`(`SCHED_NAME`, `INSTANCE_NAME`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY`(`SCHED_NAME`, `INSTANCE_NAME`, `REQUESTS_RECOVERY`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_J_G`(`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_JG`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_T_G`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_FT_TG`(`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for qrtz_job_details
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_job_details`;
+CREATE TABLE `qrtz_job_details` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `JOB_CLASS_NAME` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `IS_DURABLE` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `IS_NONCONCURRENT` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `IS_UPDATE_DATA` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `REQUESTS_RECOVERY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_DATA` blob NULL,
+ PRIMARY KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_J_REQ_RECOVERY`(`SCHED_NAME`, `REQUESTS_RECOVERY`) USING BTREE,
+ INDEX `IDX_QRTZ_J_GRP`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of qrtz_job_details
+-- ----------------------------
+INSERT INTO `qrtz_job_details` VALUES ('RenrenScheduler', 'TASK_1067246875800000076', 'DEFAULT', NULL, 'io.renren.modules.job.utils.ScheduleJob', '0', '0', '0', '0', 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C7708000000100000000174000D4A4F425F504152414D5F4B45597372002E696F2E72656E72656E2E6D6F64756C65732E6A6F622E656E746974792E5363686564756C654A6F62456E7469747900000000000000010200074C00086265616E4E616D657400124C6A6176612F6C616E672F537472696E673B4C000E63726F6E45787072657373696F6E71007E00094C0006706172616D7371007E00094C000672656D61726B71007E00094C00067374617475737400134C6A6176612F6C616E672F496E74656765723B4C000A757064617465446174657400104C6A6176612F7574696C2F446174653B4C0007757064617465727400104C6A6176612F6C616E672F4C6F6E673B78720022696F2E72656E72656E2E636F6D6D6F6E2E656E746974792E42617365456E74697479FB83923222FF87B90200034C000A6372656174654461746571007E000B4C000763726561746F7271007E000C4C0002696471007E000C78707372000E6A6176612E7574696C2E44617465686A81014B59741903000078707708000001889FD0EAE8787372000E6A6176612E6C616E672E4C6F6E673B8BE490CC8F23DF0200014A000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700ECF9F6107B456017371007E00110ECF9F6107B4564C740008746573745461736B74000E3020302F3330202A202A202A203F74000672656E72656E740025E69C89E58F82E6B58BE8AF95EFBC8CE5A49AE4B8AAE58F82E695B0E4BDBFE794A86A736F6E737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C75657871007E0012000000007371007E000F7708000001889FD0EAE8787371007E00110ECF9F6107B456017800);
+
+-- ----------------------------
+-- Table structure for qrtz_locks
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_locks`;
+CREATE TABLE `qrtz_locks` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `LOCK_NAME` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `LOCK_NAME`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of qrtz_locks
+-- ----------------------------
+INSERT INTO `qrtz_locks` VALUES ('RenrenScheduler', 'STATE_ACCESS');
+INSERT INTO `qrtz_locks` VALUES ('RenrenScheduler', 'TRIGGER_ACCESS');
+
+-- ----------------------------
+-- Table structure for qrtz_paused_trigger_grps
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`;
+CREATE TABLE `qrtz_paused_trigger_grps` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for qrtz_scheduler_state
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_scheduler_state`;
+CREATE TABLE `qrtz_scheduler_state` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `INSTANCE_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `LAST_CHECKIN_TIME` bigint(0) NOT NULL,
+ `CHECKIN_INTERVAL` bigint(0) NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `INSTANCE_NAME`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of qrtz_scheduler_state
+-- ----------------------------
+INSERT INTO `qrtz_scheduler_state` VALUES ('RenrenScheduler', 'LAPTOP-4DMOD6O51686728211439', 1686728288954, 15000);
+
+-- ----------------------------
+-- Table structure for qrtz_simple_triggers
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_simple_triggers`;
+CREATE TABLE `qrtz_simple_triggers` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `REPEAT_COUNT` bigint(0) NOT NULL,
+ `REPEAT_INTERVAL` bigint(0) NOT NULL,
+ `TIMES_TRIGGERED` bigint(0) NOT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for qrtz_simprop_triggers
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_simprop_triggers`;
+CREATE TABLE `qrtz_simprop_triggers` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `STR_PROP_1` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `STR_PROP_2` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `STR_PROP_3` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `INT_PROP_1` int(0) NULL DEFAULT NULL,
+ `INT_PROP_2` int(0) NULL DEFAULT NULL,
+ `LONG_PROP_1` bigint(0) NULL DEFAULT NULL,
+ `LONG_PROP_2` bigint(0) NULL DEFAULT NULL,
+ `DEC_PROP_1` decimal(13, 4) NULL DEFAULT NULL,
+ `DEC_PROP_2` decimal(13, 4) NULL DEFAULT NULL,
+ `BOOL_PROP_1` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `BOOL_PROP_2` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for qrtz_triggers
+-- ----------------------------
+DROP TABLE IF EXISTS `qrtz_triggers`;
+CREATE TABLE `qrtz_triggers` (
+ `SCHED_NAME` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `JOB_GROUP` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `DESCRIPTION` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `NEXT_FIRE_TIME` bigint(0) NULL DEFAULT NULL,
+ `PREV_FIRE_TIME` bigint(0) NULL DEFAULT NULL,
+ `PRIORITY` int(0) NULL DEFAULT NULL,
+ `TRIGGER_STATE` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `TRIGGER_TYPE` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+ `START_TIME` bigint(0) NOT NULL,
+ `END_TIME` bigint(0) NULL DEFAULT NULL,
+ `CALENDAR_NAME` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `MISFIRE_INSTR` smallint(0) NULL DEFAULT NULL,
+ `JOB_DATA` blob NULL,
+ PRIMARY KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_J`(`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_JG`(`SCHED_NAME`, `JOB_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_C`(`SCHED_NAME`, `CALENDAR_NAME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_G`(`SCHED_NAME`, `TRIGGER_GROUP`) USING BTREE,
+ INDEX `IDX_QRTZ_T_STATE`(`SCHED_NAME`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_N_STATE`(`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_N_G_STATE`(`SCHED_NAME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NEXT_FIRE_TIME`(`SCHED_NAME`, `NEXT_FIRE_TIME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_ST`(`SCHED_NAME`, `TRIGGER_STATE`, `NEXT_FIRE_TIME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_MISFIRE`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_ST_MISFIRE`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`, `TRIGGER_STATE`) USING BTREE,
+ INDEX `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP`(`SCHED_NAME`, `MISFIRE_INSTR`, `NEXT_FIRE_TIME`, `TRIGGER_GROUP`, `TRIGGER_STATE`) USING BTREE,
+ CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `qrtz_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) ON DELETE RESTRICT ON UPDATE RESTRICT
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of qrtz_triggers
+-- ----------------------------
+INSERT INTO `qrtz_triggers` VALUES ('RenrenScheduler', 'TASK_1067246875800000076', 'DEFAULT', 'TASK_1067246875800000076', 'DEFAULT', NULL, 1686313800000, -1, 5, 'PAUSED', 'CRON', 1686312005000, 0, NULL, 2, 0xACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472696E674B65794469727479466C61674D61708208E8C3FBC55D280200015A0013616C6C6F77735472616E7369656E74446174617872001D6F72672E71756172747A2E7574696C732E4469727479466C61674D617013E62EAD28760ACE0200025A000564697274794C00036D617074000F4C6A6176612F7574696C2F4D61703B787001737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F4000000000000C7708000000100000000174000D4A4F425F504152414D5F4B45597372002E696F2E72656E72656E2E6D6F64756C65732E6A6F622E656E746974792E5363686564756C654A6F62456E7469747900000000000000010200074C00086265616E4E616D657400124C6A6176612F6C616E672F537472696E673B4C000E63726F6E45787072657373696F6E71007E00094C0006706172616D7371007E00094C000672656D61726B71007E00094C00067374617475737400134C6A6176612F6C616E672F496E74656765723B4C000A757064617465446174657400104C6A6176612F7574696C2F446174653B4C0007757064617465727400104C6A6176612F6C616E672F4C6F6E673B78720022696F2E72656E72656E2E636F6D6D6F6E2E656E746974792E42617365456E74697479FB83923222FF87B90200034C000A6372656174654461746571007E000B4C000763726561746F7271007E000C4C0002696471007E000C78707372000E6A6176612E7574696C2E44617465686A81014B59741903000078707708000001889FD0EAE8787372000E6A6176612E6C616E672E4C6F6E673B8BE490CC8F23DF0200014A000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700ECF9F6107B456017371007E00110ECF9F6107B4564C740008746573745461736B74000E3020302F3330202A202A202A203F74000672656E72656E740025E69C89E58F82E6B58BE8AF95EFBC8CE5A49AE4B8AAE58F82E695B0E4BDBFE794A86A736F6E737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C75657871007E0012000000007371007E000F7708000001889FD0EAE8787371007E00110ECF9F6107B456017800);
+
+-- ----------------------------
+-- Table structure for schedule_job
+-- ----------------------------
+DROP TABLE IF EXISTS `schedule_job`;
+CREATE TABLE `schedule_job` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `bean_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'spring bean名称',
+ `params` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '参数',
+ `cron_expression` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'cron表达式',
+ `status` tinyint unsigned NULL COMMENT '任务状态 0:暂停 1:正常',
+ `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '定时任务' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of schedule_job
+-- ----------------------------
+INSERT INTO `schedule_job` VALUES (1067246875800000076, 'testTask', 'renren', '0 0/30 * * * ?', 0, '有参测试,多个参数使用json', 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+
+-- ----------------------------
+-- Table structure for schedule_job_log
+-- ----------------------------
+DROP TABLE IF EXISTS `schedule_job_log`;
+CREATE TABLE `schedule_job_log` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `job_id` bigint(0) NOT NULL COMMENT '任务id',
+ `bean_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'spring bean名称',
+ `params` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '参数',
+ `status` tinyint unsigned NOT NULL COMMENT '任务状态 0:失败 1:成功',
+ `error` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '失败信息',
+ `times` int(0) NOT NULL COMMENT '耗时(单位:毫秒)',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_job_id`(`job_id`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '定时任务日志' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for setmeal
+-- ----------------------------
+DROP TABLE IF EXISTS `setmeal`;
+CREATE TABLE `setmeal` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `category_id` bigint(0) NOT NULL COMMENT '菜品分类id',
+ `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '套餐名称',
+ `price` decimal(10, 2) NOT NULL COMMENT '套餐价格',
+ `status` int(0) NULL DEFAULT NULL COMMENT '状态 0:停用 1:启用',
+ `code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '编码',
+ `description` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '描述信息',
+ `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '图片',
+ `creator` bigint(0) NOT NULL COMMENT '创建人',
+ `create_date` datetime(0) NOT NULL COMMENT '创建时间',
+ `updater` bigint(0) NOT NULL COMMENT '修改人',
+ `update_date` datetime(0) NOT NULL COMMENT '更新时间',
+ `is_deleted` int(0) NOT NULL DEFAULT 0 COMMENT '是否删除',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `idx_setmeal_name`(`name`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '套餐' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of setmeal
+-- ----------------------------
+INSERT INTO `setmeal` VALUES (1523233943468486658, 1523224049252151297, '农家腊肉+小菜+米饭', 1998.00, 1, '', '原料:大米、青菜、腊肉', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0a3b3288-3446-4420-bbff-f263d0c02d8e.jpg', 1, '2022-06-19 14:29:33', 1067246875800000001, '2022-08-29 21:19:55', 0);
+INSERT INTO `setmeal` VALUES (1523234378937905154, 1523224049252151297, '农家小炒肉+小菜+米饭', 1900.00, 1, '', '原料:大米、猪肉', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0f4bd884-dc9c-4cf9-b59e-7d5958fec3dd.jpg', 1, '2022-06-19 14:29:05', 1067246875800000001, '2022-08-29 21:19:55', 0);
+INSERT INTO `setmeal` VALUES (1523234624120139777, 1523224049252151297, '尖椒鸡+小菜+米饭', 1988.00, 1, '', '原料:大米、辣椒、青菜、鸡肉', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/0f252364-a561-4e8d-8065-9a6797a6b1d3.jpg', 1, '2022-06-19 14:29:17', 1067246875800000001, '2022-08-29 21:19:55', 0);
+INSERT INTO `setmeal` VALUES (1564250809707905025, 1523224049252151297, '测试套餐', 5000.00, 1, '001', '测试', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/d1688fe2a91cda424852b88dd5f2679e.jpeg', 1067246875800000001, '2022-08-29 21:57:10', 1067246875800000001, '2022-08-29 22:19:58', 0);
+INSERT INTO `setmeal` VALUES (1564264362565296130, 1523224049252151297, '测试测试', 3300.00, 1, '', '测试', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/e476f679-5c15-436b-87fa-8c4e9644bf33.jpeg', 1067246875800000001, '2022-08-29 21:57:10', 1067246875800000001, '2022-08-29 22:16:46', 0);
+
+-- ----------------------------
+-- Table structure for setmeal_dish
+-- ----------------------------
+DROP TABLE IF EXISTS `setmeal_dish`;
+CREATE TABLE `setmeal_dish` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `setmeal_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '套餐id ',
+ `dish_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '菜品id',
+ `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '菜品名称 (冗余字段)',
+ `price` decimal(10, 2) NULL DEFAULT NULL COMMENT '菜品原价(冗余字段)',
+ `copies` int(0) NOT NULL COMMENT '份数',
+ `sort` int(0) NOT NULL DEFAULT 0 COMMENT '排序',
+ `creator` bigint(0) NOT NULL COMMENT '创建人',
+ `create_date` datetime(0) NOT NULL COMMENT '创建时间',
+ `updater` bigint(0) NOT NULL COMMENT '修改人',
+ `update_date` datetime(0) NOT NULL COMMENT '更新时间',
+ `is_deleted` int(0) NOT NULL DEFAULT 0 COMMENT '是否删除',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '套餐菜品关系' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of setmeal_dish
+-- ----------------------------
+INSERT INTO `setmeal_dish` VALUES (1538408506959384577, '1523234378937905154', '1523233618137296897', '珍珠米饭', 100.00, 1, 0, 1, '2022-06-19 14:29:05', 1, '2022-06-19 14:29:05', 0);
+INSERT INTO `setmeal_dish` VALUES (1538408506959384578, '1523234378937905154', '1523229349560561666', '小炒肉(米饭单点)', 1380.00, 1, 0, 1, '2022-06-19 14:29:05', 1, '2022-06-19 14:29:05', 0);
+INSERT INTO `setmeal_dish` VALUES (1538408555852386305, '1523234624120139777', '1523229489490931714', '尖椒鸡(米饭单点)', 1398.00, 1, 0, 1, '2022-06-19 14:29:17', 1, '2022-06-19 14:29:17', 0);
+INSERT INTO `setmeal_dish` VALUES (1538408555852386306, '1523234624120139777', '1523233618137296897', '珍珠米饭', 100.00, 1, 0, 1, '2022-06-19 14:29:17', 1, '2022-06-19 14:29:17', 0);
+INSERT INTO `setmeal_dish` VALUES (1538408624433451009, '1523233943468486658', '1523233618137296897', '珍珠米饭', 100.00, 1, 0, 1, '2022-06-19 14:29:33', 1, '2022-06-19 14:29:33', 0);
+INSERT INTO `setmeal_dish` VALUES (1538408624433451010, '1523233943468486658', '1523227696245616641', '农家炒腊肉(米饭单点)', 1688.00, 1, 0, 1, '2022-06-19 14:29:33', 1, '2022-06-19 14:29:33', 0);
+INSERT INTO `setmeal_dish` VALUES (1564264362590461954, '1564264362565296130', '1564251465613164545', '测试测试', 1100.00, 1, 0, 1067246875800000001, '2022-08-29 22:51:01', 1067246875800000001, '2022-08-29 22:51:01', 0);
+
+-- ----------------------------
+-- Table structure for shopping_cart
+-- ----------------------------
+DROP TABLE IF EXISTS `shopping_cart`;
+CREATE TABLE `shopping_cart` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '名称',
+ `image` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '图片',
+ `user_id` bigint(0) NOT NULL COMMENT '主键',
+ `dish_id` bigint(0) NULL DEFAULT NULL COMMENT '菜品id',
+ `setmeal_id` bigint(0) NULL DEFAULT NULL COMMENT '套餐id',
+ `dish_flavor` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '口味',
+ `number` int(0) NOT NULL DEFAULT 1 COMMENT '数量',
+ `amount` decimal(10, 2) NOT NULL COMMENT '金额',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '购物车' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of shopping_cart
+-- ----------------------------
+INSERT INTO `shopping_cart` VALUES (1523375836910018561, '干锅鸡+米饭', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/1405081e-f545-42e1-86a2-f7559ae2e276.jpeg', 1523365273903456258, 1523231271495512066, NULL, '重辣', 1, 19.80, 1523365273903456258, '2022-05-09 02:54:37', 1523365273903456258, '2022-05-09 02:54:37');
+INSERT INTO `shopping_cart` VALUES (1523375851594276865, '怡宝', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/c99e0aab-3cb7-4eaa-80fd-f47d4ffea694.png', 1523365273903456258, 1523233739667255298, NULL, NULL, 1, 2.00, 1523365273903456258, '2022-05-09 02:54:41', 1523365273903456258, '2022-05-09 02:54:41');
+INSERT INTO `shopping_cart` VALUES (1533060367050199041, '尖椒鸡(米饭单点)', 'https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/2a2e9d66-b41d-4645-87bd-95f2cfeed218.jpg', 1530789235311808513, 1523229489490931714, NULL, NULL, 1, 13.98, 1530789235311808513, '2022-06-04 20:17:29', 1530789235311808513, '2022-06-04 20:17:29');
+
+-- ----------------------------
+-- Table structure for sys_dept
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_dept`;
+CREATE TABLE `sys_dept` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `pid` bigint(0) NULL DEFAULT NULL COMMENT '上级ID',
+ `pids` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所有上级ID,用逗号分开',
+ `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '部门名称',
+ `sort` int unsigned NULL COMMENT '排序',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_pid`(`pid`) USING BTREE,
+ INDEX `idx_sort`(`sort`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '部门管理' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_dept
+-- ----------------------------
+INSERT INTO `sys_dept` VALUES (1067246875800000062, 1067246875800000063, '1067246875800000066,1067246875800000063', '技术部', 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dept` VALUES (1067246875800000063, 1067246875800000066, '1067246875800000066', '长沙分公司', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dept` VALUES (1067246875800000064, 1067246875800000066, '1067246875800000066', '上海分公司', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dept` VALUES (1067246875800000065, 1067246875800000064, '1067246875800000066,1067246875800000064', '市场部', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dept` VALUES (1067246875800000066, 0, '0', '人人开源集团', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dept` VALUES (1067246875800000067, 1067246875800000064, '1067246875800000066,1067246875800000064', '销售部', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dept` VALUES (1067246875800000068, 1067246875800000063, '1067246875800000066,1067246875800000063', '产品部', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+
+-- ----------------------------
+-- Table structure for sys_dict_data
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_dict_data`;
+CREATE TABLE `sys_dict_data` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `dict_type_id` bigint(0) NOT NULL COMMENT '字典类型ID',
+ `dict_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '字典标签',
+ `dict_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '字典值',
+ `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
+ `sort` int unsigned NULL COMMENT '排序',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `uk_dict_type_value`(`dict_type_id`, `dict_value`) USING BTREE,
+ INDEX `idx_sort`(`sort`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '字典数据' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_dict_data
+-- ----------------------------
+INSERT INTO `sys_dict_data` VALUES (1160061112075464705, 1160061077912858625, '男', '0', '', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dict_data` VALUES (1160061146967879681, 1160061077912858625, '女', '1', '', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dict_data` VALUES (1160061190127267841, 1160061077912858625, '保密', '2', '', 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dict_data` VALUES (1225814069634195457, 1225813644059140097, '公告', '0', '', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dict_data` VALUES (1225814107559092225, 1225813644059140097, '会议', '1', '', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dict_data` VALUES (1225814271879340034, 1225813644059140097, '其他', '2', '', 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+
+-- ----------------------------
+-- Table structure for sys_dict_type
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_dict_type`;
+CREATE TABLE `sys_dict_type` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `dict_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '字典类型',
+ `dict_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '字典名称',
+ `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
+ `sort` int unsigned NULL COMMENT '排序',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `dict_type`(`dict_type`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '字典类型' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_dict_type
+-- ----------------------------
+INSERT INTO `sys_dict_type` VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_dict_type` VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+
+-- ----------------------------
+-- Table structure for sys_log_error
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_log_error`;
+CREATE TABLE `sys_log_error` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `request_uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求URI',
+ `request_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求方式',
+ `request_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
+ `user_agent` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户代理',
+ `ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作IP',
+ `error_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '异常信息',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '异常日志' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for sys_log_login
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_log_login`;
+CREATE TABLE `sys_log_login` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `operation` tinyint unsigned NULL COMMENT '用户操作 0:用户登录 1:用户退出',
+ `status` tinyint unsigned NOT NULL COMMENT '状态 0:失败 1:成功 2:账号已锁定',
+ `user_agent` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户代理',
+ `ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作IP',
+ `creator_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户名',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_status`(`status`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '登录日志' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_log_login
+-- ----------------------------
+INSERT INTO `sys_log_login` VALUES (1668885255721377794, 0, 1, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1', 'admin', 1067246875800000001, '2023-06-14 15:37:06');
+
+-- ----------------------------
+-- Table structure for sys_log_operation
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_log_operation`;
+CREATE TABLE `sys_log_operation` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `operation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户操作',
+ `request_uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求URI',
+ `request_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求方式',
+ `request_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '请求参数',
+ `request_time` int unsigned NOT NULL COMMENT '请求时长(毫秒)',
+ `user_agent` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户代理',
+ `ip` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作IP',
+ `status` tinyint unsigned NOT NULL COMMENT '状态 0:失败 1:成功',
+ `creator_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户名',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '操作日志' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_log_operation
+-- ----------------------------
+INSERT INTO `sys_log_operation` VALUES (1668885397493047298, '修改', '/renren-admin/takeout/setmeal/', 'PUT', '{\"id\":1564250809707905025,\"categoryId\":1523224049252151297,\"name\":\"测试套餐\",\"price\":5000,\"status\":0,\"code\":\"001\",\"description\":\"测试\",\"image\":\"https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/d1688fe2a91cda424852b88dd5f2679e.jpeg\",\"creator\":1067246875800000001,\"createDate\":1661781430000,\"updater\":1067246875800000001,\"updateDate\":1661782798000,\"isDeleted\":0}', 18, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1', 1, 'admin', 1067246875800000001, '2023-06-14 15:37:40');
+INSERT INTO `sys_log_operation` VALUES (1668885437984858114, '修改', '/renren-admin/takeout/setmeal/', 'PUT', '{\"id\":1564250809707905025,\"categoryId\":1523224049252151297,\"name\":\"测试套餐\",\"price\":5000,\"status\":1,\"code\":\"001\",\"description\":\"测试\",\"image\":\"https://mt-take-out-1259733126.cos.ap-nanjing.myqcloud.com/d1688fe2a91cda424852b88dd5f2679e.jpeg\",\"creator\":1067246875800000001,\"createDate\":1661781430000,\"updater\":1067246875800000001,\"updateDate\":1661782798000,\"isDeleted\":0}', 13, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36', '0:0:0:0:0:0:0:1', 1, 'admin', 1067246875800000001, '2023-06-14 15:37:49');
+
+-- ----------------------------
+-- Table structure for sys_menu
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_menu`;
+CREATE TABLE `sys_menu` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `pid` bigint(0) NULL DEFAULT NULL COMMENT '上级ID,一级菜单为0',
+ `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
+ `url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单URL',
+ `permissions` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '授权(多个用逗号分隔,如:sys:user:list,sys:user:save)',
+ `menu_type` tinyint unsigned NULL COMMENT '类型 0:菜单 1:按钮',
+ `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '菜单图标',
+ `sort` int(0) NULL DEFAULT NULL COMMENT '排序',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_pid`(`pid`) USING BTREE,
+ INDEX `idx_sort`(`sort`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '菜单管理' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_menu
+-- ----------------------------
+INSERT INTO `sys_menu` VALUES (1067246875800000002, 0, '权限管理', NULL, NULL, 0, 'icon-safetycertificate', 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:14:57');
+INSERT INTO `sys_menu` VALUES (1067246875800000003, 1067246875800000055, '新增', NULL, 'sys:user:save,sys:dept:list,sys:role:list', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000004, 1067246875800000055, '修改', NULL, 'sys:user:update,sys:dept:list,sys:role:list', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000005, 1067246875800000055, '删除', NULL, 'sys:user:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000006, 1067246875800000055, '导出', NULL, 'sys:user:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000007, 1067246875800000002, '角色管理', 'sys/role', NULL, 0, 'icon-team', 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000008, 1067246875800000007, '查看', NULL, 'sys:role:page,sys:role:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000009, 1067246875800000007, '新增', NULL, 'sys:role:save,sys:menu:select,sys:dept:list', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000010, 1067246875800000007, '修改', NULL, 'sys:role:update,sys:menu:select,sys:dept:list', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000011, 1067246875800000007, '删除', NULL, 'sys:role:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000012, 1067246875800000002, '部门管理', 'sys/dept', NULL, 0, 'icon-apartment', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000014, 1067246875800000012, '查看', NULL, 'sys:dept:list,sys:dept:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000015, 1067246875800000012, '新增', NULL, 'sys:dept:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000016, 1067246875800000012, '修改', NULL, 'sys:dept:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000017, 1067246875800000012, '删除', NULL, 'sys:dept:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000025, 1067246875800000035, '菜单管理', 'sys/menu', NULL, 0, 'icon-unorderedlist', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000026, 1067246875800000025, '查看', NULL, 'sys:menu:list,sys:menu:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000027, 1067246875800000025, '新增', NULL, 'sys:menu:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000028, 1067246875800000025, '修改', NULL, 'sys:menu:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000029, 1067246875800000025, '删除', NULL, 'sys:menu:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000030, 1067246875800000035, '定时任务', 'job/schedule', NULL, 0, 'icon-dashboard', 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000031, 1067246875800000030, '查看', NULL, 'sys:schedule:page,sys:schedule:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000032, 1067246875800000030, '新增', NULL, 'sys:schedule:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000033, 1067246875800000030, '修改', NULL, 'sys:schedule:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000034, 1067246875800000030, '删除', NULL, 'sys:schedule:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000035, 0, '系统设置', NULL, NULL, 0, 'icon-setting', 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:05:39');
+INSERT INTO `sys_menu` VALUES (1067246875800000036, 1067246875800000030, '暂停', NULL, 'sys:schedule:pause', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000037, 1067246875800000030, '恢复', NULL, 'sys:schedule:resume', 1, NULL, 5, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000038, 1067246875800000030, '立即执行', NULL, 'sys:schedule:run', 1, NULL, 6, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000039, 1067246875800000030, '日志列表', NULL, 'sys:schedule:log', 1, NULL, 7, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000040, 1067246875800000035, '参数管理', 'sys/params', '', 0, 'icon-fileprotect', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000041, 1067246875800000035, '字典管理', 'sys/dict-type', NULL, 0, 'icon-golden-fill', 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000042, 1067246875800000041, '查看', NULL, 'sys:dict:page,sys:dict:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000043, 1067246875800000041, '新增', NULL, 'sys:dict:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000044, 1067246875800000041, '修改', NULL, 'sys:dict:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000045, 1067246875800000041, '删除', NULL, 'sys:dict:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000046, 0, '日志管理', NULL, NULL, 0, 'icon-container', 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:05:45');
+INSERT INTO `sys_menu` VALUES (1067246875800000047, 1067246875800000035, '文件上传', 'oss/oss', 'sys:oss:all', 0, 'icon-upload', 4, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000048, 1067246875800000046, '登录日志', 'sys/log-login', 'sys:log:login', 0, 'icon-filedone', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000049, 1067246875800000046, '操作日志', 'sys/log-operation', 'sys:log:operation', 0, 'icon-solution', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000050, 1067246875800000046, '异常日志', 'sys/log-error', 'sys:log:error', 0, 'icon-file-exception', 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000051, 1067246875800000053, 'SQL监控', '{{ window.SITE_CONFIG[\"apiURL\"] }}/druid/sql.html', NULL, 0, 'icon-database', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000053, 0, '系统监控', NULL, NULL, 0, 'icon-desktop', 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:05:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000055, 1067246875800000002, '用户管理', 'sys/user', NULL, 0, 'icon-user', 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000056, 1067246875800000055, '查看', NULL, 'sys:user:page,sys:user:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000057, 1067246875800000040, '新增', NULL, 'sys:params:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000058, 1067246875800000040, '导出', NULL, 'sys:params:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000059, 1067246875800000040, '查看', '', 'sys:params:page,sys:params:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000060, 1067246875800000040, '修改', NULL, 'sys:params:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1067246875800000061, 1067246875800000040, '删除', '', 'sys:params:delete', 1, '', 3, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1156748733921165314, 1067246875800000053, '接口文档', '{{ window.SITE_CONFIG[\"apiURL\"] }}/doc.html', '', 0, 'icon-file-word', 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+INSERT INTO `sys_menu` VALUES (1667117354689961986, 0, '用户信息', 'takeout/user', NULL, 0, 'icon-desktop', 0, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:02:28');
+INSERT INTO `sys_menu` VALUES (1667117354689961987, 1667117354689961986, '查看', NULL, 'takeout:user:page,takeout:user:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354689961988, 1667117354689961986, '新增', NULL, 'takeout:user:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354689961989, 1667117354689961986, '修改', NULL, 'takeout:user:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354689961990, 1667117354689961986, '删除', NULL, 'takeout:user:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354689961991, 1667117354689961986, '导出', NULL, 'takeout:user:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354887094274, 0, '套餐管理', 'takeout/setmeal', NULL, 0, 'icon-desktop', 1, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:03:16');
+INSERT INTO `sys_menu` VALUES (1667117354887094275, 1667117354887094274, '查看', NULL, 'takeout:setmeal:page,takeout:setmeal:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354887094276, 1667117354887094274, '新增', NULL, 'takeout:setmeal:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354887094277, 1667117354887094274, '修改', NULL, 'takeout:setmeal:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354887094278, 1667117354887094274, '删除', NULL, 'takeout:setmeal:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117354887094279, 1667117354887094274, '导出', NULL, 'takeout:setmeal:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355218444289, 0, '订单管理', 'takeout/orders', NULL, 0, 'icon-desktop', 2, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:05:26');
+INSERT INTO `sys_menu` VALUES (1667117355218444290, 1667117355218444289, '查看', NULL, 'takeout:orders:page,takeout:orders:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355218444291, 1667117355218444289, '新增', NULL, 'takeout:orders:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355218444292, 1667117355218444289, '修改', NULL, 'takeout:orders:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355218444293, 1667117355218444289, '删除', NULL, 'takeout:orders:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355218444294, 1667117355218444289, '导出', NULL, 'takeout:orders:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355344273409, 0, '菜品管理', 'takeout/dish', NULL, 0, 'icon-desktop', 0, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:02:51');
+INSERT INTO `sys_menu` VALUES (1667117355344273410, 1667117355344273409, '查看', NULL, 'takeout:dish:page,takeout:dish:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355344273411, 1667117355344273409, '新增', NULL, 'takeout:dish:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355344273412, 1667117355344273409, '修改', NULL, 'takeout:dish:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355344273413, 1667117355344273409, '删除', NULL, 'takeout:dish:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355344273414, 1667117355344273409, '导出', NULL, 'takeout:dish:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355474296833, 0, '菜品及套餐分类管理', 'takeout/category', NULL, 0, 'icon-desktop', 1, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:05:11');
+INSERT INTO `sys_menu` VALUES (1667117355474296834, 1667117355474296833, '查看', NULL, 'takeout:category:page,takeout:category:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355474296835, 1667117355474296833, '新增', NULL, 'takeout:category:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355474296836, 1667117355474296833, '修改', NULL, 'takeout:category:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355474296837, 1667117355474296833, '删除', NULL, 'takeout:category:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355474296838, 1667117355474296833, '导出', NULL, 'takeout:category:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:01:47', 1067246875800000001, '2023-06-09 19:01:47');
+INSERT INTO `sys_menu` VALUES (1667117355537211394, 0, '地址管理', 'takeout/addressbook', NULL, 0, 'icon-desktop', 0, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:02:59');
+INSERT INTO `sys_menu` VALUES (1667117355537211395, 1667117355537211394, '查看', NULL, 'takeout:addressbook:page,takeout:addressbook:info', 1, NULL, 0, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355537211396, 1667117355537211394, '新增', NULL, 'takeout:addressbook:save', 1, NULL, 1, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355537211397, 1667117355537211394, '修改', NULL, 'takeout:addressbook:update', 1, NULL, 2, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355537211398, 1667117355537211394, '删除', NULL, 'takeout:addressbook:delete', 1, NULL, 3, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+INSERT INTO `sys_menu` VALUES (1667117355537211399, 1667117355537211394, '导出', NULL, 'takeout:addressbook:export', 1, NULL, 4, 1067246875800000001, '2023-06-09 19:01:46', 1067246875800000001, '2023-06-09 19:01:46');
+
+-- ----------------------------
+-- Table structure for sys_oss
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_oss`;
+CREATE TABLE `sys_oss` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'URL地址',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '文件上传' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for sys_params
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_params`;
+CREATE TABLE `sys_params` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `param_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '参数编码',
+ `param_value` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '参数值',
+ `param_type` tinyint unsigned NULL COMMENT '类型 0:系统参数 1:非系统参数',
+ `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `uk_param_code`(`param_code`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '参数管理' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_params
+-- ----------------------------
+INSERT INTO `sys_params` VALUES (1067246875800000073, 'CLOUD_STORAGE_CONFIG_KEY', '{\"type\":1,\"qiniuDomain\":\"http://test.oss.renren.io\",\"qiniuPrefix\":\"upload\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuSecretKey\":\"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV\",\"qiniuBucketName\":\"renren-oss\",\"aliyunDomain\":\"\",\"aliyunPrefix\":\"\",\"aliyunEndPoint\":\"\",\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qcloudBucketName\":\"\"}', 0, '云存储配置信息', 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+
+-- ----------------------------
+-- Table structure for sys_role
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_role`;
+CREATE TABLE `sys_role` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '角色名称',
+ `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
+ `dept_id` bigint(0) NULL DEFAULT NULL COMMENT '部门ID',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_dept_id`(`dept_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色管理' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for sys_role_data_scope
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_role_data_scope`;
+CREATE TABLE `sys_role_data_scope` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `role_id` bigint(0) NULL DEFAULT NULL COMMENT '角色ID',
+ `dept_id` bigint(0) NULL DEFAULT NULL COMMENT '部门ID',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_role_id`(`role_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色数据权限' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for sys_role_menu
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_role_menu`;
+CREATE TABLE `sys_role_menu` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `role_id` bigint(0) NULL DEFAULT NULL COMMENT '角色ID',
+ `menu_id` bigint(0) NULL DEFAULT NULL COMMENT '菜单ID',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_role_id`(`role_id`) USING BTREE,
+ INDEX `idx_menu_id`(`menu_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色菜单关系' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for sys_role_user
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_role_user`;
+CREATE TABLE `sys_role_user` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `role_id` bigint(0) NULL DEFAULT NULL COMMENT '角色ID',
+ `user_id` bigint(0) NULL DEFAULT NULL COMMENT '用户ID',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ INDEX `idx_role_id`(`role_id`) USING BTREE,
+ INDEX `idx_user_id`(`user_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色用户关系' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Table structure for sys_user
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_user`;
+CREATE TABLE `sys_user` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户名',
+ `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '密码',
+ `real_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名',
+ `head_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '头像',
+ `gender` tinyint unsigned NULL COMMENT '性别 0:男 1:女 2:保密',
+ `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邮箱',
+ `mobile` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
+ `dept_id` bigint(0) NULL DEFAULT NULL COMMENT '部门ID',
+ `super_admin` tinyint unsigned NULL COMMENT '超级管理员 0:否 1:是',
+ `status` tinyint(0) NULL DEFAULT NULL COMMENT '状态 0:停用 1:正常',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `uk_username`(`username`) USING BTREE,
+ INDEX `idx_create_date`(`create_date`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '系统用户' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_user
+-- ----------------------------
+INSERT INTO `sys_user` VALUES (1067246875800000001, 'admin', '$2a$10$012Kx2ba5jzqr9gLlG4MX.bnQJTD9UWqF57XDo2N3.fPtLne02u/m', '管理员', NULL, 0, 'root@renren.io', '13612345678', NULL, 1, 1, 1067246875800000001, '2023-06-09 19:00:49', 1067246875800000001, '2023-06-09 19:00:49');
+
+-- ----------------------------
+-- Table structure for sys_user_token
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_user_token`;
+CREATE TABLE `sys_user_token` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `user_id` bigint(0) NOT NULL COMMENT '用户id',
+ `token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户token',
+ `expire_date` datetime(0) NULL DEFAULT NULL COMMENT '过期时间',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `user_id`(`user_id`) USING BTREE,
+ UNIQUE INDEX `token`(`token`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '系统用户Token' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of sys_user_token
+-- ----------------------------
+INSERT INTO `sys_user_token` VALUES (1667124900934565889, 1067246875800000001, '1904c2b953248bb8ab8f62bbc90d00e4', '2023-06-15 03:37:06', '2023-06-14 15:37:06', '2023-06-09 19:02:05');
+
+-- ----------------------------
+-- Table structure for tb_token
+-- ----------------------------
+DROP TABLE IF EXISTS `tb_token`;
+CREATE TABLE `tb_token` (
+ `id` bigint(0) NOT NULL COMMENT 'id',
+ `user_id` bigint(0) NOT NULL COMMENT '用户ID',
+ `token` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'token',
+ `expire_date` datetime(0) NULL DEFAULT NULL COMMENT '过期时间',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE,
+ UNIQUE INDEX `user_id`(`user_id`) USING BTREE,
+ UNIQUE INDEX `token`(`token`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户Token' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of tb_token
+-- ----------------------------
+INSERT INTO `tb_token` VALUES (1562819873267068930, 1562819873229320194, 'decff2481e9d41b3a1402d54b6a5d6ab', '2022-08-26 11:11:08', '2022-08-25 23:11:08');
+INSERT INTO `tb_token` VALUES (1562837457970499586, 1534405913534889985, 'd58caef22a7f4947a72dc18ee18497ae', '2022-08-28 08:29:40', '2022-08-27 20:29:40');
+
+-- ----------------------------
+-- Table structure for user
+-- ----------------------------
+DROP TABLE IF EXISTS `user`;
+CREATE TABLE `user` (
+ `id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT 'id',
+ `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '姓名',
+ `phone` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '手机号',
+ `gender` tinyint(0) NULL DEFAULT NULL COMMENT '性别 0:男 1:女 2:保密',
+ `id_number` varchar(18) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '身份证号',
+ `avatar_url` varchar(500) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '头像',
+ `status` tinyint(0) NULL DEFAULT 1 COMMENT '状态 0:禁用,1:正常',
+ `openid` varchar(90) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '微信openid',
+ `nick_name` varchar(150) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '微信昵称',
+ `creator` bigint(0) NULL DEFAULT NULL COMMENT '创建者',
+ `create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `updater` bigint(0) NULL DEFAULT NULL COMMENT '更新者',
+ `update_date` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息' ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of user
+-- ----------------------------
+INSERT INTO `user` VALUES (1668247645219012609, NULL, '1029606625@qq.com', NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL);
+
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..9fe62d1
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,212 @@
+
+ 4.0.0
+ io.renren
+ renren-security
+ 5.2.0
+ pom
+
+ renren-security
+ 人人权限系统
+ https://www.renren.io
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.5
+
+
+
+ renren-common
+ renren-dynamic-datasource
+ renren-admin
+ renren-api
+ renren-generator
+
+
+
+ UTF-8
+ UTF-8
+ 1.8
+ 4.2.2
+ 1.2.13
+ 3.5.2
+ 4.0
+ 11.2.0.3
+ 8.1.2.79
+ 3.12.0
+ 1.4
+ 2.11.0
+ 1.15
+ 20.0
+ 2.10.14
+ 5.7.22
+ 2.9.0
+ 1.15.3
+ 2.0.9
+ 1.18.24
+ 1.1.1
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-aop
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ org.springframework
+ spring-context-support
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+
+ redis.clients
+ jedis
+ ${jedis.version}
+
+
+
+ com.mysql
+ mysql-connector-j
+
+
+
+ com.oracle
+ ojdbc6
+ ${oracle.version}
+
+
+
+ com.microsoft.sqlserver
+ sqljdbc4
+ ${sqlserver.version}
+
+
+
+ org.postgresql
+ postgresql
+
+
+
+ com.dameng
+ DmJdbcDriver18
+ ${dameng.version}
+
+
+ com.alibaba
+ druid-spring-boot-starter
+ ${druid.version}
+
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ ${mybatisplus.version}
+
+
+ com.baomidou
+ mybatis-plus-generator
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ ${commons.lang.version}
+
+
+ commons-fileupload
+ commons-fileupload
+ ${commons.fileupload.version}
+
+
+ commons-io
+ commons-io
+ ${commons.io.version}
+
+
+ commons-codec
+ commons-codec
+ ${commons.codec.version}
+
+
+ com.google.guava
+ guava
+ ${guava.version}
+
+
+ joda-time
+ joda-time
+ ${joda.time.version}
+
+
+ com.google.code.gson
+ gson
+ ${gson.version}
+
+
+ cn.hutool
+ hutool-all
+ ${hutool.version}
+
+
+ org.jsoup
+ jsoup
+ ${jsoup.version}
+
+
+ com.github.xiaoymin
+ knife4j-spring-boot-starter
+ ${knife4j.version}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+
+
+
+
+ public
+ aliyun nexus
+ https://maven.aliyun.com/repository/public/
+
+ true
+
+
+
+
+
+ public
+ aliyun nexus
+ https://maven.aliyun.com/repository/public/
+
+ true
+
+
+ false
+
+
+
+
\ No newline at end of file
diff --git a/renren-admin/Dockerfile b/renren-admin/Dockerfile
new file mode 100644
index 0000000..9db81f6
--- /dev/null
+++ b/renren-admin/Dockerfile
@@ -0,0 +1,7 @@
+FROM java:8
+EXPOSE 8080
+
+VOLUME /tmp
+ADD renren-admin.jar /app.jar
+RUN bash -c 'touch /app.jar'
+ENTRYPOINT ["java","-jar","/app.jar"]
diff --git a/renren-admin/db/dm8.sql b/renren-admin/db/dm8.sql
new file mode 100644
index 0000000..682c2ff
--- /dev/null
+++ b/renren-admin/db/dm8.sql
@@ -0,0 +1,674 @@
+CREATE TABLE sys_user (
+ id bigint NOT NULL,
+ username varchar(50) NOT NULL,
+ password varchar(100),
+ real_name varchar(50),
+ head_url varchar(200),
+ gender int,
+ email varchar(100),
+ mobile varchar(100),
+ dept_id bigint,
+ super_admin int,
+ status int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_username on sys_user(username);
+CREATE INDEX idx_sys_user_create_date on sys_user(create_date);
+
+COMMENT ON TABLE sys_user IS '用户管理';
+COMMENT ON COLUMN sys_user.id IS 'id';
+COMMENT ON COLUMN sys_user.username IS '用户名';
+COMMENT ON COLUMN sys_user.password IS '密码';
+COMMENT ON COLUMN sys_user.real_name IS '姓名';
+COMMENT ON COLUMN sys_user.head_url IS '头像';
+COMMENT ON COLUMN sys_user.gender IS '性别 0:男 1:女 2:保密';
+COMMENT ON COLUMN sys_user.email IS '邮箱';
+COMMENT ON COLUMN sys_user.mobile IS '手机号';
+COMMENT ON COLUMN sys_user.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_user.super_admin IS '超级管理员 0:否 1:是';
+COMMENT ON COLUMN sys_user.status IS '状态 0:停用 1:正常';
+COMMENT ON COLUMN sys_user.creator IS '创建者';
+COMMENT ON COLUMN sys_user.create_date IS '创建时间';
+COMMENT ON COLUMN sys_user.updater IS '更新者';
+COMMENT ON COLUMN sys_user.update_date IS '更新时间';
+
+
+CREATE TABLE sys_dept (
+ id bigint NOT NULL,
+ pid bigint,
+ pids varchar(500),
+ name varchar(50),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dept_pid on sys_dept(pid);
+CREATE INDEX idx_sys_dept_idx_sort on sys_dept(sort);
+
+COMMENT ON TABLE sys_dept IS '部门管理';
+COMMENT ON COLUMN sys_dept.id IS 'id';
+COMMENT ON COLUMN sys_dept.pid IS '上级ID';
+COMMENT ON COLUMN sys_dept.pids IS '所有上级ID,用逗号分开';
+COMMENT ON COLUMN sys_dept.name IS '部门名称';
+COMMENT ON COLUMN sys_dept.sort IS '排序';
+COMMENT ON COLUMN sys_dept.creator IS '创建者';
+COMMENT ON COLUMN sys_dept.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dept.updater IS '更新者';
+COMMENT ON COLUMN sys_dept.update_date IS '更新时间';
+
+
+create table sys_role
+(
+ id bigint NOT NULL,
+ name varchar(50),
+ remark varchar(100),
+ dept_id bigint,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_dept_id on sys_role(dept_id);
+
+COMMENT ON TABLE sys_role IS '角色管理';
+COMMENT ON COLUMN sys_role.id IS 'id';
+COMMENT ON COLUMN sys_role.name IS '角色名称';
+COMMENT ON COLUMN sys_role.remark IS '备注';
+COMMENT ON COLUMN sys_role.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_role.creator IS '创建者';
+COMMENT ON COLUMN sys_role.create_date IS '创建时间';
+COMMENT ON COLUMN sys_role.updater IS '更新者';
+COMMENT ON COLUMN sys_role.update_date IS '更新时间';
+
+
+create table sys_menu
+(
+ id bigint NOT NULL,
+ pid bigint,
+ name varchar(200),
+ url varchar(200),
+ permissions varchar(500),
+ menu_type int,
+ icon varchar(50),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_menu_pid on sys_menu(pid);
+CREATE INDEX idx_sys_menu_sort on sys_menu(sort);
+
+COMMENT ON TABLE sys_menu IS '菜单管理';
+COMMENT ON COLUMN sys_menu.id IS 'id';
+COMMENT ON COLUMN sys_menu.pid IS '上级ID,一级菜单为0';
+COMMENT ON COLUMN sys_menu.name IS '名称';
+COMMENT ON COLUMN sys_menu.url IS '菜单URL';
+COMMENT ON COLUMN sys_menu.permissions IS '授权(多个用逗号分隔,如:sys:user:list,sys:user:save)';
+COMMENT ON COLUMN sys_menu.menu_type IS '类型 0:菜单 1:按钮';
+COMMENT ON COLUMN sys_menu.icon IS '菜单图标';
+COMMENT ON COLUMN sys_menu.sort IS '排序';
+COMMENT ON COLUMN sys_menu.creator IS '创建者';
+COMMENT ON COLUMN sys_menu.create_date IS '创建时间';
+COMMENT ON COLUMN sys_menu.updater IS '更新者';
+COMMENT ON COLUMN sys_menu.update_date IS '更新时间';
+
+
+create table sys_role_user
+(
+ id bigint NOT NULL,
+ role_id bigint,
+ user_id bigint,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_user_role_id on sys_role_user(role_id);
+CREATE INDEX idx_sys_role_user_user_id on sys_role_user(user_id);
+
+COMMENT ON TABLE sys_role_user IS '角色用户关系';
+COMMENT ON COLUMN sys_role_user.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_user.user_id IS '用户ID';
+COMMENT ON COLUMN sys_role_user.creator IS '创建者';
+COMMENT ON COLUMN sys_role_user.create_date IS '创建时间';
+
+
+create table sys_role_menu
+(
+ id bigint NOT NULL,
+ role_id bigint,
+ menu_id bigint,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_menu_role_id on sys_role_menu(role_id);
+CREATE INDEX idx_sys_role_menu_menu_id on sys_role_menu(menu_id);
+
+COMMENT ON TABLE sys_role_menu IS '角色菜单关系';
+COMMENT ON COLUMN sys_role_menu.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_menu.menu_id IS '菜单ID';
+COMMENT ON COLUMN sys_role_menu.creator IS '创建者';
+COMMENT ON COLUMN sys_role_menu.create_date IS '创建时间';
+
+
+create table sys_role_data_scope
+(
+ id bigint NOT NULL,
+ role_id bigint,
+ dept_id bigint,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_data_scope_role_id on sys_role_data_scope(role_id);
+
+COMMENT ON TABLE sys_role_data_scope IS '角色数据权限';
+COMMENT ON COLUMN sys_role_data_scope.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_data_scope.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_role_data_scope.creator IS '创建者';
+COMMENT ON COLUMN sys_role_data_scope.create_date IS '创建时间';
+
+
+create table sys_params
+(
+ id bigint NOT NULL,
+ param_code varchar(32),
+ param_value varchar(2000),
+ param_type int DEFAULT 1 NOT NULL,
+ remark varchar(200),
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_params_param_code on sys_params(param_code);
+CREATE INDEX idx_sys_params_create_date on sys_params(create_date);
+
+COMMENT ON TABLE sys_params IS '参数管理';
+COMMENT ON COLUMN sys_params.param_code IS '参数编码';
+COMMENT ON COLUMN sys_params.param_value IS '参数值';
+COMMENT ON COLUMN sys_params.param_type IS '类型 0:系统参数 1:非系统参数';
+COMMENT ON COLUMN sys_params.remark IS '备注';
+COMMENT ON COLUMN sys_params.creator IS '创建者';
+COMMENT ON COLUMN sys_params.create_date IS '创建时间';
+COMMENT ON COLUMN sys_params.updater IS '更新者';
+COMMENT ON COLUMN sys_params.update_date IS '更新时间';
+
+
+create table sys_dict_type
+(
+ id bigint NOT NULL,
+ dict_type varchar(100),
+ dict_name varchar(255),
+ remark varchar(255),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_dict_type_dict_type on sys_dict_type(dict_type);
+
+COMMENT ON TABLE sys_dict_type IS '字典类型';
+COMMENT ON COLUMN sys_dict_type.id IS 'id';
+COMMENT ON COLUMN sys_dict_type.dict_type IS '字典类型';
+COMMENT ON COLUMN sys_dict_type.dict_name IS '字典名称';
+COMMENT ON COLUMN sys_dict_type.remark IS '备注';
+COMMENT ON COLUMN sys_dict_type.sort IS '排序';
+COMMENT ON COLUMN sys_dict_type.creator IS '创建者';
+COMMENT ON COLUMN sys_dict_type.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dict_type.updater IS '更新者';
+COMMENT ON COLUMN sys_dict_type.update_date IS '更新时间';
+
+create table sys_dict_data
+(
+ id bigint NOT NULL,
+ dict_type_id bigint NOT NULL,
+ dict_label varchar(255),
+ dict_value varchar(255),
+ remark varchar(255),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dict_data_sort on sys_dict_data(sort);
+CREATE UNIQUE INDEX uk_dict_type_value on sys_dict_data(dict_type_id, dict_value);
+
+COMMENT ON TABLE sys_dict_data IS '字典数据';
+COMMENT ON COLUMN sys_dict_data.id IS 'id';
+COMMENT ON COLUMN sys_dict_data.dict_type_id IS '字典类型ID';
+COMMENT ON COLUMN sys_dict_data.dict_label IS '字典标签';
+COMMENT ON COLUMN sys_dict_data.dict_value IS '字典值';
+COMMENT ON COLUMN sys_dict_data.remark IS '备注';
+COMMENT ON COLUMN sys_dict_data.sort IS '排序';
+COMMENT ON COLUMN sys_dict_data.creator IS '创建者';
+COMMENT ON COLUMN sys_dict_data.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dict_data.updater IS '更新者';
+COMMENT ON COLUMN sys_dict_data.update_date IS '更新时间';
+
+
+create table sys_log_login
+(
+ id bigint NOT NULL,
+ operation int,
+ status int,
+ user_agent varchar(500),
+ ip varchar(32),
+ creator_name varchar(50),
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_login_status on sys_log_login(status);
+CREATE INDEX idx_login_create_date on sys_log_login(create_date);
+
+COMMENT ON TABLE sys_log_login IS '登录日志';
+COMMENT ON COLUMN sys_log_login.id IS 'id';
+COMMENT ON COLUMN sys_log_login.operation IS '用户操作 0:用户登录 1:用户退出';
+COMMENT ON COLUMN sys_log_login.status IS '状态 0:失败 1:成功 2:账号已锁定';
+COMMENT ON COLUMN sys_log_login.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_login.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_login.creator_name IS '用户名';
+COMMENT ON COLUMN sys_log_login.creator IS '创建者';
+COMMENT ON COLUMN sys_log_login.create_date IS '创建时间';
+
+
+create table sys_log_operation
+(
+ id bigint NOT NULL,
+ operation varchar(50),
+ request_uri varchar(200),
+ request_method varchar(20),
+ request_params text,
+ request_time int,
+ user_agent varchar(500),
+ ip varchar(32),
+ status int,
+ creator_name varchar(50),
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_operation_create_date on sys_log_operation(create_date);
+
+COMMENT ON TABLE sys_log_operation IS '操作日志';
+COMMENT ON COLUMN sys_log_operation.id IS 'id';
+COMMENT ON COLUMN sys_log_operation.operation IS '用户操作';
+COMMENT ON COLUMN sys_log_operation.request_uri IS '请求URI';
+COMMENT ON COLUMN sys_log_operation.request_method IS '请求方式';
+COMMENT ON COLUMN sys_log_operation.request_params IS '请求参数';
+COMMENT ON COLUMN sys_log_operation.request_time IS '请求时长(毫秒)';
+COMMENT ON COLUMN sys_log_operation.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_operation.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_operation.status IS '状态 0:失败 1:成功';
+COMMENT ON COLUMN sys_log_operation.creator_name IS '用户名';
+COMMENT ON COLUMN sys_log_operation.creator IS '创建者';
+COMMENT ON COLUMN sys_log_operation.create_date IS '创建时间';
+
+
+create table sys_log_error
+(
+ id bigint NOT NULL,
+ request_uri varchar(200),
+ request_method varchar(20),
+ request_params text,
+ user_agent varchar(500),
+ ip varchar(32),
+ error_info text,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_error_create_date on sys_log_error(create_date);
+
+COMMENT ON TABLE sys_log_error IS '异常日志';
+COMMENT ON COLUMN sys_log_error.id IS 'id';
+COMMENT ON COLUMN sys_log_error.request_uri IS '请求URI';
+COMMENT ON COLUMN sys_log_error.request_method IS '请求方式';
+COMMENT ON COLUMN sys_log_error.request_params IS '请求参数';
+COMMENT ON COLUMN sys_log_error.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_error.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_error.error_info IS '异常信息';
+COMMENT ON COLUMN sys_log_error.creator IS '创建者';
+COMMENT ON COLUMN sys_log_error.create_date IS '创建时间';
+
+
+
+CREATE TABLE sys_oss (
+ id bigint NOT NULL,
+ url varchar(200),
+ creator bigint,
+ create_date datetime,
+ PRIMARY KEY (id)
+);
+CREATE INDEX idx_sys_oss_create_date on sys_oss(create_date);
+
+COMMENT ON TABLE sys_oss IS '文件上传';
+COMMENT ON COLUMN sys_oss.id IS 'id';
+COMMENT ON COLUMN sys_oss.url IS 'URL地址';
+COMMENT ON COLUMN sys_oss.creator IS '创建者';
+COMMENT ON COLUMN sys_oss.create_date IS '创建时间';
+
+
+CREATE TABLE schedule_job (
+ id bigint NOT NULL,
+ bean_name varchar(200),
+ params varchar(2000),
+ cron_expression varchar(100),
+ status int,
+ remark varchar(255),
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_schedule_job_create_date on schedule_job(create_date);
+
+COMMENT ON TABLE schedule_job IS '定时任务';
+COMMENT ON COLUMN schedule_job.id IS 'id';
+COMMENT ON COLUMN schedule_job.bean_name IS 'spring bean名称';
+COMMENT ON COLUMN schedule_job.params IS '参数';
+COMMENT ON COLUMN schedule_job.cron_expression IS 'cron表达式';
+COMMENT ON COLUMN schedule_job.status IS '任务状态 0:暂停 1:正常';
+COMMENT ON COLUMN schedule_job.remark IS '备注';
+COMMENT ON COLUMN schedule_job.creator IS '创建者';
+COMMENT ON COLUMN schedule_job.create_date IS '创建时间';
+COMMENT ON COLUMN schedule_job.updater IS '更新者';
+COMMENT ON COLUMN schedule_job.update_date IS '更新时间';
+
+
+CREATE TABLE schedule_job_log (
+ id bigint NOT NULL,
+ job_id bigint NOT NULL,
+ bean_name varchar(200),
+ params varchar(2000),
+ status int,
+ error varchar(2000),
+ times int,
+ create_date datetime,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_job_log_job_id on schedule_job_log(job_id);
+CREATE INDEX idx_job_log_create_date on schedule_job_log(create_date);
+
+COMMENT ON TABLE schedule_job_log IS '定时任务日志';
+COMMENT ON COLUMN schedule_job_log.id IS 'id';
+COMMENT ON COLUMN schedule_job_log.bean_name IS 'spring bean名称';
+COMMENT ON COLUMN schedule_job_log.params IS '参数';
+COMMENT ON COLUMN schedule_job_log.status IS '任务状态 0:失败 1:成功';
+COMMENT ON COLUMN schedule_job_log.error IS '失败信息';
+COMMENT ON COLUMN schedule_job_log.times IS '耗时(单位:毫秒)';
+COMMENT ON COLUMN schedule_job.create_date IS '创建时间';
+
+
+CREATE TABLE sys_user_token (
+ id bigint NOT NULL,
+ user_id bigint,
+ token varchar(100),
+ expire_date datetime,
+ update_date datetime,
+ create_date datetime,
+ PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_token_user_id on sys_user_token(user_id);
+CREATE UNIQUE INDEX uk_sys_user_token on sys_user_token(token);
+
+COMMENT ON TABLE sys_user_token IS '系统用户Token';
+COMMENT ON COLUMN sys_user_token.id IS 'id';
+COMMENT ON COLUMN sys_user_token.user_id IS '用户id';
+COMMENT ON COLUMN sys_user_token.token IS '用户token';
+COMMENT ON COLUMN sys_user_token.expire_date IS '过期时间';
+COMMENT ON COLUMN sys_user_token.update_date IS '更新时间';
+COMMENT ON COLUMN sys_user_token.create_date IS '创建时间';
+
+
+
+-- 初始数据
+INSERT INTO sys_user(id, username, password, real_name, gender, email, mobile, status, dept_id, super_admin, creator, create_date, updater, update_date) VALUES (1067246875800000001, 'admin', '$2a$10$012Kx2ba5jzqr9gLlG4MX.bnQJTD9UWqF57XDo2N3.fPtLne02u/m', '管理员', 0, 'root@renren.io', '13612345678', 1, null, 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000002, 0, '权限管理', NULL, NULL, 0, 'icon-safetycertificate', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000003, 1067246875800000055, '新增', NULL, 'sys:user:save,sys:dept:list,sys:role:list', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000004, 1067246875800000055, '修改', NULL, 'sys:user:update,sys:dept:list,sys:role:list', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000005, 1067246875800000055, '删除', NULL, 'sys:user:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000006, 1067246875800000055, '导出', NULL, 'sys:user:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000007, 1067246875800000002, '角色管理', 'sys/role', NULL, 0, 'icon-team', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000008, 1067246875800000007, '查看', NULL, 'sys:role:page,sys:role:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000009, 1067246875800000007, '新增', NULL, 'sys:role:save,sys:menu:select,sys:dept:list', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000010, 1067246875800000007, '修改', NULL, 'sys:role:update,sys:menu:select,sys:dept:list', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000011, 1067246875800000007, '删除', NULL, 'sys:role:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000012, 1067246875800000002, '部门管理', 'sys/dept', NULL, 0, 'icon-apartment', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000014, 1067246875800000012, '查看', NULL, 'sys:dept:list,sys:dept:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000015, 1067246875800000012, '新增', NULL, 'sys:dept:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000016, 1067246875800000012, '修改', NULL, 'sys:dept:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000017, 1067246875800000012, '删除', NULL, 'sys:dept:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000025, 1067246875800000035, '菜单管理', 'sys/menu', NULL, 0, 'icon-unorderedlist', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000026, 1067246875800000025, '查看', NULL, 'sys:menu:list,sys:menu:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000027, 1067246875800000025, '新增', NULL, 'sys:menu:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000028, 1067246875800000025, '修改', NULL, 'sys:menu:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000029, 1067246875800000025, '删除', NULL, 'sys:menu:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000030, 1067246875800000035, '定时任务', 'job/schedule', NULL, 0, 'icon-dashboard', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000031, 1067246875800000030, '查看', NULL, 'sys:schedule:page,sys:schedule:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000032, 1067246875800000030, '新增', NULL, 'sys:schedule:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000033, 1067246875800000030, '修改', NULL, 'sys:schedule:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000034, 1067246875800000030, '删除', NULL, 'sys:schedule:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000035, 0, '系统设置', NULL, NULL, 0, 'icon-setting', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000036, 1067246875800000030, '暂停', NULL, 'sys:schedule:pause', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000037, 1067246875800000030, '恢复', NULL, 'sys:schedule:resume', 1, NULL, 5, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000038, 1067246875800000030, '立即执行', NULL, 'sys:schedule:run', 1, NULL, 6, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000039, 1067246875800000030, '日志列表', NULL, 'sys:schedule:log', 1, NULL, 7, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000040, 1067246875800000035, '参数管理', 'sys/params', '', 0, 'icon-fileprotect', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000041, 1067246875800000035, '字典管理', 'sys/dict-type', NULL, 0, 'icon-golden-fill', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000042, 1067246875800000041, '查看', NULL, 'sys:dict:page,sys:dict:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000043, 1067246875800000041, '新增', NULL, 'sys:dict:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000044, 1067246875800000041, '修改', NULL, 'sys:dict:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000045, 1067246875800000041, '删除', NULL, 'sys:dict:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000046, 0, '日志管理', NULL, NULL, 0, 'icon-container', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000047, 1067246875800000035, '文件上传', 'oss/oss', 'sys:oss:all', 0, 'icon-upload', 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000048, 1067246875800000046, '登录日志', 'sys/log-login', 'sys:log:login', 0, 'icon-filedone', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000049, 1067246875800000046, '操作日志', 'sys/log-operation', 'sys:log:operation', 0, 'icon-solution', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000050, 1067246875800000046, '异常日志', 'sys/log-error', 'sys:log:error', 0, 'icon-file-exception', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000051, 1067246875800000053, 'SQL监控', '{{ window.SITE_CONFIG["apiURL"] }}/druid/sql.html', NULL, 0, 'icon-database', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000053, 0, '系统监控', NULL, NULL, 0, 'icon-desktop', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000055, 1067246875800000002, '用户管理', 'sys/user', NULL, 0, 'icon-user', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000056, 1067246875800000055, '查看', NULL, 'sys:user:page,sys:user:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000057, 1067246875800000040, '新增', NULL, 'sys:params:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000058, 1067246875800000040, '导出', NULL, 'sys:params:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000059, 1067246875800000040, '查看', '', 'sys:params:page,sys:params:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000060, 1067246875800000040, '修改', NULL, 'sys:params:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000061, 1067246875800000040, '删除', '', 'sys:params:delete', 1, '', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1156748733921165314, 1067246875800000053, '接口文档', '{{ window.SITE_CONFIG["apiURL"] }}/doc.html', '', 0, 'icon-file-word', 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000062, 1067246875800000063, '1067246875800000066,1067246875800000063', '技术部', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000063, 1067246875800000066, '1067246875800000066', '长沙分公司', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000064, 1067246875800000066, '1067246875800000066', '上海分公司', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000065, 1067246875800000064, '1067246875800000066,1067246875800000064', '市场部', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000066, 0, '0', '人人开源集团', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000067, 1067246875800000064, '1067246875800000066,1067246875800000064', '销售部', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000068, 1067246875800000063, '1067246875800000066,1067246875800000063', '产品部', 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061112075464705, 1160061077912858625, '男', '0', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061146967879681, 1160061077912858625, '女', '1', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061190127267841, 1160061077912858625, '保密', '2', '', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814069634195457, 1225813644059140097, '公告', '0', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814107559092225, 1225813644059140097, '会议', '1', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814271879340034, 1225813644059140097, '其他', '2', '', 2, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_params(id, param_code, param_value, param_type, remark, creator, create_date, updater, update_date) VALUES (1067246875800000073, 'CLOUD_STORAGE_CONFIG_KEY', '{"type":1,"qiniuDomain":"http://test.oss.renren.io","qiniuPrefix":"upload","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","qiniuBucketName":"renren-oss","aliyunDomain":"","aliyunPrefix":"","aliyunEndPoint":"","aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qcloudBucketName":""}', '0', '云存储配置信息', 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO schedule_job (id, bean_name, params, cron_expression, status, remark, creator, create_date, updater, update_date) VALUES (1067246875800000076, 'testTask', 'renren', '0 0/30 * * * ?', 0, '有参测试,多个参数使用json', 1067246875800000001, now(), 1067246875800000001, now());
+
+
+
+
+-- quartz自带表结构
+DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
+DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
+DROP TABLE IF EXISTS QRTZ_LOCKS;
+DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_TRIGGERS;
+DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
+DROP TABLE IF EXISTS QRTZ_CALENDARS;
+
+create table QRTZ_JOB_DETAILS (
+ sched_name varchar(120) not null,
+ job_name varchar(200) not null,
+ job_group varchar(200) not null,
+ description varchar(250) null,
+ job_class_name varchar(250) not null,
+ is_durable varchar(1) not null,
+ is_nonconcurrent varchar(1) not null,
+ is_update_data varchar(1) not null,
+ requests_recovery varchar(1) not null,
+ job_data blob null,
+ primary key (sched_name, job_name, job_group)
+);
+
+create table QRTZ_TRIGGERS (
+ sched_name varchar(120) not null,
+ trigger_name varchar(200) not null,
+ trigger_group varchar(200) not null,
+ job_name varchar(200) not null,
+ job_group varchar(200) not null,
+ description varchar(250) null,
+ next_fire_time bigint null,
+ prev_fire_time bigint null,
+ priority int null,
+ trigger_state varchar(16) not null,
+ trigger_type varchar(8) not null,
+ start_time bigint not null,
+ end_time bigint null,
+ calendar_name varchar(200) null,
+ misfire_instr int null,
+ job_data blob null,
+ primary key (sched_name, trigger_name, trigger_group),
+ foreign key (sched_name, job_name, job_group)
+ references QRTZ_JOB_DETAILS(sched_name, job_name, job_group)
+);
+
+create table QRTZ_SIMPLE_TRIGGERS (
+ sched_name varchar(120) not null,
+ trigger_name varchar(200) not null,
+ trigger_group varchar(200) not null,
+ repeat_count bigint not null,
+ repeat_interval bigint not null,
+ times_triggered bigint not null,
+ primary key (sched_name, trigger_name, trigger_group),
+ foreign key (sched_name, trigger_name, trigger_group)
+ references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
+);
+
+create table QRTZ_CRON_TRIGGERS (
+ sched_name varchar(120) not null,
+ trigger_name varchar(200) not null,
+ trigger_group varchar(200) not null,
+ cron_expression varchar(200) not null,
+ time_zone_id varchar(80),
+ primary key (sched_name, trigger_name, trigger_group),
+ foreign key (sched_name, trigger_name, trigger_group)
+ references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
+);
+
+create table QRTZ_BLOB_TRIGGERS (
+ sched_name varchar(120) not null,
+ trigger_name varchar(200) not null,
+ trigger_group varchar(200) not null,
+ blob_data blob null,
+ primary key (sched_name, trigger_name, trigger_group),
+ foreign key (sched_name, trigger_name, trigger_group)
+ references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
+);
+
+create table QRTZ_CALENDARS (
+ sched_name varchar(120) not null,
+ calendar_name varchar(200) not null,
+ calendar blob not null,
+ primary key (sched_name, calendar_name)
+);
+
+create table QRTZ_PAUSED_TRIGGER_GRPS (
+ sched_name varchar(120) not null,
+ trigger_group varchar(200) not null,
+ primary key (sched_name, trigger_group)
+);
+
+create table QRTZ_FIRED_TRIGGERS (
+ sched_name varchar(120) not null,
+ entry_id varchar(95) not null,
+ trigger_name varchar(200) not null,
+ trigger_group varchar(200) not null,
+ instance_name varchar(200) not null,
+ fired_time bigint not null,
+ sched_time bigint not null,
+ priority int not null,
+ state varchar(16) not null,
+ job_name varchar(200) null,
+ job_group varchar(200) null,
+ is_nonconcurrent varchar(1) null,
+ requests_recovery varchar(1) null,
+ primary key (sched_name, entry_id)
+);
+
+create table QRTZ_SCHEDULER_STATE (
+ sched_name varchar(120) not null,
+ instance_name varchar(200) not null,
+ last_checkin_time bigint not null,
+ checkin_interval bigint not null,
+ primary key (sched_name, instance_name)
+);
+
+create table QRTZ_LOCKS (
+ sched_name varchar(120) not null,
+ lock_name varchar(40) not null,
+ primary key (sched_name, lock_name)
+);
+
+create table QRTZ_SIMPROP_TRIGGERS (
+ sched_name varchar(120) not null,
+ trigger_name varchar(200) not null,
+ trigger_group varchar(200) not null,
+ str_prop_1 varchar(512) null,
+ str_prop_2 varchar(512) null,
+ str_prop_3 varchar(512) null,
+ int_prop_1 int null,
+ int_prop_2 int null,
+ long_prop_1 bigint null,
+ long_prop_2 bigint null,
+ dec_prop_1 numeric(13,4) null,
+ dec_prop_2 numeric(13,4) null,
+ bool_prop_1 varchar(1) null,
+ bool_prop_2 varchar(1) null,
+ primary key (sched_name, trigger_name, trigger_group),
+ foreign key (sched_name, trigger_name, trigger_group)
+ references QRTZ_TRIGGERS(sched_name, trigger_name, trigger_group)
+);
\ No newline at end of file
diff --git a/renren-admin/db/mysql.sql b/renren-admin/db/mysql.sql
new file mode 100644
index 0000000..c700c7e
--- /dev/null
+++ b/renren-admin/db/mysql.sql
@@ -0,0 +1,504 @@
+-- 系统用户
+CREATE TABLE sys_user (
+ id bigint NOT NULL COMMENT 'id',
+ username varchar(50) NOT NULL COMMENT '用户名',
+ password varchar(100) COMMENT '密码',
+ real_name varchar(50) COMMENT '姓名',
+ head_url varchar(200) COMMENT '头像',
+ gender tinyint unsigned COMMENT '性别 0:男 1:女 2:保密',
+ email varchar(100) COMMENT '邮箱',
+ mobile varchar(100) COMMENT '手机号',
+ dept_id bigint COMMENT '部门ID',
+ super_admin tinyint unsigned COMMENT '超级管理员 0:否 1:是',
+ status tinyint COMMENT '状态 0:停用 1:正常',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ primary key (id),
+ unique key uk_username (username),
+ key idx_create_date (create_date)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统用户';
+
+-- 部门
+CREATE TABLE sys_dept (
+ id bigint NOT NULL COMMENT 'id',
+ pid bigint COMMENT '上级ID',
+ pids varchar(500) COMMENT '所有上级ID,用逗号分开',
+ name varchar(50) COMMENT '部门名称',
+ sort int unsigned COMMENT '排序',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ primary key (id),
+ key idx_pid (pid),
+ key idx_sort (sort)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门管理';
+
+-- 角色管理
+create table sys_role
+(
+ id bigint NOT NULL COMMENT 'id',
+ name varchar(50) COMMENT '角色名称',
+ remark varchar(100) COMMENT '备注',
+ dept_id bigint COMMENT '部门ID',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ primary key (id),
+ key idx_dept_id (dept_id)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='角色管理';
+
+-- 菜单管理
+create table sys_menu
+(
+ id bigint NOT NULL COMMENT 'id',
+ pid bigint COMMENT '上级ID,一级菜单为0',
+ name varchar(200) COMMENT '名称',
+ url varchar(200) COMMENT '菜单URL',
+ permissions varchar(500) COMMENT '授权(多个用逗号分隔,如:sys:user:list,sys:user:save)',
+ menu_type tinyint unsigned COMMENT '类型 0:菜单 1:按钮',
+ icon varchar(50) COMMENT '菜单图标',
+ sort int COMMENT '排序',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ primary key (id),
+ key idx_pid (pid),
+ key idx_sort (sort)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='菜单管理';
+
+-- 角色用户关系
+create table sys_role_user
+(
+ id bigint NOT NULL COMMENT 'id',
+ role_id bigint COMMENT '角色ID',
+ user_id bigint COMMENT '用户ID',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ primary key (id),
+ key idx_role_id (role_id),
+ key idx_user_id (user_id)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='角色用户关系';
+
+-- 角色菜单关系
+create table sys_role_menu
+(
+ id bigint NOT NULL COMMENT 'id',
+ role_id bigint COMMENT '角色ID',
+ menu_id bigint COMMENT '菜单ID',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ primary key (id),
+ key idx_role_id (role_id),
+ key idx_menu_id (menu_id)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='角色菜单关系';
+
+-- 角色数据权限
+create table sys_role_data_scope
+(
+ id bigint NOT NULL COMMENT 'id',
+ role_id bigint COMMENT '角色ID',
+ dept_id bigint COMMENT '部门ID',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ primary key (id),
+ key idx_role_id (role_id)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='角色数据权限';
+
+-- 参数管理
+create table sys_params
+(
+ id bigint NOT NULL COMMENT 'id',
+ param_code varchar(32) COMMENT '参数编码',
+ param_value varchar(2000) COMMENT '参数值',
+ param_type tinyint unsigned default 1 COMMENT '类型 0:系统参数 1:非系统参数',
+ remark varchar(200) COMMENT '备注',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ primary key (id),
+ unique key uk_param_code (param_code),
+ key idx_create_date (create_date)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='参数管理';
+
+-- 字典类型
+create table sys_dict_type
+(
+ id bigint NOT NULL COMMENT 'id',
+ dict_type varchar(100) NOT NULL COMMENT '字典类型',
+ dict_name varchar(255) NOT NULL COMMENT '字典名称',
+ remark varchar(255) COMMENT '备注',
+ sort int unsigned COMMENT '排序',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ primary key (id),
+ UNIQUE KEY(dict_type)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='字典类型';
+
+-- 字典数据
+create table sys_dict_data
+(
+ id bigint NOT NULL COMMENT 'id',
+ dict_type_id bigint NOT NULL COMMENT '字典类型ID',
+ dict_label varchar(255) NOT NULL COMMENT '字典标签',
+ dict_value varchar(255) COMMENT '字典值',
+ remark varchar(255) COMMENT '备注',
+ sort int unsigned COMMENT '排序',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ primary key (id),
+ unique key uk_dict_type_value (dict_type_id, dict_value),
+ key idx_sort (sort)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='字典数据';
+
+-- 登录日志
+create table sys_log_login
+(
+ id bigint NOT NULL COMMENT 'id',
+ operation tinyint unsigned COMMENT '用户操作 0:用户登录 1:用户退出',
+ status tinyint unsigned NOT NULL COMMENT '状态 0:失败 1:成功 2:账号已锁定',
+ user_agent varchar(500) COMMENT '用户代理',
+ ip varchar(32) COMMENT '操作IP',
+ creator_name varchar(50) COMMENT '用户名',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ primary key (id),
+ key idx_status (status),
+ key idx_create_date (create_date)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='登录日志';
+
+-- 操作日志
+create table sys_log_operation
+(
+ id bigint NOT NULL COMMENT 'id',
+ operation varchar(50) COMMENT '用户操作',
+ request_uri varchar(200) COMMENT '请求URI',
+ request_method varchar(20) COMMENT '请求方式',
+ request_params text COMMENT '请求参数',
+ request_time int unsigned NOT NULL COMMENT '请求时长(毫秒)',
+ user_agent varchar(500) COMMENT '用户代理',
+ ip varchar(32) COMMENT '操作IP',
+ status tinyint unsigned NOT NULL COMMENT '状态 0:失败 1:成功',
+ creator_name varchar(50) COMMENT '用户名',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ primary key (id),
+ key idx_create_date (create_date)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='操作日志';
+
+-- 异常日志
+create table sys_log_error
+(
+ id bigint NOT NULL COMMENT 'id',
+ request_uri varchar(200) COMMENT '请求URI',
+ request_method varchar(20) COMMENT '请求方式',
+ request_params text COMMENT '请求参数',
+ user_agent varchar(500) COMMENT '用户代理',
+ ip varchar(32) COMMENT '操作IP',
+ error_info text COMMENT '异常信息',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ primary key (id),
+ key idx_create_date (create_date)
+)ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='异常日志';
+
+
+-- 文件上传
+CREATE TABLE sys_oss (
+ id bigint NOT NULL COMMENT 'id',
+ url varchar(200) COMMENT 'URL地址',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ PRIMARY KEY (id),
+ key idx_create_date (create_date)
+) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT='文件上传';
+
+-- 定时任务
+CREATE TABLE schedule_job (
+ id bigint NOT NULL COMMENT 'id',
+ bean_name varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
+ params varchar(2000) DEFAULT NULL COMMENT '参数',
+ cron_expression varchar(100) DEFAULT NULL COMMENT 'cron表达式',
+ status tinyint unsigned COMMENT '任务状态 0:暂停 1:正常',
+ remark varchar(255) DEFAULT NULL COMMENT '备注',
+ creator bigint COMMENT '创建者',
+ create_date datetime COMMENT '创建时间',
+ updater bigint COMMENT '更新者',
+ update_date datetime COMMENT '更新时间',
+ PRIMARY KEY (id),
+ key idx_create_date (create_date)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='定时任务';
+
+-- 定时任务日志
+CREATE TABLE schedule_job_log (
+ id bigint NOT NULL COMMENT 'id',
+ job_id bigint NOT NULL COMMENT '任务id',
+ bean_name varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
+ params varchar(2000) DEFAULT NULL COMMENT '参数',
+ status tinyint unsigned NOT NULL COMMENT '任务状态 0:失败 1:成功',
+ error varchar(2000) DEFAULT NULL COMMENT '失败信息',
+ times int NOT NULL COMMENT '耗时(单位:毫秒)',
+ create_date datetime COMMENT '创建时间',
+ PRIMARY KEY (id),
+ key idx_job_id (job_id),
+ key idx_create_date (create_date)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='定时任务日志';
+
+-- 系统用户Token
+CREATE TABLE sys_user_token (
+ id bigint NOT NULL COMMENT 'id',
+ user_id bigint NOT NULL COMMENT '用户id',
+ token varchar(100) NOT NULL COMMENT '用户token',
+ expire_date datetime COMMENT '过期时间',
+ update_date datetime COMMENT '更新时间',
+ create_date datetime COMMENT '创建时间',
+ PRIMARY KEY (id),
+ UNIQUE KEY user_id (user_id),
+ UNIQUE KEY token (token)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统用户Token';
+
+-- 初始数据
+INSERT INTO sys_user(id, username, password, real_name, gender, email, mobile, status, dept_id, super_admin, creator, create_date, updater, update_date) VALUES (1067246875800000001, 'admin', '$2a$10$012Kx2ba5jzqr9gLlG4MX.bnQJTD9UWqF57XDo2N3.fPtLne02u/m', '管理员', 0, 'root@renren.io', '13612345678', 1, null, 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000002, 0, '权限管理', NULL, NULL, 0, 'icon-safetycertificate', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000003, 1067246875800000055, '新增', NULL, 'sys:user:save,sys:dept:list,sys:role:list', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000004, 1067246875800000055, '修改', NULL, 'sys:user:update,sys:dept:list,sys:role:list', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000005, 1067246875800000055, '删除', NULL, 'sys:user:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000006, 1067246875800000055, '导出', NULL, 'sys:user:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000007, 1067246875800000002, '角色管理', 'sys/role', NULL, 0, 'icon-team', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000008, 1067246875800000007, '查看', NULL, 'sys:role:page,sys:role:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000009, 1067246875800000007, '新增', NULL, 'sys:role:save,sys:menu:select,sys:dept:list', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000010, 1067246875800000007, '修改', NULL, 'sys:role:update,sys:menu:select,sys:dept:list', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000011, 1067246875800000007, '删除', NULL, 'sys:role:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000012, 1067246875800000002, '部门管理', 'sys/dept', NULL, 0, 'icon-apartment', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000014, 1067246875800000012, '查看', NULL, 'sys:dept:list,sys:dept:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000015, 1067246875800000012, '新增', NULL, 'sys:dept:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000016, 1067246875800000012, '修改', NULL, 'sys:dept:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000017, 1067246875800000012, '删除', NULL, 'sys:dept:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000025, 1067246875800000035, '菜单管理', 'sys/menu', NULL, 0, 'icon-unorderedlist', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000026, 1067246875800000025, '查看', NULL, 'sys:menu:list,sys:menu:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000027, 1067246875800000025, '新增', NULL, 'sys:menu:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000028, 1067246875800000025, '修改', NULL, 'sys:menu:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000029, 1067246875800000025, '删除', NULL, 'sys:menu:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000030, 1067246875800000035, '定时任务', 'job/schedule', NULL, 0, 'icon-dashboard', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000031, 1067246875800000030, '查看', NULL, 'sys:schedule:page,sys:schedule:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000032, 1067246875800000030, '新增', NULL, 'sys:schedule:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000033, 1067246875800000030, '修改', NULL, 'sys:schedule:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000034, 1067246875800000030, '删除', NULL, 'sys:schedule:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000035, 0, '系统设置', NULL, NULL, 0, 'icon-setting', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000036, 1067246875800000030, '暂停', NULL, 'sys:schedule:pause', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000037, 1067246875800000030, '恢复', NULL, 'sys:schedule:resume', 1, NULL, 5, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000038, 1067246875800000030, '立即执行', NULL, 'sys:schedule:run', 1, NULL, 6, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000039, 1067246875800000030, '日志列表', NULL, 'sys:schedule:log', 1, NULL, 7, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000040, 1067246875800000035, '参数管理', 'sys/params', '', 0, 'icon-fileprotect', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000041, 1067246875800000035, '字典管理', 'sys/dict-type', NULL, 0, 'icon-golden-fill', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000042, 1067246875800000041, '查看', NULL, 'sys:dict:page,sys:dict:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000043, 1067246875800000041, '新增', NULL, 'sys:dict:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000044, 1067246875800000041, '修改', NULL, 'sys:dict:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000045, 1067246875800000041, '删除', NULL, 'sys:dict:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000046, 0, '日志管理', NULL, NULL, 0, 'icon-container', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000047, 1067246875800000035, '文件上传', 'oss/oss', 'sys:oss:all', 0, 'icon-upload', 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000048, 1067246875800000046, '登录日志', 'sys/log-login', 'sys:log:login', 0, 'icon-filedone', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000049, 1067246875800000046, '操作日志', 'sys/log-operation', 'sys:log:operation', 0, 'icon-solution', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000050, 1067246875800000046, '异常日志', 'sys/log-error', 'sys:log:error', 0, 'icon-file-exception', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000051, 1067246875800000053, 'SQL监控', '{{ window.SITE_CONFIG["apiURL"] }}/druid/sql.html', NULL, 0, 'icon-database', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000053, 0, '系统监控', NULL, NULL, 0, 'icon-desktop', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000055, 1067246875800000002, '用户管理', 'sys/user', NULL, 0, 'icon-user', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000056, 1067246875800000055, '查看', NULL, 'sys:user:page,sys:user:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000057, 1067246875800000040, '新增', NULL, 'sys:params:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000058, 1067246875800000040, '导出', NULL, 'sys:params:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000059, 1067246875800000040, '查看', '', 'sys:params:page,sys:params:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000060, 1067246875800000040, '修改', NULL, 'sys:params:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000061, 1067246875800000040, '删除', '', 'sys:params:delete', 1, '', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1156748733921165314, 1067246875800000053, '接口文档', '{{ window.SITE_CONFIG["apiURL"] }}/doc.html', '', 0, 'icon-file-word', 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000062, 1067246875800000063, '1067246875800000066,1067246875800000063', '技术部', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000063, 1067246875800000066, '1067246875800000066', '长沙分公司', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000064, 1067246875800000066, '1067246875800000066', '上海分公司', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000065, 1067246875800000064, '1067246875800000066,1067246875800000064', '市场部', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000066, 0, '0', '人人开源集团', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000067, 1067246875800000064, '1067246875800000066,1067246875800000064', '销售部', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000068, 1067246875800000063, '1067246875800000066,1067246875800000063', '产品部', 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061112075464705, 1160061077912858625, '男', '0', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061146967879681, 1160061077912858625, '女', '1', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061190127267841, 1160061077912858625, '保密', '2', '', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814069634195457, 1225813644059140097, '公告', '0', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814107559092225, 1225813644059140097, '会议', '1', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814271879340034, 1225813644059140097, '其他', '2', '', 2, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_params(id, param_code, param_value, param_type, remark, creator, create_date, updater, update_date) VALUES (1067246875800000073, 'CLOUD_STORAGE_CONFIG_KEY', '{"type":1,"qiniuDomain":"http://test.oss.renren.io","qiniuPrefix":"upload","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","qiniuBucketName":"renren-oss","aliyunDomain":"","aliyunPrefix":"","aliyunEndPoint":"","aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qcloudBucketName":""}', '0', '云存储配置信息', 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO schedule_job (id, bean_name, params, cron_expression, status, remark, creator, create_date, updater, update_date) VALUES (1067246875800000076, 'testTask', 'renren', '0 0/30 * * * ?', 0, '有参测试,多个参数使用json', 1067246875800000001, now(), 1067246875800000001, now());
+
+
+-- quartz自带表结构
+CREATE TABLE QRTZ_JOB_DETAILS(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ JOB_NAME VARCHAR(200) NOT NULL,
+ JOB_GROUP VARCHAR(200) NOT NULL,
+ DESCRIPTION VARCHAR(250) NULL,
+ JOB_CLASS_NAME VARCHAR(250) NOT NULL,
+ IS_DURABLE VARCHAR(1) NOT NULL,
+ IS_NONCONCURRENT VARCHAR(1) NOT NULL,
+ IS_UPDATE_DATA VARCHAR(1) NOT NULL,
+ REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
+ JOB_DATA BLOB NULL,
+ PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_TRIGGERS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ JOB_NAME VARCHAR(200) NOT NULL,
+ JOB_GROUP VARCHAR(200) NOT NULL,
+ DESCRIPTION VARCHAR(250) NULL,
+ NEXT_FIRE_TIME BIGINT(13) NULL,
+ PREV_FIRE_TIME BIGINT(13) NULL,
+ PRIORITY INTEGER NULL,
+ TRIGGER_STATE VARCHAR(16) NOT NULL,
+ TRIGGER_TYPE VARCHAR(8) NOT NULL,
+ START_TIME BIGINT(13) NOT NULL,
+ END_TIME BIGINT(13) NULL,
+ CALENDAR_NAME VARCHAR(200) NULL,
+ MISFIRE_INSTR SMALLINT(2) NULL,
+ JOB_DATA BLOB NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+ REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ REPEAT_COUNT BIGINT(7) NOT NULL,
+ REPEAT_INTERVAL BIGINT(12) NOT NULL,
+ TIMES_TRIGGERED BIGINT(10) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_CRON_TRIGGERS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ CRON_EXPRESSION VARCHAR(120) NOT NULL,
+ TIME_ZONE_ID VARCHAR(80),
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_SIMPROP_TRIGGERS
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ STR_PROP_1 VARCHAR(512) NULL,
+ STR_PROP_2 VARCHAR(512) NULL,
+ STR_PROP_3 VARCHAR(512) NULL,
+ INT_PROP_1 INT NULL,
+ INT_PROP_2 INT NULL,
+ LONG_PROP_1 BIGINT NULL,
+ LONG_PROP_2 BIGINT NULL,
+ DEC_PROP_1 NUMERIC(13,4) NULL,
+ DEC_PROP_2 NUMERIC(13,4) NULL,
+ BOOL_PROP_1 VARCHAR(1) NULL,
+ BOOL_PROP_2 VARCHAR(1) NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_BLOB_TRIGGERS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ BLOB_DATA BLOB NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_CALENDARS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ CALENDAR_NAME VARCHAR(200) NOT NULL,
+ CALENDAR BLOB NOT NULL,
+ PRIMARY KEY (SCHED_NAME,CALENDAR_NAME))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_FIRED_TRIGGERS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ ENTRY_ID VARCHAR(95) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ INSTANCE_NAME VARCHAR(200) NOT NULL,
+ FIRED_TIME BIGINT(13) NOT NULL,
+ SCHED_TIME BIGINT(13) NOT NULL,
+ PRIORITY INTEGER NOT NULL,
+ STATE VARCHAR(16) NOT NULL,
+ JOB_NAME VARCHAR(200) NULL,
+ JOB_GROUP VARCHAR(200) NULL,
+ IS_NONCONCURRENT VARCHAR(1) NULL,
+ REQUESTS_RECOVERY VARCHAR(1) NULL,
+ PRIMARY KEY (SCHED_NAME,ENTRY_ID))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_SCHEDULER_STATE (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ INSTANCE_NAME VARCHAR(200) NOT NULL,
+ LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
+ CHECKIN_INTERVAL BIGINT(13) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,INSTANCE_NAME))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE QRTZ_LOCKS (
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ LOCK_NAME VARCHAR(40) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,LOCK_NAME))
+ ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY);
+CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP);
+
+CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME);
+CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
+CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME);
+CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
+CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
+CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
+CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
+
+CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME);
+CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
+CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP);
+CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
+CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
\ No newline at end of file
diff --git a/renren-admin/db/oracle.sql b/renren-admin/db/oracle.sql
new file mode 100644
index 0000000..d1468ea
--- /dev/null
+++ b/renren-admin/db/oracle.sql
@@ -0,0 +1,684 @@
+CREATE TABLE sys_user (
+ id NUMBER(20, 0) NOT NULL,
+ username varchar2(50) NOT NULL,
+ password varchar2(100),
+ real_name varchar2(50),
+ head_url varchar2(200),
+ gender NUMBER(2, 0),
+ email varchar2(100),
+ mobile varchar2(100),
+ dept_id NUMBER(20, 0),
+ super_admin NUMBER(2, 0),
+ status NUMBER(2, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ primary key (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_username on sys_user(username);
+CREATE INDEX idx_sys_user_create_date on sys_user(create_date);
+
+COMMENT ON TABLE sys_user IS '用户管理';
+COMMENT ON COLUMN sys_user.id IS 'id';
+COMMENT ON COLUMN sys_user.username IS '用户名';
+COMMENT ON COLUMN sys_user.password IS '密码';
+COMMENT ON COLUMN sys_user.real_name IS '姓名';
+COMMENT ON COLUMN sys_user.head_url IS '头像';
+COMMENT ON COLUMN sys_user.gender IS '性别 0:男 1:女 2:保密';
+COMMENT ON COLUMN sys_user.email IS '邮箱';
+COMMENT ON COLUMN sys_user.mobile IS '手机号';
+COMMENT ON COLUMN sys_user.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_user.super_admin IS '超级管理员 0:否 1:是';
+COMMENT ON COLUMN sys_user.status IS '状态 0:停用 1:正常';
+COMMENT ON COLUMN sys_user.creator IS '创建者';
+COMMENT ON COLUMN sys_user.create_date IS '创建时间';
+COMMENT ON COLUMN sys_user.updater IS '更新者';
+COMMENT ON COLUMN sys_user.update_date IS '更新时间';
+
+
+CREATE TABLE sys_dept (
+ id NUMBER(20, 0) NOT NULL,
+ pid NUMBER(20, 0),
+ pids varchar2(500),
+ name varchar2(50),
+ sort NUMBER(10, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dept_pid on sys_dept(pid);
+CREATE INDEX idx_sys_dept_idx_sort on sys_dept(sort);
+
+COMMENT ON TABLE sys_dept IS '部门管理';
+COMMENT ON COLUMN sys_dept.id IS 'id';
+COMMENT ON COLUMN sys_dept.pid IS '上级ID';
+COMMENT ON COLUMN sys_dept.pids IS '所有上级ID,用逗号分开';
+COMMENT ON COLUMN sys_dept.name IS '部门名称';
+COMMENT ON COLUMN sys_dept.sort IS '排序';
+COMMENT ON COLUMN sys_dept.creator IS '创建者';
+COMMENT ON COLUMN sys_dept.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dept.updater IS '更新者';
+COMMENT ON COLUMN sys_dept.update_date IS '更新时间';
+
+
+create table sys_role
+(
+ id NUMBER(20, 0) NOT NULL,
+ name varchar2(32),
+ remark varchar2(100),
+ dept_id NUMBER(20, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_dept_id on sys_role(dept_id);
+
+COMMENT ON TABLE sys_role IS '角色管理';
+COMMENT ON COLUMN sys_role.id IS 'id';
+COMMENT ON COLUMN sys_role.name IS '角色名称';
+COMMENT ON COLUMN sys_role.remark IS '备注';
+COMMENT ON COLUMN sys_role.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_role.creator IS '创建者';
+COMMENT ON COLUMN sys_role.create_date IS '创建时间';
+COMMENT ON COLUMN sys_role.updater IS '更新者';
+COMMENT ON COLUMN sys_role.update_date IS '更新时间';
+
+
+create table sys_menu
+(
+ id NUMBER(20, 0) NOT NULL,
+ pid NUMBER(20, 0),
+ name varchar2(200),
+ url varchar2(200),
+ permissions varchar2(500),
+ menu_type NUMBER(2, 0),
+ icon varchar2(50),
+ sort NUMBER(10, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_menu_pid on sys_menu(pid);
+CREATE INDEX idx_sys_menu_sort on sys_menu(sort);
+
+COMMENT ON TABLE sys_menu IS '菜单管理';
+COMMENT ON COLUMN sys_menu.id IS 'id';
+COMMENT ON COLUMN sys_menu.pid IS '上级ID,一级菜单为0';
+COMMENT ON COLUMN sys_menu.name IS '名称';
+COMMENT ON COLUMN sys_menu.url IS '菜单URL';
+COMMENT ON COLUMN sys_menu.permissions IS '授权(多个用逗号分隔,如:sys:user:list,sys:user:save)';
+COMMENT ON COLUMN sys_menu.menu_type IS '类型 0:菜单 1:按钮';
+COMMENT ON COLUMN sys_menu.icon IS '菜单图标';
+COMMENT ON COLUMN sys_menu.sort IS '排序';
+COMMENT ON COLUMN sys_menu.creator IS '创建者';
+COMMENT ON COLUMN sys_menu.create_date IS '创建时间';
+COMMENT ON COLUMN sys_menu.updater IS '更新者';
+COMMENT ON COLUMN sys_menu.update_date IS '更新时间';
+
+
+create table sys_role_user
+(
+ id varchar2(32) NOT NULL,
+ role_id varchar2(32),
+ user_id varchar2(32),
+ creator varchar2(32),
+ create_date date,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_user_role_id on sys_role_user(role_id);
+CREATE INDEX idx_sys_role_user_user_id on sys_role_user(user_id);
+
+COMMENT ON TABLE sys_role_user IS '角色用户关系';
+COMMENT ON COLUMN sys_role_user.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_user.user_id IS '用户ID';
+COMMENT ON COLUMN sys_role_user.creator IS '创建者';
+COMMENT ON COLUMN sys_role_user.create_date IS '创建时间';
+
+
+create table sys_role_menu
+(
+ id NUMBER(20, 0) NOT NULL,
+ role_id NUMBER(20, 0),
+ menu_id NUMBER(20, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_menu_role_id on sys_role_menu(role_id);
+CREATE INDEX idx_sys_role_menu_menu_id on sys_role_menu(menu_id);
+
+COMMENT ON TABLE sys_role_menu IS '角色菜单关系';
+COMMENT ON COLUMN sys_role_menu.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_menu.menu_id IS '菜单ID';
+COMMENT ON COLUMN sys_role_menu.creator IS '创建者';
+COMMENT ON COLUMN sys_role_menu.create_date IS '创建时间';
+
+
+create table sys_role_data_scope
+(
+ id NUMBER(20, 0) NOT NULL,
+ role_id NUMBER(20, 0),
+ dept_id NUMBER(20, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ primary key (id)
+);
+CREATE INDEX idx_data_scope_role_id on sys_role_data_scope(role_id);
+
+COMMENT ON TABLE sys_role_data_scope IS '角色数据权限';
+COMMENT ON COLUMN sys_role_data_scope.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_data_scope.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_role_data_scope.creator IS '创建者';
+COMMENT ON COLUMN sys_role_data_scope.create_date IS '创建时间';
+
+
+create table sys_params
+(
+ id NUMBER(20, 0) NOT NULL,
+ param_code varchar2(32),
+ param_value varchar2(2000),
+ param_type NUMBER(2, 0) DEFAULT 1 NOT NULL,
+ remark varchar2(200),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_params_param_code on sys_params(param_code);
+CREATE INDEX idx_sys_params_create_date on sys_params(create_date);
+
+COMMENT ON TABLE sys_params IS '参数管理';
+COMMENT ON COLUMN sys_params.param_code IS '参数编码';
+COMMENT ON COLUMN sys_params.param_value IS '参数值';
+COMMENT ON COLUMN sys_params.param_type IS '类型 0:系统参数 1:非系统参数';
+COMMENT ON COLUMN sys_params.remark IS '备注';
+COMMENT ON COLUMN sys_params.creator IS '创建者';
+COMMENT ON COLUMN sys_params.create_date IS '创建时间';
+COMMENT ON COLUMN sys_params.updater IS '更新者';
+COMMENT ON COLUMN sys_params.update_date IS '更新时间';
+
+
+create table sys_dict_type
+(
+ id NUMBER(20, 0) NOT NULL,
+ dict_type varchar2(100),
+ dict_name varchar2(255),
+ remark varchar2(255),
+ sort NUMBER(10, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_dict_type_dict_type on sys_dict_type(dict_type);
+
+COMMENT ON TABLE sys_dict_type IS '字典类型';
+COMMENT ON COLUMN sys_dict_type.id IS 'id';
+COMMENT ON COLUMN sys_dict_type.dict_type IS '字典类型';
+COMMENT ON COLUMN sys_dict_type.dict_name IS '字典名称';
+COMMENT ON COLUMN sys_dict_type.remark IS '备注';
+COMMENT ON COLUMN sys_dict_type.sort IS '排序';
+COMMENT ON COLUMN sys_dict_type.creator IS '创建者';
+COMMENT ON COLUMN sys_dict_type.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dict_type.updater IS '更新者';
+COMMENT ON COLUMN sys_dict_type.update_date IS '更新时间';
+
+create table sys_dict_data
+(
+ id NUMBER(20, 0) NOT NULL,
+ dict_type_id NUMBER(20, 0) NOT NULL,
+ dict_label varchar2(255),
+ dict_value varchar2(255),
+ remark varchar2(255),
+ sort NUMBER(10, 0),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dict_data_sort on sys_dict_data(sort);
+CREATE UNIQUE INDEX uk_dict_type_value on sys_dict_data(dict_type_id, dict_value);
+
+COMMENT ON TABLE sys_dict_data IS '字典数据';
+COMMENT ON COLUMN sys_dict_data.id IS 'id';
+COMMENT ON COLUMN sys_dict_data.dict_type_id IS '字典类型ID';
+COMMENT ON COLUMN sys_dict_data.dict_label IS '字典标签';
+COMMENT ON COLUMN sys_dict_data.dict_value IS '字典值';
+COMMENT ON COLUMN sys_dict_data.remark IS '备注';
+COMMENT ON COLUMN sys_dict_data.sort IS '排序';
+COMMENT ON COLUMN sys_dict_data.creator IS '创建者';
+COMMENT ON COLUMN sys_dict_data.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dict_data.updater IS '更新者';
+COMMENT ON COLUMN sys_dict_data.update_date IS '更新时间';
+
+create table sys_log_login
+(
+ id NUMBER(20, 0) NOT NULL,
+ operation NUMBER(2, 0),
+ status NUMBER(2, 0),
+ user_agent varchar2(500),
+ ip varchar2(32),
+ creator_name varchar2(50),
+ creator NUMBER(20, 0),
+ create_date date,
+ primary key (id)
+);
+CREATE INDEX idx_login_status on sys_log_login(status);
+CREATE INDEX idx_login_create_date on sys_log_login(create_date);
+
+COMMENT ON TABLE sys_log_login IS '登录日志';
+COMMENT ON COLUMN sys_log_login.id IS 'id';
+COMMENT ON COLUMN sys_log_login.operation IS '用户操作 0:用户登录 1:用户退出';
+COMMENT ON COLUMN sys_log_login.status IS '状态 0:失败 1:成功 2:账号已锁定';
+COMMENT ON COLUMN sys_log_login.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_login.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_login.creator_name IS '用户名';
+COMMENT ON COLUMN sys_log_login.creator IS '创建者';
+COMMENT ON COLUMN sys_log_login.create_date IS '创建时间';
+
+
+create table sys_log_operation
+(
+ id NUMBER(20, 0) NOT NULL,
+ operation varchar2(50),
+ request_uri varchar2(200),
+ request_method varchar2(20),
+ request_params clob,
+ request_time NUMBER(10, 0),
+ user_agent varchar2(500),
+ ip varchar2(32),
+ status NUMBER(2, 0),
+ creator_name varchar2(50),
+ creator NUMBER(20, 0),
+ create_date date,
+ primary key (id)
+);
+CREATE INDEX idx_operation_create_date on sys_log_operation(create_date);
+
+COMMENT ON TABLE sys_log_operation IS '操作日志';
+COMMENT ON COLUMN sys_log_operation.id IS 'id';
+COMMENT ON COLUMN sys_log_operation.operation IS '用户操作';
+COMMENT ON COLUMN sys_log_operation.request_uri IS '请求URI';
+COMMENT ON COLUMN sys_log_operation.request_method IS '请求方式';
+COMMENT ON COLUMN sys_log_operation.request_params IS '请求参数';
+COMMENT ON COLUMN sys_log_operation.request_time IS '请求时长(毫秒)';
+COMMENT ON COLUMN sys_log_operation.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_operation.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_operation.status IS '状态 0:失败 1:成功';
+COMMENT ON COLUMN sys_log_operation.creator_name IS '用户名';
+COMMENT ON COLUMN sys_log_operation.creator IS '创建者';
+COMMENT ON COLUMN sys_log_operation.create_date IS '创建时间';
+
+
+create table sys_log_error
+(
+ id NUMBER(20, 0) NOT NULL,
+ request_uri varchar2(200),
+ request_method varchar2(20),
+ request_params clob,
+ user_agent varchar2(500),
+ ip varchar2(32),
+ error_info clob,
+ creator NUMBER(20, 0),
+ create_date date,
+ primary key (id)
+);
+CREATE INDEX idx_error_create_date on sys_log_error(create_date);
+
+COMMENT ON TABLE sys_log_error IS '异常日志';
+COMMENT ON COLUMN sys_log_error.id IS 'id';
+COMMENT ON COLUMN sys_log_error.request_uri IS '请求URI';
+COMMENT ON COLUMN sys_log_error.request_method IS '请求方式';
+COMMENT ON COLUMN sys_log_error.request_params IS '请求参数';
+COMMENT ON COLUMN sys_log_error.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_error.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_error.error_info IS '异常信息';
+COMMENT ON COLUMN sys_log_error.creator IS '创建者';
+COMMENT ON COLUMN sys_log_error.create_date IS '创建时间';
+
+
+CREATE TABLE sys_oss (
+ id NUMBER(20, 0) NOT NULL,
+ url varchar2(200),
+ creator NUMBER(20, 0),
+ create_date date,
+ PRIMARY KEY (id)
+);
+CREATE INDEX idx_sys_oss_create_date on sys_oss(create_date);
+
+COMMENT ON TABLE sys_oss IS '文件上传';
+COMMENT ON COLUMN sys_oss.id IS 'id';
+COMMENT ON COLUMN sys_oss.url IS 'URL地址';
+COMMENT ON COLUMN sys_mail_log.creator IS '创建者';
+COMMENT ON COLUMN sys_mail_log.create_date IS '创建时间';
+
+
+CREATE TABLE schedule_job (
+ id NUMBER(20, 0) NOT NULL,
+ bean_name varchar2(200),
+ params varchar2(2000),
+ cron_expression varchar2(100),
+ status NUMBER(2, 0),
+ remark varchar2(255),
+ creator NUMBER(20, 0),
+ create_date date,
+ updater NUMBER(20, 0),
+ update_date date,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_schedule_job_create_date on schedule_job(create_date);
+
+COMMENT ON TABLE schedule_job IS '定时任务';
+COMMENT ON COLUMN schedule_job.id IS 'id';
+COMMENT ON COLUMN schedule_job.bean_name IS 'spring bean名称';
+COMMENT ON COLUMN schedule_job.params IS '参数';
+COMMENT ON COLUMN schedule_job.cron_expression IS 'cron表达式';
+COMMENT ON COLUMN schedule_job.status IS '任务状态 0:暂停 1:正常';
+COMMENT ON COLUMN schedule_job.remark IS '备注';
+COMMENT ON COLUMN schedule_job.creator IS '创建者';
+COMMENT ON COLUMN schedule_job.create_date IS '创建时间';
+COMMENT ON COLUMN schedule_job.updater IS '更新者';
+COMMENT ON COLUMN schedule_job.update_date IS '更新时间';
+
+
+CREATE TABLE schedule_job_log (
+ id NUMBER(20, 0) NOT NULL,
+ job_id NUMBER(20, 0) NOT NULL,
+ bean_name varchar2(200),
+ params varchar2(2000),
+ status NUMBER(2, 0),
+ error varchar2(2000),
+ times NUMBER(10, 0),
+ create_date date,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_job_log_job_id on schedule_job_log(job_id);
+CREATE INDEX idx_job_log_create_date on schedule_job_log(create_date);
+
+COMMENT ON TABLE schedule_job_log IS '定时任务日志';
+COMMENT ON COLUMN schedule_job_log.id IS 'id';
+COMMENT ON COLUMN schedule_job_log.bean_name IS 'spring bean名称';
+COMMENT ON COLUMN schedule_job_log.params IS '参数';
+COMMENT ON COLUMN schedule_job_log.status IS '任务状态 0:失败 1:成功';
+COMMENT ON COLUMN schedule_job_log.error IS '失败信息';
+COMMENT ON COLUMN schedule_job_log.times IS '耗时(单位:毫秒)';
+COMMENT ON COLUMN schedule_job.create_date IS '创建时间';
+
+
+CREATE TABLE sys_user_token (
+ id NUMBER(20, 0) NOT NULL,
+ user_id NUMBER(20, 0),
+ token varchar2(100),
+ expire_date date,
+ update_date date,
+ create_date date,
+ PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_token_user_id on sys_user_token(user_id);
+CREATE UNIQUE INDEX uk_sys_user_token on sys_user_token(token);
+
+COMMENT ON TABLE sys_user_token IS '系统用户Token';
+COMMENT ON COLUMN sys_user_token.id IS 'id';
+COMMENT ON COLUMN sys_user_token.user_id IS '用户id';
+COMMENT ON COLUMN sys_user_token.token IS '用户token';
+COMMENT ON COLUMN sys_user_token.expire_date IS '过期时间';
+COMMENT ON COLUMN sys_user_token.update_date IS '更新时间';
+COMMENT ON COLUMN sys_user_token.create_date IS '创建时间';
+
+
+
+-- 初始数据
+INSERT INTO sys_user(id, username, password, real_name, gender, email, mobile, status, dept_id, super_admin, creator, create_date, updater, update_date) VALUES (1067246875800000001, 'admin', '$2a$10$012Kx2ba5jzqr9gLlG4MX.bnQJTD9UWqF57XDo2N3.fPtLne02u/m', '管理员', 0, 'root@renren.io', '13612345678', 1, null, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000002, 0, '权限管理', NULL, NULL, 0, 'icon-safetycertificate', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000003, 1067246875800000055, '新增', NULL, 'sys:user:save,sys:dept:list,sys:role:list', 1, NULL, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000004, 1067246875800000055, '修改', NULL, 'sys:user:update,sys:dept:list,sys:role:list', 1, NULL, 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000005, 1067246875800000055, '删除', NULL, 'sys:user:delete', 1, NULL, 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000006, 1067246875800000055, '导出', NULL, 'sys:user:export', 1, NULL, 4, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000007, 1067246875800000002, '角色管理', 'sys/role', NULL, 0, 'icon-team', 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000008, 1067246875800000007, '查看', NULL, 'sys:role:page,sys:role:info', 1, NULL, 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000009, 1067246875800000007, '新增', NULL, 'sys:role:save,sys:menu:select,sys:dept:list', 1, NULL, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000010, 1067246875800000007, '修改', NULL, 'sys:role:update,sys:menu:select,sys:dept:list', 1, NULL, 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000011, 1067246875800000007, '删除', NULL, 'sys:role:delete', 1, NULL, 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000012, 1067246875800000002, '部门管理', 'sys/dept', NULL, 0, 'icon-apartment', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000014, 1067246875800000012, '查看', NULL, 'sys:dept:list,sys:dept:info', 1, NULL, 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000015, 1067246875800000012, '新增', NULL, 'sys:dept:save', 1, NULL, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000016, 1067246875800000012, '修改', NULL, 'sys:dept:update', 1, NULL, 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000017, 1067246875800000012, '删除', NULL, 'sys:dept:delete', 1, NULL, 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000025, 1067246875800000035, '菜单管理', 'sys/menu', NULL, 0, 'icon-unorderedlist', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000026, 1067246875800000025, '查看', NULL, 'sys:menu:list,sys:menu:info', 1, NULL, 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000027, 1067246875800000025, '新增', NULL, 'sys:menu:save', 1, NULL, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000028, 1067246875800000025, '修改', NULL, 'sys:menu:update', 1, NULL, 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000029, 1067246875800000025, '删除', NULL, 'sys:menu:delete', 1, NULL, 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000030, 1067246875800000035, '定时任务', 'job/schedule', NULL, 0, 'icon-dashboard', 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000031, 1067246875800000030, '查看', NULL, 'sys:schedule:page,sys:schedule:info', 1, NULL, 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000032, 1067246875800000030, '新增', NULL, 'sys:schedule:save', 1, NULL, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000033, 1067246875800000030, '修改', NULL, 'sys:schedule:update', 1, NULL, 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000034, 1067246875800000030, '删除', NULL, 'sys:schedule:delete', 1, NULL, 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000035, 0, '系统设置', NULL, NULL, 0, 'icon-setting', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000036, 1067246875800000030, '暂停', NULL, 'sys:schedule:pause', 1, NULL, 4, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000037, 1067246875800000030, '恢复', NULL, 'sys:schedule:resume', 1, NULL, 5, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000038, 1067246875800000030, '立即执行', NULL, 'sys:schedule:run', 1, NULL, 6, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000039, 1067246875800000030, '日志列表', NULL, 'sys:schedule:log', 1, NULL, 7, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000040, 1067246875800000035, '参数管理', 'sys/params', '', 0, 'icon-fileprotect', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000041, 1067246875800000035, '字典管理', 'sys/dict-type', NULL, 0, 'icon-golden-fill', 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000042, 1067246875800000041, '查看', NULL, 'sys:dict:page,sys:dict:info', 1, NULL, 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000043, 1067246875800000041, '新增', NULL, 'sys:dict:save', 1, NULL, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000044, 1067246875800000041, '修改', NULL, 'sys:dict:update', 1, NULL, 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000045, 1067246875800000041, '删除', NULL, 'sys:dict:delete', 1, NULL, 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000046, 0, '日志管理', NULL, NULL, 0, 'icon-container', 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000047, 1067246875800000035, '文件上传', 'oss/oss', 'sys:oss:all', 0, 'icon-upload', 4, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000048, 1067246875800000046, '登录日志', 'sys/log-login', 'sys:log:login', 0, 'icon-filedone', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000049, 1067246875800000046, '操作日志', 'sys/log-operation', 'sys:log:operation', 0, 'icon-solution', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000050, 1067246875800000046, '异常日志', 'sys/log-error', 'sys:log:error', 0, 'icon-file-exception', 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000051, 1067246875800000053, 'SQL监控', '{{ window.SITE_CONFIG["apiURL"] }}/druid/sql.html', NULL, 0, 'icon-database', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000053, 0, '系统监控', NULL, NULL, 0, 'icon-desktop', 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000055, 1067246875800000002, '用户管理', 'sys/user', NULL, 0, 'icon-user', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000056, 1067246875800000055, '查看', NULL, 'sys:user:page,sys:user:info', 1, NULL, 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000057, 1067246875800000040, '新增', NULL, 'sys:params:save', 1, NULL, 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000058, 1067246875800000040, '导出', NULL, 'sys:params:export', 1, NULL, 4, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000059, 1067246875800000040, '查看', '', 'sys:params:page,sys:params:info', 1, NULL, 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000060, 1067246875800000040, '修改', NULL, 'sys:params:update', 1, NULL, 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000061, 1067246875800000040, '删除', '', 'sys:params:delete', 1, '', 3, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1156748733921165314, 1067246875800000053, '接口文档', '{{ window.SITE_CONFIG["apiURL"] }}/doc.html', '', 0, 'icon-file-word', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+
+
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000062, 1067246875800000063, '1067246875800000066,1067246875800000063', '技术部', 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000063, 1067246875800000066, '1067246875800000066', '长沙分公司', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000064, 1067246875800000066, '1067246875800000066', '上海分公司', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000065, 1067246875800000064, '1067246875800000066,1067246875800000064', '市场部', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000066, 0, '0', '人人开源集团', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000067, 1067246875800000064, '1067246875800000066,1067246875800000064', '销售部', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000068, 1067246875800000063, '1067246875800000066,1067246875800000063', '产品部', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061112075464705, 1160061077912858625, '男', '0', '', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061146967879681, 1160061077912858625, '女', '1', '', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061190127267841, 1160061077912858625, '保密', '2', '', 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814069634195457, 1225813644059140097, '公告', '0', '', 0, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814107559092225, 1225813644059140097, '会议', '1', '', 1, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814271879340034, 1225813644059140097, '其他', '2', '', 2, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+
+INSERT INTO sys_params(id, param_code, param_value, param_type, remark, creator, create_date, updater, update_date) VALUES (1067246875800000073, 'CLOUD_STORAGE_CONFIG_KEY', '{"type":1,"qiniuDomain":"http://test.oss.renren.io","qiniuPrefix":"upload","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","qiniuBucketName":"renren-oss","aliyunDomain":"","aliyunPrefix":"","aliyunEndPoint":"","aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qcloudBucketName":""}', '0', '云存储配置信息', 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+
+INSERT INTO schedule_job (id, bean_name, params, cron_expression, status, remark, creator, create_date, updater, update_date) VALUES (1067246875800000076, 'testTask', 'renren', '0 0/30 * * * ?', 0, '有参测试,多个参数使用json', 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE);
+
+
+-- quartz自带表结构
+CREATE TABLE qrtz_job_details
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ JOB_NAME VARCHAR2(200) NOT NULL,
+ JOB_GROUP VARCHAR2(200) NOT NULL,
+ DESCRIPTION VARCHAR2(250) NULL,
+ JOB_CLASS_NAME VARCHAR2(250) NOT NULL,
+ IS_DURABLE VARCHAR2(1) NOT NULL,
+ IS_NONCONCURRENT VARCHAR2(1) NOT NULL,
+ IS_UPDATE_DATA VARCHAR2(1) NOT NULL,
+ REQUESTS_RECOVERY VARCHAR2(1) NOT NULL,
+ JOB_DATA BLOB NULL,
+ CONSTRAINT QRTZ_JOB_DETAILS_PK PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+CREATE TABLE qrtz_triggers
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ TRIGGER_NAME VARCHAR2(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+ JOB_NAME VARCHAR2(200) NOT NULL,
+ JOB_GROUP VARCHAR2(200) NOT NULL,
+ DESCRIPTION VARCHAR2(250) NULL,
+ NEXT_FIRE_TIME NUMBER(13) NULL,
+ PREV_FIRE_TIME NUMBER(13) NULL,
+ PRIORITY NUMBER(13) NULL,
+ TRIGGER_STATE VARCHAR2(16) NOT NULL,
+ TRIGGER_TYPE VARCHAR2(8) NOT NULL,
+ START_TIME NUMBER(13) NOT NULL,
+ END_TIME NUMBER(13) NULL,
+ CALENDAR_NAME VARCHAR2(200) NULL,
+ MISFIRE_INSTR NUMBER(2) NULL,
+ JOB_DATA BLOB NULL,
+ CONSTRAINT QRTZ_TRIGGERS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ CONSTRAINT QRTZ_TRIGGER_TO_JOBS_FK FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+ REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+CREATE TABLE qrtz_simple_triggers
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ TRIGGER_NAME VARCHAR2(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+ REPEAT_COUNT NUMBER(7) NOT NULL,
+ REPEAT_INTERVAL NUMBER(12) NOT NULL,
+ TIMES_TRIGGERED NUMBER(10) NOT NULL,
+ CONSTRAINT QRTZ_SIMPLE_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ CONSTRAINT QRTZ_SIMPLE_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+CREATE TABLE qrtz_cron_triggers
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ TRIGGER_NAME VARCHAR2(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+ CRON_EXPRESSION VARCHAR2(120) NOT NULL,
+ TIME_ZONE_ID VARCHAR2(80),
+ CONSTRAINT QRTZ_CRON_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ CONSTRAINT QRTZ_CRON_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+CREATE TABLE qrtz_simprop_triggers
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ TRIGGER_NAME VARCHAR2(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+ STR_PROP_1 VARCHAR2(512) NULL,
+ STR_PROP_2 VARCHAR2(512) NULL,
+ STR_PROP_3 VARCHAR2(512) NULL,
+ INT_PROP_1 NUMBER(10) NULL,
+ INT_PROP_2 NUMBER(10) NULL,
+ LONG_PROP_1 NUMBER(13) NULL,
+ LONG_PROP_2 NUMBER(13) NULL,
+ DEC_PROP_1 NUMERIC(13,4) NULL,
+ DEC_PROP_2 NUMERIC(13,4) NULL,
+ BOOL_PROP_1 VARCHAR2(1) NULL,
+ BOOL_PROP_2 VARCHAR2(1) NULL,
+ CONSTRAINT QRTZ_SIMPROP_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ CONSTRAINT QRTZ_SIMPROP_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+CREATE TABLE qrtz_blob_triggers
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ TRIGGER_NAME VARCHAR2(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+ BLOB_DATA BLOB NULL,
+ CONSTRAINT QRTZ_BLOB_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ CONSTRAINT QRTZ_BLOB_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+CREATE TABLE qrtz_calendars
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ CALENDAR_NAME VARCHAR2(200) NOT NULL,
+ CALENDAR BLOB NOT NULL,
+ CONSTRAINT QRTZ_CALENDARS_PK PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
+);
+CREATE TABLE qrtz_paused_trigger_grps
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+ CONSTRAINT QRTZ_PAUSED_TRIG_GRPS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
+);
+CREATE TABLE qrtz_fired_triggers
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ ENTRY_ID VARCHAR2(95) NOT NULL,
+ TRIGGER_NAME VARCHAR2(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR2(200) NOT NULL,
+ INSTANCE_NAME VARCHAR2(200) NOT NULL,
+ FIRED_TIME NUMBER(13) NOT NULL,
+ SCHED_TIME NUMBER(13) NOT NULL,
+ PRIORITY NUMBER(13) NOT NULL,
+ STATE VARCHAR2(16) NOT NULL,
+ JOB_NAME VARCHAR2(200) NULL,
+ JOB_GROUP VARCHAR2(200) NULL,
+ IS_NONCONCURRENT VARCHAR2(1) NULL,
+ REQUESTS_RECOVERY VARCHAR2(1) NULL,
+ CONSTRAINT QRTZ_FIRED_TRIGGER_PK PRIMARY KEY (SCHED_NAME,ENTRY_ID)
+);
+CREATE TABLE qrtz_scheduler_state
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ INSTANCE_NAME VARCHAR2(200) NOT NULL,
+ LAST_CHECKIN_TIME NUMBER(13) NOT NULL,
+ CHECKIN_INTERVAL NUMBER(13) NOT NULL,
+ CONSTRAINT QRTZ_SCHEDULER_STATE_PK PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
+);
+CREATE TABLE qrtz_locks
+(
+ SCHED_NAME VARCHAR2(120) NOT NULL,
+ LOCK_NAME VARCHAR2(40) NOT NULL,
+ CONSTRAINT QRTZ_LOCKS_PK PRIMARY KEY (SCHED_NAME,LOCK_NAME)
+);
+
+create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP);
+
+create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME);
+create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP);
+create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE);
+create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
+create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
+
+create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME);
+create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
+create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP);
+
+
diff --git a/renren-admin/db/postgresql.sql b/renren-admin/db/postgresql.sql
new file mode 100644
index 0000000..2247476
--- /dev/null
+++ b/renren-admin/db/postgresql.sql
@@ -0,0 +1,699 @@
+CREATE TABLE sys_user (
+ id int8 NOT NULL,
+ username varchar(50) NOT NULL,
+ password varchar(100),
+ real_name varchar(50),
+ head_url varchar(200),
+ gender int,
+ email varchar(100),
+ mobile varchar(100),
+ dept_id int8,
+ super_admin int,
+ status int,
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ primary key (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_username on sys_user(username);
+CREATE INDEX idx_sys_user_create_date on sys_user(create_date);
+
+COMMENT ON TABLE sys_user IS '用户管理';
+COMMENT ON COLUMN sys_user.id IS 'id';
+COMMENT ON COLUMN sys_user.username IS '用户名';
+COMMENT ON COLUMN sys_user.password IS '密码';
+COMMENT ON COLUMN sys_user.real_name IS '姓名';
+COMMENT ON COLUMN sys_user.head_url IS '头像';
+COMMENT ON COLUMN sys_user.gender IS '性别 0:男 1:女 2:保密';
+COMMENT ON COLUMN sys_user.email IS '邮箱';
+COMMENT ON COLUMN sys_user.mobile IS '手机号';
+COMMENT ON COLUMN sys_user.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_user.super_admin IS '超级管理员 0:否 1:是';
+COMMENT ON COLUMN sys_user.status IS '状态 0:停用 1:正常';
+COMMENT ON COLUMN sys_user.creator IS '创建者';
+COMMENT ON COLUMN sys_user.create_date IS '创建时间';
+COMMENT ON COLUMN sys_user.updater IS '更新者';
+COMMENT ON COLUMN sys_user.update_date IS '更新时间';
+
+
+CREATE TABLE sys_dept (
+ id int8 NOT NULL,
+ pid int8,
+ pids varchar(500),
+ name varchar(50),
+ sort int,
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dept_pid on sys_dept(pid);
+CREATE INDEX idx_sys_dept_idx_sort on sys_dept(sort);
+
+COMMENT ON TABLE sys_dept IS '部门管理';
+COMMENT ON COLUMN sys_dept.id IS 'id';
+COMMENT ON COLUMN sys_dept.pid IS '上级ID';
+COMMENT ON COLUMN sys_dept.pids IS '所有上级ID,用逗号分开';
+COMMENT ON COLUMN sys_dept.name IS '部门名称';
+COMMENT ON COLUMN sys_dept.sort IS '排序';
+COMMENT ON COLUMN sys_dept.creator IS '创建者';
+COMMENT ON COLUMN sys_dept.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dept.updater IS '更新者';
+COMMENT ON COLUMN sys_dept.update_date IS '更新时间';
+
+
+create table sys_role
+(
+ id int8 NOT NULL,
+ name varchar(50),
+ remark varchar(100),
+ dept_id int8,
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_dept_id on sys_role(dept_id);
+
+COMMENT ON TABLE sys_role IS '角色管理';
+COMMENT ON COLUMN sys_role.id IS 'id';
+COMMENT ON COLUMN sys_role.name IS '角色名称';
+COMMENT ON COLUMN sys_role.remark IS '备注';
+COMMENT ON COLUMN sys_role.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_role.creator IS '创建者';
+COMMENT ON COLUMN sys_role.create_date IS '创建时间';
+COMMENT ON COLUMN sys_role.updater IS '更新者';
+COMMENT ON COLUMN sys_role.update_date IS '更新时间';
+
+
+create table sys_menu
+(
+ id int8 NOT NULL,
+ pid int8,
+ name varchar(200),
+ url varchar(200),
+ permissions varchar(500),
+ menu_type int,
+ icon varchar(50),
+ sort int,
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_menu_pid on sys_menu(pid);
+CREATE INDEX idx_sys_menu_sort on sys_menu(sort);
+
+COMMENT ON TABLE sys_menu IS '菜单管理';
+COMMENT ON COLUMN sys_menu.id IS 'id';
+COMMENT ON COLUMN sys_menu.pid IS '上级ID,一级菜单为0';
+COMMENT ON COLUMN sys_menu.name IS '名称';
+COMMENT ON COLUMN sys_menu.url IS '菜单URL';
+COMMENT ON COLUMN sys_menu.permissions IS '授权(多个用逗号分隔,如:sys:user:list,sys:user:save)';
+COMMENT ON COLUMN sys_menu.menu_type IS '类型 0:菜单 1:按钮';
+COMMENT ON COLUMN sys_menu.icon IS '菜单图标';
+COMMENT ON COLUMN sys_menu.sort IS '排序';
+COMMENT ON COLUMN sys_menu.creator IS '创建者';
+COMMENT ON COLUMN sys_menu.create_date IS '创建时间';
+COMMENT ON COLUMN sys_menu.updater IS '更新者';
+COMMENT ON COLUMN sys_menu.update_date IS '更新时间';
+
+
+create table sys_role_user
+(
+ id int8 NOT NULL,
+ role_id int8,
+ user_id int8,
+ creator int8,
+ create_date timestamp,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_user_role_id on sys_role_user(role_id);
+CREATE INDEX idx_sys_role_user_user_id on sys_role_user(user_id);
+
+COMMENT ON TABLE sys_role_user IS '角色用户关系';
+COMMENT ON COLUMN sys_role_user.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_user.user_id IS '用户ID';
+COMMENT ON COLUMN sys_role_user.creator IS '创建者';
+COMMENT ON COLUMN sys_role_user.create_date IS '创建时间';
+
+
+create table sys_role_menu
+(
+ id int8 NOT NULL,
+ role_id int8,
+ menu_id int8,
+ creator int8,
+ create_date timestamp,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_menu_role_id on sys_role_menu(role_id);
+CREATE INDEX idx_sys_role_menu_menu_id on sys_role_menu(menu_id);
+
+COMMENT ON TABLE sys_role_menu IS '角色菜单关系';
+COMMENT ON COLUMN sys_role_menu.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_menu.menu_id IS '菜单ID';
+COMMENT ON COLUMN sys_role_menu.creator IS '创建者';
+COMMENT ON COLUMN sys_role_menu.create_date IS '创建时间';
+
+
+create table sys_role_data_scope
+(
+ id int8 NOT NULL,
+ role_id int8,
+ dept_id int8,
+ creator int8,
+ create_date timestamp,
+ primary key (id)
+);
+CREATE INDEX idx_data_scope_role_id on sys_role_data_scope(role_id);
+
+COMMENT ON TABLE sys_role_data_scope IS '角色数据权限';
+COMMENT ON COLUMN sys_role_data_scope.role_id IS '角色ID';
+COMMENT ON COLUMN sys_role_data_scope.dept_id IS '部门ID';
+COMMENT ON COLUMN sys_role_data_scope.creator IS '创建者';
+COMMENT ON COLUMN sys_role_data_scope.create_date IS '创建时间';
+
+
+create table sys_params
+(
+ id int8 NOT NULL,
+ param_code varchar(32),
+ param_value varchar(2000),
+ param_type int DEFAULT 1 NOT NULL,
+ remark varchar(200),
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_params_param_code on sys_params(param_code);
+CREATE INDEX idx_sys_params_create_date on sys_params(create_date);
+
+COMMENT ON TABLE sys_params IS '参数管理';
+COMMENT ON COLUMN sys_params.param_code IS '参数编码';
+COMMENT ON COLUMN sys_params.param_value IS '参数值';
+COMMENT ON COLUMN sys_params.param_type IS '类型 0:系统参数 1:非系统参数';
+COMMENT ON COLUMN sys_params.remark IS '备注';
+COMMENT ON COLUMN sys_params.creator IS '创建者';
+COMMENT ON COLUMN sys_params.create_date IS '创建时间';
+COMMENT ON COLUMN sys_params.updater IS '更新者';
+COMMENT ON COLUMN sys_params.update_date IS '更新时间';
+
+
+create table sys_dict_type
+(
+ id int8 NOT NULL,
+ dict_type varchar(100),
+ dict_name varchar(255),
+ remark varchar(255),
+ sort int,
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_dict_type_dict_type on sys_dict_type(dict_type);
+
+COMMENT ON TABLE sys_dict_type IS '字典类型';
+COMMENT ON COLUMN sys_dict_type.id IS 'id';
+COMMENT ON COLUMN sys_dict_type.dict_type IS '字典类型';
+COMMENT ON COLUMN sys_dict_type.dict_name IS '字典名称';
+COMMENT ON COLUMN sys_dict_type.remark IS '备注';
+COMMENT ON COLUMN sys_dict_type.sort IS '排序';
+COMMENT ON COLUMN sys_dict_type.creator IS '创建者';
+COMMENT ON COLUMN sys_dict_type.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dict_type.updater IS '更新者';
+COMMENT ON COLUMN sys_dict_type.update_date IS '更新时间';
+
+create table sys_dict_data
+(
+ id int8 NOT NULL,
+ dict_type_id int8 NOT NULL,
+ dict_label varchar(255),
+ dict_value varchar(255),
+ remark varchar(255),
+ sort int,
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dict_data_sort on sys_dict_data(sort);
+CREATE UNIQUE INDEX uk_dict_type_value on sys_dict_data(dict_type_id, dict_value);
+
+COMMENT ON TABLE sys_dict_data IS '字典数据';
+COMMENT ON COLUMN sys_dict_data.id IS 'id';
+COMMENT ON COLUMN sys_dict_data.dict_type_id IS '字典类型ID';
+COMMENT ON COLUMN sys_dict_data.dict_label IS '字典标签';
+COMMENT ON COLUMN sys_dict_data.dict_value IS '字典值';
+COMMENT ON COLUMN sys_dict_data.remark IS '备注';
+COMMENT ON COLUMN sys_dict_data.sort IS '排序';
+COMMENT ON COLUMN sys_dict_data.creator IS '创建者';
+COMMENT ON COLUMN sys_dict_data.create_date IS '创建时间';
+COMMENT ON COLUMN sys_dict_data.updater IS '更新者';
+COMMENT ON COLUMN sys_dict_data.update_date IS '更新时间';
+
+
+create table sys_log_login
+(
+ id int8 NOT NULL,
+ operation int,
+ status int,
+ user_agent varchar(500),
+ ip varchar(32),
+ creator_name varchar(50),
+ creator int8,
+ create_date timestamp,
+ primary key (id)
+);
+CREATE INDEX idx_login_status on sys_log_login(status);
+CREATE INDEX idx_login_create_date on sys_log_login(create_date);
+
+COMMENT ON TABLE sys_log_login IS '登录日志';
+COMMENT ON COLUMN sys_log_login.id IS 'id';
+COMMENT ON COLUMN sys_log_login.operation IS '用户操作 0:用户登录 1:用户退出';
+COMMENT ON COLUMN sys_log_login.status IS '状态 0:失败 1:成功 2:账号已锁定';
+COMMENT ON COLUMN sys_log_login.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_login.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_login.creator_name IS '用户名';
+COMMENT ON COLUMN sys_log_login.creator IS '创建者';
+COMMENT ON COLUMN sys_log_login.create_date IS '创建时间';
+
+
+create table sys_log_operation
+(
+ id int8 NOT NULL,
+ operation varchar(50),
+ request_uri varchar(200),
+ request_method varchar(20),
+ request_params text,
+ request_time int,
+ user_agent varchar(500),
+ ip varchar(32),
+ status int,
+ creator_name varchar(50),
+ creator int8,
+ create_date timestamp,
+ primary key (id)
+);
+CREATE INDEX idx_operation_create_date on sys_log_operation(create_date);
+
+COMMENT ON TABLE sys_log_operation IS '操作日志';
+COMMENT ON COLUMN sys_log_operation.id IS 'id';
+COMMENT ON COLUMN sys_log_operation.operation IS '用户操作';
+COMMENT ON COLUMN sys_log_operation.request_uri IS '请求URI';
+COMMENT ON COLUMN sys_log_operation.request_method IS '请求方式';
+COMMENT ON COLUMN sys_log_operation.request_params IS '请求参数';
+COMMENT ON COLUMN sys_log_operation.request_time IS '请求时长(毫秒)';
+COMMENT ON COLUMN sys_log_operation.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_operation.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_operation.status IS '状态 0:失败 1:成功';
+COMMENT ON COLUMN sys_log_operation.creator_name IS '用户名';
+COMMENT ON COLUMN sys_log_operation.creator IS '创建者';
+COMMENT ON COLUMN sys_log_operation.create_date IS '创建时间';
+
+
+create table sys_log_error
+(
+ id int8 NOT NULL,
+ request_uri varchar(200),
+ request_method varchar(20),
+ request_params text,
+ user_agent varchar(500),
+ ip varchar(32),
+ error_info text,
+ creator int8,
+ create_date timestamp,
+ primary key (id)
+);
+CREATE INDEX idx_error_create_date on sys_log_error(create_date);
+
+COMMENT ON TABLE sys_log_error IS '异常日志';
+COMMENT ON COLUMN sys_log_error.id IS 'id';
+COMMENT ON COLUMN sys_log_error.request_uri IS '请求URI';
+COMMENT ON COLUMN sys_log_error.request_method IS '请求方式';
+COMMENT ON COLUMN sys_log_error.request_params IS '请求参数';
+COMMENT ON COLUMN sys_log_error.user_agent IS '用户代理';
+COMMENT ON COLUMN sys_log_error.ip IS '操作IP';
+COMMENT ON COLUMN sys_log_error.error_info IS '异常信息';
+COMMENT ON COLUMN sys_log_error.creator IS '创建者';
+COMMENT ON COLUMN sys_log_error.create_date IS '创建时间';
+
+
+
+CREATE TABLE sys_oss (
+ id int8 NOT NULL,
+ url varchar(200),
+ creator int8,
+ create_date timestamp,
+ PRIMARY KEY (id)
+);
+CREATE INDEX idx_sys_oss_create_date on sys_oss(create_date);
+
+COMMENT ON TABLE sys_oss IS '文件上传';
+COMMENT ON COLUMN sys_oss.id IS 'id';
+COMMENT ON COLUMN sys_oss.url IS 'URL地址';
+COMMENT ON COLUMN sys_oss.creator IS '创建者';
+COMMENT ON COLUMN sys_oss.create_date IS '创建时间';
+
+
+CREATE TABLE schedule_job (
+ id int8 NOT NULL,
+ bean_name varchar(200),
+ params varchar(2000),
+ cron_expression varchar(100),
+ status int,
+ remark varchar(255),
+ creator int8,
+ create_date timestamp,
+ updater int8,
+ update_date timestamp,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_schedule_job_create_date on schedule_job(create_date);
+
+COMMENT ON TABLE schedule_job IS '定时任务';
+COMMENT ON COLUMN schedule_job.id IS 'id';
+COMMENT ON COLUMN schedule_job.bean_name IS 'spring bean名称';
+COMMENT ON COLUMN schedule_job.params IS '参数';
+COMMENT ON COLUMN schedule_job.cron_expression IS 'cron表达式';
+COMMENT ON COLUMN schedule_job.status IS '任务状态 0:暂停 1:正常';
+COMMENT ON COLUMN schedule_job.remark IS '备注';
+COMMENT ON COLUMN schedule_job.creator IS '创建者';
+COMMENT ON COLUMN schedule_job.create_date IS '创建时间';
+COMMENT ON COLUMN schedule_job.updater IS '更新者';
+COMMENT ON COLUMN schedule_job.update_date IS '更新时间';
+
+
+CREATE TABLE schedule_job_log (
+ id int8 NOT NULL,
+ job_id int8 NOT NULL,
+ bean_name varchar(200),
+ params varchar(2000),
+ status int,
+ error varchar(2000),
+ times int,
+ create_date timestamp,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_job_log_job_id on schedule_job_log(job_id);
+CREATE INDEX idx_job_log_create_date on schedule_job_log(create_date);
+
+COMMENT ON TABLE schedule_job_log IS '定时任务日志';
+COMMENT ON COLUMN schedule_job_log.id IS 'id';
+COMMENT ON COLUMN schedule_job_log.bean_name IS 'spring bean名称';
+COMMENT ON COLUMN schedule_job_log.params IS '参数';
+COMMENT ON COLUMN schedule_job_log.status IS '任务状态 0:失败 1:成功';
+COMMENT ON COLUMN schedule_job_log.error IS '失败信息';
+COMMENT ON COLUMN schedule_job_log.times IS '耗时(单位:毫秒)';
+COMMENT ON COLUMN schedule_job.create_date IS '创建时间';
+
+
+CREATE TABLE sys_user_token (
+ id int8 NOT NULL,
+ user_id int8,
+ token varchar(100),
+ expire_date timestamp,
+ update_date timestamp,
+ create_date timestamp,
+ PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_token_user_id on sys_user_token(user_id);
+CREATE UNIQUE INDEX uk_sys_user_token on sys_user_token(token);
+
+COMMENT ON TABLE sys_user_token IS '系统用户Token';
+COMMENT ON COLUMN sys_user_token.id IS 'id';
+COMMENT ON COLUMN sys_user_token.user_id IS '用户id';
+COMMENT ON COLUMN sys_user_token.token IS '用户token';
+COMMENT ON COLUMN sys_user_token.expire_date IS '过期时间';
+COMMENT ON COLUMN sys_user_token.update_date IS '更新时间';
+COMMENT ON COLUMN sys_user_token.create_date IS '创建时间';
+
+
+
+-- 初始数据
+INSERT INTO sys_user(id, username, password, real_name, gender, email, mobile, status, dept_id, super_admin, creator, create_date, updater, update_date) VALUES (1067246875800000001, 'admin', '$2a$10$012Kx2ba5jzqr9gLlG4MX.bnQJTD9UWqF57XDo2N3.fPtLne02u/m', '管理员', 0, 'root@renren.io', '13612345678', 1, null, 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000002, 0, '权限管理', NULL, NULL, 0, 'icon-safetycertificate', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000003, 1067246875800000055, '新增', NULL, 'sys:user:save,sys:dept:list,sys:role:list', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000004, 1067246875800000055, '修改', NULL, 'sys:user:update,sys:dept:list,sys:role:list', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000005, 1067246875800000055, '删除', NULL, 'sys:user:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000006, 1067246875800000055, '导出', NULL, 'sys:user:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000007, 1067246875800000002, '角色管理', 'sys/role', NULL, 0, 'icon-team', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000008, 1067246875800000007, '查看', NULL, 'sys:role:page,sys:role:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000009, 1067246875800000007, '新增', NULL, 'sys:role:save,sys:menu:select,sys:dept:list', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000010, 1067246875800000007, '修改', NULL, 'sys:role:update,sys:menu:select,sys:dept:list', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000011, 1067246875800000007, '删除', NULL, 'sys:role:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000012, 1067246875800000002, '部门管理', 'sys/dept', NULL, 0, 'icon-apartment', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000014, 1067246875800000012, '查看', NULL, 'sys:dept:list,sys:dept:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000015, 1067246875800000012, '新增', NULL, 'sys:dept:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000016, 1067246875800000012, '修改', NULL, 'sys:dept:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000017, 1067246875800000012, '删除', NULL, 'sys:dept:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000025, 1067246875800000035, '菜单管理', 'sys/menu', NULL, 0, 'icon-unorderedlist', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000026, 1067246875800000025, '查看', NULL, 'sys:menu:list,sys:menu:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000027, 1067246875800000025, '新增', NULL, 'sys:menu:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000028, 1067246875800000025, '修改', NULL, 'sys:menu:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000029, 1067246875800000025, '删除', NULL, 'sys:menu:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000030, 1067246875800000035, '定时任务', 'job/schedule', NULL, 0, 'icon-dashboard', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000031, 1067246875800000030, '查看', NULL, 'sys:schedule:page,sys:schedule:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000032, 1067246875800000030, '新增', NULL, 'sys:schedule:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000033, 1067246875800000030, '修改', NULL, 'sys:schedule:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000034, 1067246875800000030, '删除', NULL, 'sys:schedule:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000035, 0, '系统设置', NULL, NULL, 0, 'icon-setting', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000036, 1067246875800000030, '暂停', NULL, 'sys:schedule:pause', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000037, 1067246875800000030, '恢复', NULL, 'sys:schedule:resume', 1, NULL, 5, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000038, 1067246875800000030, '立即执行', NULL, 'sys:schedule:run', 1, NULL, 6, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000039, 1067246875800000030, '日志列表', NULL, 'sys:schedule:log', 1, NULL, 7, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000040, 1067246875800000035, '参数管理', 'sys/params', '', 0, 'icon-fileprotect', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000041, 1067246875800000035, '字典管理', 'sys/dict-type', NULL, 0, 'icon-golden-fill', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000042, 1067246875800000041, '查看', NULL, 'sys:dict:page,sys:dict:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000043, 1067246875800000041, '新增', NULL, 'sys:dict:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000044, 1067246875800000041, '修改', NULL, 'sys:dict:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000045, 1067246875800000041, '删除', NULL, 'sys:dict:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000046, 0, '日志管理', NULL, NULL, 0, 'icon-container', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000047, 1067246875800000035, '文件上传', 'oss/oss', 'sys:oss:all', 0, 'icon-upload', 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000048, 1067246875800000046, '登录日志', 'sys/log-login', 'sys:log:login', 0, 'icon-filedone', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000049, 1067246875800000046, '操作日志', 'sys/log-operation', 'sys:log:operation', 0, 'icon-solution', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000050, 1067246875800000046, '异常日志', 'sys/log-error', 'sys:log:error', 0, 'icon-file-exception', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000051, 1067246875800000053, 'SQL监控', '{{ window.SITE_CONFIG["apiURL"] }}/druid/sql.html', NULL, 0, 'icon-database', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000053, 0, '系统监控', NULL, NULL, 0, 'icon-desktop', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000055, 1067246875800000002, '用户管理', 'sys/user', NULL, 0, 'icon-user', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000056, 1067246875800000055, '查看', NULL, 'sys:user:page,sys:user:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000057, 1067246875800000040, '新增', NULL, 'sys:params:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000058, 1067246875800000040, '导出', NULL, 'sys:params:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000059, 1067246875800000040, '查看', '', 'sys:params:page,sys:params:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000060, 1067246875800000040, '修改', NULL, 'sys:params:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000061, 1067246875800000040, '删除', '', 'sys:params:delete', 1, '', 3, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1156748733921165314, 1067246875800000053, '接口文档', '{{ window.SITE_CONFIG["apiURL"] }}/doc.html', '', 0, 'icon-file-word', 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000062, 1067246875800000063, '1067246875800000066,1067246875800000063', '技术部', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000063, 1067246875800000066, '1067246875800000066', '长沙分公司', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000064, 1067246875800000066, '1067246875800000066', '上海分公司', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000065, 1067246875800000064, '1067246875800000066,1067246875800000064', '市场部', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000066, 0, '0', '人人开源集团', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000067, 1067246875800000064, '1067246875800000066,1067246875800000064', '销售部', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000068, 1067246875800000063, '1067246875800000066,1067246875800000063', '产品部', 1, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061112075464705, 1160061077912858625, '男', '0', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061146967879681, 1160061077912858625, '女', '1', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061190127267841, 1160061077912858625, '保密', '2', '', 2, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814069634195457, 1225813644059140097, '公告', '0', '', 0, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814107559092225, 1225813644059140097, '会议', '1', '', 1, 1067246875800000001, now(), 1067246875800000001, now());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814271879340034, 1225813644059140097, '其他', '2', '', 2, 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO sys_params(id, param_code, param_value, param_type, remark, creator, create_date, updater, update_date) VALUES (1067246875800000073, 'CLOUD_STORAGE_CONFIG_KEY', '{"type":1,"qiniuDomain":"http://test.oss.renren.io","qiniuPrefix":"upload","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","qiniuBucketName":"renren-oss","aliyunDomain":"","aliyunPrefix":"","aliyunEndPoint":"","aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qcloudBucketName":""}', '0', '云存储配置信息', 1067246875800000001, now(), 1067246875800000001, now());
+
+INSERT INTO schedule_job (id, bean_name, params, cron_expression, status, remark, creator, create_date, updater, update_date) VALUES (1067246875800000076, 'testTask', 'renren', '0 0/30 * * * ?', 0, '有参测试,多个参数使用json', 1067246875800000001, now(), 1067246875800000001, now());
+
+
+
+-- quartz自带表结构
+CREATE TABLE qrtz_job_details
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ JOB_NAME VARCHAR(200) NOT NULL,
+ JOB_GROUP VARCHAR(200) NOT NULL,
+ DESCRIPTION VARCHAR(250) NULL,
+ JOB_CLASS_NAME VARCHAR(250) NOT NULL,
+ IS_DURABLE BOOL NOT NULL,
+ IS_NONCONCURRENT BOOL NOT NULL,
+ IS_UPDATE_DATA BOOL NOT NULL,
+ REQUESTS_RECOVERY BOOL NOT NULL,
+ JOB_DATA BYTEA NULL,
+ PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+
+CREATE TABLE qrtz_triggers
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ JOB_NAME VARCHAR(200) NOT NULL,
+ JOB_GROUP VARCHAR(200) NOT NULL,
+ DESCRIPTION VARCHAR(250) NULL,
+ NEXT_FIRE_TIME BIGINT NULL,
+ PREV_FIRE_TIME BIGINT NULL,
+ PRIORITY INTEGER NULL,
+ TRIGGER_STATE VARCHAR(16) NOT NULL,
+ TRIGGER_TYPE VARCHAR(8) NOT NULL,
+ START_TIME BIGINT NOT NULL,
+ END_TIME BIGINT NULL,
+ CALENDAR_NAME VARCHAR(200) NULL,
+ MISFIRE_INSTR SMALLINT NULL,
+ JOB_DATA BYTEA NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
+ REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
+);
+
+CREATE TABLE qrtz_simple_triggers
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ REPEAT_COUNT BIGINT NOT NULL,
+ REPEAT_INTERVAL BIGINT NOT NULL,
+ TIMES_TRIGGERED BIGINT NOT NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE qrtz_cron_triggers
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ CRON_EXPRESSION VARCHAR(120) NOT NULL,
+ TIME_ZONE_ID VARCHAR(80),
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE qrtz_simprop_triggers
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ STR_PROP_1 VARCHAR(512) NULL,
+ STR_PROP_2 VARCHAR(512) NULL,
+ STR_PROP_3 VARCHAR(512) NULL,
+ INT_PROP_1 INT NULL,
+ INT_PROP_2 INT NULL,
+ LONG_PROP_1 BIGINT NULL,
+ LONG_PROP_2 BIGINT NULL,
+ DEC_PROP_1 NUMERIC(13,4) NULL,
+ DEC_PROP_2 NUMERIC(13,4) NULL,
+ BOOL_PROP_1 BOOL NULL,
+ BOOL_PROP_2 BOOL NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE qrtz_blob_triggers
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ BLOB_DATA BYTEA NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
+ FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+ REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE qrtz_calendars
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ CALENDAR_NAME VARCHAR(200) NOT NULL,
+ CALENDAR BYTEA NOT NULL,
+ PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
+);
+
+
+CREATE TABLE qrtz_paused_trigger_grps
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
+);
+
+CREATE TABLE qrtz_fired_triggers
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ ENTRY_ID VARCHAR(95) NOT NULL,
+ TRIGGER_NAME VARCHAR(200) NOT NULL,
+ TRIGGER_GROUP VARCHAR(200) NOT NULL,
+ INSTANCE_NAME VARCHAR(200) NOT NULL,
+ FIRED_TIME BIGINT NOT NULL,
+ SCHED_TIME BIGINT NOT NULL,
+ PRIORITY INTEGER NOT NULL,
+ STATE VARCHAR(16) NOT NULL,
+ JOB_NAME VARCHAR(200) NULL,
+ JOB_GROUP VARCHAR(200) NULL,
+ IS_NONCONCURRENT BOOL NULL,
+ REQUESTS_RECOVERY BOOL NULL,
+ PRIMARY KEY (SCHED_NAME,ENTRY_ID)
+);
+
+CREATE TABLE qrtz_scheduler_state
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ INSTANCE_NAME VARCHAR(200) NOT NULL,
+ LAST_CHECKIN_TIME BIGINT NOT NULL,
+ CHECKIN_INTERVAL BIGINT NOT NULL,
+ PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
+);
+
+CREATE TABLE qrtz_locks
+(
+ SCHED_NAME VARCHAR(120) NOT NULL,
+ LOCK_NAME VARCHAR(40) NOT NULL,
+ PRIMARY KEY (SCHED_NAME,LOCK_NAME)
+);
+
+create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP);
+
+create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME);
+create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP);
+create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE);
+create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
+create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
+create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
+create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
+
+create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME);
+create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
+create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
+create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP);
+create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
+create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP);
+
+
+commit;
diff --git a/renren-admin/db/sqlserver.sql b/renren-admin/db/sqlserver.sql
new file mode 100644
index 0000000..5915d64
--- /dev/null
+++ b/renren-admin/db/sqlserver.sql
@@ -0,0 +1,674 @@
+CREATE TABLE sys_user (
+ id bigint NOT NULL,
+ username varchar(50) NOT NULL,
+ password varchar(100),
+ real_name varchar(50),
+ head_url varchar(200),
+ gender int,
+ email varchar(100),
+ mobile varchar(100),
+ dept_id bigint,
+ super_admin int,
+ status int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_username on sys_user(username);
+CREATE INDEX idx_sys_user_create_date on sys_user(create_date);
+
+
+CREATE TABLE sys_dept (
+ id bigint NOT NULL,
+ pid bigint,
+ pids varchar(500),
+ name varchar(50),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dept_pid on sys_dept(pid);
+CREATE INDEX idx_sys_dept_idx_sort on sys_dept(sort);
+
+
+create table sys_role
+(
+ id bigint NOT NULL,
+ name varchar(50),
+ remark varchar(100),
+ dept_id bigint,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_dept_id on sys_role(dept_id);
+
+
+create table sys_menu
+(
+ id bigint NOT NULL,
+ pid bigint,
+ name varchar(200),
+ url varchar(200),
+ permissions varchar(500),
+ menu_type int,
+ icon varchar(50),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_menu_pid on sys_menu(pid);
+CREATE INDEX idx_sys_menu_sort on sys_menu(sort);
+
+
+create table sys_role_user
+(
+ id bigint NOT NULL,
+ role_id bigint,
+ user_id bigint,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_user_role_id on sys_role_user(role_id);
+CREATE INDEX idx_sys_role_user_user_id on sys_role_user(user_id);
+
+
+create table sys_role_menu
+(
+ id bigint NOT NULL,
+ role_id bigint,
+ menu_id bigint,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+
+CREATE INDEX idx_sys_role_menu_role_id on sys_role_menu(role_id);
+CREATE INDEX idx_sys_role_menu_menu_id on sys_role_menu(menu_id);
+
+
+create table sys_role_data_scope
+(
+ id bigint NOT NULL,
+ role_id bigint,
+ dept_id bigint,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_data_scope_role_id on sys_role_data_scope(role_id);
+
+
+create table sys_params
+(
+ id bigint NOT NULL,
+ param_code varchar(32),
+ param_value varchar(2000),
+ param_type int DEFAULT 1 NOT NULL,
+ remark varchar(200),
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_params_param_code on sys_params(param_code);
+CREATE INDEX idx_sys_params_create_date on sys_params(create_date);
+
+
+create table sys_dict_type
+(
+ id bigint NOT NULL,
+ dict_type varchar(100),
+ dict_name varchar(255),
+ remark varchar(255),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE UNIQUE INDEX uk_sys_dict_type_dict_type on sys_dict_type(dict_type);
+
+
+create table sys_dict_data
+(
+ id bigint NOT NULL,
+ dict_type_id bigint NOT NULL,
+ dict_label varchar(255),
+ dict_value varchar(255),
+ remark varchar(255),
+ sort int,
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_sys_dict_data_sort on sys_dict_data(sort);
+CREATE UNIQUE INDEX uk_dict_type_value on sys_dict_data(dict_type_id, dict_value);
+
+
+create table sys_log_login
+(
+ id bigint NOT NULL,
+ operation int,
+ status int,
+ user_agent varchar(500),
+ ip varchar(32),
+ creator_name varchar(50),
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_login_status on sys_log_login(status);
+CREATE INDEX idx_login_create_date on sys_log_login(create_date);
+
+
+create table sys_log_operation
+(
+ id bigint NOT NULL,
+ operation varchar(50),
+ request_uri varchar(200),
+ request_method varchar(20),
+ request_params text,
+ request_time int,
+ user_agent varchar(500),
+ ip varchar(32),
+ status int,
+ creator_name varchar(50),
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_operation_create_date on sys_log_operation(create_date);
+
+
+create table sys_log_error
+(
+ id bigint NOT NULL,
+ request_uri varchar(200),
+ request_method varchar(20),
+ request_params text,
+ user_agent varchar(500),
+ ip varchar(32),
+ error_info text,
+ creator bigint,
+ create_date datetime,
+ primary key (id)
+);
+CREATE INDEX idx_error_create_date on sys_log_error(create_date);
+
+
+CREATE TABLE sys_oss (
+ id bigint NOT NULL,
+ url varchar(200),
+ creator bigint,
+ create_date datetime,
+ PRIMARY KEY (id)
+);
+CREATE INDEX idx_sys_oss_create_date on sys_oss(create_date);
+
+
+CREATE TABLE schedule_job (
+ id bigint NOT NULL,
+ bean_name varchar(200),
+ params varchar(2000),
+ cron_expression varchar(100),
+ status int,
+ remark varchar(255),
+ creator bigint,
+ create_date datetime,
+ updater bigint,
+ update_date datetime,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_schedule_job_create_date on schedule_job(create_date);
+
+
+CREATE TABLE schedule_job_log (
+ id bigint NOT NULL,
+ job_id bigint NOT NULL,
+ bean_name varchar(200),
+ params varchar(2000),
+ status int,
+ error varchar(2000),
+ times int,
+ create_date datetime,
+ PRIMARY KEY (id)
+);
+
+CREATE INDEX idx_job_log_job_id on schedule_job_log(job_id);
+CREATE INDEX idx_job_log_create_date on schedule_job_log(create_date);
+
+
+CREATE TABLE sys_user_token (
+ id bigint NOT NULL,
+ user_id bigint,
+ token varchar(100),
+ expire_date datetime,
+ update_date datetime,
+ create_date datetime,
+ PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX uk_sys_user_token_user_id on sys_user_token(user_id);
+CREATE UNIQUE INDEX uk_sys_user_token on sys_user_token(token);
+
+
+
+-- 初始数据
+INSERT INTO sys_user(id, username, password, real_name, gender, email, mobile, status, dept_id, super_admin, creator, create_date, updater, update_date) VALUES (1067246875800000001, 'admin', '$2a$10$012Kx2ba5jzqr9gLlG4MX.bnQJTD9UWqF57XDo2N3.fPtLne02u/m', '管理员', 0, 'root@renren.io', '13612345678', 1, null, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000002, 0, '权限管理', NULL, NULL, 0, 'icon-safetycertificate', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000003, 1067246875800000055, '新增', NULL, 'sys:user:save,sys:dept:list,sys:role:list', 1, NULL, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000004, 1067246875800000055, '修改', NULL, 'sys:user:update,sys:dept:list,sys:role:list', 1, NULL, 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000005, 1067246875800000055, '删除', NULL, 'sys:user:delete', 1, NULL, 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000006, 1067246875800000055, '导出', NULL, 'sys:user:export', 1, NULL, 4, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000007, 1067246875800000002, '角色管理', 'sys/role', NULL, 0, 'icon-team', 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000008, 1067246875800000007, '查看', NULL, 'sys:role:page,sys:role:info', 1, NULL, 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000009, 1067246875800000007, '新增', NULL, 'sys:role:save,sys:menu:select,sys:dept:list', 1, NULL, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000010, 1067246875800000007, '修改', NULL, 'sys:role:update,sys:menu:select,sys:dept:list', 1, NULL, 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000011, 1067246875800000007, '删除', NULL, 'sys:role:delete', 1, NULL, 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000012, 1067246875800000002, '部门管理', 'sys/dept', NULL, 0, 'icon-apartment', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000014, 1067246875800000012, '查看', NULL, 'sys:dept:list,sys:dept:info', 1, NULL, 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000015, 1067246875800000012, '新增', NULL, 'sys:dept:save', 1, NULL, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000016, 1067246875800000012, '修改', NULL, 'sys:dept:update', 1, NULL, 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000017, 1067246875800000012, '删除', NULL, 'sys:dept:delete', 1, NULL, 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000025, 1067246875800000035, '菜单管理', 'sys/menu', NULL, 0, 'icon-unorderedlist', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000026, 1067246875800000025, '查看', NULL, 'sys:menu:list,sys:menu:info', 1, NULL, 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000027, 1067246875800000025, '新增', NULL, 'sys:menu:save', 1, NULL, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000028, 1067246875800000025, '修改', NULL, 'sys:menu:update', 1, NULL, 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000029, 1067246875800000025, '删除', NULL, 'sys:menu:delete', 1, NULL, 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000030, 1067246875800000035, '定时任务', 'job/schedule', NULL, 0, 'icon-dashboard', 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000031, 1067246875800000030, '查看', NULL, 'sys:schedule:page,sys:schedule:info', 1, NULL, 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000032, 1067246875800000030, '新增', NULL, 'sys:schedule:save', 1, NULL, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000033, 1067246875800000030, '修改', NULL, 'sys:schedule:update', 1, NULL, 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000034, 1067246875800000030, '删除', NULL, 'sys:schedule:delete', 1, NULL, 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000035, 0, '系统设置', NULL, NULL, 0, 'icon-setting', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000036, 1067246875800000030, '暂停', NULL, 'sys:schedule:pause', 1, NULL, 4, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000037, 1067246875800000030, '恢复', NULL, 'sys:schedule:resume', 1, NULL, 5, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000038, 1067246875800000030, '立即执行', NULL, 'sys:schedule:run', 1, NULL, 6, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000039, 1067246875800000030, '日志列表', NULL, 'sys:schedule:log', 1, NULL, 7, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000040, 1067246875800000035, '参数管理', 'sys/params', '', 0, 'icon-fileprotect', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000041, 1067246875800000035, '字典管理', 'sys/dict-type', NULL, 0, 'icon-golden-fill', 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000042, 1067246875800000041, '查看', NULL, 'sys:dict:page,sys:dict:info', 1, NULL, 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000043, 1067246875800000041, '新增', NULL, 'sys:dict:save', 1, NULL, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000044, 1067246875800000041, '修改', NULL, 'sys:dict:update', 1, NULL, 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000045, 1067246875800000041, '删除', NULL, 'sys:dict:delete', 1, NULL, 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000046, 0, '日志管理', NULL, NULL, 0, 'icon-container', 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000047, 1067246875800000035, '文件上传', 'oss/oss', 'sys:oss:all', 0, 'icon-upload', 4, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000048, 1067246875800000046, '登录日志', 'sys/log-login', 'sys:log:login', 0, 'icon-filedone', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000049, 1067246875800000046, '操作日志', 'sys/log-operation', 'sys:log:operation', 0, 'icon-solution', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000050, 1067246875800000046, '异常日志', 'sys/log-error', 'sys:log:error', 0, 'icon-file-exception', 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000051, 1067246875800000053, 'SQL监控', '{{ window.SITE_CONFIG["apiURL"] }}/druid/sql.html', NULL, 0, 'icon-database', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000053, 0, '系统监控', NULL, NULL, 0, 'icon-desktop', 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000055, 1067246875800000002, '用户管理', 'sys/user', NULL, 0, 'icon-user', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000056, 1067246875800000055, '查看', NULL, 'sys:user:page,sys:user:info', 1, NULL, 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000057, 1067246875800000040, '新增', NULL, 'sys:params:save', 1, NULL, 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000058, 1067246875800000040, '导出', NULL, 'sys:params:export', 1, NULL, 4, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000059, 1067246875800000040, '查看', '', 'sys:params:page,sys:params:info', 1, NULL, 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000060, 1067246875800000040, '修改', NULL, 'sys:params:update', 1, NULL, 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1067246875800000061, 1067246875800000040, '删除', '', 'sys:params:delete', 1, '', 3, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_menu (id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date) VALUES (1156748733921165314, 1067246875800000053, '接口文档', '{{ window.SITE_CONFIG["apiURL"] }}/doc.html', '', 0, 'icon-file-word', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+
+
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000062, 1067246875800000063, '1067246875800000066,1067246875800000063', '技术部', 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000063, 1067246875800000066, '1067246875800000066', '长沙分公司', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000064, 1067246875800000066, '1067246875800000066', '上海分公司', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000065, 1067246875800000064, '1067246875800000066,1067246875800000064', '市场部', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000066, 0, '0', '人人开源集团', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000067, 1067246875800000064, '1067246875800000066,1067246875800000064', '销售部', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dept(id, pid, pids, name, sort, creator, create_date, updater, update_date) VALUES (1067246875800000068, 1067246875800000063, '1067246875800000066,1067246875800000063', '产品部', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061112075464705, 1160061077912858625, '男', '0', '', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061146967879681, 1160061077912858625, '女', '1', '', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1160061190127267841, 1160061077912858625, '保密', '2', '', 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dict_type(id, dict_type, dict_name, remark, sort, creator, create_date, updater, update_date) VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814069634195457, 1225813644059140097, '公告', '0', '', 0, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814107559092225, 1225813644059140097, '会议', '1', '', 1, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+INSERT INTO sys_dict_data(id, dict_type_id, dict_label, dict_value, remark, sort, creator, create_date, updater, update_date) VALUES (1225814271879340034, 1225813644059140097, '其他', '2', '', 2, 1067246875800000001, getdate(), 1067246875800000001, getdate());
+
+INSERT INTO sys_params(id, param_code, param_value, param_type, remark, creator, create_date, updater, update_date) VALUES (1067246875800000073, 'CLOUD_STORAGE_CONFIG_KEY', '{"type":1,"qiniuDomain":"http://test.oss.renren.io","qiniuPrefix":"upload","qiniuAccessKey":"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ","qiniuSecretKey":"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV","qiniuBucketName":"renren-oss","aliyunDomain":"","aliyunPrefix":"","aliyunEndPoint":"","aliyunAccessKeyId":"","aliyunAccessKeySecret":"","aliyunBucketName":"","qcloudDomain":"","qcloudPrefix":"","qcloudSecretId":"","qcloudSecretKey":"","qcloudBucketName":""}', '0', '云存储配置信息', 1067246875800000001, getdate(), 1067246875800000001, getdate());
+
+INSERT INTO schedule_job (id, bean_name, params, cron_expression, status, remark, creator, create_date, updater, update_date) VALUES (1067246875800000076, 'testTask', 'renren', '0 0/30 * * * ?', 0, '有参测试,多个参数使用json', 1067246875800000001, getdate(), 1067246875800000001, getdate());
+
+
+-- quartz自带表结构
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ ALTER TABLE [dbo].[QRTZ_TRIGGERS] DROP CONSTRAINT FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] DROP CONSTRAINT FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISFOREIGNKEY') = 1)
+ ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] DROP CONSTRAINT FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CALENDARS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_CALENDARS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_CRON_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_CRON_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_BLOB_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_BLOB_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_FIRED_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_FIRED_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_PAUSED_TRIGGER_GRPS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SCHEDULER_STATE]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_SCHEDULER_STATE]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_LOCKS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_LOCKS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_JOB_DETAILS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_JOB_DETAILS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPLE_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_SIMPROP_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS]
+GO
+
+IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[QRTZ_TRIGGERS]') AND OBJECTPROPERTY(id, N'ISUSERTABLE') = 1)
+ DROP TABLE [dbo].[QRTZ_TRIGGERS]
+GO
+
+CREATE TABLE [dbo].[QRTZ_CALENDARS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [CALENDAR_NAME] [VARCHAR] (200) NOT NULL ,
+ [CALENDAR] [IMAGE] NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_CRON_TRIGGERS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
+ [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
+ [CRON_EXPRESSION] [VARCHAR] (120) NOT NULL ,
+ [TIME_ZONE_ID] [VARCHAR] (80)
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_FIRED_TRIGGERS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [ENTRY_ID] [VARCHAR] (95) NOT NULL ,
+ [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
+ [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
+ [INSTANCE_NAME] [VARCHAR] (200) NOT NULL ,
+ [FIRED_TIME] [BIGINT] NOT NULL ,
+ [SCHED_TIME] [BIGINT] NOT NULL ,
+ [PRIORITY] [INTEGER] NOT NULL ,
+ [STATE] [VARCHAR] (16) NOT NULL,
+ [JOB_NAME] [VARCHAR] (200) NULL ,
+ [JOB_GROUP] [VARCHAR] (200) NULL ,
+ [IS_NONCONCURRENT] [VARCHAR] (1) NULL ,
+ [REQUESTS_RECOVERY] [VARCHAR] (1) NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_SCHEDULER_STATE] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [INSTANCE_NAME] [VARCHAR] (200) NOT NULL ,
+ [LAST_CHECKIN_TIME] [BIGINT] NOT NULL ,
+ [CHECKIN_INTERVAL] [BIGINT] NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_LOCKS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [LOCK_NAME] [VARCHAR] (40) NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_JOB_DETAILS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [JOB_NAME] [VARCHAR] (200) NOT NULL ,
+ [JOB_GROUP] [VARCHAR] (200) NOT NULL ,
+ [DESCRIPTION] [VARCHAR] (250) NULL ,
+ [JOB_CLASS_NAME] [VARCHAR] (250) NOT NULL ,
+ [IS_DURABLE] [VARCHAR] (1) NOT NULL ,
+ [IS_NONCONCURRENT] [VARCHAR] (1) NOT NULL ,
+ [IS_UPDATE_DATA] [VARCHAR] (1) NOT NULL ,
+ [REQUESTS_RECOVERY] [VARCHAR] (1) NOT NULL ,
+ [JOB_DATA] [IMAGE] NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
+ [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
+ [REPEAT_COUNT] [BIGINT] NOT NULL ,
+ [REPEAT_INTERVAL] [BIGINT] NOT NULL ,
+ [TIMES_TRIGGERED] [BIGINT] NOT NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
+ [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
+ [STR_PROP_1] [VARCHAR] (512) NULL,
+ [STR_PROP_2] [VARCHAR] (512) NULL,
+ [STR_PROP_3] [VARCHAR] (512) NULL,
+ [INT_PROP_1] [INT] NULL,
+ [INT_PROP_2] [INT] NULL,
+ [LONG_PROP_1] [BIGINT] NULL,
+ [LONG_PROP_2] [BIGINT] NULL,
+ [DEC_PROP_1] [NUMERIC] (13,4) NULL,
+ [DEC_PROP_2] [NUMERIC] (13,4) NULL,
+ [BOOL_PROP_1] [VARCHAR] (1) NULL,
+ [BOOL_PROP_2] [VARCHAR] (1) NULL,
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_BLOB_TRIGGERS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
+ [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
+ [BLOB_DATA] [IMAGE] NULL
+) ON [PRIMARY]
+GO
+
+CREATE TABLE [dbo].[QRTZ_TRIGGERS] (
+ [SCHED_NAME] [VARCHAR] (120) NOT NULL ,
+ [TRIGGER_NAME] [VARCHAR] (200) NOT NULL ,
+ [TRIGGER_GROUP] [VARCHAR] (200) NOT NULL ,
+ [JOB_NAME] [VARCHAR] (200) NOT NULL ,
+ [JOB_GROUP] [VARCHAR] (200) NOT NULL ,
+ [DESCRIPTION] [VARCHAR] (250) NULL ,
+ [NEXT_FIRE_TIME] [BIGINT] NULL ,
+ [PREV_FIRE_TIME] [BIGINT] NULL ,
+ [PRIORITY] [INTEGER] NULL ,
+ [TRIGGER_STATE] [VARCHAR] (16) NOT NULL ,
+ [TRIGGER_TYPE] [VARCHAR] (8) NOT NULL ,
+ [START_TIME] [BIGINT] NOT NULL ,
+ [END_TIME] [BIGINT] NULL ,
+ [CALENDAR_NAME] [VARCHAR] (200) NULL ,
+ [MISFIRE_INSTR] [SMALLINT] NULL ,
+ [JOB_DATA] [IMAGE] NULL
+) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_CALENDARS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_CALENDARS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [CALENDAR_NAME]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_CRON_TRIGGERS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_FIRED_TRIGGERS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_FIRED_TRIGGERS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [ENTRY_ID]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_PAUSED_TRIGGER_GRPS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_PAUSED_TRIGGER_GRPS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [TRIGGER_GROUP]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_SCHEDULER_STATE] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_SCHEDULER_STATE] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [INSTANCE_NAME]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_LOCKS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_LOCKS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [LOCK_NAME]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_JOB_DETAILS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_JOB_DETAILS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [JOB_NAME],
+ [JOB_GROUP]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_SIMPLE_TRIGGERS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_SIMPROP_TRIGGERS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_TRIGGERS] WITH NOCHECK ADD
+ CONSTRAINT [PK_QRTZ_TRIGGERS] PRIMARY KEY CLUSTERED
+ (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) ON [PRIMARY]
+GO
+
+ALTER TABLE [dbo].[QRTZ_CRON_TRIGGERS] ADD
+ CONSTRAINT [FK_QRTZ_CRON_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
+ (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPLE_TRIGGERS] ADD
+ CONSTRAINT [FK_QRTZ_SIMPLE_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
+ (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[QRTZ_SIMPROP_TRIGGERS] ADD
+ CONSTRAINT [FK_QRTZ_SIMPROP_TRIGGERS_QRTZ_TRIGGERS] FOREIGN KEY
+ (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) REFERENCES [dbo].[QRTZ_TRIGGERS] (
+ [SCHED_NAME],
+ [TRIGGER_NAME],
+ [TRIGGER_GROUP]
+ ) ON DELETE CASCADE
+GO
+
+ALTER TABLE [dbo].[QRTZ_TRIGGERS] ADD
+ CONSTRAINT [FK_QRTZ_TRIGGERS_QRTZ_JOB_DETAILS] FOREIGN KEY
+ (
+ [SCHED_NAME],
+ [JOB_NAME],
+ [JOB_GROUP]
+ ) REFERENCES [dbo].[QRTZ_JOB_DETAILS] (
+ [SCHED_NAME],
+ [JOB_NAME],
+ [JOB_GROUP]
+ )
+GO
\ No newline at end of file
diff --git a/renren-admin/pom.xml b/renren-admin/pom.xml
new file mode 100644
index 0000000..ed12b5d
--- /dev/null
+++ b/renren-admin/pom.xml
@@ -0,0 +1,156 @@
+
+
+ io.renren
+ renren-security
+ 5.2.0
+
+ 4.0.0
+ renren-admin
+ jar
+ renren-admin
+
+
+ 2.3.2
+ 1.10.0
+ 1.6.2
+ 4.1.0
+ 7.2.27
+ 2.8.3
+ 3.2.2
+ 5.4.4
+
+
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ 2.15.2
+
+
+ com.alipay.sdk
+ alipay-sdk-java
+ 4.35.79.ALL
+
+
+
+ org.apache.commons
+ commons-email
+ 1.5
+
+
+
+ io.renren
+ renren-common
+ 5.2.0
+
+
+ io.renren
+ renren-dynamic-datasource
+ 5.2.0
+
+
+ org.quartz-scheduler
+ quartz
+ ${quartz.version}
+
+
+ com.mchange
+ c3p0
+
+
+ com.zaxxer
+ HikariCP-java6
+
+
+
+
+ org.apache.shiro
+ shiro-core
+ ${shiro.version}
+
+
+ org.apache.shiro
+ shiro-spring
+ ${shiro.version}
+
+
+ com.github.whvcse
+ easy-captcha
+ ${captcha.version}
+
+
+ cn.afterturn
+ easypoi-base
+ ${easypoi.version}
+
+
+ cn.afterturn
+ easypoi-web
+ ${easypoi.version}
+
+
+ cn.afterturn
+ easypoi-annotation
+ ${easypoi.version}
+
+
+ com.qiniu
+ qiniu-java-sdk
+ ${qiniu.version}
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ ${aliyun.oss.version}
+
+
+ com.aliyun
+ aliyun-java-sdk-core
+ ${aliyun.core.version}
+
+
+ com.qcloud
+ cos_api
+ ${qcloud.cos.version}
+
+
+ org.slf4j
+ slf4j-log4j12
+
+
+
+
+
+
+ ${project.artifactId}
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ true
+
+
+
+ com.spotify
+ docker-maven-plugin
+ ${docker.plugin.version}
+
+ renren/${project.artifactId}
+ ${project.basedir}/
+
+
+ /
+ ${project.build.directory}
+ ${project.build.finalName}.jar
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/AdminApplication.java b/renren-admin/src/main/java/io/renren/AdminApplication.java
new file mode 100644
index 0000000..af283d9
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/AdminApplication.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * renren-admin
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@SpringBootApplication
+@EnableTransactionManagement
+@EnableCaching
+public class AdminApplication extends SpringBootServletInitializer {
+
+ public static void main(String[] args) {
+ SpringApplication.run(AdminApplication.class, args);
+ }
+
+ @Override
+ protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+ return application.sources(AdminApplication.class);
+ }
+}
+
diff --git a/renren-admin/src/main/java/io/renren/common/annotation/DataFilter.java b/renren-admin/src/main/java/io/renren/common/annotation/DataFilter.java
new file mode 100644
index 0000000..108c7d0
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/annotation/DataFilter.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 数据过滤注解
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface DataFilter {
+ /**
+ * 表的别名
+ */
+ String tableAlias() default "";
+
+ /**
+ * 用户ID
+ */
+ String userId() default "creator";
+
+ /**
+ * 部门ID
+ */
+ String deptId() default "dept_id";
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/annotation/LogOperation.java b/renren-admin/src/main/java/io/renren/common/annotation/LogOperation.java
new file mode 100644
index 0000000..153306e
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/annotation/LogOperation.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 操作日志注解
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface LogOperation {
+
+ String value() default "";
+}
diff --git a/renren-admin/src/main/java/io/renren/common/aspect/DataFilterAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/DataFilterAspect.java
new file mode 100644
index 0000000..d0d5d07
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/aspect/DataFilterAspect.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.aspect;
+
+import cn.hutool.core.collection.CollUtil;
+import io.renren.common.annotation.DataFilter;
+import io.renren.common.constant.Constant;
+import io.renren.common.exception.ErrorCode;
+import io.renren.common.exception.RenException;
+import io.renren.common.interceptor.DataScope;
+import io.renren.modules.security.user.SecurityUser;
+import io.renren.modules.security.user.UserDetail;
+import io.renren.modules.sys.enums.SuperAdminEnum;
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 数据过滤,切面处理类
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Aspect
+@Component
+public class DataFilterAspect {
+
+ @Pointcut("@annotation(io.renren.common.annotation.DataFilter)")
+ public void dataFilterCut() {
+
+ }
+
+ @Before("dataFilterCut()")
+ public void dataFilter(JoinPoint point) {
+ Object params = point.getArgs()[0];
+ if(params != null && params instanceof Map){
+ UserDetail user = SecurityUser.getUser();
+
+ //如果是超级管理员,则不进行数据过滤
+ if(user.getSuperAdmin() == SuperAdminEnum.YES.value()) {
+ return ;
+ }
+
+ try {
+ //否则进行数据过滤
+ Map map = (Map)params;
+ String sqlFilter = getSqlFilter(user, point);
+ map.put(Constant.SQL_FILTER, new DataScope(sqlFilter));
+ }catch (Exception e){
+
+ }
+
+ return ;
+ }
+
+ throw new RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR);
+ }
+
+ /**
+ * 获取数据过滤的SQL
+ */
+ private String getSqlFilter(UserDetail user, JoinPoint point) throws Exception {
+ MethodSignature signature = (MethodSignature) point.getSignature();
+ Method method = point.getTarget().getClass().getDeclaredMethod(signature.getName(), signature.getParameterTypes());
+ DataFilter dataFilter = method.getAnnotation(DataFilter.class);
+
+ //获取表的别名
+ String tableAlias = dataFilter.tableAlias();
+ if(StringUtils.isNotBlank(tableAlias)){
+ tableAlias += ".";
+ }
+
+ StringBuilder sqlFilter = new StringBuilder();
+ sqlFilter.append(" (");
+
+ //部门ID列表
+ List deptIdList = user.getDeptIdList();
+ if(CollUtil.isNotEmpty(deptIdList)){
+ sqlFilter.append(tableAlias).append(dataFilter.deptId());
+
+ sqlFilter.append(" in(").append(StringUtils.join(deptIdList, ",")).append(")");
+ }
+
+ //查询本人数据
+ if(CollUtil.isNotEmpty(deptIdList)){
+ sqlFilter.append(" or ");
+ }
+ sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(user.getId());
+
+ sqlFilter.append(")");
+
+ return sqlFilter.toString();
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/aspect/LogOperationAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/LogOperationAspect.java
new file mode 100644
index 0000000..ec0eb8d
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/aspect/LogOperationAspect.java
@@ -0,0 +1,110 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.aspect;
+
+import io.renren.common.annotation.LogOperation;
+import io.renren.common.utils.HttpContextUtils;
+import io.renren.common.utils.IpUtils;
+import io.renren.common.utils.JsonUtils;
+import io.renren.modules.log.entity.SysLogOperationEntity;
+import io.renren.modules.log.enums.OperationStatusEnum;
+import io.renren.modules.log.service.SysLogOperationService;
+import io.renren.modules.security.user.SecurityUser;
+import io.renren.modules.security.user.UserDetail;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Method;
+
+/**
+ * 操作日志,切面处理类
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Aspect
+@Component
+public class LogOperationAspect {
+ @Autowired
+ private SysLogOperationService sysLogOperationService;
+
+ @Pointcut("@annotation(io.renren.common.annotation.LogOperation)")
+ public void logPointCut() {
+
+ }
+
+ @Around("logPointCut()")
+ public Object around(ProceedingJoinPoint point) throws Throwable {
+ long beginTime = System.currentTimeMillis();
+ try {
+ //执行方法
+ Object result = point.proceed();
+
+ //执行时长(毫秒)
+ long time = System.currentTimeMillis() - beginTime;
+ //保存日志
+ saveLog(point, time, OperationStatusEnum.SUCCESS.value());
+
+ return result;
+ }catch(Exception e) {
+ //执行时长(毫秒)
+ long time = System.currentTimeMillis() - beginTime;
+ //保存日志
+ saveLog(point, time, OperationStatusEnum.FAIL.value());
+
+ throw e;
+ }
+ }
+
+ private void saveLog(ProceedingJoinPoint joinPoint, long time, Integer status) throws Exception {
+ MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+ Method method = joinPoint.getTarget().getClass().getDeclaredMethod(signature.getName(), signature.getParameterTypes());
+ LogOperation annotation = method.getAnnotation(LogOperation.class);
+
+ SysLogOperationEntity log = new SysLogOperationEntity();
+ if(annotation != null){
+ //注解上的描述
+ log.setOperation(annotation.value());
+ }
+
+ //登录用户信息
+ UserDetail user = SecurityUser.getUser();
+ if(user != null){
+ log.setCreatorName(user.getUsername());
+ }
+
+ log.setStatus(status);
+ log.setRequestTime((int)time);
+
+ //请求相关信息
+ HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
+ log.setIp(IpUtils.getIpAddr(request));
+ log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
+ log.setRequestUri(request.getRequestURI());
+ log.setRequestMethod(request.getMethod());
+
+ //请求参数
+ Object[] args = joinPoint.getArgs();
+ try{
+ String params = JsonUtils.toJsonString(args[0]);
+ log.setRequestParams(params);
+ }catch (Exception e){
+
+ }
+
+ //保存到DB
+ sysLogOperationService.save(log);
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/config/MybatisPlusConfig.java b/renren-admin/src/main/java/io/renren/common/config/MybatisPlusConfig.java
new file mode 100644
index 0000000..68e3fba
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/config/MybatisPlusConfig.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.config;
+
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import io.renren.common.interceptor.DataFilterInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * mybatis-plus配置
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Configuration
+public class MybatisPlusConfig {
+
+ @Bean
+ public MybatisPlusInterceptor mybatisPlusInterceptor() {
+ MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
+ // 数据权限
+ mybatisPlusInterceptor.addInnerInterceptor(new DataFilterInterceptor());
+ // 分页插件
+ mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
+ // 乐观锁
+ mybatisPlusInterceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
+ // 防止全表更新与删除
+ mybatisPlusInterceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
+
+ return mybatisPlusInterceptor;
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/config/SwaggerConfig.java b/renren-admin/src/main/java/io/renren/common/config/SwaggerConfig.java
new file mode 100644
index 0000000..135421a
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/config/SwaggerConfig.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.config;
+
+import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver;
+import io.renren.common.constant.Constant;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
+
+import java.util.List;
+
+import static com.google.common.collect.Lists.newArrayList;
+
+/**
+ * Swagger配置
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Configuration
+@EnableSwagger2WebMvc
+@AllArgsConstructor
+public class SwaggerConfig{
+ private final OpenApiExtensionResolver openApiExtensionResolver;
+
+ @Bean
+ public Docket createRestApi() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .apiInfo(apiInfo())
+ .select()
+ //加了ApiOperation注解的类,生成接口文档
+ .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+ //包下的类,生成接口文档
+ //.apis(RequestHandlerSelectors.basePackage("io.renren.modules.job.controller"))
+ .paths(PathSelectors.any())
+ .build()
+ .extensions(openApiExtensionResolver.buildExtensions("Renren"))
+ .directModelSubstitute(java.util.Date.class, String.class)
+ .securitySchemes(security());
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder()
+ .title("人人开源")
+ .description("renren-admin文档")
+ .termsOfServiceUrl("https://www.renren.io")
+ .version("5.x")
+ .build();
+ }
+
+ private List security() {
+ return newArrayList(
+ new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header")
+ );
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/exception/RenExceptionHandler.java b/renren-admin/src/main/java/io/renren/common/exception/RenExceptionHandler.java
new file mode 100644
index 0000000..2be058c
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/exception/RenExceptionHandler.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.exception;
+
+import cn.hutool.core.map.MapUtil;
+import io.renren.common.utils.HttpContextUtils;
+import io.renren.common.utils.IpUtils;
+import io.renren.common.utils.JsonUtils;
+import io.renren.common.utils.Result;
+import io.renren.modules.log.entity.SysLogErrorEntity;
+import io.renren.modules.log.service.SysLogErrorService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.http.HttpHeaders;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+
+/**
+ * 异常处理器
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@RestControllerAdvice
+public class RenExceptionHandler {
+ private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class);
+
+ @Autowired
+ private SysLogErrorService sysLogErrorService;
+
+ /**
+ * 处理自定义异常
+ */
+ @ExceptionHandler(RenException.class)
+ public Result handleRenException(RenException ex){
+ Result result = new Result();
+ result.error(ex.getCode(), ex.getMsg());
+
+ return result;
+ }
+
+ @ExceptionHandler(DuplicateKeyException.class)
+ public Result handleDuplicateKeyException(DuplicateKeyException ex){
+ Result result = new Result();
+ result.error(ErrorCode.DB_RECORD_EXISTS);
+
+ return result;
+ }
+
+ @ExceptionHandler(Exception.class)
+ public Result handleException(Exception ex){
+ logger.error(ex.getMessage(), ex);
+
+ saveLog(ex);
+
+ return new Result().error();
+ }
+
+ /**
+ * 保存异常日志
+ */
+ private void saveLog(Exception ex){
+ SysLogErrorEntity log = new SysLogErrorEntity();
+
+ //请求相关信息
+ HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
+ log.setIp(IpUtils.getIpAddr(request));
+ log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
+ log.setRequestUri(request.getRequestURI());
+ log.setRequestMethod(request.getMethod());
+ Map params = HttpContextUtils.getParameterMap(request);
+ if(MapUtil.isNotEmpty(params)){
+ log.setRequestParams(JsonUtils.toJsonString(params));
+ }
+
+ //异常信息
+ log.setErrorInfo(ExceptionUtils.getErrorStackTrace(ex));
+
+ //保存
+ sysLogErrorService.save(log);
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/handler/FieldMetaObjectHandler.java b/renren-admin/src/main/java/io/renren/common/handler/FieldMetaObjectHandler.java
new file mode 100644
index 0000000..26ffd93
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/handler/FieldMetaObjectHandler.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.handler;
+
+import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
+import io.renren.modules.front.utils.BaseContext;
+import io.renren.modules.security.user.SecurityUser;
+import io.renren.modules.security.user.UserDetail;
+import org.apache.ibatis.reflection.MetaObject;
+import org.springframework.stereotype.Component;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 公共字段,自动填充值
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Component
+public class FieldMetaObjectHandler implements MetaObjectHandler {
+ private final static String CREATE_DATE = "createDate";
+ private final static String CREATOR = "creator";
+ private final static String UPDATE_DATE = "updateDate";
+ private final static String UPDATER = "updater";
+ private final static String DEPT_ID = "deptId";
+
+ private static final String TARGET_PACKAGE = "io.renren.modules.front.bean";
+
+ @Override
+ public void insertFill(MetaObject metaObject) {
+ String className = metaObject.getOriginalObject().getClass().getName();
+ if (className.startsWith(TARGET_PACKAGE)){
+ //填充前台页面相关公共字段
+ metaObject.setValue(CREATOR, BaseContext.getCurrentId());
+ metaObject.setValue(CREATE_DATE, LocalDateTime.now());
+ metaObject.setValue(UPDATER, BaseContext.getCurrentId());
+ metaObject.setValue(UPDATE_DATE, LocalDateTime.now());
+ }else {
+ //填充后台页面相关公共字段
+ UserDetail user = SecurityUser.getUser();
+ Date date = new Date();
+
+ //创建者
+ strictInsertFill(metaObject, CREATOR, Long.class, user.getId());
+ //创建时间
+ strictInsertFill(metaObject, CREATE_DATE, Date.class, date);
+
+ //创建者所属部门
+ strictInsertFill(metaObject, DEPT_ID, Long.class, user.getDeptId());
+
+ //更新者
+ strictInsertFill(metaObject, UPDATER, Long.class, user.getId());
+ //更新时间
+ strictInsertFill(metaObject, UPDATE_DATE, Date.class, date);
+ }
+ }
+
+ @Override
+ public void updateFill(MetaObject metaObject) {
+ String className = metaObject.getOriginalObject().getClass().getName();
+ if (className.startsWith(TARGET_PACKAGE)){
+ //填充前台页面相关公共字段
+ metaObject.setValue(UPDATER, BaseContext.getCurrentId());
+ metaObject.setValue(UPDATE_DATE, LocalDateTime.now());
+ }else {
+ //更新者
+ strictUpdateFill(metaObject, UPDATER, Long.class, SecurityUser.getUserId());
+ //更新时间
+ strictUpdateFill(metaObject, UPDATE_DATE, Date.class, new Date());
+ }
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/interceptor/DataFilterInterceptor.java b/renren-admin/src/main/java/io/renren/common/interceptor/DataFilterInterceptor.java
new file mode 100644
index 0000000..87cb0b2
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/interceptor/DataFilterInterceptor.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.interceptor;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.PluginUtils;
+import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
+import net.sf.jsqlparser.JSQLParserException;
+import net.sf.jsqlparser.expression.Expression;
+import net.sf.jsqlparser.expression.StringValue;
+import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
+import net.sf.jsqlparser.parser.CCJSqlParserUtil;
+import net.sf.jsqlparser.statement.select.PlainSelect;
+import net.sf.jsqlparser.statement.select.Select;
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.BoundSql;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.session.ResultHandler;
+import org.apache.ibatis.session.RowBounds;
+
+import java.util.Map;
+
+/**
+ * 数据过滤
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public class DataFilterInterceptor implements InnerInterceptor {
+
+ @Override
+ public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) {
+ DataScope scope = getDataScope(parameter);
+ // 不进行数据过滤
+ if(scope == null || StrUtil.isBlank(scope.getSqlFilter())){
+ return;
+ }
+
+ // 拼接新SQL
+ String buildSql = getSelect(boundSql.getSql(), scope);
+
+ // 重写SQL
+ PluginUtils.mpBoundSql(boundSql).sql(buildSql);
+ }
+
+ private DataScope getDataScope(Object parameter){
+ if (parameter == null){
+ return null;
+ }
+
+ // 判断参数里是否有DataScope对象
+ if (parameter instanceof Map) {
+ Map, ?> parameterMap = (Map, ?>) parameter;
+ for (Map.Entry entry : parameterMap.entrySet()) {
+ if (entry.getValue() != null && entry.getValue() instanceof DataScope) {
+ return (DataScope) entry.getValue();
+ }
+ }
+ } else if (parameter instanceof DataScope) {
+ return (DataScope) parameter;
+ }
+
+ return null;
+ }
+
+ private String getSelect(String buildSql, DataScope scope){
+ try {
+ Select select = (Select) CCJSqlParserUtil.parse(buildSql);
+ PlainSelect plainSelect = (PlainSelect) select.getSelectBody();
+
+ Expression expression = plainSelect.getWhere();
+ if(expression == null){
+ plainSelect.setWhere(new StringValue(scope.getSqlFilter()));
+ }else{
+ AndExpression andExpression = new AndExpression(expression, new StringValue(scope.getSqlFilter()));
+ plainSelect.setWhere(andExpression);
+ }
+
+ return select.toString().replaceAll("'", "");
+ }catch (JSQLParserException e){
+ return buildSql;
+ }
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/interceptor/DataScope.java b/renren-admin/src/main/java/io/renren/common/interceptor/DataScope.java
new file mode 100644
index 0000000..11acdd2
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/interceptor/DataScope.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.interceptor;
+
+/**
+ * 数据范围
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public class DataScope {
+ private String sqlFilter;
+
+ public DataScope(String sqlFilter) {
+ this.sqlFilter = sqlFilter;
+ }
+
+ public String getSqlFilter() {
+ return sqlFilter;
+ }
+
+ public void setSqlFilter(String sqlFilter) {
+ this.sqlFilter = sqlFilter;
+ }
+
+ @Override
+ public String toString() {
+ return this.sqlFilter;
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/utils/ExcelUtils.java b/renren-admin/src/main/java/io/renren/common/utils/ExcelUtils.java
new file mode 100644
index 0000000..cc9256c
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/utils/ExcelUtils.java
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.utils;
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.BeanUtils;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * excel工具类
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public class ExcelUtils {
+
+ /**
+ * Excel导出
+ *
+ * @param response response
+ * @param fileName 文件名
+ * @param list 数据List
+ * @param pojoClass 对象Class
+ */
+ public static void exportExcel(HttpServletResponse response, String fileName, Collection> list,
+ Class> pojoClass) throws IOException {
+ if(StringUtils.isBlank(fileName)){
+ //当前日期
+ fileName = DateUtils.format(new Date());
+ }
+
+ Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), pojoClass, list);
+ response.setCharacterEncoding("UTF-8");
+ response.setHeader("content-Type", "application/vnd.ms-excel");
+ response.setHeader("Content-Disposition",
+ "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
+ ServletOutputStream out = response.getOutputStream();
+ workbook.write(out);
+ out.flush();
+ }
+
+ /**
+ * Excel导出,先sourceList转换成List,再导出
+ *
+ * @param response response
+ * @param fileName 文件名
+ * @param sourceList 原数据List
+ * @param targetClass 目标对象Class
+ */
+ public static void exportExcelToTarget(HttpServletResponse response, String fileName, Collection> sourceList,
+ Class> targetClass) throws Exception {
+ List targetList = new ArrayList<>(sourceList.size());
+ for(Object source : sourceList){
+ Object target = targetClass.newInstance();
+ BeanUtils.copyProperties(source, target);
+ targetList.add(target);
+ }
+
+ exportExcel(response, fileName, targetList, targetClass);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/common/validator/group/AliyunGroup.java b/renren-admin/src/main/java/io/renren/common/validator/group/AliyunGroup.java
new file mode 100644
index 0000000..d8e7b5c
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/validator/group/AliyunGroup.java
@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.validator.group;
+
+/**
+ * 阿里云
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public interface AliyunGroup {
+}
diff --git a/renren-admin/src/main/java/io/renren/common/validator/group/QcloudGroup.java b/renren-admin/src/main/java/io/renren/common/validator/group/QcloudGroup.java
new file mode 100644
index 0000000..376e988
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/validator/group/QcloudGroup.java
@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.validator.group;
+
+/**
+ * 腾讯云
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public interface QcloudGroup {
+}
diff --git a/renren-admin/src/main/java/io/renren/common/validator/group/QiniuGroup.java b/renren-admin/src/main/java/io/renren/common/validator/group/QiniuGroup.java
new file mode 100644
index 0000000..542018b
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/common/validator/group/QiniuGroup.java
@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.common.validator.group;
+
+/**
+ * 七牛
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public interface QiniuGroup {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/AddressBook.java b/renren-admin/src/main/java/io/renren/modules/front/bean/AddressBook.java
new file mode 100644
index 0000000..b4b37ae
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/AddressBook.java
@@ -0,0 +1,121 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 地址管理(AddressBook)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:55
+ */
+@Data
+@NoArgsConstructor
+@TableName("address_book")
+public class AddressBook implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 用户id
+ */
+ private Long userId;
+
+ /**
+ * 收货人
+ */
+ private String consignee;
+
+ /**
+ * 性别 0 男 1 女
+ */
+ private Integer gender;
+
+ /**
+ * 手机号
+ */
+ private String phone;
+
+ /**
+ * 省级区划编号
+ */
+ private String provinceCode;
+
+ /**
+ * 省级名称
+ */
+ private String provinceName;
+
+ /**
+ * 市级区划编号
+ */
+ private String cityCode;
+
+ /**
+ * 市级名称
+ */
+ private String cityName;
+
+ /**
+ * 区级区划编号
+ */
+ private String districtCode;
+
+ /**
+ * 区级名称
+ */
+ private String districtName;
+
+ /**
+ * 详细地址
+ */
+ private String detail;
+
+ /**
+ * 标签
+ */
+ private String label;
+
+ /**
+ * 默认 0 否 1是
+ */
+ private Integer isDefault;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private LocalDateTime updateDate;
+
+ /**
+ * 是否删除
+ */
+ private Integer isDeleted;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/Category.java b/renren-admin/src/main/java/io/renren/modules/front/bean/Category.java
new file mode 100644
index 0000000..8f2a5d1
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/Category.java
@@ -0,0 +1,66 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 菜品及套餐分类(Category)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("category")
+public class Category implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 类型 1 菜品分类 2 套餐分类
+ */
+ private Integer type;
+
+ /**
+ * 分类名称
+ */
+ private String name;
+
+ /**
+ * 顺序
+ */
+ private Integer sort;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private LocalDateTime updateDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/Dish.java b/renren-admin/src/main/java/io/renren/modules/front/bean/Dish.java
new file mode 100644
index 0000000..849d409
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/Dish.java
@@ -0,0 +1,104 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 菜品管理(Dish)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("dish")
+public class Dish implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 菜品名称
+ */
+ private String name;
+
+ /**
+ * 菜品分类id
+ */
+ private Long categoryId;
+
+ /**
+ * 菜品价格
+ */
+ private Double price;
+
+ /**
+ * 商品码
+ */
+ private String code;
+
+ /**
+ * 图片
+ */
+ private String image;
+
+ /**
+ * 描述信息
+ */
+ private String description;
+
+ /**
+ * 0 停售 1 起售
+ */
+ private Integer status;
+
+ /**
+ * 顺序
+ */
+ private Integer sort;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @JsonSerialize(using = LocalDateTimeSerializer.class)// 序列化
+ @JsonDeserialize(using = LocalDateTimeDeserializer.class)// 反序列化
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @JsonSerialize(using = LocalDateTimeSerializer.class)// 序列化
+ @JsonDeserialize(using = LocalDateTimeDeserializer.class)// 反序列化
+ private LocalDateTime updateDate;
+
+ /**
+ * 是否删除
+ */
+ private Integer isDeleted;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/DishFlavor.java b/renren-admin/src/main/java/io/renren/modules/front/bean/DishFlavor.java
new file mode 100644
index 0000000..0aea790
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/DishFlavor.java
@@ -0,0 +1,79 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 菜品口味关系表(DishFlavor)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("dish_flavor")
+public class DishFlavor implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 菜品
+ */
+ private Long dishId;
+
+ /**
+ * 口味名称
+ */
+ private String name;
+
+ /**
+ * 口味数据list
+ */
+ private String value;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ @JsonSerialize(using = LocalDateTimeSerializer.class)// 序列化
+ @JsonDeserialize(using = LocalDateTimeDeserializer.class)// 反序列化
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @JsonSerialize(using = LocalDateTimeSerializer.class)// 序列化
+ @JsonDeserialize(using = LocalDateTimeDeserializer.class)// 反序列化
+ private LocalDateTime updateDate;
+
+ /**
+ * 是否删除
+ */
+ private Integer isDeleted;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/OrderDetail.java b/renren-admin/src/main/java/io/renren/modules/front/bean/OrderDetail.java
new file mode 100644
index 0000000..9c501a7
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/OrderDetail.java
@@ -0,0 +1,69 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 订单明细表(OrderDetail)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("order_detail")
+public class OrderDetail implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 名字
+ */
+ private String name;
+
+ /**
+ * 图片
+ */
+ private String image;
+
+ /**
+ * 订单id
+ */
+ private Long orderId;
+
+ /**
+ * 菜品id
+ */
+ private Long dishId;
+
+ /**
+ * 套餐id
+ */
+ private Long setmealId;
+
+ /**
+ * 口味
+ */
+ private String dishFlavor;
+
+ /**
+ * 数量
+ */
+ private Integer number;
+
+ /**
+ * 金额
+ */
+ private BigDecimal amount;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/Orders.java b/renren-admin/src/main/java/io/renren/modules/front/bean/Orders.java
new file mode 100644
index 0000000..39f1e22
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/Orders.java
@@ -0,0 +1,83 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 订单表(Orders)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("orders")
+public class Orders implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 订单号
+ */
+ private String number;
+
+ /**
+ * 订单状态 1待付款,2待派送,3已派送,4已完成,5已取消
+ */
+ private Integer status;
+
+ /**
+ * 下单用户
+ */
+ private Long userId;
+
+ /**
+ * 地址id
+ */
+ private Long addressBookId;
+
+ /**
+ * 下单时间
+ */
+ private LocalDateTime orderTime;
+
+ /**
+ * 结账时间
+ */
+ private LocalDateTime checkoutTime;
+
+ /**
+ * 支付方式 1微信,2支付宝
+ */
+ private Integer payMethod;
+
+ /**
+ * 实收金额
+ */
+ private BigDecimal amount;
+
+ /**
+ * 备注
+ */
+ private String remark;
+
+ private String phone;
+
+ private String address;
+
+ private String userName;
+
+ private String consignee;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/Setmeal.java b/renren-admin/src/main/java/io/renren/modules/front/bean/Setmeal.java
new file mode 100644
index 0000000..617fc09
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/Setmeal.java
@@ -0,0 +1,91 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 套餐(Setmeal)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("setmeal")
+public class Setmeal implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 菜品分类id
+ */
+ private Long categoryId;
+
+ /**
+ * 套餐名称
+ */
+ private String name;
+
+ /**
+ * 套餐价格
+ */
+ private Double price;
+
+ /**
+ * 状态 0:停用 1:启用
+ */
+ private Integer status;
+
+ /**
+ * 编码
+ */
+ private String code;
+
+ /**
+ * 描述信息
+ */
+ private String description;
+
+ /**
+ * 图片
+ */
+ private String image;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private LocalDateTime updateDate;
+
+ /**
+ * 是否删除
+ */
+ private Integer isDeleted;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/SetmealDish.java b/renren-admin/src/main/java/io/renren/modules/front/bean/SetmealDish.java
new file mode 100644
index 0000000..560fedf
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/SetmealDish.java
@@ -0,0 +1,86 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 套餐菜品关系(SetmealDish)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("setmeal_dish")
+public class SetmealDish implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 套餐id
+ */
+ private String setmealId;
+
+ /**
+ * 菜品id
+ */
+ private String dishId;
+
+ /**
+ * 菜品名称 (冗余字段)
+ */
+ private String name;
+
+ /**
+ * 菜品原价(冗余字段)
+ */
+ private Double price;
+
+ /**
+ * 份数
+ */
+ private Integer copies;
+
+ /**
+ * 排序
+ */
+ private Integer sort;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private LocalDateTime updateDate;
+
+ /**
+ * 是否删除
+ */
+ private Integer isDeleted;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/ShoppingCart.java b/renren-admin/src/main/java/io/renren/modules/front/bean/ShoppingCart.java
new file mode 100644
index 0000000..a61b123
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/ShoppingCart.java
@@ -0,0 +1,92 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 购物车(ShoppingCart)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("shopping_cart")
+public class ShoppingCart implements Serializable {
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 名称
+ */
+ private String name;
+
+ /**
+ * 图片
+ */
+ private String image;
+
+ /**
+ * 主键
+ */
+ private Long userId;
+
+ /**
+ * 菜品id
+ */
+ private Long dishId;
+
+ /**
+ * 套餐id
+ */
+ private Long setmealId;
+
+ /**
+ * 口味
+ */
+ private String dishFlavor;
+
+ /**
+ * 数量
+ */
+ private Integer number;
+
+ /**
+ * 金额
+ */
+ private BigDecimal amount;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private LocalDateTime updateDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/bean/User.java b/renren-admin/src/main/java/io/renren/modules/front/bean/User.java
new file mode 100644
index 0000000..29bdd85
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/bean/User.java
@@ -0,0 +1,91 @@
+package io.renren.modules.front.bean;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 用户信息(User)表实体类
+ *
+ * @author 张宇轩
+ * @since 2023-06-13 13:03:56
+ */
+@Data
+@NoArgsConstructor
+@TableName("user")
+public class User implements Serializable {
+
+ /**
+ * id
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 姓名
+ */
+ private String name;
+
+ /**
+ * 手机号
+ */
+ private String phone;
+
+ /**
+ * 性别 0:男 1:女 2:保密
+ */
+ private Integer gender;
+
+ /**
+ * 身份证号
+ */
+ private String idNumber;
+
+ /**
+ * 头像
+ */
+ private String avatarUrl;
+
+ /**
+ * 状态 0:禁用,1:正常
+ */
+ private Integer status;
+
+ /**
+ * 微信openid
+ */
+ private String openid;
+
+ /**
+ * 微信昵称
+ */
+ private String nickName;
+
+ /**
+ * 创建人
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long creator;
+
+ /**
+ * 创建时间
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createDate;
+
+ /**
+ * 修改人
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private LocalDateTime updateDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/common/CustomException.java b/renren-admin/src/main/java/io/renren/modules/front/common/CustomException.java
new file mode 100644
index 0000000..4a32f45
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/common/CustomException.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.common;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/5/31 - 9:31
+ */
+public class CustomException extends RuntimeException{
+ public CustomException() {
+ super();
+ }
+
+ public CustomException(String message) {
+ super(message);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/common/GlobalExceptionHandler.java b/renren-admin/src/main/java/io/renren/modules/front/common/GlobalExceptionHandler.java
new file mode 100644
index 0000000..2a11fbf
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/common/GlobalExceptionHandler.java
@@ -0,0 +1,32 @@
+package io.renren.modules.front.common;
+
+import io.renren.modules.front.utils.R;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+import java.sql.SQLIntegrityConstraintViolationException;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/5/30 - 9:44
+ */
+//全局异常处理
+@RestControllerAdvice(annotations = {RestController.class, Controller.class})
+public class GlobalExceptionHandler {
+ @ExceptionHandler(SQLIntegrityConstraintViolationException.class)
+ public R exceptionHandler(SQLIntegrityConstraintViolationException ex){
+ String msg = ex.getMessage();
+ String userName = "";
+ if(msg.contains("Duplicate entry")){
+ userName = msg.split(" ")[2];
+ }
+ return R.error(userName + ":已经存在,无法注册!");
+ }
+
+ @ExceptionHandler(CustomException.class)
+ public R exceptionHandler(CustomException ex){
+ return R.error(ex.getMessage());
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/common/JacksonObjectMapper.java b/renren-admin/src/main/java/io/renren/modules/front/common/JacksonObjectMapper.java
new file mode 100644
index 0000000..02c0e0f
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/common/JacksonObjectMapper.java
@@ -0,0 +1,53 @@
+package io.renren.modules.front.common;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
+
+import java.math.BigInteger;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+
+import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES;
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/5/30 - 14:21
+ * 对象映射器:基于jackson将Java对象转为json,或者将json转为Java对象
+ * 将JSON解析为Java对象的过程称为 [从JSON反序列化Java对象]
+ * 从Java对象生成JSON的过程称为 [序列化Java对象到JSON]
+ */
+public class JacksonObjectMapper extends ObjectMapper {
+ public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
+ public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+ public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
+ public JacksonObjectMapper() {
+ super();
+ //收到未知属性时不报异常
+ this.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
+ //反序列化时,属性不存在的兼容处理
+ this.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+
+ SimpleModule simpleModule = new SimpleModule()
+ .addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
+ .addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
+ .addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)))
+
+ .addSerializer(BigInteger.class, ToStringSerializer.instance)
+ .addSerializer(Long.class, ToStringSerializer.instance)
+
+ .addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
+ .addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
+ .addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
+ //注册功能模块 例如,可以添加自定义序列化器和反序列化器
+ this.registerModule(simpleModule);
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/front/config/AlipayConfig.java b/renren-admin/src/main/java/io/renren/modules/front/config/AlipayConfig.java
new file mode 100644
index 0000000..9938049
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/config/AlipayConfig.java
@@ -0,0 +1,28 @@
+package io.renren.modules.front.config;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/6/6 - 9:24
+ */
+public class AlipayConfig {
+ // 商户appid
+ public static String APPID = "";
+ // 私钥 pkcs8格式的
+ public static String RSA_PRIVATE_KEY = "";
+ // 服务器异步通知页面路径 需http://或者https://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问
+ public static String notify_url = "http://商户网关地址/alipay.trade.wap.pay-JAVA-UTF-8/notify_url.jsp";
+ // 页面跳转同步通知页面路径 需http://或者https://格式的完整路径,不能加?id=123这类自定义参数,必须外网可以正常访问 商户可以自定义同步跳转地址
+ public static String return_url = "http://localhost:8080/api/front/order/afterPayOrder";
+ // 请求网关地址
+ public static String URL = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
+ // 编码
+ public static String CHARSET = "UTF-8";
+ // 返回格式
+ public static String FORMAT = "json";
+ // 支付宝公钥
+ public static String ALIPAY_PUBLIC_KEY = "";
+ // 日志记录目录定义在 logFile 中
+ public static String log_path = "/log";
+ // RSA2
+ public static String SIGNTYPE = "RSA2";
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/AddressBookController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/AddressBookController.java
new file mode 100644
index 0000000..248adeb
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/AddressBookController.java
@@ -0,0 +1,79 @@
+package io.renren.modules.front.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.renren.modules.front.bean.AddressBook;
+import io.renren.modules.front.service.AddressBookService;
+import io.renren.modules.front.utils.BaseContext;
+import io.renren.modules.front.utils.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 地址管理(AddressBook)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "addressBookControllerFront")
+@RequestMapping("front/addressBook")
+public class AddressBookController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private AddressBookService addressBookService;
+
+ //查询当前登录用户的所有地址信息
+ @GetMapping("/list")
+ public R> list(){
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(AddressBook::getUserId, BaseContext.getCurrentId());
+ List bookList = addressBookService.list(lqw);
+ return R.success(bookList);
+ }
+
+ //添加收货地址
+ @PostMapping
+ public R add(@RequestBody AddressBook addressBook){
+ addressBook.setUserId(BaseContext.getCurrentId());
+ addressBookService.save(addressBook);
+ return R.success("地址保存成功");
+ }
+
+ //设置默认地址
+ @PutMapping("/default")
+ public R defaultAddress(@RequestBody AddressBook addressBook){
+ addressBookService.defaultAddress(addressBook);
+ return R.success("设置默认地址成功!");
+ }
+
+ //查询默认地址
+ @GetMapping("/default")
+ public R getDefaultAddress(){
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(AddressBook::getUserId, BaseContext.getCurrentId()).eq(AddressBook::getIsDefault, 1);
+ return R.success(addressBookService.getOne(lqw));
+ }
+
+ //根据id获取地址信息
+ @GetMapping("/{id}")
+ public R getAddressById(@PathVariable("id") Long id){
+ AddressBook addressBook = addressBookService.getById(id);
+ return R.success(addressBook);
+ }
+
+ //修改地址
+ @PutMapping
+ public R updateAddress(@RequestBody AddressBook addressBook){
+ addressBookService.updateById(addressBook);
+ return R.success("地址修改成功!");
+ }
+
+ @DeleteMapping
+ public R deleteAddress(@RequestParam("ids") Long ids){
+ addressBookService.removeById(ids);
+ return R.success("地址删除成功");
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/AlipayController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/AlipayController.java
new file mode 100644
index 0000000..cf75028
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/AlipayController.java
@@ -0,0 +1,63 @@
+package io.renren.modules.front.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.AlipayClient;
+import com.alipay.api.DefaultAlipayClient;
+import com.alipay.api.request.AlipayTradeWapPayRequest;
+import com.alipay.api.response.AlipayTradeWapPayResponse;
+import io.renren.modules.front.config.AlipayConfig;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.math.BigDecimal;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/6/6 - 9:30
+ */
+@RestController
+@RequestMapping("front/pay")
+@Slf4j
+public class AlipayController {
+ //实现对接支付宝沙箱支付
+ @GetMapping("/orderPay")
+ public String orderPay(@RequestParam("orderNum") Long out_trade_no,
+ @RequestParam("amount") BigDecimal total_amount) throws AlipayApiException {
+ AlipayClient alipayClient = new DefaultAlipayClient(
+ AlipayConfig.URL,
+ AlipayConfig.APPID,
+ AlipayConfig.RSA_PRIVATE_KEY,
+ AlipayConfig.FORMAT,
+ AlipayConfig.CHARSET,
+ AlipayConfig.ALIPAY_PUBLIC_KEY,
+ AlipayConfig.SIGNTYPE);
+ AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
+ //异步接收地址,仅支持http/https,公网可访问
+ request.setNotifyUrl(AlipayConfig.notify_url);
+ //同步跳转地址,仅支持http/https
+ request.setReturnUrl(AlipayConfig.return_url);
+ /* *****必传参数***** */
+ JSONObject bizContent = new JSONObject();
+ //商户订单号,商家自定义,保持唯一性
+ bizContent.put("out_trade_no", out_trade_no);
+ //支付金额,最小值0.01元
+ bizContent.put("total_amount", total_amount);
+ //订单标题,不可使用特殊符号
+ bizContent.put("subject", "美食元素订单支付");
+
+ /* ****可选参数***** */
+ //手机网站支付默认传值FAST_INSTANT_TRADE_PAY
+ bizContent.put("product_code", "QUICK_WAP_WAY");
+
+ request.setBizContent(bizContent.toString());
+ AlipayTradeWapPayResponse response = alipayClient.pageExecute(request);
+
+ String result = response.getBody();
+ log.info("result: {}", result);
+ return result;
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/CategoryController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/CategoryController.java
new file mode 100644
index 0000000..12921df
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/CategoryController.java
@@ -0,0 +1,68 @@
+package io.renren.modules.front.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.renren.modules.front.bean.Category;
+import io.renren.modules.front.service.CategoryService;
+import io.renren.modules.front.utils.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 菜品及套餐分类(Category)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "categoryControllerFront")
+@RequestMapping("front/category")
+public class CategoryController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private CategoryService categoryService;
+
+// //添加菜品套餐的分类信息
+// @PostMapping
+// public R add(@RequestBody Category category){
+// categoryService.save(category);
+// return R.success("添加成功!");
+// }
+//
+// //分页查询员工信息
+// @GetMapping("/page")
+// public R> page(@RequestParam Integer page,
+// @RequestParam Integer pageSize){
+// IPage iPage = new Page<>(page, pageSize);
+// QueryWrapper lqw = new QueryWrapper<>();
+// lqw.lambda().orderByDesc(Category::getUpdateDate);
+// categoryService.page(iPage, lqw);
+// return R.success(iPage);
+// }
+//
+// @PutMapping
+// public R update(@RequestBody Category category){
+// categoryService.updateById(category);
+// return R.success("修改成功!");
+// }
+//
+// @DeleteMapping
+// public R removeById(@RequestParam("id") Long cateId){
+// //删除分类信息
+// categoryService.removeCateById(cateId);
+// return R.success("删除分类信息成功");
+// }
+
+ @GetMapping("/list")
+ public R> list(@RequestParam(required = false) Integer type){
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(type!=null, Category::getType, type).orderByDesc(Category::getUpdateDate);
+ List categoryList = categoryService.list(lqw);
+ return R.success(categoryList);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/DishController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/DishController.java
new file mode 100644
index 0000000..15c6d4b
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/DishController.java
@@ -0,0 +1,186 @@
+package io.renren.modules.front.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.renren.modules.front.bean.Dish;
+import io.renren.modules.front.bean.DishFlavor;
+import io.renren.modules.front.dto.DishDTO;
+import io.renren.modules.front.service.CategoryService;
+import io.renren.modules.front.service.DishFlavorService;
+import io.renren.modules.front.service.DishService;
+import io.renren.modules.front.service.SetmealDishService;
+import io.renren.modules.front.utils.R;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+/**
+ * 菜品管理(Dish)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "dishControllerFront")
+@RequestMapping("front/dish")
+public class DishController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private DishService dishService;
+
+ @Autowired
+ private CategoryService categoryService;
+ @Autowired
+ private SetmealDishService setmealDishService;
+ @Autowired
+ private DishFlavorService dishFlavorService;
+
+ @Autowired
+ private RedisTemplate redisTemplate;
+
+// //保存菜品和口味信息
+// @PostMapping
+// public R saveDishFlavor(@RequestBody DishDTO dishDTO){
+// dishService.saveDishFlavor(dishDTO);
+// //清除当前分类下的菜品信息
+// redisTemplate.delete("dish_" + dishDTO.getCategoryId() + "_1");
+// return R.success("菜品保存成功!");
+// }
+//
+// //分页查询菜品信息
+// @GetMapping("/page")
+// public R> page(@RequestParam Integer page,
+// @RequestParam Integer pageSize,
+// @RequestParam(required = false) String name){
+// //这个iPageDto才是最后封装返回的分页数据
+// Page iPageDto = new Page<>(page, pageSize);
+// Page iPage = new Page<>(page, pageSize);
+// LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+// lqw.like(!StringUtils.isEmpty(name), Dish::getName, name).orderByDesc(Dish::getUpdateDate);
+// dishService.page(iPage, lqw);
+// //对象复制操作,把iPage中的分页数据(页数,总条数等)复制给iPageDto,具体的菜品数据不复制。
+// BeanUtils.copyProperties(iPage, iPageDto, "records");
+// //构建菜品数据,封装到PageDto中
+// List dishList = iPage.getRecords();
+// //把dishList转换为dishDtoList
+// List dishDTOList = dishList.stream().map(dish -> {
+// //构建新的DishDTO对象
+// DishDTO dishDTO = new DishDTO();
+// //把dish复制给dishDIO
+// BeanUtils.copyProperties(dish, dishDTO);
+// //获取categoryName,设置到DishDTo中
+// Category category = categoryService.getById(dish.getCategoryId());
+// dishDTO.setCategoryName( category.getName());
+// return dishDTO;
+// }).collect(Collectors.toList());
+// //设置dishDTOList到iPageDto
+// iPageDto.setRecords(dishDTOList);
+// return R.success(iPageDto);
+// }
+//
+// @PostMapping("/status/{status}")
+// public R setStatus(@PathVariable("status") Integer status,
+// @RequestParam List ids){
+// LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+// luw.set(Dish::getStatus, status).set(Dish::getUpdateDate, LocalDateTime.now()).in(Dish::getId, ids);
+// dishService.update(luw);
+// return R.success("停售成功");
+// }
+//
+// @DeleteMapping
+// public R delete(@RequestParam List ids){
+// LambdaQueryWrapper qw = new LambdaQueryWrapper<>();
+// qw.in(Dish::getId, ids).eq(Dish::getStatus, 1);
+// long cnt = dishService.count(qw);
+// if(cnt > 0){
+// throw new CustomException("存在起售的菜品,不能删除");
+// }
+// for (Long id : ids) {
+// LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+// lqw.eq(SetmealDish::getDishId, id);
+// long count = setmealDishService.count(lqw);
+// if (count > 0) {
+// throw new CustomException("存在包含该菜品的套餐,无法删除");
+// }
+// }
+// for(Long id: ids) {
+// LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+// luw.eq(DishFlavor::getDishId, id);
+// dishFlavorService.remove(luw);
+// dishService.removeById(id);
+// }
+// //清除所有的菜品缓存数据
+// redisTemplate.delete("dish_*");
+// return R.success("删除成功");
+// }
+//
+// //根据菜品id查询菜品和口味的信息
+// @GetMapping("/{dishId}")
+// public R getDIshFlavorById(@PathVariable("dishId") Long dishId){
+// DishDTO dishDTO = new DishDTO();
+// //查询菜品信息
+// Dish dish = dishService.getById(dishId);
+// BeanUtils.copyProperties(dish, dishDTO);
+// //查询当前菜品下的口味信息
+// LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+// lqw.eq(DishFlavor::getDishId, dishId);
+// List dishFlavorList = dishFlavorService.list(lqw);
+// //把口味的集合放入DishDTO
+// dishDTO.setFlavors(dishFlavorList);
+// return R.success(dishDTO);
+// }
+//
+// @PutMapping
+// public R updateDishFlavor(@RequestBody DishDTO dishDTO){
+// //先查询当前菜品的分类id,清除当前分类的redis数据
+// Dish dish = dishService.getById(dishDTO.getId());
+// redisTemplate.delete("dish_" + dish.getCategoryId() + "_1");
+// //查询更新的菜品的分类id,清除更新的分类的redis数据
+// if(!dish.getCategoryId().equals(dishDTO.getCategoryId())){
+// redisTemplate.delete("dish_" + dishDTO.getCategoryId() + "_1");
+// }
+// dishService.updateDishFlavor(dishDTO);
+// return R.success("修改菜品信息成功");
+// }
+
+ //根据分类的id,查询当前分类下的所有菜品信息
+ @GetMapping("/list")
+ private R> list(Dish dish){
+ //先从redis查询当前是否有分类下的菜品数据,如果有直接返回
+ //string结构
+ String key = "dish_" + dish.getCategoryId() + "_" + dish.getStatus();
+ List dishDTOList = (List) redisTemplate.opsForValue().get(key);
+ //如果有,直接返回数据
+ if(!CollectionUtils.isEmpty(dishDTOList)){
+ return R.success(dishDTOList);
+ }
+ //如果没有,去mysql数据库查询
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(Dish::getCategoryId, dish.getCategoryId())
+ //status为空时对应后台页面,非空则对应客户端页面
+ .eq(dish.getStatus()!=null, Dish::getStatus, dish.getStatus())
+ .orderByDesc(Dish::getSort).orderByDesc(Dish::getUpdateDate);
+ List dishList = dishService.list(lqw);
+ dishDTOList = dishList.stream().map(item -> {
+ DishDTO dishDTO = new DishDTO();
+ BeanUtils.copyProperties(item, dishDTO);
+ //封装口味数据
+ LambdaQueryWrapper qw = new LambdaQueryWrapper<>();
+ qw.eq(DishFlavor::getDishId, item.getId());
+ List dishFlavorList = dishFlavorService.list(qw);
+ dishDTO.setFlavors(dishFlavorList);
+ return dishDTO;
+ }).collect(Collectors.toList());
+ //把在msql查询的数据放入redis
+ redisTemplate.opsForValue().set(key, dishDTOList,1, TimeUnit.HOURS);
+ return R.success(dishDTOList);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/DishFlavorController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/DishFlavorController.java
new file mode 100644
index 0000000..dacb40a
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/DishFlavorController.java
@@ -0,0 +1,24 @@
+package io.renren.modules.front.controller;
+
+import io.renren.modules.front.service.DishFlavorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 菜品口味关系表(DishFlavor)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "dishFlavorControllerFront")
+@RequestMapping("front/dishFlavor")
+public class DishFlavorController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private DishFlavorService dishFlavorService;
+
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/OrderDetailController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/OrderDetailController.java
new file mode 100644
index 0000000..24881eb
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/OrderDetailController.java
@@ -0,0 +1,24 @@
+package io.renren.modules.front.controller;
+
+import io.renren.modules.front.service.OrderDetailService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 订单明细表(OrderDetail)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "orderDetailControllerFront")
+@RequestMapping("front/orderDetail")
+public class OrderDetailController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private OrderDetailService orderDetailService;
+
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/OrdersController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/OrdersController.java
new file mode 100644
index 0000000..80250fa
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/OrdersController.java
@@ -0,0 +1,88 @@
+package io.renren.modules.front.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.renren.modules.front.bean.Orders;
+import io.renren.modules.front.dto.OrdersDTO;
+import io.renren.modules.front.service.OrdersService;
+import io.renren.modules.front.utils.BaseContext;
+import io.renren.modules.front.utils.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDateTime;
+
+/**
+ * 订单表(Orders)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@Controller(value = "ordersControllerFront")
+@RequestMapping("front/order")
+public class OrdersController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private OrdersService ordersService;
+
+// @GetMapping("/page")
+// @ResponseBody
+// public R> page(@RequestParam Integer page,
+// @RequestParam Integer pageSize,
+// @RequestParam(required = false) String number,
+// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+// @RequestParam(required = false) LocalDateTime beginTime,
+// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+// @RequestParam(required = false) LocalDateTime endTime){
+// Page ordersPage = new Page<>(page, pageSize);
+// LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+// lqw.like(number!=null, Orders::getNumber, number)
+// .ge(beginTime!=null, Orders::getOrderTime, beginTime)
+// .le(endTime!=null, Orders::getOrderTime, endTime);
+// ordersService.page(ordersPage, lqw);
+// return R.success(ordersPage);
+// }
+//
+// @PutMapping
+// @ResponseBody
+// public R setStatus(@RequestBody Orders orders){
+// LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+// luw.eq(Orders::getId, orders.getId()).set(Orders::getStatus, orders.getStatus());
+// ordersService.update(luw);
+// return R.success("状态更改成功!");
+// }
+
+ //下单操作
+ @PostMapping("/submit")
+ @ResponseBody
+ public R addOrder(@RequestBody Orders orders){
+ Orders order = ordersService.addOrder(orders);
+ return R.success(order);
+ }
+
+ //查看订单
+ @GetMapping("/userPage")
+ @ResponseBody
+ public R> page(@RequestParam Integer page,
+ @RequestParam Integer pageSize){
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(Orders::getUserId, BaseContext.getCurrentId()).orderByDesc(Orders::getOrderTime);
+ Page dtoPage = ordersService.getUserPage(page, pageSize, lqw);
+ return R.success(dtoPage);
+ }
+
+ //支付完成之后的回调方法,处理订单状态等
+ @GetMapping("/afterPayOrder")
+ public String afterPayOrder(@RequestParam String out_trade_no){
+ LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+ luw.eq(Orders::getNumber, out_trade_no)
+ .set(Orders::getStatus, 2)
+ .set(Orders::getCheckoutTime, LocalDateTime.now());
+ ordersService.update(luw);
+ return "redirect:http://localhost:8001/front/page/pay-success.html";
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/SetmealController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/SetmealController.java
new file mode 100644
index 0000000..df033e7
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/SetmealController.java
@@ -0,0 +1,147 @@
+package io.renren.modules.front.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.renren.modules.front.bean.Dish;
+import io.renren.modules.front.bean.Setmeal;
+import io.renren.modules.front.bean.SetmealDish;
+import io.renren.modules.front.dto.SetmealDishDTO;
+import io.renren.modules.front.service.CategoryService;
+import io.renren.modules.front.service.DishService;
+import io.renren.modules.front.service.SetmealDishService;
+import io.renren.modules.front.service.SetmealService;
+import io.renren.modules.front.utils.R;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 套餐(Setmeal)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "setmealControllerFront")
+@RequestMapping("front/setmeal")
+public class SetmealController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private SetmealService setmealService;
+ @Autowired
+ private CategoryService categoryService;
+ @Autowired
+ private SetmealDishService setmealDishService;
+ @Autowired
+ private DishService dishService;
+
+// //添加套餐信息
+// @CacheEvict(value = "setmealCache", allEntries = true)
+// @PostMapping
+// public R saveSetmealDish(@RequestBody SetmealDTO setmealDTO){
+// setmealService.saveSetmealDish(setmealDTO);
+// return R.success("套餐添加成功!");
+// }
+//
+// @GetMapping("/page")
+// public R> page(@RequestParam Integer page,
+// @RequestParam Integer pageSize,
+// @RequestParam(required = false) String name){
+// IPage setmealDTOIPage = new Page<>();
+// IPage iPage = new Page<>(page, pageSize);
+// LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+// lqw.like(!StringUtils.isEmpty(name), Setmeal::getName, name);
+// setmealService.page(iPage, lqw);
+// BeanUtils.copyProperties(iPage, setmealDTOIPage, "records");
+// List setmealDTOList = iPage.getRecords().stream().map(setmeal -> {
+// SetmealDTO setmealDTO = new SetmealDTO();
+// BeanUtils.copyProperties(setmeal, setmealDTO);
+// Category category = categoryService.getById(setmeal.getCategoryId());
+// setmealDTO.setCategoryName(category.getName());
+// return setmealDTO;
+// }).collect(Collectors.toList());
+// setmealDTOIPage.setRecords(setmealDTOList);
+// return R.success(setmealDTOIPage);
+// }
+//
+// @PostMapping("/status/{status}")
+// public R setStatus(@PathVariable("status") Integer status,
+// @RequestParam List ids){
+// LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+// luw.set(Setmeal::getStatus, status).set(Setmeal::getUpdateDate, LocalDateTime.now()).in(Setmeal::getId, ids);
+// setmealService.update(luw);
+// return R.success("停售成功");
+// }
+//
+// @DeleteMapping
+// public R delete(@RequestParam List ids){
+// LambdaQueryWrapper qw = new LambdaQueryWrapper<>();
+// qw.in(Setmeal::getId, ids).eq(Setmeal::getStatus, 1);
+// long cnt = setmealService.count(qw);
+// if(cnt > 0){
+// throw new CustomException("存在起售的套餐,不能删除");
+// }
+// for (Long id : ids) {
+// LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+// luw.eq(SetmealDish::getSetmealId, id);
+// setmealDishService.remove(luw);
+// }
+// setmealService.removeBatchByIds(ids);
+// return R.success("删除成功");
+// }
+//
+// @GetMapping("/{setmealId}")
+// public R getSetmealById(@PathVariable("setmealId") Long setmealId){
+// Setmeal setmeal = setmealService.getById(setmealId);
+// SetmealDTO setmealDTO = new SetmealDTO();
+// BeanUtils.copyProperties(setmeal, setmealDTO);
+//
+// LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+// lqw.eq(SetmealDish::getSetmealId, setmealId);
+// List setmealDishList = setmealDishService.list(lqw);
+// setmealDTO.setSetmealDishes(setmealDishList);
+// return R.success(setmealDTO);
+// }
+//
+// @PutMapping
+// public R update(@RequestBody SetmealDTO setmealDTO){
+// setmealService.updateSetmealDish(setmealDTO);
+// return R.success("套餐保存成功!");
+// }
+
+ //根据分类id和状态查询套餐信息
+ @GetMapping("/list")
+ @Cacheable(value = "setmealCache", key = "#setmeal.categoryId + '_' + #setmeal.status")
+ public R> list(Setmeal setmeal){
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(Setmeal::getCategoryId, setmeal.getCategoryId())
+ .eq(setmeal.getStatus()!=null, Setmeal::getStatus, setmeal.getStatus())
+ .orderByDesc(Setmeal::getUpdateDate);
+ List setmealList = setmealService.list(lqw);
+ return R.success(setmealList);
+ }
+
+ //查看套餐详情
+ @GetMapping("/dish/{id}")
+ public R> getSetmealDetail(@PathVariable("id") Long id){
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(SetmealDish::getSetmealId, id).orderByDesc(SetmealDish::getUpdateDate);
+ List setmealDishList = setmealDishService.list(lqw);
+
+ List list = setmealDishList.stream().map(setmealDish -> {
+ SetmealDishDTO setmealDishDTO = new SetmealDishDTO();
+ BeanUtils.copyProperties(setmealDish, setmealDishDTO);
+ Dish dish = dishService.getById(setmealDish.getDishId());
+ setmealDishDTO.setImage(dish.getImage());
+ return setmealDishDTO;
+ }).collect(Collectors.toList());
+ return R.success(list);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/SetmealDishController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/SetmealDishController.java
new file mode 100644
index 0000000..d51ae01
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/SetmealDishController.java
@@ -0,0 +1,43 @@
+package io.renren.modules.front.controller;
+
+import io.renren.modules.front.service.DishService;
+import io.renren.modules.front.service.SetmealDishService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 套餐菜品关系(SetmealDish)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "setmealDishControllerFront")
+@RequestMapping("front/setmealDish")
+public class SetmealDishController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private SetmealDishService setmealDishService;
+ @Autowired
+ private DishService dishService;
+
+// //查询套餐详情信息
+// @GetMapping("/dish/{id}")
+// public R> setmealDetail(@PathVariable Long id) {
+// LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+// lqw.eq(SetmealDish::getSetmealId, id)
+// .orderByDesc(SetmealDish::getUpdateDate);
+// List setmealDishList = setmealDishService.list(lqw);
+// List setmealDishDTOList = setmealDishList.stream().map(setmealDish -> {
+// SetmealDishDTO setmealDishDTO = new SetmealDishDTO();
+// BeanUtils.copyProperties(setmealDish, setmealDishDTO);
+// Dish dish = dishService.getById(setmealDish.getDishId());
+// setmealDishDTO.setImage(dish.getImage());
+// return setmealDishDTO;
+// }).collect(Collectors.toList());
+// return R.success(setmealDishDTOList);
+// }
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/ShoppingCartController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/ShoppingCartController.java
new file mode 100644
index 0000000..0e02c12
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/ShoppingCartController.java
@@ -0,0 +1,59 @@
+package io.renren.modules.front.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import io.renren.modules.front.bean.ShoppingCart;
+import io.renren.modules.front.service.ShoppingCartService;
+import io.renren.modules.front.utils.BaseContext;
+import io.renren.modules.front.utils.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 购物车(ShoppingCart)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "shoppingCartControllerFront")
+@RequestMapping("front/shoppingCart")
+public class ShoppingCartController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private ShoppingCartService shoppingCartService;
+
+ @GetMapping("/list")
+ public R> list(){
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ShoppingCart::getUserId, BaseContext.getCurrentId());
+ return R.success(shoppingCartService.list(lqw));
+ }
+
+ //添加购物车
+ @PostMapping("/add")
+ public R add(@RequestBody ShoppingCart shoppingCart){
+ ShoppingCart cart = shoppingCartService.add(shoppingCart);
+ return R.success(cart);
+ }
+
+ //减少菜品/套餐数量
+ @PostMapping("/sub")
+ public R sub(@RequestBody ShoppingCart cart){
+ ShoppingCart shoppingCart = shoppingCartService.sub(cart);
+ return R.success(shoppingCart);
+ }
+
+ //清空购物车
+ @DeleteMapping("/clean")
+ public R clean(){
+ LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+ luw.eq(ShoppingCart::getUserId, BaseContext.getCurrentId());
+ shoppingCartService.remove(luw);
+ return R.success("购物车清空成功");
+ }
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/controller/UserController.java b/renren-admin/src/main/java/io/renren/modules/front/controller/UserController.java
new file mode 100644
index 0000000..a602b55
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/controller/UserController.java
@@ -0,0 +1,114 @@
+package io.renren.modules.front.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.renren.modules.front.bean.User;
+import io.renren.modules.front.service.UserService;
+import io.renren.modules.front.utils.BaseContext;
+import io.renren.modules.front.utils.R;
+import io.renren.modules.front.utils.SendEmailUtils;
+import io.renren.modules.front.utils.ValidateCodeUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.mail.EmailException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 用户信息(User)表控制层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:09:40
+ */
+@RestController(value = "userControllerFront")
+@RequestMapping("front/user")
+@Slf4j
+public class UserController {
+ /**
+ * 服务对象
+ */
+ @Autowired
+ private UserService userService;
+
+ @Autowired
+ private RedisTemplate redisTemplate;
+
+ //发送验证码
+ @PostMapping("/sendMsg")
+ public R sendMsg(@RequestBody User user, HttpSession session){
+ //生成6位随机数字验证码
+ String code = ValidateCodeUtils.generateValidateCode(6).toString();
+ log.info("验证码:{}", code);
+ //发送短信,让用户接受验证码
+ try {
+ SendEmailUtils.sendAuthCodeEmail(user.getPhone(), code);
+ //把验证码保存到redis,1分钟有效
+ redisTemplate.opsForValue().set(user.getPhone() + ":code", code, 1, TimeUnit.MINUTES);
+ return R.success("验证码发送成功");
+ } catch (EmailException e) {
+ e.printStackTrace();
+ return R.error("验证码发送失败");
+ }
+ }
+
+ //用户登录
+ @PostMapping("/login")
+ public R login(HttpSession session, @RequestBody Map map, HttpServletResponse response){
+ //获取前端传递的数据
+ String phone = (String) map.get("phone");
+ String code = (String) map.get("code");
+ //将前端传来的code与redis中的code比较
+ Object redisCode = redisTemplate.opsForValue().get(phone + ":code");
+ if(redisCode == null){
+ return R.error("验证码过期,请重新发送验证码");
+ }
+ if(code!=null && code.equals(redisCode)){
+ //根据手机号查询用户信息
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(User::getPhone, phone);
+ User user = userService.getOne(lqw);
+ if (user == null) {
+ //用户不存在,注册用户信息
+ user = new User();
+ user.setPhone(phone);
+ user.setStatus(1);
+ userService.save(user);
+ }
+ //将用户id存到session中
+// session.setAttribute("user", user.getId());
+ Cookie cookie = new Cookie("user", String.valueOf(user.getId()));
+ cookie.setPath("/");
+ cookie.setDomain("localhost");
+ cookie.setHttpOnly(true);
+
+ response.addCookie(cookie);
+ System.out.println("cookie['user'] = " + cookie.getValue());
+ //验证码使用之后,从redis中删除
+ redisTemplate.delete(phone + ":code");
+ return R.success("用户登录成功");
+ }
+ return R.error("验证码错误");
+ }
+
+ //用户登出
+ @PostMapping("/loginout")
+ public R logout(HttpServletResponse response){
+ BaseContext.setCurrentId(null);
+ Cookie cookie = new Cookie("user", null);
+ cookie.setPath("/");
+ cookie.setDomain("localhost");
+ cookie.setHttpOnly(true);
+ cookie.setMaxAge(0);
+
+ response.addCookie(cookie);
+ return R.success("退出成功");
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/AddressBookMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/AddressBookMapper.java
new file mode 100644
index 0000000..c7ec0a2
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/AddressBookMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.AddressBook;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 地址管理(AddressBook)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:43
+ */
+@Mapper
+public interface AddressBookMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/CategoryMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/CategoryMapper.java
new file mode 100644
index 0000000..d50b8ef
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/CategoryMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.Category;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 菜品及套餐分类(Category)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:43
+ */
+@Mapper
+public interface CategoryMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/DishFlavorMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/DishFlavorMapper.java
new file mode 100644
index 0000000..c62b99c
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/DishFlavorMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.DishFlavor;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 菜品口味关系表(DishFlavor)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+@Mapper
+public interface DishFlavorMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/DishMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/DishMapper.java
new file mode 100644
index 0000000..409397a
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/DishMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.Dish;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 菜品管理(Dish)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+@Mapper
+public interface DishMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/OrderDetailMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/OrderDetailMapper.java
new file mode 100644
index 0000000..23b78e3
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/OrderDetailMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.OrderDetail;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 订单明细表(OrderDetail)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+@Mapper
+public interface OrderDetailMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/OrdersMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/OrdersMapper.java
new file mode 100644
index 0000000..97f9396
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/OrdersMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.Orders;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 订单表(Orders)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Mapper
+public interface OrdersMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/SetmealDishMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/SetmealDishMapper.java
new file mode 100644
index 0000000..38ac07e
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/SetmealDishMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.SetmealDish;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 套餐菜品关系(SetmealDish)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Mapper
+public interface SetmealDishMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/SetmealMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/SetmealMapper.java
new file mode 100644
index 0000000..1d2ed73
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/SetmealMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.Setmeal;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 套餐(Setmeal)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Mapper
+public interface SetmealMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/ShoppingCartMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/ShoppingCartMapper.java
new file mode 100644
index 0000000..22c7520
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/ShoppingCartMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.ShoppingCart;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 购物车(ShoppingCart)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Mapper
+public interface ShoppingCartMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dao/UserMapper.java b/renren-admin/src/main/java/io/renren/modules/front/dao/UserMapper.java
new file mode 100644
index 0000000..9b757a0
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dao/UserMapper.java
@@ -0,0 +1,15 @@
+package io.renren.modules.front.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import io.renren.modules.front.bean.User;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 用户信息(User)表数据库访问层
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:46
+ */
+@Mapper
+public interface UserMapper extends BaseMapper {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dto/DishDTO.java b/renren-admin/src/main/java/io/renren/modules/front/dto/DishDTO.java
new file mode 100644
index 0000000..45d1e33
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dto/DishDTO.java
@@ -0,0 +1,24 @@
+package io.renren.modules.front.dto;
+
+import io.renren.modules.front.bean.Dish;
+import io.renren.modules.front.bean.DishFlavor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/5/31 - 14:30
+ */
+@Data
+@NoArgsConstructor
+public class DishDTO extends Dish implements Serializable {
+ //口味的集合
+ private List flavors = new ArrayList<>();
+
+ //分类的名称 与前端elementUI的prop属性一致
+ private String categoryName;
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dto/OrdersDTO.java b/renren-admin/src/main/java/io/renren/modules/front/dto/OrdersDTO.java
new file mode 100644
index 0000000..4cbf9cb
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dto/OrdersDTO.java
@@ -0,0 +1,19 @@
+package io.renren.modules.front.dto;
+
+import io.renren.modules.front.bean.OrderDetail;
+import io.renren.modules.front.bean.Orders;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/6/5 - 16:15
+ */
+@Data
+@NoArgsConstructor
+public class OrdersDTO extends Orders implements Serializable {
+ private List orderDetails;
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dto/SetmealDTO.java b/renren-admin/src/main/java/io/renren/modules/front/dto/SetmealDTO.java
new file mode 100644
index 0000000..d908ec5
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dto/SetmealDTO.java
@@ -0,0 +1,22 @@
+package io.renren.modules.front.dto;
+
+import io.renren.modules.front.bean.Setmeal;
+import io.renren.modules.front.bean.SetmealDish;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/6/1 - 11:17
+ */
+@Data
+@NoArgsConstructor
+public class SetmealDTO extends Setmeal implements Serializable {
+ private List setmealDishes = new ArrayList<>();
+
+ private String categoryName;
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/dto/SetmealDishDTO.java b/renren-admin/src/main/java/io/renren/modules/front/dto/SetmealDishDTO.java
new file mode 100644
index 0000000..3965cf3
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/dto/SetmealDishDTO.java
@@ -0,0 +1,17 @@
+package io.renren.modules.front.dto;
+
+import io.renren.modules.front.bean.SetmealDish;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/6/2 - 15:54
+ */
+@Data
+@NoArgsConstructor
+public class SetmealDishDTO extends SetmealDish implements Serializable {
+ private String image;
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/interceptor/LoginFilter.java b/renren-admin/src/main/java/io/renren/modules/front/interceptor/LoginFilter.java
new file mode 100644
index 0000000..b752b6b
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/interceptor/LoginFilter.java
@@ -0,0 +1,82 @@
+package io.renren.modules.front.interceptor;
+
+import com.alibaba.fastjson.JSONObject;
+import io.renren.modules.front.utils.BaseContext;
+import io.renren.modules.front.utils.R;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
+import org.springframework.stereotype.Component;
+import org.springframework.util.AntPathMatcher;
+import org.springframework.util.StringUtils;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/6/13 - 20:09
+ */
+@Slf4j
+@Component
+public class LoginFilter extends BasicHttpAuthenticationFilter {
+ //请求到达控制器之前拦截
+ @Override
+ public boolean preHandle(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception {
+ HttpServletRequest request = (HttpServletRequest) servletRequest;
+ HttpServletResponse response = (HttpServletResponse) servletResponse;
+
+ //设置允许跨域
+ response.setContentType("application/json;charset=UTF-8");
+ String origin = request.getHeader("Origin");
+ if (StringUtils.hasText(origin)){
+ response.setHeader("Access-Control-Allow-Origin", origin);
+ }
+ response.setHeader("Access-Control-Allow-Credentials", "true");
+ response.setHeader("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS");
+ response.setHeader("Access-Control-Allow-Headers", "Content-Type,token");
+
+ //获取当前线程id
+ long id = Thread.currentThread().getId();
+ log.info("LoginFilter >> 线程Id: {}, RequestURI: {}", id, request.getRequestURI());
+ //2.检测是否为前台页面请求
+ if(new AntPathMatcher().match("/api/front/**", request.getRequestURI())){
+
+ //是登录相关请求,直接放行
+ if(new AntPathMatcher().match("/api/front/user/**", request.getRequestURI())){
+ log.info("LoginFilter >> "+request.getRequestURI()+">> 与/api/front/user/**匹配");
+ return true;
+ }
+ //其他前台请求
+ log.info("LoginFilter >> "+request.getRequestURI()+">> 与/api/front/**匹配");
+ //获取cookie['user']
+ String userObj = null;
+ Cookie[] cookies = request.getCookies();
+ log.info(Arrays.toString(cookies));
+ if (cookies != null) {
+ for (Cookie cookie : cookies) {
+ if ("user".equals(cookie.getName())) {
+ userObj = cookie.getValue();
+ }
+ }
+ }
+ log.info("LoginFilter >> "+request.getRequestURI()+" >> cookie['user'] = " + userObj);
+ //判断是否为空
+ if (userObj != null) {
+ log.info("当前用户已经登录,用户id为:{}", userObj);
+ //把userId放入ThreadLocal中
+ BaseContext.setCurrentId(Long.valueOf(userObj));
+ return true;
+ }
+ //未登录,响应数据
+ response.getWriter().write(JSONObject.toJSONString(R.error("NOTLOGIN")));
+ return false;
+ }
+
+ log.info("LoginFilter >> 后台页面请求");
+ return true;
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/AddressBookService.java b/renren-admin/src/main/java/io/renren/modules/front/service/AddressBookService.java
new file mode 100644
index 0000000..310cd9d
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/AddressBookService.java
@@ -0,0 +1,14 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.AddressBook;
+
+/**
+ * 地址管理(AddressBook)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:43
+ */
+public interface AddressBookService extends IService {
+ void defaultAddress(AddressBook addressBook);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/CategoryService.java b/renren-admin/src/main/java/io/renren/modules/front/service/CategoryService.java
new file mode 100644
index 0000000..7c05651
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/CategoryService.java
@@ -0,0 +1,14 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.Category;
+
+/**
+ * 菜品及套餐分类(Category)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+public interface CategoryService extends IService {
+ void removeCateById(Long cateId);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/DishFlavorService.java b/renren-admin/src/main/java/io/renren/modules/front/service/DishFlavorService.java
new file mode 100644
index 0000000..9c8d9f0
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/DishFlavorService.java
@@ -0,0 +1,13 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.DishFlavor;
+
+/**
+ * 菜品口味关系表(DishFlavor)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+public interface DishFlavorService extends IService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/DishService.java b/renren-admin/src/main/java/io/renren/modules/front/service/DishService.java
new file mode 100644
index 0000000..b7ad566
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/DishService.java
@@ -0,0 +1,17 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.Dish;
+import io.renren.modules.front.dto.DishDTO;
+
+/**
+ * 菜品管理(Dish)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+public interface DishService extends IService {
+ void saveDishFlavor(DishDTO dishDTO);
+
+ void updateDishFlavor(DishDTO dishDTO);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/OrderDetailService.java b/renren-admin/src/main/java/io/renren/modules/front/service/OrderDetailService.java
new file mode 100644
index 0000000..f9bd78b
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/OrderDetailService.java
@@ -0,0 +1,13 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.OrderDetail;
+
+/**
+ * 订单明细表(OrderDetail)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+public interface OrderDetailService extends IService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/OrdersService.java b/renren-admin/src/main/java/io/renren/modules/front/service/OrdersService.java
new file mode 100644
index 0000000..3976cc6
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/OrdersService.java
@@ -0,0 +1,19 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.Orders;
+import io.renren.modules.front.dto.OrdersDTO;
+
+/**
+ * 订单表(Orders)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+public interface OrdersService extends IService {
+ Orders addOrder(Orders orders);
+
+ Page getUserPage(Integer page, Integer pageSize, LambdaQueryWrapper lqw);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/SetmealDishService.java b/renren-admin/src/main/java/io/renren/modules/front/service/SetmealDishService.java
new file mode 100644
index 0000000..aac3145
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/SetmealDishService.java
@@ -0,0 +1,13 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.SetmealDish;
+
+/**
+ * 套餐菜品关系(SetmealDish)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+public interface SetmealDishService extends IService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/SetmealService.java b/renren-admin/src/main/java/io/renren/modules/front/service/SetmealService.java
new file mode 100644
index 0000000..2b30df6
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/SetmealService.java
@@ -0,0 +1,16 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.Setmeal;
+
+/**
+ * 套餐(Setmeal)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+public interface SetmealService extends IService {
+// void saveSetmealDish(SetmealDTO setmealDTO);
+//
+// void updateSetmealDish(SetmealDTO setmealDTO);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/ShoppingCartService.java b/renren-admin/src/main/java/io/renren/modules/front/service/ShoppingCartService.java
new file mode 100644
index 0000000..caecc8f
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/ShoppingCartService.java
@@ -0,0 +1,16 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.ShoppingCart;
+
+/**
+ * 购物车(ShoppingCart)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+public interface ShoppingCartService extends IService {
+ ShoppingCart add(ShoppingCart shoppingCart);
+
+ ShoppingCart sub(ShoppingCart cart);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/UserService.java b/renren-admin/src/main/java/io/renren/modules/front/service/UserService.java
new file mode 100644
index 0000000..d1a9c59
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/UserService.java
@@ -0,0 +1,13 @@
+package io.renren.modules.front.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import io.renren.modules.front.bean.User;
+
+/**
+ * 用户信息(User)表服务接口
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:46
+ */
+public interface UserService extends IService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/AddressBookServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/AddressBookServiceImpl.java
new file mode 100644
index 0000000..cb665c1
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/AddressBookServiceImpl.java
@@ -0,0 +1,32 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.AddressBook;
+import io.renren.modules.front.dao.AddressBookMapper;
+import io.renren.modules.front.service.AddressBookService;
+import io.renren.modules.front.utils.BaseContext;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 地址管理(AddressBook)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:43
+ */
+@Service(value = "addressBookServiceImplFront")
+@Transactional
+public class AddressBookServiceImpl extends ServiceImpl implements AddressBookService {
+ @Override
+ public void defaultAddress(AddressBook addressBook) {
+ //把当前登录用户的所有地址的默认值改为0
+ LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+ luw.eq(AddressBook::getUserId, BaseContext.getCurrentId()).set(AddressBook::getIsDefault, 0);
+ this.update(luw);
+ //把当前登录用户的当前地址的默认值改为1
+ LambdaUpdateWrapper luw1 = new LambdaUpdateWrapper<>();
+ luw1.eq(AddressBook::getId, addressBook.getId()).set(AddressBook::getIsDefault, 1);
+ this.update(luw1);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/CategoryServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/CategoryServiceImpl.java
new file mode 100644
index 0000000..3ba5fb7
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/CategoryServiceImpl.java
@@ -0,0 +1,51 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.Category;
+import io.renren.modules.front.bean.Dish;
+import io.renren.modules.front.bean.Setmeal;
+import io.renren.modules.front.common.CustomException;
+import io.renren.modules.front.dao.CategoryMapper;
+import io.renren.modules.front.service.CategoryService;
+import io.renren.modules.front.service.DishService;
+import io.renren.modules.front.service.SetmealService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 菜品及套餐分类(Category)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+@Service(value = "categoryServiceImplFront")
+@Transactional
+public class CategoryServiceImpl extends ServiceImpl implements CategoryService {
+
+ @Autowired
+ private DishService dishService;
+ @Autowired
+ private SetmealService setmealService;
+
+ @Override
+ public void removeCateById(Long cateId) {
+ //判断当前分类下,是否有菜品信息,如果有则不能删除
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(Dish::getCategoryId, cateId);
+ long dishCount = dishService.count(lqw);
+ if (dishCount > 0) {
+ throw new CustomException("当前分类下有菜品信息,不能删除!");
+ }
+ //判断当前分类下,是否有套餐信息,如果有则不能删除
+ LambdaQueryWrapper lqw1 = new LambdaQueryWrapper<>();
+ lqw1.eq(Setmeal::getCategoryId, cateId);
+ long setmealCount = setmealService.count(lqw1);
+ if(setmealCount > 0){
+ throw new CustomException("当前分类下有套餐信息,不能删除!");
+ }
+ //删除当前分类信息
+ this.removeById(cateId);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/DishFlavorServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/DishFlavorServiceImpl.java
new file mode 100644
index 0000000..c0f3dee
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/DishFlavorServiceImpl.java
@@ -0,0 +1,19 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.DishFlavor;
+import io.renren.modules.front.dao.DishFlavorMapper;
+import io.renren.modules.front.service.DishFlavorService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 菜品口味关系表(DishFlavor)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+@Service(value = "dishFlavorServiceImplFront")
+@Transactional
+public class DishFlavorServiceImpl extends ServiceImpl implements DishFlavorService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/DishServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/DishServiceImpl.java
new file mode 100644
index 0000000..f572d0a
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/DishServiceImpl.java
@@ -0,0 +1,58 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.Dish;
+import io.renren.modules.front.bean.DishFlavor;
+import io.renren.modules.front.dao.DishMapper;
+import io.renren.modules.front.dto.DishDTO;
+import io.renren.modules.front.service.DishFlavorService;
+import io.renren.modules.front.service.DishService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 菜品管理(Dish)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+@Service(value = "dishServiceImplFront")
+@Transactional
+public class DishServiceImpl extends ServiceImpl implements DishService {
+ @Autowired
+ private DishFlavorService dishFlavorService;
+
+ @Override
+ public void saveDishFlavor(DishDTO dishDTO) {
+ //封装菜品信息,保存
+ this.save(dishDTO);
+ //封装口味信息
+ List flavorList = dishDTO.getFlavors().stream().map(dishFlavor -> {
+ dishFlavor.setDishId(dishDTO.getId());
+ return dishFlavor;
+ }).collect(Collectors.toList());
+ //批量保存数据
+ dishFlavorService.saveBatch(flavorList);
+ }
+
+ @Override
+ public void updateDishFlavor(DishDTO dishDTO){
+ //保存修改的菜品信息
+ this.updateById(dishDTO);
+ //删除旧口味数据
+ LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+ luw.eq(DishFlavor::getDishId, dishDTO.getId());
+ dishFlavorService.remove(luw);
+ //保存新口味
+ List flavorList = dishDTO.getFlavors().stream().map(dishFlavor -> {
+ dishFlavor.setDishId(dishDTO.getId());
+ return dishFlavor;
+ }).collect(Collectors.toList());
+ dishFlavorService.saveBatch(flavorList);
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/OrderDetailServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/OrderDetailServiceImpl.java
new file mode 100644
index 0000000..a73274b
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/OrderDetailServiceImpl.java
@@ -0,0 +1,17 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.OrderDetail;
+import io.renren.modules.front.dao.OrderDetailMapper;
+import io.renren.modules.front.service.OrderDetailService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 订单明细表(OrderDetail)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:44
+ */
+@Service(value = "orderDetailServiceImplFront")
+public class OrderDetailServiceImpl extends ServiceImpl implements OrderDetailService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/OrdersServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/OrdersServiceImpl.java
new file mode 100644
index 0000000..2f3d09d
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/OrdersServiceImpl.java
@@ -0,0 +1,115 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.*;
+import io.renren.modules.front.common.CustomException;
+import io.renren.modules.front.dao.OrdersMapper;
+import io.renren.modules.front.dto.OrdersDTO;
+import io.renren.modules.front.service.*;
+import io.renren.modules.front.utils.BaseContext;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+/**
+ * 订单表(Orders)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Service(value = "ordersServiceImplFront")
+public class OrdersServiceImpl extends ServiceImpl implements OrdersService {
+
+ @Autowired
+ private UserService userService;
+ @Autowired
+ private AddressBookService addressBookService;
+ @Autowired
+ private ShoppingCartService shoppingCartService;
+ @Autowired
+ private OrderDetailService orderDetailService;
+
+ @Override
+ public Orders addOrder(Orders orders) {
+ //1.查询用户信息
+ User user = userService.getById(BaseContext.getCurrentId());
+ //2.查询地址信息
+ AddressBook addressBook = addressBookService.getById(orders.getAddressBookId());
+ //3.保存订单明细的数据
+ //3-1.生成订单id
+ long orderId = IdWorker.getId();
+ //3-2.查询购物车数据
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ShoppingCart::getUserId, BaseContext.getCurrentId());
+ List shoppingCartList = shoppingCartService.list(lqw);
+ if (CollectionUtils.isEmpty(shoppingCartList)) {
+ throw new CustomException("当前购物车信息为空,无法下单");
+ }
+ //3-3.计算总金额-考虑多线程并发安全的问题
+ //AtomInteger:提供了原子性的计算操作
+ AtomicInteger amount = new AtomicInteger();
+ //3-4.遍历购物车集合,构建订单明细数据
+ List orderDetailList = shoppingCartList.stream().map(cart -> {
+ //总金额 += 数量*单价
+ amount.addAndGet(cart.getAmount()
+ .multiply(new BigDecimal(cart.getNumber())).intValue());
+ OrderDetail orderDetail = new OrderDetail();
+ orderDetail.setOrderId(orderId);
+ BeanUtils.copyProperties(cart, orderDetail);
+ return orderDetail;
+ }).collect(Collectors.toList());
+ //4.封装订单表的数据
+ Orders order = new Orders();
+ order.setNumber(String.valueOf(orderId));
+ order.setStatus(1);
+ order.setUserId(user.getId());
+ order.setAddressBookId(orders.getAddressBookId());
+ order.setOrderTime(LocalDateTime.now());
+ order.setPayMethod(2);
+ order.setAmount(new BigDecimal(amount.get()));
+ order.setRemark(orders.getRemark());
+ order.setPhone(addressBook.getPhone());
+ order.setAddress(addressBook.getDetail());
+ order.setUserName(user.getName());
+ order.setConsignee(addressBook.getConsignee());
+ //5.保存订单数据
+ this.save(order);
+ //6.保存订单明细苏剧
+ orderDetailService.saveBatch(orderDetailList);
+ //7.清空购物车数据
+ shoppingCartService.remove(lqw);
+ return order;
+ }
+
+ @Override
+ public Page getUserPage(Integer page, Integer pageSize, LambdaQueryWrapper lqw) {
+ Page ordersPage = this.page(new Page<>(page, pageSize), lqw);
+ List dtoList = ordersPage.getRecords().stream().map(orders -> {
+ OrdersDTO ordersDTO = new OrdersDTO();
+ LambdaQueryWrapper qw = new LambdaQueryWrapper<>();
+ qw.eq(OrderDetail::getOrderId, orders.getNumber());
+ List detailList = orderDetailService.list(qw);
+
+ BeanUtils.copyProperties(orders, ordersDTO);
+ ordersDTO.setOrderDetails(detailList);
+ return ordersDTO;
+ }).collect(Collectors.toList());
+
+ Page dtoPage = new Page<>();
+ BeanUtils.copyProperties(ordersPage, dtoPage, "records");
+ dtoPage.setRecords(dtoList);
+ return dtoPage;
+ }
+
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/SetmealDishServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/SetmealDishServiceImpl.java
new file mode 100644
index 0000000..f486fb1
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/SetmealDishServiceImpl.java
@@ -0,0 +1,17 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.SetmealDish;
+import io.renren.modules.front.dao.SetmealDishMapper;
+import io.renren.modules.front.service.SetmealDishService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 套餐菜品关系(SetmealDish)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Service(value = "setmealDishServiceImplFront")
+public class SetmealDishServiceImpl extends ServiceImpl implements SetmealDishService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/SetmealServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/SetmealServiceImpl.java
new file mode 100644
index 0000000..46ea014
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/SetmealServiceImpl.java
@@ -0,0 +1,55 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.Setmeal;
+import io.renren.modules.front.bean.SetmealDish;
+import io.renren.modules.front.dao.SetmealMapper;
+import io.renren.modules.front.service.SetmealDishService;
+import io.renren.modules.front.service.SetmealService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 套餐(Setmeal)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Service(value = "setmealServiceImplFront")
+public class SetmealServiceImpl extends ServiceImpl implements SetmealService {
+
+// @Autowired
+// private SetmealDishService setmealDishService;
+//
+// @Override
+// public void saveSetmealDish(SetmealDTO setmealDTO) {
+// //保存套餐信息
+// this.save(setmealDTO);
+// //保存套餐菜品信息
+// List list = setmealDTO.getSetmealDishes().stream().map(setmealDish -> {
+// setmealDish.setSetmealId(String.valueOf(setmealDTO.getId()));
+// return setmealDish;
+// }).collect(Collectors.toList());
+// setmealDishService.saveBatch(list);
+// }
+//
+// @Override
+// public void updateSetmealDish(SetmealDTO setmealDTO) {
+// //保存套餐信息
+// this.updateById(setmealDTO);
+// //清空原有菜品信息
+// LambdaUpdateWrapper luw = new LambdaUpdateWrapper<>();
+// luw.eq(SetmealDish::getSetmealId, setmealDTO.getId());
+// setmealDishService.remove(luw);
+// //保存套餐新菜品信息
+// List list = setmealDTO.getSetmealDishes().stream().map(setmealDish -> {
+// setmealDish.setSetmealId(String.valueOf(setmealDTO.getId()));
+// return setmealDish;
+// }).collect(Collectors.toList());
+// setmealDishService.saveBatch(list);
+// }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/ShoppingCartServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/ShoppingCartServiceImpl.java
new file mode 100644
index 0000000..39ca960
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/ShoppingCartServiceImpl.java
@@ -0,0 +1,71 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.ShoppingCart;
+import io.renren.modules.front.dao.ShoppingCartMapper;
+import io.renren.modules.front.service.ShoppingCartService;
+import io.renren.modules.front.utils.BaseContext;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+
+/**
+ * 购物车(ShoppingCart)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:45
+ */
+@Service(value = "shoppingCartServiceImplFront")
+public class ShoppingCartServiceImpl extends ServiceImpl implements ShoppingCartService {
+ @Override
+ public ShoppingCart add(ShoppingCart shoppingCart) {
+ //查询当前购物车的菜品/套餐是否在数据库存在
+ //若存在则number+1,否则添加到购物车表中
+ //1.1.查询当前用户的购物车信息
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ShoppingCart::getUserId, BaseContext.getCurrentId());
+ //1.2.判断查询的是菜品还是套餐
+ Long dishId = shoppingCart.getDishId();
+ if(dishId != null){
+ lqw.eq(ShoppingCart::getDishId, dishId);
+ } else {
+ lqw.eq(ShoppingCart::getSetmealId, shoppingCart.getSetmealId());
+ }
+ //1.3.执行查询
+ ShoppingCart cart = this.getOne(lqw);
+ //2 如果存在,数量+1
+ if(cart != null){
+ cart.setNumber(cart.getNumber()+1);
+ this.updateById(cart);
+ } else {
+ //3 不存在,添加到购物车表中
+ shoppingCart.setCreateDate(LocalDateTime.now());
+ shoppingCart.setUserId(BaseContext.getCurrentId());
+ shoppingCart.setNumber(1);
+ this.save(shoppingCart);
+ cart = shoppingCart;
+ }
+ return cart;
+ }
+
+ @Override
+ public ShoppingCart sub(ShoppingCart cart) {
+ //查询菜品/套餐的购物车数据
+ LambdaQueryWrapper lqw = new LambdaQueryWrapper<>();
+ lqw.eq(ShoppingCart::getUserId, BaseContext.getCurrentId());
+ if(cart.getDishId() != null){
+ lqw.eq(ShoppingCart::getDishId, cart.getDishId());
+ } else {
+ lqw.eq(ShoppingCart::getSetmealId, cart.getSetmealId());
+ }
+ ShoppingCart shoppingCart = this.getOne(lqw);
+ //修改数量
+ if(shoppingCart.getNumber() == 1){
+ this.removeById(shoppingCart);
+ }
+ shoppingCart.setNumber(shoppingCart.getNumber()-1);
+ this.updateById(shoppingCart);
+ return shoppingCart;
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/service/impl/UserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/front/service/impl/UserServiceImpl.java
new file mode 100644
index 0000000..3d5197c
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/service/impl/UserServiceImpl.java
@@ -0,0 +1,17 @@
+package io.renren.modules.front.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.renren.modules.front.bean.User;
+import io.renren.modules.front.dao.UserMapper;
+import io.renren.modules.front.service.UserService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 用户信息(User)表服务实现类
+ *
+ * @author 张宇轩
+ * @since 2023-05-29 11:08:46
+ */
+@Service(value = "userServiceImplFront")
+public class UserServiceImpl extends ServiceImpl implements UserService {
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/utils/BaseContext.java b/renren-admin/src/main/java/io/renren/modules/front/utils/BaseContext.java
new file mode 100644
index 0000000..31e789e
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/utils/BaseContext.java
@@ -0,0 +1,24 @@
+package io.renren.modules.front.utils;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/5/30 - 15:51
+ * 基于ThreadLocal封装工具类,用户保存和获取当前登录用户id
+ */
+public class BaseContext {
+ private static ThreadLocal threadLocal = new ThreadLocal<>();
+ /**
+ * 设置值
+ * @param id
+ */
+ public static void setCurrentId(Long id){
+ threadLocal.set(id);
+ }
+ /**
+ * 获取值
+ * @return
+ */
+ public static Long getCurrentId(){
+ return threadLocal.get();
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/utils/R.java b/renren-admin/src/main/java/io/renren/modules/front/utils/R.java
new file mode 100644
index 0000000..57b388a
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/utils/R.java
@@ -0,0 +1,35 @@
+package io.renren.modules.front.utils;
+
+import lombok.Data;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 通用返回结果,服务端响应的数据最终都会封装成此对象
+ * @param
+ */
+@Data
+public class R {
+ private Integer code; //编码:1成功,0和其它数字为失败
+ private String msg; //错误信息
+ private T data; //数据
+ private Map map = new HashMap(); //动态数据
+
+ public static R success(T object) {
+ R r = new R();
+ r.data = object;
+ r.code = 1;
+ return r;
+ }
+ public static R error(String msg) {
+ R r = new R();
+ r.msg = msg;
+ r.code = 0;
+ return r;
+ }
+ public R add(String key, Object value) {
+ this.map.put(key, value);
+ return this;
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/front/utils/SendEmailUtils.java b/renren-admin/src/main/java/io/renren/modules/front/utils/SendEmailUtils.java
new file mode 100644
index 0000000..8b74cbd
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/utils/SendEmailUtils.java
@@ -0,0 +1,53 @@
+package io.renren.modules.front.utils;
+
+import org.apache.commons.mail.EmailException;
+import org.apache.commons.mail.HtmlEmail;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/1/19 - 15:43
+ */
+@Component
+public class SendEmailUtils {
+ private static String userName;
+ private static String password;
+
+ @Value("${email.userName}")
+ public void setUserName(String userName) {
+ SendEmailUtils.userName = userName;
+ }
+
+ @Value("${email.password}")
+ public void setPassword(String password) {
+ SendEmailUtils.password = password;
+ }
+
+
+ /**
+ * 发送验证码
+ * @param email 接收邮箱
+ * @param code 验证码
+ */
+ public static void sendAuthCodeEmail(String email,String code) throws EmailException {
+ HtmlEmail mail = new HtmlEmail();
+ /*发送邮件的服务器 126邮箱为smtp.126.com,163邮箱为163.smtp.com,QQ为smtp.qq.com*/
+ mail.setHostName("smtp.qq.com");
+ /*不设置发送的消息有可能是乱码*/
+ mail.setCharset("UTF-8");
+ /*IMAP/SMTP服务的密码 username为你开启发送验证码功能的邮箱号 password为你在qq邮箱获取到的一串字符串*/
+ mail.setAuthentication(userName, password);
+ /*发送邮件的邮箱和发件人*/
+ mail.setFrom(userName, "美食元素");
+ /*使用安全链接*/
+ mail.setSSLOnConnect(true);
+ /*接收的邮箱*/
+ mail.addTo(email);
+ /*设置邮件的主题*/
+ mail.setSubject("登录验证码");
+ /*设置邮件的内容*/
+ mail.setMsg("尊敬的用户:你好! 登录验证码为:" + code + "(有效期为一分钟)");
+ mail.send();//发送
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/front/utils/ValidateCodeUtils.java b/renren-admin/src/main/java/io/renren/modules/front/utils/ValidateCodeUtils.java
new file mode 100644
index 0000000..645e3d2
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/front/utils/ValidateCodeUtils.java
@@ -0,0 +1,43 @@
+package io.renren.modules.front.utils;
+
+import java.util.Random;
+
+/**
+ * 随机生成验证码工具类
+ */
+public class ValidateCodeUtils {
+ /**
+ * 随机生成验证码
+ * @param length 长度为4位或者6位
+ * @return
+ */
+ public static Integer generateValidateCode(int length){
+ Integer code =null;
+ if(length == 4){
+ code = new Random().nextInt(9999);//生成随机数,最大为9999
+ if(code < 1000){
+ code = code + 1000;//保证随机数为4位数字
+ }
+ }else if(length == 6){
+ code = new Random().nextInt(999999);//生成随机数,最大为999999
+ if(code < 100000){
+ code = code + 100000;//保证随机数为6位数字
+ }
+ }else{
+ throw new RuntimeException("只能生成4位或6位数字验证码");
+ }
+ return code;
+ }
+
+ /**
+ * 随机生成指定长度字符串验证码
+ * @param length 长度
+ * @return
+ */
+ public static String generateValidateCode4String(int length){
+ Random rdm = new Random();
+ String hash1 = Integer.toHexString(rdm.nextInt());
+ String capstr = hash1.substring(0, length);
+ return capstr;
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/config/ScheduleConfig.java b/renren-admin/src/main/java/io/renren/modules/job/config/ScheduleConfig.java
new file mode 100644
index 0000000..284d180
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/config/ScheduleConfig.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+
+import javax.sql.DataSource;
+import java.util.Properties;
+
+/**
+ * 定时任务配置
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Configuration
+public class ScheduleConfig {
+
+ @Bean
+ public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) {
+ SchedulerFactoryBean factory = new SchedulerFactoryBean();
+ factory.setDataSource(dataSource);
+
+ //quartz参数
+ Properties prop = new Properties();
+ prop.put("org.quartz.scheduler.instanceName", "RenrenScheduler");
+ prop.put("org.quartz.scheduler.instanceId", "AUTO");
+ //线程池配置
+ prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
+ prop.put("org.quartz.threadPool.threadCount", "20");
+ prop.put("org.quartz.threadPool.threadPriority", "5");
+ //JobStore配置
+ prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
+ //集群配置
+ prop.put("org.quartz.jobStore.isClustered", "true");
+ prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
+ prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
+
+ prop.put("org.quartz.jobStore.misfireThreshold", "12000");
+ prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
+ prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
+
+ //PostgreSQL数据库,需要打开此注释
+ //prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate");
+
+ factory.setQuartzProperties(prop);
+
+ factory.setSchedulerName("RenrenScheduler");
+ //延时启动
+ factory.setStartupDelay(30);
+ factory.setApplicationContextSchedulerContextKey("applicationContextKey");
+ //可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
+ factory.setOverwriteExistingJobs(true);
+ //设置自动启动,默认为true
+ factory.setAutoStartup(true);
+
+ return factory;
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/controller/ScheduleJobController.java b/renren-admin/src/main/java/io/renren/modules/job/controller/ScheduleJobController.java
new file mode 100644
index 0000000..fcb1566
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/controller/ScheduleJobController.java
@@ -0,0 +1,133 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.controller;
+
+import io.renren.common.annotation.LogOperation;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.utils.Result;
+import io.renren.common.validator.ValidatorUtils;
+import io.renren.common.validator.group.AddGroup;
+import io.renren.common.validator.group.DefaultGroup;
+import io.renren.common.validator.group.UpdateGroup;
+import io.renren.modules.job.dto.ScheduleJobDTO;
+import io.renren.modules.job.service.ScheduleJobService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.Map;
+
+/**
+ * 定时任务
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@RestController
+@RequestMapping("/sys/schedule")
+@Api(tags="定时任务")
+public class ScheduleJobController {
+ @Autowired
+ private ScheduleJobService scheduleJobService;
+
+ @GetMapping("page")
+ @ApiOperation("分页")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = "beanName", value = "beanName", paramType = "query", dataType="String")
+ })
+ @RequiresPermissions("sys:schedule:page")
+ public Result> page(@ApiIgnore @RequestParam Map params){
+ PageData page = scheduleJobService.page(params);
+
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ @ApiOperation("信息")
+ @RequiresPermissions("sys:schedule:info")
+ public Result info(@PathVariable("id") Long id){
+ ScheduleJobDTO schedule = scheduleJobService.get(id);
+
+ return new Result().ok(schedule);
+ }
+
+ @PostMapping
+ @ApiOperation("保存")
+ @LogOperation("保存")
+ @RequiresPermissions("sys:schedule:save")
+ public Result save(@RequestBody ScheduleJobDTO dto){
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+
+ scheduleJobService.save(dto);
+
+ return new Result();
+ }
+
+ @PutMapping
+ @ApiOperation("修改")
+ @LogOperation("修改")
+ @RequiresPermissions("sys:schedule:update")
+ public Result update(@RequestBody ScheduleJobDTO dto){
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+
+ scheduleJobService.update(dto);
+
+ return new Result();
+ }
+
+ @DeleteMapping
+ @ApiOperation("删除")
+ @LogOperation("删除")
+ @RequiresPermissions("sys:schedule:delete")
+ public Result delete(@RequestBody Long[] ids){
+ scheduleJobService.deleteBatch(ids);
+
+ return new Result();
+ }
+
+ @PutMapping("/run")
+ @ApiOperation("立即执行")
+ @LogOperation("立即执行")
+ @RequiresPermissions("sys:schedule:run")
+ public Result run(@RequestBody Long[] ids){
+ scheduleJobService.run(ids);
+
+ return new Result();
+ }
+
+ @PutMapping("/pause")
+ @ApiOperation("暂停")
+ @LogOperation("暂停")
+ @RequiresPermissions("sys:schedule:pause")
+ public Result pause(@RequestBody Long[] ids){
+ scheduleJobService.pause(ids);
+
+ return new Result();
+ }
+
+ @PutMapping("/resume")
+ @ApiOperation("恢复")
+ @LogOperation("恢复")
+ @RequiresPermissions("sys:schedule:resume")
+ public Result resume(@RequestBody Long[] ids){
+ scheduleJobService.resume(ids);
+
+ return new Result();
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/controller/ScheduleJobLogController.java b/renren-admin/src/main/java/io/renren/modules/job/controller/ScheduleJobLogController.java
new file mode 100644
index 0000000..6d3c8da
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/controller/ScheduleJobLogController.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.controller;
+
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.utils.Result;
+import io.renren.modules.job.dto.ScheduleJobLogDTO;
+import io.renren.modules.job.service.ScheduleJobLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.Map;
+
+/**
+ * 定时任务日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@RestController
+@RequestMapping("/sys/scheduleLog")
+@Api(tags="定时任务日志")
+public class ScheduleJobLogController {
+ @Autowired
+ private ScheduleJobLogService scheduleJobLogService;
+
+ @GetMapping("page")
+ @ApiOperation("分页")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = "jobId", value = "jobId", paramType = "query", dataType="String")
+ })
+ @RequiresPermissions("sys:schedule:log")
+ public Result> page(@ApiIgnore @RequestParam Map params){
+ PageData page = scheduleJobLogService.page(params);
+
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ @ApiOperation("信息")
+ @RequiresPermissions("sys:schedule:log")
+ public Result info(@PathVariable("id") Long id){
+ ScheduleJobLogDTO log = scheduleJobLogService.get(id);
+
+ return new Result().ok(log);
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/dao/ScheduleJobDao.java b/renren-admin/src/main/java/io/renren/modules/job/dao/ScheduleJobDao.java
new file mode 100644
index 0000000..c5e6f91
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/dao/ScheduleJobDao.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.dao;
+
+import io.renren.common.dao.BaseDao;
+import io.renren.modules.job.entity.ScheduleJobEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.Map;
+
+/**
+ * 定时任务
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Mapper
+public interface ScheduleJobDao extends BaseDao {
+
+ /**
+ * 批量更新状态
+ */
+ int updateBatch(Map map);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/dao/ScheduleJobLogDao.java b/renren-admin/src/main/java/io/renren/modules/job/dao/ScheduleJobLogDao.java
new file mode 100644
index 0000000..9c46eb3
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/dao/ScheduleJobLogDao.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.dao;
+
+import io.renren.common.dao.BaseDao;
+import io.renren.modules.job.entity.ScheduleJobLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 定时任务日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Mapper
+public interface ScheduleJobLogDao extends BaseDao {
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/dto/ScheduleJobDTO.java b/renren-admin/src/main/java/io/renren/modules/job/dto/ScheduleJobDTO.java
new file mode 100644
index 0000000..7ca4a22
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/dto/ScheduleJobDTO.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.renren.common.validator.group.AddGroup;
+import io.renren.common.validator.group.DefaultGroup;
+import io.renren.common.validator.group.UpdateGroup;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.hibernate.validator.constraints.Range;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Null;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 定时任务
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@ApiModel(value = "定时任务")
+public class ScheduleJobDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "id")
+ @Null(message="{id.null}", groups = AddGroup.class)
+ @NotNull(message="{id.require}", groups = UpdateGroup.class)
+ private Long id;
+
+ @ApiModelProperty(value = "spring bean名称")
+ @NotBlank(message = "{schedule.bean.require}", groups = DefaultGroup.class)
+ private String beanName;
+
+ @ApiModelProperty(value = "参数")
+ private String params;
+
+ @ApiModelProperty(value = "cron表达式")
+ @NotBlank(message = "{schedule.cron.require}", groups = DefaultGroup.class)
+ private String cronExpression;
+
+ @ApiModelProperty(value = "任务状态 0:暂停 1:正常")
+ @Range(min=0, max=1, message = "{schedule.status.range}", groups = DefaultGroup.class)
+ private Integer status;
+
+ @ApiModelProperty(value = "备注")
+ private String remark;
+
+ @ApiModelProperty(value = "创建时间")
+ @JsonProperty(access = JsonProperty.Access.READ_ONLY)
+ private Date createDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/dto/ScheduleJobLogDTO.java b/renren-admin/src/main/java/io/renren/modules/job/dto/ScheduleJobLogDTO.java
new file mode 100644
index 0000000..0a2459a
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/dto/ScheduleJobLogDTO.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 定时任务日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@ApiModel(value = "定时任务日志")
+public class ScheduleJobLogDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "id")
+ private Long id;
+
+ @ApiModelProperty(value = "任务id")
+ private Long jobId;
+
+ @ApiModelProperty(value = "spring bean名称")
+ private String beanName;
+
+ @ApiModelProperty(value = "参数")
+ private String params;
+
+ @ApiModelProperty(value = "任务状态 0:失败 1:成功")
+ private Integer status;
+
+ @ApiModelProperty(value = "失败信息")
+ private String error;
+
+ @ApiModelProperty(value = "耗时(单位:毫秒)")
+ private Integer times;
+
+ @ApiModelProperty(value = "创建时间")
+ private Date createDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/entity/ScheduleJobEntity.java b/renren-admin/src/main/java/io/renren/modules/job/entity/ScheduleJobEntity.java
new file mode 100644
index 0000000..7c584bd
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/entity/ScheduleJobEntity.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.renren.common.entity.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 定时任务
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("schedule_job")
+public class ScheduleJobEntity extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * spring bean名称
+ */
+ private String beanName;
+ /**
+ * 参数
+ */
+ private String params;
+ /**
+ * cron表达式
+ */
+ private String cronExpression;
+ /**
+ * 任务状态 0:暂停 1:正常
+ */
+ private Integer status;
+ /**
+ * 备注
+ */
+ private String remark;
+ /**
+ * 更新者
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Long updater;
+ /**
+ * 更新时间
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Date updateDate;
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/entity/ScheduleJobLogEntity.java b/renren-admin/src/main/java/io/renren/modules/job/entity/ScheduleJobLogEntity.java
new file mode 100644
index 0000000..0d4c9eb
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/entity/ScheduleJobLogEntity.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 定时任务日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Data
+@TableName("schedule_job_log")
+public class ScheduleJobLogEntity implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * id
+ */
+ @TableId
+ private Long id;
+ /**
+ * 任务id
+ */
+ private Long jobId;
+ /**
+ * spring bean名称
+ */
+ private String beanName;
+ /**
+ * 参数
+ */
+ private String params;
+ /**
+ * 任务状态 0:失败 1:成功
+ */
+ private Integer status;
+ /**
+ * 失败信息
+ */
+ private String error;
+ /**
+ * 耗时(单位:毫秒)
+ */
+ private Integer times;
+ /**
+ * 创建时间
+ */
+ private Date createDate;
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/init/JobCommandLineRunner.java b/renren-admin/src/main/java/io/renren/modules/job/init/JobCommandLineRunner.java
new file mode 100644
index 0000000..eb79ee8
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/init/JobCommandLineRunner.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.init;
+
+import io.renren.modules.job.dao.ScheduleJobDao;
+import io.renren.modules.job.entity.ScheduleJobEntity;
+import io.renren.modules.job.utils.ScheduleUtils;
+import org.quartz.CronTrigger;
+import org.quartz.Scheduler;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 初始化定时任务数据
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Component
+public class JobCommandLineRunner implements CommandLineRunner {
+ @Autowired
+ private Scheduler scheduler;
+ @Autowired
+ private ScheduleJobDao scheduleJobDao;
+
+ @Override
+ public void run(String... args) {
+ List scheduleJobList = scheduleJobDao.selectList(null);
+ for(ScheduleJobEntity scheduleJob : scheduleJobList){
+ CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getId());
+ //如果不存在,则创建
+ if(cronTrigger == null) {
+ ScheduleUtils.createScheduleJob(scheduler, scheduleJob);
+ }else {
+ ScheduleUtils.updateScheduleJob(scheduler, scheduleJob);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/service/ScheduleJobLogService.java b/renren-admin/src/main/java/io/renren/modules/job/service/ScheduleJobLogService.java
new file mode 100644
index 0000000..8c4e5bb
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/service/ScheduleJobLogService.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.service;
+
+import io.renren.common.page.PageData;
+import io.renren.common.service.BaseService;
+import io.renren.modules.job.dto.ScheduleJobLogDTO;
+import io.renren.modules.job.entity.ScheduleJobLogEntity;
+
+import java.util.Map;
+
+/**
+ * 定时任务日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public interface ScheduleJobLogService extends BaseService {
+
+ PageData page(Map params);
+
+ ScheduleJobLogDTO get(Long id);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/service/ScheduleJobService.java b/renren-admin/src/main/java/io/renren/modules/job/service/ScheduleJobService.java
new file mode 100644
index 0000000..970f8c8
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/service/ScheduleJobService.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.service;
+
+import io.renren.common.page.PageData;
+import io.renren.common.service.BaseService;
+import io.renren.modules.job.dto.ScheduleJobDTO;
+import io.renren.modules.job.entity.ScheduleJobEntity;
+
+import java.util.Map;
+
+/**
+ * 定时任务
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public interface ScheduleJobService extends BaseService {
+
+ PageData page(Map params);
+
+ ScheduleJobDTO get(Long id);
+
+ /**
+ * 保存定时任务
+ */
+ void save(ScheduleJobDTO dto);
+
+ /**
+ * 更新定时任务
+ */
+ void update(ScheduleJobDTO dto);
+
+ /**
+ * 批量删除定时任务
+ */
+ void deleteBatch(Long[] ids);
+
+ /**
+ * 批量更新定时任务状态
+ */
+ int updateBatch(Long[] ids, int status);
+
+ /**
+ * 立即执行
+ */
+ void run(Long[] ids);
+
+ /**
+ * 暂停运行
+ */
+ void pause(Long[] ids);
+
+ /**
+ * 恢复运行
+ */
+ void resume(Long[] ids);
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/job/service/impl/ScheduleJobLogServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/job/service/impl/ScheduleJobLogServiceImpl.java
new file mode 100644
index 0000000..9a2cc08
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/service/impl/ScheduleJobLogServiceImpl.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.service.impl.BaseServiceImpl;
+import io.renren.common.utils.ConvertUtils;
+import io.renren.modules.job.dao.ScheduleJobLogDao;
+import io.renren.modules.job.dto.ScheduleJobLogDTO;
+import io.renren.modules.job.entity.ScheduleJobLogEntity;
+import io.renren.modules.job.service.ScheduleJobLogService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+@Service
+public class ScheduleJobLogServiceImpl extends BaseServiceImpl implements ScheduleJobLogService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, Constant.CREATE_DATE, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ScheduleJobLogDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String jobId = (String)params.get("jobId");
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(jobId), "job_id", jobId);
+
+ return wrapper;
+ }
+
+ @Override
+ public ScheduleJobLogDTO get(Long id) {
+ ScheduleJobLogEntity entity = baseDao.selectById(id);
+
+ return ConvertUtils.sourceToTarget(entity, ScheduleJobLogDTO.class);
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/service/impl/ScheduleJobServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/job/service/impl/ScheduleJobServiceImpl.java
new file mode 100644
index 0000000..c8dcb79
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/service/impl/ScheduleJobServiceImpl.java
@@ -0,0 +1,130 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.service.impl.BaseServiceImpl;
+import io.renren.common.utils.ConvertUtils;
+import io.renren.modules.job.dao.ScheduleJobDao;
+import io.renren.modules.job.dto.ScheduleJobDTO;
+import io.renren.modules.job.entity.ScheduleJobEntity;
+import io.renren.modules.job.service.ScheduleJobService;
+import io.renren.modules.job.utils.ScheduleUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.quartz.Scheduler;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class ScheduleJobServiceImpl extends BaseServiceImpl implements ScheduleJobService {
+ @Autowired
+ private Scheduler scheduler;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, Constant.CREATE_DATE, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ScheduleJobDTO.class);
+ }
+
+ @Override
+ public ScheduleJobDTO get(Long id) {
+ ScheduleJobEntity entity = baseDao.selectById(id);
+
+ return ConvertUtils.sourceToTarget(entity, ScheduleJobDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String beanName = (String)params.get("beanName");
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.like(StringUtils.isNotBlank(beanName), "bean_name", beanName);
+
+ return wrapper;
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(ScheduleJobDTO dto) {
+ ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class);
+
+ entity.setStatus(Constant.ScheduleStatus.NORMAL.getValue());
+ this.insert(entity);
+
+ ScheduleUtils.createScheduleJob(scheduler, entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(ScheduleJobDTO dto) {
+ ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class);
+
+ ScheduleUtils.updateScheduleJob(scheduler, entity);
+
+ this.updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deleteBatch(Long[] ids) {
+ for(Long id : ids){
+ ScheduleUtils.deleteScheduleJob(scheduler, id);
+ }
+
+ //删除数据
+ this.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ @Override
+ public int updateBatch(Long[] ids, int status){
+ Map map = new HashMap<>(2);
+ map.put("ids", ids);
+ map.put("status", status);
+ return baseDao.updateBatch(map);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void run(Long[] ids) {
+ for(Long id : ids){
+ ScheduleUtils.run(scheduler, this.selectById(id));
+ }
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void pause(Long[] ids) {
+ for(Long id : ids){
+ ScheduleUtils.pauseJob(scheduler, id);
+ }
+
+ updateBatch(ids, Constant.ScheduleStatus.PAUSE.getValue());
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void resume(Long[] ids) {
+ for(Long id : ids){
+ ScheduleUtils.resumeJob(scheduler, id);
+ }
+
+ updateBatch(ids, Constant.ScheduleStatus.NORMAL.getValue());
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/task/ITask.java b/renren-admin/src/main/java/io/renren/modules/job/task/ITask.java
new file mode 100644
index 0000000..c6e09b9
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/task/ITask.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.task;
+
+/**
+ * 定时任务接口,所有定时任务都要实现该接口
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public interface ITask {
+
+ /**
+ * 执行定时任务接口
+ *
+ * @param params 参数,多参数使用JSON数据
+ */
+ void run(String params);
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/task/TestTask.java b/renren-admin/src/main/java/io/renren/modules/job/task/TestTask.java
new file mode 100644
index 0000000..7dc12ea
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/task/TestTask.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.task;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+/**
+ * 测试定时任务(演示Demo,可删除)
+ *
+ * testTask为spring bean的名称
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@Component("testTask")
+public class TestTask implements ITask{
+ private Logger logger = LoggerFactory.getLogger(getClass());
+
+ @Override
+ public void run(String params){
+ logger.debug("TestTask定时任务正在执行,参数为:{}", params);
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/utils/ScheduleJob.java b/renren-admin/src/main/java/io/renren/modules/job/utils/ScheduleJob.java
new file mode 100644
index 0000000..257ba18
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/utils/ScheduleJob.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.utils;
+
+import io.renren.common.constant.Constant;
+import io.renren.common.exception.ExceptionUtils;
+import io.renren.common.utils.SpringContextUtils;
+import io.renren.modules.job.entity.ScheduleJobEntity;
+import io.renren.modules.job.entity.ScheduleJobLogEntity;
+import io.renren.modules.job.service.ScheduleJobLogService;
+import org.quartz.JobExecutionContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+
+
+/**
+ * 定时任务
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public class ScheduleJob extends QuartzJobBean {
+ private Logger logger = LoggerFactory.getLogger(getClass());
+
+ @Override
+ protected void executeInternal(JobExecutionContext context) {
+ ScheduleJobEntity scheduleJob = (ScheduleJobEntity) context.getMergedJobDataMap().
+ get(ScheduleUtils.JOB_PARAM_KEY);
+
+ //数据库保存执行记录
+ ScheduleJobLogEntity log = new ScheduleJobLogEntity();
+ log.setJobId(scheduleJob.getId());
+ log.setBeanName(scheduleJob.getBeanName());
+ log.setParams(scheduleJob.getParams());
+ log.setCreateDate(new Date());
+
+ //任务开始时间
+ long startTime = System.currentTimeMillis();
+
+ try {
+ //执行任务
+ logger.info("任务准备执行,任务ID:{}", scheduleJob.getId());
+ Object target = SpringContextUtils.getBean(scheduleJob.getBeanName());
+ Method method = target.getClass().getDeclaredMethod("run", String.class);
+ method.invoke(target, scheduleJob.getParams());
+
+ //任务执行总时长
+ long times = System.currentTimeMillis() - startTime;
+ log.setTimes((int)times);
+ //任务状态
+ log.setStatus(Constant.SUCCESS);
+
+ logger.info("任务执行完毕,任务ID:{} 总共耗时:{} 毫秒", scheduleJob.getId(), times);
+ } catch (Exception e) {
+ logger.error("任务执行失败,任务ID:{}", scheduleJob.getId(), e);
+
+ //任务执行总时长
+ long times = System.currentTimeMillis() - startTime;
+ log.setTimes((int)times);
+
+ //任务状态
+ log.setStatus(Constant.FAIL);
+ log.setError(ExceptionUtils.getErrorStackTrace(e));
+ }finally {
+ //获取spring bean
+ ScheduleJobLogService scheduleJobLogService = SpringContextUtils.getBean(ScheduleJobLogService.class);
+ scheduleJobLogService.insert(log);
+ }
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/job/utils/ScheduleUtils.java b/renren-admin/src/main/java/io/renren/modules/job/utils/ScheduleUtils.java
new file mode 100644
index 0000000..7e141b9
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/job/utils/ScheduleUtils.java
@@ -0,0 +1,161 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.job.utils;
+
+import io.renren.common.constant.Constant;
+import io.renren.common.exception.ErrorCode;
+import io.renren.common.exception.RenException;
+import io.renren.modules.job.entity.ScheduleJobEntity;
+import org.quartz.*;
+
+/**
+ * 定时任务工具类
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+public class ScheduleUtils {
+ private final static String JOB_NAME = "TASK_";
+ /**
+ * 任务调度参数key
+ */
+ public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
+
+ /**
+ * 获取触发器key
+ */
+ public static TriggerKey getTriggerKey(Long jobId) {
+ return TriggerKey.triggerKey(JOB_NAME + jobId);
+ }
+
+ /**
+ * 获取jobKey
+ */
+ public static JobKey getJobKey(Long jobId) {
+ return JobKey.jobKey(JOB_NAME + jobId);
+ }
+
+ /**
+ * 获取表达式触发器
+ */
+ public static CronTrigger getCronTrigger(Scheduler scheduler, Long jobId) {
+ try {
+ return (CronTrigger) scheduler.getTrigger(getTriggerKey(jobId));
+ } catch (SchedulerException e) {
+ throw new RenException(ErrorCode.JOB_ERROR, e);
+ }
+ }
+
+ /**
+ * 创建定时任务
+ */
+ public static void createScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
+ try {
+ //构建job信息
+ JobDetail jobDetail = JobBuilder.newJob(ScheduleJob.class).withIdentity(getJobKey(scheduleJob.getId())).build();
+
+ //表达式调度构建器
+ CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression())
+ .withMisfireHandlingInstructionDoNothing();
+
+ //按新的cronExpression表达式构建一个新的trigger
+ CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(scheduleJob.getId())).withSchedule(scheduleBuilder).build();
+
+ //放入参数,运行时的方法可以获取
+ jobDetail.getJobDataMap().put(JOB_PARAM_KEY, scheduleJob);
+
+ scheduler.scheduleJob(jobDetail, trigger);
+
+ //暂停任务
+ if(scheduleJob.getStatus() == Constant.ScheduleStatus.PAUSE.getValue()){
+ pauseJob(scheduler, scheduleJob.getId());
+ }
+ } catch (SchedulerException e) {
+ throw new RenException(ErrorCode.JOB_ERROR, e);
+ }
+ }
+
+ /**
+ * 更新定时任务
+ */
+ public static void updateScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
+ try {
+ TriggerKey triggerKey = getTriggerKey(scheduleJob.getId());
+
+ //表达式调度构建器
+ CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression())
+ .withMisfireHandlingInstructionDoNothing();
+
+ CronTrigger trigger = getCronTrigger(scheduler, scheduleJob.getId());
+
+ //按新的cronExpression表达式重新构建trigger
+ trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build();
+
+ //参数
+ trigger.getJobDataMap().put(JOB_PARAM_KEY, scheduleJob);
+
+ scheduler.rescheduleJob(triggerKey, trigger);
+
+ //暂停任务
+ if(scheduleJob.getStatus() == Constant.ScheduleStatus.PAUSE.getValue()){
+ pauseJob(scheduler, scheduleJob.getId());
+ }
+
+ } catch (SchedulerException e) {
+ throw new RenException(ErrorCode.JOB_ERROR, e);
+ }
+ }
+
+ /**
+ * 立即执行任务
+ */
+ public static void run(Scheduler scheduler, ScheduleJobEntity scheduleJob) {
+ try {
+ //参数
+ JobDataMap dataMap = new JobDataMap();
+ dataMap.put(JOB_PARAM_KEY, scheduleJob);
+
+ scheduler.triggerJob(getJobKey(scheduleJob.getId()), dataMap);
+ } catch (SchedulerException e) {
+ throw new RenException(ErrorCode.JOB_ERROR, e);
+ }
+ }
+
+ /**
+ * 暂停任务
+ */
+ public static void pauseJob(Scheduler scheduler, Long jobId) {
+ try {
+ scheduler.pauseJob(getJobKey(jobId));
+ } catch (SchedulerException e) {
+ throw new RenException(ErrorCode.JOB_ERROR, e);
+ }
+ }
+
+ /**
+ * 恢复任务
+ */
+ public static void resumeJob(Scheduler scheduler, Long jobId) {
+ try {
+ scheduler.resumeJob(getJobKey(jobId));
+ } catch (SchedulerException e) {
+ throw new RenException(ErrorCode.JOB_ERROR, e);
+ }
+ }
+
+ /**
+ * 删除定时任务
+ */
+ public static void deleteScheduleJob(Scheduler scheduler, Long jobId) {
+ try {
+ scheduler.deleteJob(getJobKey(jobId));
+ } catch (SchedulerException e) {
+ throw new RenException(ErrorCode.JOB_ERROR, e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogErrorController.java b/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogErrorController.java
new file mode 100644
index 0000000..c62a07d
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogErrorController.java
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.controller;
+
+import io.renren.common.annotation.LogOperation;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.utils.ExcelUtils;
+import io.renren.common.utils.Result;
+import io.renren.modules.log.dto.SysLogErrorDTO;
+import io.renren.modules.log.excel.SysLogErrorExcel;
+import io.renren.modules.log.service.SysLogErrorService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 异常日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@RestController
+@RequestMapping("sys/log/error")
+@Api(tags="异常日志")
+public class SysLogErrorController {
+ @Autowired
+ private SysLogErrorService sysLogErrorService;
+
+ @GetMapping("page")
+ @ApiOperation("分页")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
+ })
+ @RequiresPermissions("sys:log:error")
+ public Result> page(@ApiIgnore @RequestParam Map params){
+ PageData page = sysLogErrorService.page(params);
+
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("export")
+ @ApiOperation("导出")
+ @LogOperation("导出")
+ @RequiresPermissions("sys:log:error")
+ public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = sysLogErrorService.list(params);
+
+ ExcelUtils.exportExcelToTarget(response, null, list, SysLogErrorExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogLoginController.java b/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogLoginController.java
new file mode 100644
index 0000000..e95352d
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogLoginController.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.controller;
+
+import io.renren.common.annotation.LogOperation;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.utils.ExcelUtils;
+import io.renren.common.utils.Result;
+import io.renren.modules.log.dto.SysLogLoginDTO;
+import io.renren.modules.log.excel.SysLogLoginExcel;
+import io.renren.modules.log.service.SysLogLoginService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 登录日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@RestController
+@RequestMapping("sys/log/login")
+@Api(tags="登录日志")
+public class SysLogLoginController {
+ @Autowired
+ private SysLogLoginService sysLogLoginService;
+
+ @GetMapping("page")
+ @ApiOperation("分页")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"),
+ @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String")
+ })
+ @RequiresPermissions("sys:log:login")
+ public Result> page(@ApiIgnore @RequestParam Map params){
+ PageData page = sysLogLoginService.page(params);
+
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("export")
+ @ApiOperation("导出")
+ @LogOperation("导出")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"),
+ @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String")
+ })
+ @RequiresPermissions("sys:log:login")
+ public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = sysLogLoginService.list(params);
+
+ ExcelUtils.exportExcelToTarget(response, null, list, SysLogLoginExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogOperationController.java b/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogOperationController.java
new file mode 100644
index 0000000..a93eb15
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/controller/SysLogOperationController.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.controller;
+
+import io.renren.common.annotation.LogOperation;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.utils.ExcelUtils;
+import io.renren.common.utils.Result;
+import io.renren.modules.log.dto.SysLogOperationDTO;
+import io.renren.modules.log.excel.SysLogOperationExcel;
+import io.renren.modules.log.service.SysLogOperationService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 操作日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@RestController
+@RequestMapping("sys/log/operation")
+@Api(tags="操作日志")
+public class SysLogOperationController {
+ @Autowired
+ private SysLogOperationService sysLogOperationService;
+
+ @GetMapping("page")
+ @ApiOperation("分页")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
+ @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
+ @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功", paramType = "query", dataType="int")
+ })
+ @RequiresPermissions("sys:log:operation")
+ public Result> page(@ApiIgnore @RequestParam Map params){
+ PageData page = sysLogOperationService.page(params);
+
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("export")
+ @ApiOperation("导出")
+ @LogOperation("导出")
+ @RequiresPermissions("sys:log:operation")
+ public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = sysLogOperationService.list(params);
+
+ ExcelUtils.exportExcelToTarget(response, null, list, SysLogOperationExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogErrorDao.java b/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogErrorDao.java
new file mode 100644
index 0000000..cf7e397
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogErrorDao.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.dao;
+
+import io.renren.common.dao.BaseDao;
+import io.renren.modules.log.entity.SysLogErrorEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 异常日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Mapper
+public interface SysLogErrorDao extends BaseDao {
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogLoginDao.java b/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogLoginDao.java
new file mode 100644
index 0000000..3ed5087
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogLoginDao.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.dao;
+
+import io.renren.common.dao.BaseDao;
+import io.renren.modules.log.entity.SysLogLoginEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 登录日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Mapper
+public interface SysLogLoginDao extends BaseDao {
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogOperationDao.java b/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogOperationDao.java
new file mode 100644
index 0000000..5be96ca
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/dao/SysLogOperationDao.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.dao;
+
+import io.renren.common.dao.BaseDao;
+import io.renren.modules.log.entity.SysLogOperationEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 操作日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Mapper
+public interface SysLogOperationDao extends BaseDao {
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogErrorDTO.java b/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogErrorDTO.java
new file mode 100644
index 0000000..7df2a4c
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogErrorDTO.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 异常日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@ApiModel(value = "异常日志")
+public class SysLogErrorDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "id")
+ private Long id;
+ @ApiModelProperty(value = "请求URI")
+ private String requestUri;
+ @ApiModelProperty(value = "请求方式")
+ private String requestMethod;
+ @ApiModelProperty(value = "请求参数")
+ private String requestParams;
+ @ApiModelProperty(value = "用户代理")
+ private String userAgent;
+ @ApiModelProperty(value = "操作IP")
+ private String ip;
+ @ApiModelProperty(value = "异常信息")
+ private String errorInfo;
+ @ApiModelProperty(value = "创建时间")
+ private Date createDate;
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogLoginDTO.java b/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogLoginDTO.java
new file mode 100644
index 0000000..c638d60
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogLoginDTO.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 登录日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@ApiModel(value = "登录日志")
+public class SysLogLoginDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "id")
+ private Long id;
+
+ @ApiModelProperty(value = "用户操作 0:用户登录 1:用户退出")
+ private Integer operation;
+
+ @ApiModelProperty(value = "状态 0:失败 1:成功 2:账号已锁定")
+ private Integer status;
+
+ @ApiModelProperty(value = "用户代理")
+ private String userAgent;
+
+ @ApiModelProperty(value = "操作IP")
+ private String ip;
+
+ @ApiModelProperty(value = "用户名")
+ private String creatorName;
+
+ @ApiModelProperty(value = "创建时间")
+ private Date createDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogOperationDTO.java b/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogOperationDTO.java
new file mode 100644
index 0000000..133b3c4
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/dto/SysLogOperationDTO.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 操作日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@ApiModel(value = "操作日志")
+public class SysLogOperationDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "id")
+ private Long id;
+
+ @ApiModelProperty(value = "用户操作")
+ private String operation;
+
+ @ApiModelProperty(value = "请求URI")
+ private String requestUri;
+
+ @ApiModelProperty(value = "请求方式")
+ private String requestMethod;
+
+ @ApiModelProperty(value = "请求参数")
+ private String requestParams;
+
+ @ApiModelProperty(value = "请求时长(毫秒)")
+ private Integer requestTime;
+
+ @ApiModelProperty(value = "用户代理")
+ private String userAgent;
+
+ @ApiModelProperty(value = "操作IP")
+ private String ip;
+
+ @ApiModelProperty(value = "状态 0:失败 1:成功")
+ private Integer status;
+
+ @ApiModelProperty(value = "用户名")
+ private String creatorName;
+
+ @ApiModelProperty(value = "创建时间")
+ private Date createDate;
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogErrorEntity.java b/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogErrorEntity.java
new file mode 100644
index 0000000..b14a970
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogErrorEntity.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.renren.common.entity.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 异常日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("sys_log_error")
+public class SysLogErrorEntity extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 请求URI
+ */
+ private String requestUri;
+ /**
+ * 请求方式
+ */
+ private String requestMethod;
+ /**
+ * 请求参数
+ */
+ private String requestParams;
+ /**
+ * 用户代理
+ */
+ private String userAgent;
+ /**
+ * 操作IP
+ */
+ private String ip;
+ /**
+ * 异常信息
+ */
+ private String errorInfo;
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogLoginEntity.java b/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogLoginEntity.java
new file mode 100644
index 0000000..2be0651
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogLoginEntity.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.renren.common.entity.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 登录日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("sys_log_login")
+public class SysLogLoginEntity extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 用户操作 0:用户登录 1:用户退出
+ */
+ private Integer operation;
+ /**
+ * 状态 0:失败 1:成功 2:账号已锁定
+ */
+ private Integer status;
+ /**
+ * 用户代理
+ */
+ private String userAgent;
+ /**
+ * 操作IP
+ */
+ private String ip;
+ /**
+ * 用户名
+ */
+ private String creatorName;
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogOperationEntity.java b/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogOperationEntity.java
new file mode 100644
index 0000000..ac1ce1e
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/entity/SysLogOperationEntity.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.renren.common.entity.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 操作日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("sys_log_operation")
+public class SysLogOperationEntity extends BaseEntity {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 用户操作
+ */
+ private String operation;
+ /**
+ * 请求URI
+ */
+ private String requestUri;
+ /**
+ * 请求方式
+ */
+ private String requestMethod;
+ /**
+ * 请求参数
+ */
+ private String requestParams;
+ /**
+ * 请求时长(毫秒)
+ */
+ private Integer requestTime;
+ /**
+ * 用户代理
+ */
+ private String userAgent;
+ /**
+ * 操作IP
+ */
+ private String ip;
+ /**
+ * 状态 0:失败 1:成功
+ */
+ private Integer status;
+ /**
+ * 用户名
+ */
+ private String creatorName;
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/enums/LoginOperationEnum.java b/renren-admin/src/main/java/io/renren/modules/log/enums/LoginOperationEnum.java
new file mode 100644
index 0000000..a130c96
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/enums/LoginOperationEnum.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.enums;
+
+/**
+ * 登录操作枚举
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public enum LoginOperationEnum {
+ /**
+ * 用户登录
+ */
+ LOGIN(0),
+ /**
+ * 用户退出
+ */
+ LOGOUT(1);
+
+ private int value;
+
+ LoginOperationEnum(int value) {
+ this.value = value;
+ }
+
+ public int value() {
+ return this.value;
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/enums/LoginStatusEnum.java b/renren-admin/src/main/java/io/renren/modules/log/enums/LoginStatusEnum.java
new file mode 100644
index 0000000..0292db3
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/enums/LoginStatusEnum.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.enums;
+
+/**
+ * 登录状态枚举
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public enum LoginStatusEnum {
+ /**
+ * 失败
+ */
+ FAIL(0),
+ /**
+ * 成功
+ */
+ SUCCESS(1),
+ /**
+ * 账号已锁定
+ */
+ LOCK(2);
+
+ private int value;
+
+ LoginStatusEnum(int value) {
+ this.value = value;
+ }
+
+ public int value() {
+ return this.value;
+ }
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/log/enums/OperationStatusEnum.java b/renren-admin/src/main/java/io/renren/modules/log/enums/OperationStatusEnum.java
new file mode 100644
index 0000000..366e5fa
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/enums/OperationStatusEnum.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.enums;
+
+/**
+ * 操作状态枚举
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public enum OperationStatusEnum {
+ /**
+ * 失败
+ */
+ FAIL(0),
+ /**
+ * 成功
+ */
+ SUCCESS(1);
+
+ private int value;
+
+ OperationStatusEnum(int value) {
+ this.value = value;
+ }
+
+ public int value() {
+ return this.value;
+ }
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogErrorExcel.java b/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogErrorExcel.java
new file mode 100644
index 0000000..16d73dc
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogErrorExcel.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 异常日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+public class SysLogErrorExcel {
+ @Excel(name = "请求URI")
+ private String requestUri;
+ @Excel(name = "请求方式")
+ private String requestMethod;
+ @Excel(name = "请求参数")
+ private String requestParams;
+ @Excel(name = "User-Agent")
+ private String userAgent;
+ @Excel(name = "操作IP")
+ private String ip;
+ @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss")
+ private Date createDate;
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogLoginExcel.java b/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogLoginExcel.java
new file mode 100644
index 0000000..12c736d
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogLoginExcel.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 登录日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+public class SysLogLoginExcel {
+ @Excel(name = "用户操作")
+ private String operation;
+ @Excel(name = "状态", replace = {"失败_0", "成功_1", "账号已锁定_1"})
+ private Integer status;
+ @Excel(name = "User-Agent")
+ private String userAgent;
+ @Excel(name = "操作IP")
+ private String ip;
+ @Excel(name = "用户名")
+ private String creatorName;
+ @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss")
+ private Date createDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogOperationExcel.java b/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogOperationExcel.java
new file mode 100644
index 0000000..84fbcd0
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/excel/SysLogOperationExcel.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 操作日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Data
+public class SysLogOperationExcel {
+ @Excel(name = "用户操作")
+ private String operation;
+ @Excel(name = "请求URI")
+ private String requestUri;
+ @Excel(name = "请求方式")
+ private String requestMethod;
+ @Excel(name = "请求参数")
+ private String requestParams;
+ @Excel(name = "请求时长(毫秒)")
+ private Integer requestTime;
+ @Excel(name = "User-Agent")
+ private String userAgent;
+ @Excel(name = "操作IP")
+ private String ip;
+ @Excel(name = "状态", replace = {"失败_0", "成功_1"})
+ private Integer status;
+ @Excel(name = "用户名")
+ private String creatorName;
+ @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss")
+ private Date createDate;
+
+}
diff --git a/renren-admin/src/main/java/io/renren/modules/log/service/SysLogErrorService.java b/renren-admin/src/main/java/io/renren/modules/log/service/SysLogErrorService.java
new file mode 100644
index 0000000..7ac9f66
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/service/SysLogErrorService.java
@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.service;
+
+
+import io.renren.common.page.PageData;
+import io.renren.common.service.BaseService;
+import io.renren.modules.log.dto.SysLogErrorDTO;
+import io.renren.modules.log.entity.SysLogErrorEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 异常日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public interface SysLogErrorService extends BaseService {
+
+ PageData page(Map params);
+
+ List list(Map params);
+
+ void save(SysLogErrorEntity entity);
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/service/SysLogLoginService.java b/renren-admin/src/main/java/io/renren/modules/log/service/SysLogLoginService.java
new file mode 100644
index 0000000..39ed28d
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/service/SysLogLoginService.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.service;
+
+import io.renren.common.page.PageData;
+import io.renren.common.service.BaseService;
+import io.renren.modules.log.dto.SysLogLoginDTO;
+import io.renren.modules.log.entity.SysLogLoginEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 登录日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public interface SysLogLoginService extends BaseService {
+
+ PageData page(Map params);
+
+ List list(Map params);
+
+ void save(SysLogLoginEntity entity);
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/service/SysLogOperationService.java b/renren-admin/src/main/java/io/renren/modules/log/service/SysLogOperationService.java
new file mode 100644
index 0000000..5c7983e
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/service/SysLogOperationService.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.service;
+
+import io.renren.common.page.PageData;
+import io.renren.common.service.BaseService;
+import io.renren.modules.log.dto.SysLogOperationDTO;
+import io.renren.modules.log.entity.SysLogOperationEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 操作日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public interface SysLogOperationService extends BaseService {
+
+ PageData page(Map params);
+
+ List list(Map params);
+
+ void save(SysLogOperationEntity entity);
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogErrorServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogErrorServiceImpl.java
new file mode 100644
index 0000000..b249ae7
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogErrorServiceImpl.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.service.impl.BaseServiceImpl;
+import io.renren.common.utils.ConvertUtils;
+import io.renren.modules.log.dao.SysLogErrorDao;
+import io.renren.modules.log.dto.SysLogErrorDTO;
+import io.renren.modules.log.entity.SysLogErrorEntity;
+import io.renren.modules.log.service.SysLogErrorService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 异常日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Service
+public class SysLogErrorServiceImpl extends BaseServiceImpl implements SysLogErrorService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, Constant.CREATE_DATE, false),
+ getWrapper(params)
+ );
+
+ return getPageData(page, SysLogErrorDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, SysLogErrorDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ QueryWrapper wrapper = new QueryWrapper<>();
+ return wrapper;
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(SysLogErrorEntity entity) {
+ insert(entity);
+ }
+
+}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogLoginServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogLoginServiceImpl.java
new file mode 100644
index 0000000..e2d180b
--- /dev/null
+++ b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogLoginServiceImpl.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package io.renren.modules.log.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.renren.common.constant.Constant;
+import io.renren.common.page.PageData;
+import io.renren.common.service.impl.BaseServiceImpl;
+import io.renren.common.utils.ConvertUtils;
+import io.renren.modules.log.dao.SysLogLoginDao;
+import io.renren.modules.log.dto.SysLogLoginDTO;
+import io.renren.modules.log.entity.SysLogLoginEntity;
+import io.renren.modules.log.service.SysLogLoginService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 登录日志
+ *
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+@Service
+public class SysLogLoginServiceImpl extends BaseServiceImpl implements SysLogLoginService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, Constant.CREATE_DATE, false),
+ getWrapper(params)
+ );
+
+ return getPageData(page, SysLogLoginDTO.class);
+ }
+
+ @Override
+ public List