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 list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogLoginDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String status = (String) params.get("status"); + String creatorName = (String) params.get("creatorName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(status), "status", status); + wrapper.like(StringUtils.isNotBlank(creatorName), "creator_name", creatorName); + + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogLoginEntity entity) { + insert(entity); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogOperationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogOperationServiceImpl.java new file mode 100644 index 0000000..10f37cf --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/log/service/impl/SysLogOperationServiceImpl.java @@ -0,0 +1,69 @@ +/** + * 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.SysLogOperationDao; +import io.renren.modules.log.dto.SysLogOperationDTO; +import io.renren.modules.log.entity.SysLogOperationEntity; +import io.renren.modules.log.service.SysLogOperationService; +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 SysLogOperationServiceImpl extends BaseServiceImpl implements SysLogOperationService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysLogOperationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogOperationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String status = (String) params.get("status"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(status), "status", status); + + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogOperationEntity entity) { + insert(entity); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/oss/cloud/AbstractCloudStorageService.java b/renren-admin/src/main/java/io/renren/modules/oss/cloud/AbstractCloudStorageService.java new file mode 100644 index 0000000..0bb7b46 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/cloud/AbstractCloudStorageService.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import io.renren.common.utils.DateUtils; +import org.apache.commons.lang3.StringUtils; + +import java.io.InputStream; +import java.util.Date; +import java.util.UUID; + +/** + * 云存储(支持七牛、阿里云、腾讯云) + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class AbstractCloudStorageService { + /** 云存储配置信息 */ + CloudStorageConfig config; + + /** + * 文件路径 + * @param prefix 前缀 + * @param suffix 后缀 + * @return 返回上传路径 + */ + public String getPath(String prefix, String suffix) { + //生成uuid + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + //文件路径 + String path = DateUtils.format(new Date(), "yyyyMMdd") + "/" + uuid; + + if(StringUtils.isNotBlank(prefix)){ + path = prefix + "/" + path; + } + + return path + "." + suffix; + } + + /** + * 文件上传 + * @param data 文件字节数组 + * @param path 文件路径,包含文件名 + * @return 返回http地址 + */ + public abstract String upload(byte[] data, String path); + + /** + * 文件上传 + * @param data 文件字节数组 + * @param suffix 后缀 + * @return 返回http地址 + */ + public abstract String uploadSuffix(byte[] data, String suffix); + + /** + * 文件上传 + * @param inputStream 字节流 + * @param path 文件路径,包含文件名 + * @return 返回http地址 + */ + public abstract String upload(InputStream inputStream, String path); + + /** + * 文件上传 + * @param inputStream 字节流 + * @param suffix 后缀 + * @return 返回http地址 + */ + public abstract String uploadSuffix(InputStream inputStream, String suffix); + +} diff --git a/renren-admin/src/main/java/io/renren/modules/oss/cloud/AliyunCloudStorageService.java b/renren-admin/src/main/java/io/renren/modules/oss/cloud/AliyunCloudStorageService.java new file mode 100644 index 0000000..9754dbb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/cloud/AliyunCloudStorageService.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import com.aliyun.oss.OSSClient; +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +/** + * 阿里云存储 + * + * @author Mark sunlightcs@gmail.com + */ +public class AliyunCloudStorageService extends AbstractCloudStorageService { + + public AliyunCloudStorageService(CloudStorageConfig config){ + this.config = config; + } + + @Override + public String upload(byte[] data, String path) { + return upload(new ByteArrayInputStream(data), path); + } + + @Override + public String upload(InputStream inputStream, String path) { + OSSClient client = new OSSClient(config.getAliyunEndPoint(), config.getAliyunAccessKeyId(), + config.getAliyunAccessKeySecret()); + try { + client.putObject(config.getAliyunBucketName(), path, inputStream); + client.shutdown(); + } catch (Exception e){ + throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); + } + + return config.getAliyunDomain() + "/" + path; + } + + @Override + public String uploadSuffix(byte[] data, String suffix) { + return upload(data, getPath(config.getAliyunPrefix(), suffix)); + } + + @Override + public String uploadSuffix(InputStream inputStream, String suffix) { + return upload(inputStream, getPath(config.getAliyunPrefix(), suffix)); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/oss/cloud/CloudStorageConfig.java b/renren-admin/src/main/java/io/renren/modules/oss/cloud/CloudStorageConfig.java new file mode 100644 index 0000000..4b8225f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/cloud/CloudStorageConfig.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import io.renren.common.validator.group.AliyunGroup; +import io.renren.common.validator.group.QcloudGroup; +import io.renren.common.validator.group.QiniuGroup; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Range; +import org.hibernate.validator.constraints.URL; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 云存储配置信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "云存储配置信息") +public class CloudStorageConfig implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "类型 1:七牛 2:阿里云 3:腾讯云 4:FastDFS 5:本地上传 6:MinIO") + @Range(min=1, max=6, message = "{oss.type.range}") + private Integer type; + + @ApiModelProperty(value = "七牛绑定的域名") + @NotBlank(message="{qiniu.domain.require}", groups = QiniuGroup.class) + @URL(message = "{qiniu.domain.url}", groups = QiniuGroup.class) + private String qiniuDomain; + + @ApiModelProperty(value = "七牛路径前缀") + private String qiniuPrefix; + + @ApiModelProperty(value = "七牛ACCESS_KEY") + @NotBlank(message="{qiniu.accesskey.require}", groups = QiniuGroup.class) + private String qiniuAccessKey; + + @ApiModelProperty(value = "七牛SECRET_KEY") + @NotBlank(message="{qiniu.secretkey.require}", groups = QiniuGroup.class) + private String qiniuSecretKey; + + @ApiModelProperty(value = "七牛存储空间名") + @NotBlank(message="{qiniu.bucketname.require}", groups = QiniuGroup.class) + private String qiniuBucketName; + + @ApiModelProperty(value = "阿里云绑定的域名") + @NotBlank(message="{aliyun.domain.require}", groups = AliyunGroup.class) + @URL(message = "{aliyun.domain.url}", groups = AliyunGroup.class) + private String aliyunDomain; + + @ApiModelProperty(value = "阿里云路径前缀") + private String aliyunPrefix; + + @ApiModelProperty(value = "阿里云EndPoint") + @NotBlank(message="{aliyun.endPoint.require}", groups = AliyunGroup.class) + private String aliyunEndPoint; + + @ApiModelProperty(value = "阿里云AccessKeyId") + @NotBlank(message="{aliyun.accesskeyid.require}", groups = AliyunGroup.class) + private String aliyunAccessKeyId; + + @ApiModelProperty(value = "阿里云AccessKeySecret") + @NotBlank(message="{aliyun.accesskeysecret.require}", groups = AliyunGroup.class) + private String aliyunAccessKeySecret; + + @ApiModelProperty(value = "阿里云BucketName") + @NotBlank(message="{aliyun.bucketname.require}", groups = AliyunGroup.class) + private String aliyunBucketName; + + @ApiModelProperty(value = "腾讯云绑定的域名") + @NotBlank(message="{qcloud.domain.require}", groups = QcloudGroup.class) + @URL(message = "{qcloud.domain.url}", groups = QcloudGroup.class) + private String qcloudDomain; + + @ApiModelProperty(value = "腾讯云路径前缀") + private String qcloudPrefix; + + @ApiModelProperty(value = "腾讯云AppId") + @NotNull(message="{qcloud.appid.require}", groups = QcloudGroup.class) + private Integer qcloudAppId; + + @ApiModelProperty(value = "腾讯云SecretId") + @NotBlank(message="{qcloud.secretId.require}", groups = QcloudGroup.class) + private String qcloudSecretId; + + @ApiModelProperty(value = "腾讯云SecretKey") + @NotBlank(message="{qcloud.secretkey.require}", groups = QcloudGroup.class) + private String qcloudSecretKey; + + @ApiModelProperty(value = "腾讯云BucketName") + @NotBlank(message="{qcloud.bucketname.require}", groups = QcloudGroup.class) + private String qcloudBucketName; + + @ApiModelProperty(value = "腾讯云COS所属地区") + @NotBlank(message="{qcloud.region.require}", groups = QcloudGroup.class) + private String qcloudRegion; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/oss/cloud/OSSFactory.java b/renren-admin/src/main/java/io/renren/modules/oss/cloud/OSSFactory.java new file mode 100644 index 0000000..f7d5bd5 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/cloud/OSSFactory.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import io.renren.common.constant.Constant; +import io.renren.common.utils.SpringContextUtils; +import io.renren.modules.sys.service.SysParamsService; + +/** + * 文件上传Factory + * @author Mark sunlightcs@gmail.com + */ +public final class OSSFactory { + private static SysParamsService sysParamsService; + + static { + OSSFactory.sysParamsService = SpringContextUtils.getBean(SysParamsService.class); + } + + public static AbstractCloudStorageService build(){ + //获取云存储配置信息 + CloudStorageConfig config = sysParamsService.getValueObject(Constant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class); + + if(config.getType() == Constant.CloudService.QINIU.getValue()){ + return new QiniuCloudStorageService(config); + }else if(config.getType() == Constant.CloudService.ALIYUN.getValue()){ + return new AliyunCloudStorageService(config); + }else if(config.getType() == Constant.CloudService.QCLOUD.getValue()){ + return new QcloudCloudStorageService(config); + } + + return null; + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/oss/cloud/QcloudCloudStorageService.java b/renren-admin/src/main/java/io/renren/modules/oss/cloud/QcloudCloudStorageService.java new file mode 100644 index 0000000..80d05d6 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/cloud/QcloudCloudStorageService.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import com.qcloud.cos.COSClient; +import com.qcloud.cos.ClientConfig; +import com.qcloud.cos.auth.BasicCOSCredentials; +import com.qcloud.cos.auth.COSCredentials; +import com.qcloud.cos.model.ObjectMetadata; +import com.qcloud.cos.model.PutObjectRequest; +import com.qcloud.cos.model.PutObjectResult; +import com.qcloud.cos.region.Region; +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * 腾讯云存储 + * + * @author Mark sunlightcs@gmail.com + */ +public class QcloudCloudStorageService extends AbstractCloudStorageService { + private COSCredentials credentials; + private ClientConfig clientConfig; + + public QcloudCloudStorageService(CloudStorageConfig config){ + this.config = config; + + //初始化 + init(); + } + + private void init(){ + //1、初始化用户身份信息(secretId, secretKey) + credentials = new BasicCOSCredentials(config.getQcloudSecretId(), config.getQcloudSecretKey()); + + //2、设置bucket的区域, COS地域的简称请参照 https://cloud.tencent.com/document/product/436/6224 + clientConfig = new ClientConfig(new Region(config.getQcloudRegion())); + } + + @Override + public String upload(byte[] data, String path) { + return upload(new ByteArrayInputStream(data), path); + } + + @Override + public String upload(InputStream inputStream, String path) { + try { + COSClient client = new COSClient(credentials, clientConfig); + + ObjectMetadata metadata = new ObjectMetadata(); + metadata.setContentLength(inputStream.available()); + String bucketName = config.getQcloudBucketName() +"-"+ config.getQcloudAppId(); + PutObjectRequest request = new PutObjectRequest(bucketName, path, inputStream, metadata); + PutObjectResult result = client.putObject(request); + + client.shutdown(); + if(result.getETag() == null){ + throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, ""); + } + } catch (IOException e) { + throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); + } + + return config.getQcloudDomain() + "/" + path; + } + + @Override + public String uploadSuffix(byte[] data, String suffix) { + return upload(data, getPath(config.getQcloudPrefix(), suffix)); + } + + @Override + public String uploadSuffix(InputStream inputStream, String suffix) { + return upload(inputStream, getPath(config.getQcloudPrefix(), suffix)); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/oss/cloud/QiniuCloudStorageService.java b/renren-admin/src/main/java/io/renren/modules/oss/cloud/QiniuCloudStorageService.java new file mode 100644 index 0000000..2361c33 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/cloud/QiniuCloudStorageService.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.cloud; + +import com.qiniu.http.Response; +import com.qiniu.storage.Configuration; +import com.qiniu.storage.Region; +import com.qiniu.storage.UploadManager; +import com.qiniu.util.Auth; +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; + +/** + * 七牛云存储 + * + * @author Mark sunlightcs@gmail.com + */ +public class QiniuCloudStorageService extends AbstractCloudStorageService { + private UploadManager uploadManager; + private String token; + + public QiniuCloudStorageService(CloudStorageConfig config){ + this.config = config; + + //初始化 + init(); + } + + private void init(){ + uploadManager = new UploadManager(new Configuration(Region.autoRegion())); + token = Auth.create(config.getQiniuAccessKey(), config.getQiniuSecretKey()). + uploadToken(config.getQiniuBucketName()); + + } + + @Override + public String upload(byte[] data, String path) { + try { + Response res = uploadManager.put(data, path, token); + if (!res.isOK()) { + throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, res.toString()); + } + } catch (Exception e) { + throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); + } + + return config.getQiniuDomain() + "/" + path; + } + + @Override + public String upload(InputStream inputStream, String path) { + try { + byte[] data = IOUtils.toByteArray(inputStream); + return this.upload(data, path); + } catch (IOException e) { + throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); + } + } + + @Override + public String uploadSuffix(byte[] data, String suffix) { + return upload(data, getPath(config.getQiniuPrefix(), suffix)); + } + + @Override + public String uploadSuffix(InputStream inputStream, String suffix) { + return upload(inputStream, getPath(config.getQiniuPrefix(), suffix)); + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/oss/controller/SysOssController.java b/renren-admin/src/main/java/io/renren/modules/oss/controller/SysOssController.java new file mode 100644 index 0000000..27888c2 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/controller/SysOssController.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.controller; + +import com.google.gson.Gson; +import io.renren.common.annotation.LogOperation; +import io.renren.common.constant.Constant; +import io.renren.common.exception.ErrorCode; +import io.renren.common.page.PageData; +import io.renren.common.utils.Result; +import io.renren.common.validator.ValidatorUtils; +import io.renren.common.validator.group.AliyunGroup; +import io.renren.common.validator.group.QcloudGroup; +import io.renren.common.validator.group.QiniuGroup; +import io.renren.modules.oss.cloud.CloudStorageConfig; +import io.renren.modules.oss.cloud.OSSFactory; +import io.renren.modules.oss.entity.SysOssEntity; +import io.renren.modules.oss.service.SysOssService; +import io.renren.modules.sys.service.SysParamsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.io.FilenameUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("sys/oss") +@Api(tags="文件上传") +public class SysOssController { + @Autowired + private SysOssService sysOssService; + @Autowired + private SysParamsService sysParamsService; + + private final static String KEY = Constant.CLOUD_STORAGE_CONFIG_KEY; + + @GetMapping("page") + @ApiOperation(value = "分页") + @RequiresPermissions("sys:oss:all") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysOssService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("info") + @ApiOperation(value = "云存储配置信息") + @RequiresPermissions("sys:oss:all") + public Result info(){ + CloudStorageConfig config = sysParamsService.getValueObject(KEY, CloudStorageConfig.class); + + return new Result().ok(config); + } + + @PostMapping + @ApiOperation(value = "保存云存储配置信息") + @LogOperation("保存云存储配置信息") + @RequiresPermissions("sys:oss:all") + public Result saveConfig(@RequestBody CloudStorageConfig config){ + //校验类型 + ValidatorUtils.validateEntity(config); + + if(config.getType() == Constant.CloudService.QINIU.getValue()){ + //校验七牛数据 + ValidatorUtils.validateEntity(config, QiniuGroup.class); + }else if(config.getType() == Constant.CloudService.ALIYUN.getValue()){ + //校验阿里云数据 + ValidatorUtils.validateEntity(config, AliyunGroup.class); + }else if(config.getType() == Constant.CloudService.QCLOUD.getValue()){ + //校验腾讯云数据 + ValidatorUtils.validateEntity(config, QcloudGroup.class); + } + + sysParamsService.updateValueByCode(KEY, new Gson().toJson(config)); + + return new Result(); + } + + @PostMapping("upload") + @ApiOperation(value = "上传文件") + @RequiresPermissions("sys:oss:all") + public Result> upload(@RequestParam("file") MultipartFile file) throws Exception { + if (file.isEmpty()) { + return new Result>().error(ErrorCode.UPLOAD_FILE_EMPTY); + } + + //上传文件 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + String url = OSSFactory.build().uploadSuffix(file.getBytes(), extension); + + //保存文件信息 + SysOssEntity ossEntity = new SysOssEntity(); + ossEntity.setUrl(url); + ossEntity.setCreateDate(new Date()); + sysOssService.insert(ossEntity); + + Map data = new HashMap<>(1); + data.put("src", url); + + return new Result>().ok(data); + } + + @DeleteMapping + @ApiOperation(value = "删除") + @LogOperation("删除") + @RequiresPermissions("sys:oss:all") + public Result delete(@RequestBody Long[] ids){ + sysOssService.deleteBatchIds(Arrays.asList(ids)); + + return new Result(); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/oss/dao/SysOssDao.java b/renren-admin/src/main/java/io/renren/modules/oss/dao/SysOssDao.java new file mode 100644 index 0000000..0b164b0 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/dao/SysOssDao.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.oss.entity.SysOssEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysOssDao extends BaseDao { + +} diff --git a/renren-admin/src/main/java/io/renren/modules/oss/entity/SysOssEntity.java b/renren-admin/src/main/java/io/renren/modules/oss/entity/SysOssEntity.java new file mode 100644 index 0000000..af6601a --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/entity/SysOssEntity.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.renren.common.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_oss") +public class SysOssEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * URL地址 + */ + private String url; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/oss/service/SysOssService.java b/renren-admin/src/main/java/io/renren/modules/oss/service/SysOssService.java new file mode 100644 index 0000000..46736ef --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/service/SysOssService.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.service; + +import io.renren.common.page.PageData; +import io.renren.common.service.BaseService; +import io.renren.modules.oss.entity.SysOssEntity; + +import java.util.Map; + +/** + * 文件上传 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysOssService extends BaseService { + + PageData page(Map params); +} diff --git a/renren-admin/src/main/java/io/renren/modules/oss/service/impl/SysOssServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/oss/service/impl/SysOssServiceImpl.java new file mode 100644 index 0000000..04437e7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/oss/service/impl/SysOssServiceImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.oss.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.modules.oss.dao.SysOssDao; +import io.renren.modules.oss.entity.SysOssEntity; +import io.renren.modules.oss.service.SysOssService; +import org.springframework.stereotype.Service; + +import java.util.Map; + + +@Service +public class SysOssServiceImpl extends BaseServiceImpl implements SysOssService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + new QueryWrapper<>() + ); + return getPageData(page, SysOssEntity.class); + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/config/FilterConfig.java b/renren-admin/src/main/java/io/renren/modules/security/config/FilterConfig.java new file mode 100644 index 0000000..5915cb1 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/config/FilterConfig.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.config; + +import io.renren.common.xss.XssFilter; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.filter.DelegatingFilterProxy; + +import javax.servlet.DispatcherType; + +/** + * Filter配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class FilterConfig { + + @Bean + public FilterRegistrationBean shiroFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(new DelegatingFilterProxy("shiroFilter")); + //该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理 + registration.addInitParameter("targetFilterLifecycle", "true"); + registration.setEnabled(true); + registration.setOrder(Integer.MAX_VALUE - 1); + registration.addUrlPatterns("/*"); + return registration; + } + + @Bean + public FilterRegistrationBean xssFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns("/*"); + registration.setName("xssFilter"); + registration.setOrder(Integer.MAX_VALUE); + return registration; + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java new file mode 100644 index 0000000..b4d661c --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/config/ShiroConfig.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.config; + +import io.renren.modules.front.interceptor.LoginFilter; +import io.renren.modules.security.oauth2.Oauth2Filter; +import io.renren.modules.security.oauth2.Oauth2Realm; +import org.apache.shiro.mgt.SecurityManager; +import org.apache.shiro.session.mgt.SessionManager; +import org.apache.shiro.spring.LifecycleBeanPostProcessor; +import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; +import org.apache.shiro.spring.web.ShiroFilterFactoryBean; +import org.apache.shiro.web.mgt.DefaultWebSecurityManager; +import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.Filter; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Shiro的配置文件 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class ShiroConfig { + + @Bean + public DefaultWebSessionManager sessionManager(){ + DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); + sessionManager.setSessionValidationSchedulerEnabled(false); + sessionManager.setSessionIdUrlRewritingEnabled(false); + + return sessionManager; + } + + @Bean("securityManager") + public SecurityManager securityManager(Oauth2Realm oAuth2Realm, SessionManager sessionManager) { + DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); + securityManager.setRealm(oAuth2Realm); + securityManager.setSessionManager(sessionManager); + securityManager.setRememberMeManager(null); + return securityManager; + } + + @Autowired + private LoginFilter loginFilter; + + @Bean("shiroFilter") + public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) { + ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean(); + shiroFilter.setSecurityManager(securityManager); + + //oauth过滤 + Map filters = new LinkedHashMap<>(); + filters.put("loginFilter", loginFilter); // 添加自定义过滤器 + filters.put("oauth2", new Oauth2Filter()); + shiroFilter.setFilters(filters); + + Map filterMap = new LinkedHashMap<>(); + filterMap.put("/webjars/**", "anon"); + filterMap.put("/druid/**", "anon"); + filterMap.put("/login", "anon"); + filterMap.put("/swagger/**", "anon"); + filterMap.put("/v2/api-docs", "anon"); + filterMap.put("/doc.html", "anon"); + filterMap.put("/swagger-resources/**", "anon"); + filterMap.put("/captcha", "anon"); + filterMap.put("/favicon.ico", "anon"); + filterMap.put("/", "anon"); + + filterMap.put("/front/**", "loginFilter"); +// filterMap.put("/front/user/sendMsg", "anon"); +// filterMap.put("/front/user/login", "anon"); +// filterMap.put("/front/user/loginout", "anon"); +// filterMap.put("/renren-admin/front/**", "loginFilter"); + + filterMap.put("/**", "oauth2"); + shiroFilter.setFilterChainDefinitionMap(filterMap); + + return shiroFilter; + } + + @Bean("lifecycleBeanPostProcessor") + public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() { + return new LifecycleBeanPostProcessor(); + } + + @Bean + public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) { + AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor(); + advisor.setSecurityManager(securityManager); + return advisor; + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/config/WebMvcConfig.java b/renren-admin/src/main/java/io/renren/modules/security/config/WebMvcConfig.java new file mode 100644 index 0000000..df594ef --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/config/WebMvcConfig.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.config; + +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 io.renren.common.utils.DateUtils; +import io.renren.modules.front.common.JacksonObjectMapper; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.ByteArrayHttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.ResourceHttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.TimeZone; + +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOriginPatterns("*") + .allowCredentials(true) + .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") + .maxAge(3600); + } + + @Override + public void configureMessageConverters(List> converters) { + converters.add(new ByteArrayHttpMessageConverter()); + converters.add(new StringHttpMessageConverter()); + converters.add(new ResourceHttpMessageConverter()); + converters.add(new AllEncompassingFormHttpMessageConverter()); + converters.add(new StringHttpMessageConverter()); + converters.add(jackson2HttpMessageConverter()); + } + + @Override + public void extendMessageConverters(List> converters) { + MappingJackson2HttpMessageConverter messageConverter = new MappingJackson2HttpMessageConverter(); + messageConverter.setObjectMapper(new JacksonObjectMapper()); + converters.add(0, messageConverter); + } + + @Bean + public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() { + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + ObjectMapper mapper = new ObjectMapper(); + + //日期格式转换 + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN)); + mapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); + + //Long类型转String类型 + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(Long.class, ToStringSerializer.instance); + simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); + mapper.registerModule(simpleModule); + + converter.setObjectMapper(mapper); + return converter; + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java b/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java new file mode 100644 index 0000000..a64b47d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.controller; + +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import io.renren.common.utils.IpUtils; +import io.renren.common.utils.Result; +import io.renren.common.validator.AssertUtils; +import io.renren.common.validator.ValidatorUtils; +import io.renren.modules.log.entity.SysLogLoginEntity; +import io.renren.modules.log.enums.LoginOperationEnum; +import io.renren.modules.log.enums.LoginStatusEnum; +import io.renren.modules.log.service.SysLogLoginService; +import io.renren.modules.security.dto.LoginDTO; +import io.renren.modules.security.password.PasswordUtils; +import io.renren.modules.security.service.CaptchaService; +import io.renren.modules.security.service.SysUserTokenService; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.enums.UserStatusEnum; +import io.renren.modules.sys.service.SysUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Date; + +/** + * 登录 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@Api(tags="登录管理") +public class LoginController { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysUserTokenService sysUserTokenService; + @Autowired + private CaptchaService captchaService; + @Autowired + private SysLogLoginService sysLogLoginService; + + @GetMapping("captcha") + @ApiOperation(value = "验证码", produces="application/octet-stream") + @ApiImplicitParam(paramType = "query", dataType="string", name = "uuid", required = true) + public void captcha(HttpServletResponse response, String uuid)throws IOException { + //uuid不能为空 + AssertUtils.isBlank(uuid, ErrorCode.IDENTIFIER_NOT_NULL); + + //生成验证码 + captchaService.create(response, uuid); + } + + @PostMapping("login") + @ApiOperation(value = "登录") + public Result login(HttpServletRequest request, @RequestBody LoginDTO login) { + //效验数据 + ValidatorUtils.validateEntity(login); + + //验证码是否正确 + boolean flag = captchaService.validate(login.getUuid(), login.getCaptcha()); + if(!flag){ + return new Result().error(ErrorCode.CAPTCHA_ERROR); + } + + //用户信息 + SysUserDTO user = sysUserService.getByUsername(login.getUsername()); + + SysLogLoginEntity log = new SysLogLoginEntity(); + log.setOperation(LoginOperationEnum.LOGIN.value()); + log.setCreateDate(new Date()); + log.setIp(IpUtils.getIpAddr(request)); + log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); + + //用户不存在 + if(user == null){ + log.setStatus(LoginStatusEnum.FAIL.value()); + log.setCreatorName(login.getUsername()); + sysLogLoginService.save(log); + + throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); + } + + //密码错误 + if(!PasswordUtils.matches(login.getPassword(), user.getPassword())){ + log.setStatus(LoginStatusEnum.FAIL.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + sysLogLoginService.save(log); + + throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); + } + + //账号停用 + if(user.getStatus() == UserStatusEnum.DISABLE.value()){ + log.setStatus(LoginStatusEnum.LOCK.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + sysLogLoginService.save(log); + + throw new RenException(ErrorCode.ACCOUNT_DISABLE); + } + + //登录成功 + log.setStatus(LoginStatusEnum.SUCCESS.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + sysLogLoginService.save(log); + + return sysUserTokenService.createToken(user.getId()); + } + + @PostMapping("logout") + @ApiOperation(value = "退出") + public Result logout(HttpServletRequest request) { + UserDetail user = SecurityUser.getUser(); + + //退出 + sysUserTokenService.logout(user.getId()); + + //用户信息 + SysLogLoginEntity log = new SysLogLoginEntity(); + log.setOperation(LoginOperationEnum.LOGOUT.value()); + log.setIp(IpUtils.getIpAddr(request)); + log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); + log.setIp(IpUtils.getIpAddr(request)); + log.setStatus(LoginStatusEnum.SUCCESS.value()); + log.setCreator(user.getId()); + log.setCreatorName(user.getUsername()); + log.setCreateDate(new Date()); + sysLogLoginService.save(log); + + return new Result(); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/dao/SysUserTokenDao.java b/renren-admin/src/main/java/io/renren/modules/security/dao/SysUserTokenDao.java new file mode 100644 index 0000000..154b130 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/dao/SysUserTokenDao.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.security.entity.SysUserTokenEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 系统用户Token + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserTokenDao extends BaseDao { + + SysUserTokenEntity getByToken(String token); + + SysUserTokenEntity getByUserId(Long userId); + + void updateToken(@Param("userId") Long userId, @Param("token") String token); +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/dto/LoginDTO.java b/renren-admin/src/main/java/io/renren/modules/security/dto/LoginDTO.java new file mode 100644 index 0000000..608fc9b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/dto/LoginDTO.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 登录表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "登录表单") +public class LoginDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "用户名", required = true) + @NotBlank(message="{sysuser.username.require}") + private String username; + + @ApiModelProperty(value = "密码") + @NotBlank(message="{sysuser.password.require}") + private String password; + + @ApiModelProperty(value = "验证码") + @NotBlank(message="{sysuser.captcha.require}") + private String captcha; + + @ApiModelProperty(value = "唯一标识") + @NotBlank(message="{sysuser.uuid.require}") + private String uuid; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/entity/SysUserTokenEntity.java b/renren-admin/src/main/java/io/renren/modules/security/entity/SysUserTokenEntity.java new file mode 100644 index 0000000..3002c8e --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/entity/SysUserTokenEntity.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 系统用户Token + */ +@Data +@TableName("sys_user_token") +public class SysUserTokenEntity implements Serializable { + private static final long serialVersionUID = 1L; + /** + * id + */ + @TableId + private Long id; + /** + * 用户ID + */ + private Long userId; + /** + * 用户token + */ + private String token; + /** + * 过期时间 + */ + private Date expireDate; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java new file mode 100644 index 0000000..5836068 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Filter.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.oauth2; + +import com.google.gson.Gson; +import io.renren.common.constant.Constant; +import io.renren.common.exception.ErrorCode; +import io.renren.common.utils.HttpContextUtils; +import io.renren.common.utils.Result; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.shiro.authc.AuthenticationException; +import org.apache.shiro.authc.AuthenticationToken; +import org.apache.shiro.web.filter.authc.AuthenticatingFilter; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * oauth2过滤器 + * + * @author Mark sunlightcs@gmail.com + */ +public class Oauth2Filter extends AuthenticatingFilter { + + @Override + protected AuthenticationToken createToken(ServletRequest request, ServletResponse response) throws Exception { + //获取请求token + String token = getRequestToken((HttpServletRequest) request); + + if(StringUtils.isBlank(token)){ + return null; + } + + return new Oauth2Token(token); + } + + @Override + protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { + if(((HttpServletRequest) request).getMethod().equals(RequestMethod.OPTIONS.name())){ + return true; + } + + return false; + } + + @Override + protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { + //获取请求token,如果token不存在,直接返回401 + String token = getRequestToken((HttpServletRequest) request); + if(StringUtils.isBlank(token)){ + HttpServletResponse httpResponse = (HttpServletResponse) response; + httpResponse.setContentType("application/json;charset=utf-8"); + httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); + httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); + + String json = new Gson().toJson(new Result().error(ErrorCode.UNAUTHORIZED)); + + httpResponse.getWriter().print(json); + + return false; + } + return executeLogin(request, response); + } + + @Override + protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) { + HttpServletResponse httpResponse = (HttpServletResponse) response; + httpResponse.setContentType("application/json;charset=utf-8"); + httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); + httpResponse.setHeader("Access-Control-Allow-Origin", HttpContextUtils.getOrigin()); + try { + //处理登录失败的异常 + Throwable throwable = e.getCause() == null ? e : e.getCause(); + Result r = new Result().error(HttpStatus.SC_UNAUTHORIZED, throwable.getMessage()); + + String json = new Gson().toJson(r); + httpResponse.getWriter().print(json); + } catch (IOException e1) { + + } + + return false; + } + + /** + * 获取请求的token + */ + private String getRequestToken(HttpServletRequest httpRequest){ + //从header中获取token + String token = httpRequest.getHeader(Constant.TOKEN_HEADER); + + //如果header中不存在token,则从参数中获取token + if(StringUtils.isBlank(token)){ + token = httpRequest.getParameter(Constant.TOKEN_HEADER); + } + + return token; + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Realm.java b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Realm.java new file mode 100644 index 0000000..12ccf74 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Realm.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.oauth2; + +import io.renren.common.exception.ErrorCode; +import io.renren.common.utils.ConvertUtils; +import io.renren.common.utils.MessageUtils; +import io.renren.modules.security.entity.SysUserTokenEntity; +import io.renren.modules.security.service.ShiroService; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.entity.SysUserEntity; +import org.apache.shiro.authc.*; +import org.apache.shiro.authz.AuthorizationInfo; +import org.apache.shiro.authz.SimpleAuthorizationInfo; +import org.apache.shiro.realm.AuthorizingRealm; +import org.apache.shiro.subject.PrincipalCollection; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +/** + * 认证 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class Oauth2Realm extends AuthorizingRealm { + @Autowired + private ShiroService shiroService; + + @Override + public boolean supports(AuthenticationToken token) { + return token instanceof Oauth2Token; + } + + /** + * 授权(验证权限时调用) + */ + @Override + protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { + UserDetail user = (UserDetail)principals.getPrimaryPrincipal(); + + //用户权限列表 + Set permsSet = shiroService.getUserPermissions(user); + + SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); + info.setStringPermissions(permsSet); + return info; + } + + /** + * 认证(登录时调用) + */ + @Override + protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { + String accessToken = (String) token.getPrincipal(); + + //根据accessToken,查询用户信息 + SysUserTokenEntity tokenEntity = shiroService.getByToken(accessToken); + //token失效 + if(tokenEntity == null || tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()){ + throw new IncorrectCredentialsException(MessageUtils.getMessage(ErrorCode.TOKEN_INVALID)); + } + + //查询用户信息 + SysUserEntity userEntity = shiroService.getUser(tokenEntity.getUserId()); + + //转换成UserDetail对象 + UserDetail userDetail = ConvertUtils.sourceToTarget(userEntity, UserDetail.class); + + //获取用户对应的部门数据权限 + List deptIdList = shiroService.getDataScopeList(userDetail.getId()); + userDetail.setDeptIdList(deptIdList); + + //账号锁定 + if(userDetail.getStatus() == 0){ + throw new LockedAccountException(MessageUtils.getMessage(ErrorCode.ACCOUNT_LOCK)); + } + + SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(userDetail, accessToken, getName()); + return info; + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Token.java b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Token.java new file mode 100644 index 0000000..f6be31d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/oauth2/Oauth2Token.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.oauth2; + +import org.apache.shiro.authc.AuthenticationToken; + +/** + * token + * + * @author Mark sunlightcs@gmail.com + */ +public class Oauth2Token implements AuthenticationToken { + private String token; + + public Oauth2Token(String token){ + this.token = token; + } + + @Override + public String getPrincipal() { + return token; + } + + @Override + public Object getCredentials() { + return token; + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/oauth2/TokenGenerator.java b/renren-admin/src/main/java/io/renren/modules/security/oauth2/TokenGenerator.java new file mode 100644 index 0000000..13d0014 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/oauth2/TokenGenerator.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.oauth2; + +import io.renren.common.exception.RenException; + +import java.security.MessageDigest; +import java.util.UUID; + +/** + * 生成token + * + * @author Mark sunlightcs@gmail.com + */ +public class TokenGenerator { + + public static String generateValue() { + return generateValue(UUID.randomUUID().toString()); + } + + private static final char[] HEX_CODE = "0123456789abcdef".toCharArray(); + + public static String toHexString(byte[] data) { + if(data == null) { + return null; + } + StringBuilder r = new StringBuilder(data.length*2); + for ( byte b : data) { + r.append(HEX_CODE[(b >> 4) & 0xF]); + r.append(HEX_CODE[(b & 0xF)]); + } + return r.toString(); + } + + public static String generateValue(String param) { + try { + MessageDigest algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(param.getBytes()); + byte[] messageDigest = algorithm.digest(); + return toHexString(messageDigest); + } catch (Exception e) { + throw new RenException("token invalid", e); + } + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/password/BCrypt.java b/renren-admin/src/main/java/io/renren/modules/security/password/BCrypt.java new file mode 100644 index 0000000..1383c38 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/password/BCrypt.java @@ -0,0 +1,662 @@ +package io.renren.modules.security.password; + +import java.io.ByteArrayOutputStream; +import java.io.UnsupportedEncodingException; +import java.security.SecureRandom; + +/** + * BCrypt implements OpenBSD-style Blowfish password hashing using the scheme described in + * "A Future-Adaptable Password Scheme" by Niels Provos and David Mazieres. + *

+ * This password hashing system tries to thwart off-line password cracking using a + * computationally-intensive hashing algorithm, based on Bruce Schneier's Blowfish cipher. + * The work factor of the algorithm is parameterised, so it can be increased as computers + * get faster. + *

+ * Usage is really simple. To hash a password for the first time, call the hashpw method + * with a random salt, like this: + *

+ * + * String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt());
+ *
+ *

+ * To check whether a plaintext password matches one that has been hashed previously, use + * the checkpw method: + *

+ * + * if (BCrypt.checkpw(candidate_password, stored_hash))
+ *     System.out.println("It matches");
+ * else
+ *     System.out.println("It does not match");
+ *
+ *

+ * The gensalt() method takes an optional parameter (log_rounds) that determines the + * computational complexity of the hashing: + *

+ * + * String strong_salt = BCrypt.gensalt(10)
+ * String stronger_salt = BCrypt.gensalt(12)
+ *
+ *

+ * The amount of work increases exponentially (2**log_rounds), so each increment is twice + * as much work. The default log_rounds is 10, and the valid range is 4 to 31. + * + * @author Damien Miller + */ +public class BCrypt { + // BCrypt parameters + + private static final int GENSALT_DEFAULT_LOG2_ROUNDS = 10; + private static final int BCRYPT_SALT_LEN = 16; + // Blowfish parameters + private static final int BLOWFISH_NUM_ROUNDS = 16; + // Initial contents of key schedule + private static final int P_orig[] = { 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, + 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b }; + private static final int S_orig[] = { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, + 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, + 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, + 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, + 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, + 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, + 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, + 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, + 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, + 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, + 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, + 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, + 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, + 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, + 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, + 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, + 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, + 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, + 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, + 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, + 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, + 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, + 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, + 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, + 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, + 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, + 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, + 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, + 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, + 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, + 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, + 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, + 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, + 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, + 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, + 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, + 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, + 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, + 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, + 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, + 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, + 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, + 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, + 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, + 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, + 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, + 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, + 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, + 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, + 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, + 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, + 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, + 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, + 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, + 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, + 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, + 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, + 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, + 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, + 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, + 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, + 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, + 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, + 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, + 0x670efa8e, 0x406000e0, 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, + 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, + 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, + 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, + 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, + 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, + 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, + 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, + 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, + 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, + 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, + 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, + 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, + 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, + 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, + 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, + 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, + 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, + 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, + 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, + 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, + 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 }; + // bcrypt IV: "OrpheanBeholderScryDoubt" + static private final int bf_crypt_ciphertext[] = { 0x4f727068, 0x65616e42, + 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274 }; + // Table for Base64 encoding + static private final char base64_code[] = { '.', '/', 'A', 'B', 'C', 'D', 'E', 'F', + 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', + 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', + 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; + // Table for Base64 decoding + static private final byte index_64[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + -1, -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1 }; + static final int MIN_LOG_ROUNDS = 4; + static final int MAX_LOG_ROUNDS = 31; + // Expanded Blowfish key + private int P[]; + private int S[]; + + /** + * Encode a byte array using bcrypt's slightly-modified base64 encoding scheme. Note + * that this is not compatible with the standard MIME-base64 + * encoding. + * + * @param d the byte array to encode + * @param len the number of bytes to encode + * @param rs the destination buffer for the base64-encoded string + * @exception IllegalArgumentException if the length is invalid + */ + static void encode_base64(byte d[], int len, StringBuilder rs) + throws IllegalArgumentException { + int off = 0; + int c1, c2; + + if (len <= 0 || len > d.length) { + throw new IllegalArgumentException("Invalid len"); + } + + while (off < len) { + c1 = d[off++] & 0xff; + rs.append(base64_code[(c1 >> 2) & 0x3f]); + c1 = (c1 & 0x03) << 4; + if (off >= len) { + rs.append(base64_code[c1 & 0x3f]); + break; + } + c2 = d[off++] & 0xff; + c1 |= (c2 >> 4) & 0x0f; + rs.append(base64_code[c1 & 0x3f]); + c1 = (c2 & 0x0f) << 2; + if (off >= len) { + rs.append(base64_code[c1 & 0x3f]); + break; + } + c2 = d[off++] & 0xff; + c1 |= (c2 >> 6) & 0x03; + rs.append(base64_code[c1 & 0x3f]); + rs.append(base64_code[c2 & 0x3f]); + } + } + + /** + * Look up the 3 bits base64-encoded by the specified character, range-checking + * against conversion table + * @param x the base64-encoded value + * @return the decoded value of x + */ + private static byte char64(char x) { + if (x > index_64.length) { + return -1; + } + return index_64[x]; + } + + /** + * Decode a string encoded using bcrypt's base64 scheme to a byte array. Note that + * this is *not* compatible with the standard MIME-base64 encoding. + * @param s the string to decode + * @param maxolen the maximum number of bytes to decode + * @return an array containing the decoded bytes + * @throws IllegalArgumentException if maxolen is invalid + */ + static byte[] decode_base64(String s, int maxolen) throws IllegalArgumentException { + ByteArrayOutputStream out = new ByteArrayOutputStream(maxolen); + int off = 0, slen = s.length(), olen = 0; + byte c1, c2, c3, c4, o; + + if (maxolen <= 0) { + throw new IllegalArgumentException("Invalid maxolen"); + } + + while (off < slen - 1 && olen < maxolen) { + c1 = char64(s.charAt(off++)); + c2 = char64(s.charAt(off++)); + if (c1 == -1 || c2 == -1) { + break; + } + o = (byte) (c1 << 2); + o |= (c2 & 0x30) >> 4; + out.write(o); + if (++olen >= maxolen || off >= slen) { + break; + } + c3 = char64(s.charAt(off++)); + if (c3 == -1) { + break; + } + o = (byte) ((c2 & 0x0f) << 4); + o |= (c3 & 0x3c) >> 2; + out.write(o); + if (++olen >= maxolen || off >= slen) { + break; + } + c4 = char64(s.charAt(off++)); + o = (byte) ((c3 & 0x03) << 6); + o |= c4; + out.write(o); + ++olen; + } + + return out.toByteArray(); + } + + /** + * Blowfish encipher a single 64-bit block encoded as two 32-bit halves + * @param lr an array containing the two 32-bit half blocks + * @param off the position in the array of the blocks + */ + private final void encipher(int lr[], int off) { + int i, n, l = lr[off], r = lr[off + 1]; + + l ^= P[0]; + for (i = 0; i <= BLOWFISH_NUM_ROUNDS - 2;) { + // Feistel substitution on left word + n = S[(l >> 24) & 0xff]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[++i]; + + // Feistel substitution on right word + n = S[(r >> 24) & 0xff]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[++i]; + } + lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; + lr[off + 1] = l; + } + + /** + * Cycically extract a word of key material + * @param data the string to extract the data from + * @param offp a "pointer" (as a one-entry array) to the current offset into data + * @return the next word of material from data + */ + private static int streamtoword(byte data[], int offp[]) { + int i; + int word = 0; + int off = offp[0]; + + for (i = 0; i < 4; i++) { + word = (word << 8) | (data[off] & 0xff); + off = (off + 1) % data.length; + } + + offp[0] = off; + return word; + } + + /** + * Initialise the Blowfish key schedule + */ + private void init_key() { + P = (int[]) P_orig.clone(); + S = (int[]) S_orig.clone(); + } + + /** + * Key the Blowfish cipher + * @param key an array containing the key + */ + private void key(byte key[]) { + int i; + int koffp[] = { 0 }; + int lr[] = { 0, 0 }; + int plen = P.length, slen = S.length; + + for (i = 0; i < plen; i++) { + P[i] = P[i] ^ streamtoword(key, koffp); + } + + for (i = 0; i < plen; i += 2) { + encipher(lr, 0); + P[i] = lr[0]; + P[i + 1] = lr[1]; + } + + for (i = 0; i < slen; i += 2) { + encipher(lr, 0); + S[i] = lr[0]; + S[i + 1] = lr[1]; + } + } + + /** + * Perform the "enhanced key schedule" step described by Provos and Mazieres in + * "A Future-Adaptable Password Scheme" http://www.openbsd.org/papers/bcrypt-paper.ps + * @param data salt information + * @param key password information + */ + private void ekskey(byte data[], byte key[]) { + int i; + int koffp[] = { 0 }, doffp[] = { 0 }; + int lr[] = { 0, 0 }; + int plen = P.length, slen = S.length; + + for (i = 0; i < plen; i++) { + P[i] = P[i] ^ streamtoword(key, koffp); + } + + for (i = 0; i < plen; i += 2) { + lr[0] ^= streamtoword(data, doffp); + lr[1] ^= streamtoword(data, doffp); + encipher(lr, 0); + P[i] = lr[0]; + P[i + 1] = lr[1]; + } + + for (i = 0; i < slen; i += 2) { + lr[0] ^= streamtoword(data, doffp); + lr[1] ^= streamtoword(data, doffp); + encipher(lr, 0); + S[i] = lr[0]; + S[i + 1] = lr[1]; + } + } + + static long roundsForLogRounds(int log_rounds) { + if (log_rounds < 4 || log_rounds > 31) { + throw new IllegalArgumentException("Bad number of rounds"); + } + return 1L << log_rounds; + } + + /** + * Perform the central password hashing step in the bcrypt scheme + * @param password the password to hash + * @param salt the binary salt to hash with the password + * @param log_rounds the binary logarithm of the number of rounds of hashing to apply + * @return an array containing the binary hashed password + */ + private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) { + int cdata[] = (int[]) bf_crypt_ciphertext.clone(); + int clen = cdata.length; + byte ret[]; + + long rounds = roundsForLogRounds(log_rounds); + + init_key(); + ekskey(salt, password); + for (long i = 0; i < rounds; i++) { + key(password); + key(salt); + } + + for (int i = 0; i < 64; i++) { + for (int j = 0; j < (clen >> 1); j++) { + encipher(cdata, j << 1); + } + } + + ret = new byte[clen * 4]; + for (int i = 0, j = 0; i < clen; i++) { + ret[j++] = (byte) ((cdata[i] >> 24) & 0xff); + ret[j++] = (byte) ((cdata[i] >> 16) & 0xff); + ret[j++] = (byte) ((cdata[i] >> 8) & 0xff); + ret[j++] = (byte) (cdata[i] & 0xff); + } + return ret; + } + + /** + * Hash a password using the OpenBSD bcrypt scheme + * @param password the password to hash + * @param salt the salt to hash with (perhaps generated using BCrypt.gensalt) + * @return the hashed password + * @throws IllegalArgumentException if invalid salt is passed + */ + public static String hashpw(String password, String salt) throws IllegalArgumentException { + BCrypt B; + String real_salt; + byte passwordb[], saltb[], hashed[]; + char minor = (char) 0; + int rounds, off = 0; + StringBuilder rs = new StringBuilder(); + + if (salt == null) { + throw new IllegalArgumentException("salt cannot be null"); + } + + int saltLength = salt.length(); + + if (saltLength < 28) { + throw new IllegalArgumentException("Invalid salt"); + } + + if (salt.charAt(0) != '$' || salt.charAt(1) != '2') { + throw new IllegalArgumentException("Invalid salt version"); + } + if (salt.charAt(2) == '$') { + off = 3; + } + else { + minor = salt.charAt(2); + if (minor != 'a' || salt.charAt(3) != '$') { + throw new IllegalArgumentException("Invalid salt revision"); + } + off = 4; + } + + if (saltLength - off < 25) { + throw new IllegalArgumentException("Invalid salt"); + } + + // Extract number of rounds + if (salt.charAt(off + 2) > '$') { + throw new IllegalArgumentException("Missing salt rounds"); + } + rounds = Integer.parseInt(salt.substring(off, off + 2)); + + real_salt = salt.substring(off + 3, off + 25); + try { + passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8"); + } + catch (UnsupportedEncodingException uee) { + throw new AssertionError("UTF-8 is not supported"); + } + + saltb = decode_base64(real_salt, BCRYPT_SALT_LEN); + + B = new BCrypt(); + hashed = B.crypt_raw(passwordb, saltb, rounds); + + rs.append("$2"); + if (minor >= 'a') { + rs.append(minor); + } + rs.append("$"); + if (rounds < 10) { + rs.append("0"); + } + rs.append(rounds); + rs.append("$"); + encode_base64(saltb, saltb.length, rs); + encode_base64(hashed, bf_crypt_ciphertext.length * 4 - 1, rs); + return rs.toString(); + } + + /** + * Generate a salt for use with the BCrypt.hashpw() method + * @param log_rounds the log2 of the number of rounds of hashing to apply - the work + * factor therefore increases as 2**log_rounds. Minimum 4, maximum 31. + * @param random an instance of SecureRandom to use + * @return an encoded salt value + */ + public static String gensalt(int log_rounds, SecureRandom random) { + if (log_rounds < MIN_LOG_ROUNDS || log_rounds > MAX_LOG_ROUNDS) { + throw new IllegalArgumentException("Bad number of rounds"); + } + StringBuilder rs = new StringBuilder(); + byte rnd[] = new byte[BCRYPT_SALT_LEN]; + + random.nextBytes(rnd); + + rs.append("$2a$"); + if (log_rounds < 10) { + rs.append("0"); + } + rs.append(log_rounds); + rs.append("$"); + encode_base64(rnd, rnd.length, rs); + return rs.toString(); + } + + /** + * Generate a salt for use with the BCrypt.hashpw() method + * @param log_rounds the log2 of the number of rounds of hashing to apply - the work + * factor therefore increases as 2**log_rounds. Minimum 4, maximum 31. + * @return an encoded salt value + */ + public static String gensalt(int log_rounds) { + return gensalt(log_rounds, new SecureRandom()); + } + + /** + * Generate a salt for use with the BCrypt.hashpw() method, selecting a reasonable + * default for the number of hashing rounds to apply + * @return an encoded salt value + */ + public static String gensalt() { + return gensalt(GENSALT_DEFAULT_LOG2_ROUNDS); + } + + /** + * Check that a plaintext password matches a previously hashed one + * @param plaintext the plaintext password to verify + * @param hashed the previously-hashed password + * @return true if the passwords match, false otherwise + */ + public static boolean checkpw(String plaintext, String hashed) { + return equalsNoEarlyReturn(hashed, hashpw(plaintext, hashed)); + } + + static boolean equalsNoEarlyReturn(String a, String b) { + char[] caa = a.toCharArray(); + char[] cab = b.toCharArray(); + + if (caa.length != cab.length) { + return false; + } + + byte ret = 0; + for (int i = 0; i < caa.length; i++) { + ret |= caa[i] ^ cab[i]; + } + return ret == 0; + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/password/BCryptPasswordEncoder.java b/renren-admin/src/main/java/io/renren/modules/security/password/BCryptPasswordEncoder.java new file mode 100644 index 0000000..d27be66 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/password/BCryptPasswordEncoder.java @@ -0,0 +1,82 @@ +package io.renren.modules.security.password; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.security.SecureRandom; +import java.util.regex.Pattern; + +/** + * Implementation of PasswordEncoder that uses the BCrypt strong hashing function. Clients + * can optionally supply a "strength" (a.k.a. log rounds in BCrypt) and a SecureRandom + * instance. The larger the strength parameter the more work will have to be done + * (exponentially) to hash the passwords. The default value is 10. + * + * @author Dave Syer + * + */ +public class BCryptPasswordEncoder implements PasswordEncoder { + private Pattern BCRYPT_PATTERN = Pattern + .compile("\\A\\$2a?\\$\\d\\d\\$[./0-9A-Za-z]{53}"); + private final Log logger = LogFactory.getLog(getClass()); + + private final int strength; + + private final SecureRandom random; + + public BCryptPasswordEncoder() { + this(-1); + } + + /** + * @param strength the log rounds to use, between 4 and 31 + */ + public BCryptPasswordEncoder(int strength) { + this(strength, null); + } + + /** + * @param strength the log rounds to use, between 4 and 31 + * @param random the secure random instance to use + * + */ + public BCryptPasswordEncoder(int strength, SecureRandom random) { + if (strength != -1 && (strength < BCrypt.MIN_LOG_ROUNDS || strength > BCrypt.MAX_LOG_ROUNDS)) { + throw new IllegalArgumentException("Bad strength"); + } + this.strength = strength; + this.random = random; + } + + @Override + public String encode(CharSequence rawPassword) { + String salt; + if (strength > 0) { + if (random != null) { + salt = BCrypt.gensalt(strength, random); + } + else { + salt = BCrypt.gensalt(strength); + } + } + else { + salt = BCrypt.gensalt(); + } + return BCrypt.hashpw(rawPassword.toString(), salt); + } + + @Override + public boolean matches(CharSequence rawPassword, String encodedPassword) { + if (encodedPassword == null || encodedPassword.length() == 0) { + logger.warn("Empty encoded password"); + return false; + } + + if (!BCRYPT_PATTERN.matcher(encodedPassword).matches()) { + logger.warn("Encoded password does not look like BCrypt"); + return false; + } + + return BCrypt.checkpw(rawPassword.toString(), encodedPassword); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/password/PasswordEncoder.java b/renren-admin/src/main/java/io/renren/modules/security/password/PasswordEncoder.java new file mode 100644 index 0000000..3b746e6 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/password/PasswordEncoder.java @@ -0,0 +1,30 @@ +package io.renren.modules.security.password; + +/** + * Service interface for encoding passwords. + * + * The preferred implementation is {@code BCryptPasswordEncoder}. + * + * @author Keith Donald + */ +public interface PasswordEncoder { + + /** + * Encode the raw password. Generally, a good encoding algorithm applies a SHA-1 or + * greater hash combined with an 8-byte or greater randomly generated salt. + */ + String encode(CharSequence rawPassword); + + /** + * Verify the encoded password obtained from storage matches the submitted raw + * password after it too is encoded. Returns true if the passwords match, false if + * they do not. The stored password itself is never decoded. + * + * @param rawPassword the raw password to encode and match + * @param encodedPassword the encoded password from storage to compare with + * @return true if the raw password, after encoding, matches the encoded password from + * storage + */ + boolean matches(CharSequence rawPassword, String encodedPassword); + +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/password/PasswordUtils.java b/renren-admin/src/main/java/io/renren/modules/security/password/PasswordUtils.java new file mode 100644 index 0000000..be12fa6 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/password/PasswordUtils.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package io.renren.modules.security.password; + +/** + * 密码工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class PasswordUtils { + private static PasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); + + /** + * 加密 + * @param str 字符串 + * @return 返回加密字符串 + */ + public static String encode(String str){ + return passwordEncoder.encode(str); + } + + + /** + * 比较密码是否相等 + * @param str 明文密码 + * @param password 加密后密码 + * @return true:成功 false:失败 + */ + public static boolean matches(String str, String password){ + return passwordEncoder.matches(str, password); + } + + + public static void main(String[] args) { + String str = "admin"; + String password = encode(str); + + System.out.println(password); + System.out.println(matches(str, password)); + } + +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/CaptchaService.java b/renren-admin/src/main/java/io/renren/modules/security/service/CaptchaService.java new file mode 100644 index 0000000..e660f75 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/service/CaptchaService.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.service; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * 验证码 + * + * @author Mark sunlightcs@gmail.com + */ +public interface CaptchaService { + + /** + * 图片验证码 + */ + void create(HttpServletResponse response, String uuid) throws IOException; + + /** + * 验证码效验 + * @param uuid uuid + * @param code 验证码 + * @return true:成功 false:失败 + */ + boolean validate(String uuid, String code); +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/ShiroService.java b/renren-admin/src/main/java/io/renren/modules/security/service/ShiroService.java new file mode 100644 index 0000000..5beca6e --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/service/ShiroService.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.service; + +import io.renren.modules.security.entity.SysUserTokenEntity; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.entity.SysUserEntity; + +import java.util.List; +import java.util.Set; + +/** + * shiro相关接口 + * + * @author Mark sunlightcs@gmail.com + */ +public interface ShiroService { + /** + * 获取用户权限列表 + */ + Set getUserPermissions(UserDetail user); + + SysUserTokenEntity getByToken(String token); + + /** + * 根据用户ID,查询用户 + * @param userId + */ + SysUserEntity getUser(Long userId); + + /** + * 获取用户对应的部门数据权限 + * @param userId 用户ID + * @return 返回部门ID列表 + */ + List getDataScopeList(Long userId); +} diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/SysUserTokenService.java b/renren-admin/src/main/java/io/renren/modules/security/service/SysUserTokenService.java new file mode 100644 index 0000000..881493c --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/service/SysUserTokenService.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.service; + +import io.renren.common.service.BaseService; +import io.renren.common.utils.Result; +import io.renren.modules.security.entity.SysUserTokenEntity; + +/** + * 用户Token + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysUserTokenService extends BaseService { + + /** + * 生成token + * @param userId 用户ID + */ + Result createToken(Long userId); + + /** + * 退出,修改token值 + * @param userId 用户ID + */ + void logout(Long userId); + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/impl/CaptchaServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/security/service/impl/CaptchaServiceImpl.java new file mode 100644 index 0000000..9094f91 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/service/impl/CaptchaServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.service.impl; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.wf.captcha.SpecCaptcha; +import com.wf.captcha.base.Captcha; +import io.renren.common.redis.RedisKeys; +import io.renren.common.redis.RedisUtils; +import io.renren.modules.security.service.CaptchaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +/** + * 验证码 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class CaptchaServiceImpl implements CaptchaService { + @Autowired + private RedisUtils redisUtils; + @Value("${renren.redis.open: false}") + private boolean open; + /** + * Local Cache 5分钟过期 + */ + Cache localCache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterAccess(5, TimeUnit.MINUTES).build(); + + @Override + public void create(HttpServletResponse response, String uuid) throws IOException { + response.setContentType("image/gif"); + response.setHeader("Pragma", "No-cache"); + response.setHeader("Cache-Control", "no-cache"); + response.setDateHeader("Expires", 0); + + //生成验证码 + SpecCaptcha captcha = new SpecCaptcha(150, 40); + captcha.setLen(5); + captcha.setCharType(Captcha.TYPE_DEFAULT); + captcha.out(response.getOutputStream()); + + //保存到缓存 + setCache(uuid, captcha.text()); + } + + @Override + public boolean validate(String uuid, String code) { + //获取验证码 + String captcha = getCache(uuid); + + //效验成功 + if(code.equalsIgnoreCase(captcha)){ + return true; + } + + return false; + } + + private void setCache(String key, String value){ + if(open){ + key = RedisKeys.getCaptchaKey(key); + redisUtils.set(key, value, 300); + }else{ + localCache.put(key, value); + } + } + + private String getCache(String key){ + if(open){ + key = RedisKeys.getCaptchaKey(key); + String captcha = (String)redisUtils.get(key); + //删除验证码 + if(captcha != null){ + redisUtils.delete(key); + } + + return captcha; + } + + String captcha = localCache.getIfPresent(key); + //删除验证码 + if(captcha != null){ + localCache.invalidate(key); + } + return captcha; + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/impl/ShiroServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/security/service/impl/ShiroServiceImpl.java new file mode 100644 index 0000000..8c5e620 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/service/impl/ShiroServiceImpl.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.service.impl; + +import io.renren.modules.security.dao.SysUserTokenDao; +import io.renren.modules.security.entity.SysUserTokenEntity; +import io.renren.modules.security.service.ShiroService; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dao.SysMenuDao; +import io.renren.modules.sys.dao.SysRoleDataScopeDao; +import io.renren.modules.sys.dao.SysUserDao; +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.enums.SuperAdminEnum; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Service +public class ShiroServiceImpl implements ShiroService { + @Autowired + private SysMenuDao sysMenuDao; + @Autowired + private SysUserDao sysUserDao; + @Autowired + private SysUserTokenDao sysUserTokenDao; + @Autowired + private SysRoleDataScopeDao sysRoleDataScopeDao; + + @Override + public Set getUserPermissions(UserDetail user) { + //系统管理员,拥有最高权限 + List permissionsList; + if(user.getSuperAdmin() == SuperAdminEnum.YES.value()) { + permissionsList = sysMenuDao.getPermissionsList(); + }else{ + permissionsList = sysMenuDao.getUserPermissionsList(user.getId()); + } + + //用户权限列表 + Set permsSet = new HashSet<>(); + for(String permissions : permissionsList){ + if(StringUtils.isBlank(permissions)){ + continue; + } + permsSet.addAll(Arrays.asList(permissions.trim().split(","))); + } + + return permsSet; + } + + @Override + public SysUserTokenEntity getByToken(String token) { + return sysUserTokenDao.getByToken(token); + } + + @Override + public SysUserEntity getUser(Long userId) { + return sysUserDao.selectById(userId); + } + + @Override + public List getDataScopeList(Long userId) { + return sysRoleDataScopeDao.getDataScopeList(userId); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java new file mode 100644 index 0000000..3911f94 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.service.impl; + +import io.renren.common.constant.Constant; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.common.utils.Result; +import io.renren.modules.security.dao.SysUserTokenDao; +import io.renren.modules.security.entity.SysUserTokenEntity; +import io.renren.modules.security.oauth2.TokenGenerator; +import io.renren.modules.security.service.SysUserTokenService; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Service +public class SysUserTokenServiceImpl extends BaseServiceImpl implements SysUserTokenService { + /** + * 12小时后过期 + */ + private final static int EXPIRE = 3600 * 12; + + @Override + public Result createToken(Long userId) { + //用户token + String token; + + //当前时间 + Date now = new Date(); + //过期时间 + Date expireTime = new Date(now.getTime() + EXPIRE * 1000); + + //判断是否生成过token + SysUserTokenEntity tokenEntity = baseDao.getByUserId(userId); + if(tokenEntity == null){ + //生成一个token + token = TokenGenerator.generateValue(); + + tokenEntity = new SysUserTokenEntity(); + tokenEntity.setUserId(userId); + tokenEntity.setToken(token); + tokenEntity.setUpdateDate(now); + tokenEntity.setExpireDate(expireTime); + + //保存token + this.insert(tokenEntity); + }else{ + //判断token是否过期 + if(tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()){ + //token过期,重新生成token + token = TokenGenerator.generateValue(); + }else { + token = tokenEntity.getToken(); + } + + tokenEntity.setToken(token); + tokenEntity.setUpdateDate(now); + tokenEntity.setExpireDate(expireTime); + + //更新token + this.updateById(tokenEntity); + } + + Map map = new HashMap<>(2); + map.put(Constant.TOKEN_HEADER, token); + map.put("expire", EXPIRE); + return new Result().ok(map); + } + + @Override + public void logout(Long userId) { + //生成一个token + String token = TokenGenerator.generateValue(); + + //修改token + baseDao.updateToken(userId, token); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java b/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java new file mode 100644 index 0000000..2336337 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/user/SecurityUser.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.user; + +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +public class SecurityUser { + + public static Subject getSubject() { + try { + return SecurityUtils.getSubject(); + }catch (Exception e){ + return null; + } + } + + /** + * 获取用户信息 + */ + public static UserDetail getUser() { + Subject subject = getSubject(); + if(subject == null){ + return new UserDetail(); + } + + UserDetail user = (UserDetail)subject.getPrincipal(); + if(user == null){ + return new UserDetail(); + } + + return user; + } + + /** + * 获取用户ID + */ + public static Long getUserId() { + return getUser().getId(); + } + + /** + * 获取部门ID + */ + public static Long getDeptId() { + return getUser().getDeptId(); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/security/user/UserDetail.java b/renren-admin/src/main/java/io/renren/modules/security/user/UserDetail.java new file mode 100644 index 0000000..aee9cf5 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/security/user/UserDetail.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.security.user; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 登录用户信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class UserDetail implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private String username; + private String realName; + private String headUrl; + private Integer gender; + private String email; + private String mobile; + private Long deptId; + private String password; + private Integer status; + private Integer superAdmin; + /** + * 部门数据权限 + */ + private List deptIdList; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/IndexController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/IndexController.java new file mode 100644 index 0000000..18fb248 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/IndexController.java @@ -0,0 +1,20 @@ +package io.renren.modules.sys.controller; + +import io.renren.common.utils.Result; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 首页提示 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +public class IndexController { + + @GetMapping("/") + public Result index(){ + String tips = "你好,renren-admin已启动,请启动renren-ui,才能访问页面!"; + return new Result().ok(tips); + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java new file mode 100644 index 0000000..c2e944d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDeptController.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.annotation.LogOperation; +import io.renren.common.utils.Result; +import io.renren.common.validator.AssertUtils; +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.sys.dto.SysDeptDTO; +import io.renren.modules.sys.service.SysDeptService; +import io.swagger.annotations.Api; +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 java.util.HashMap; +import java.util.List; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/dept") +@Api(tags="部门管理") +public class SysDeptController { + @Autowired + private SysDeptService sysDeptService; + + @GetMapping("list") + @ApiOperation("列表") + @RequiresPermissions("sys:dept:list") + public Result> list(){ + List list = sysDeptService.list(new HashMap<>(1)); + + return new Result>().ok(list); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:dept:info") + public Result get(@PathVariable("id") Long id){ + SysDeptDTO data = sysDeptService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:dept:save") + public Result save(@RequestBody SysDeptDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysDeptService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:dept:update") + public Result update(@RequestBody SysDeptDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDeptService.update(dto); + + return new Result(); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:dept:delete") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + sysDeptService.delete(id); + + return new Result(); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictDataController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictDataController.java new file mode 100644 index 0000000..d2310cc --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictDataController.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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.AssertUtils; +import io.renren.common.validator.ValidatorUtils; +import io.renren.common.validator.group.DefaultGroup; +import io.renren.common.validator.group.UpdateGroup; +import io.renren.modules.sys.dto.SysDictDataDTO; +import io.renren.modules.sys.service.SysDictDataService; +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/dict/data") +@Api(tags="字典数据") +public class SysDictDataController { + @Autowired + private SysDictDataService sysDictDataService; + + @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 = "dictLabel", value = "字典标签", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:dict:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + //字典类型 + PageData page = sysDictDataService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:dict:info") + public Result get(@PathVariable("id") Long id){ + SysDictDataDTO data = sysDictDataService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:dict:save") + public Result save(@RequestBody SysDictDataDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysDictDataService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:dict:update") + public Result update(@RequestBody SysDictDataDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDictDataService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:dict:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysDictDataService.delete(ids); + + return new Result(); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictTypeController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictTypeController.java new file mode 100644 index 0000000..86278b5 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictTypeController.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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.AssertUtils; +import io.renren.common.validator.ValidatorUtils; +import io.renren.common.validator.group.DefaultGroup; +import io.renren.common.validator.group.UpdateGroup; +import io.renren.modules.sys.dto.SysDictTypeDTO; +import io.renren.modules.sys.entity.DictType; +import io.renren.modules.sys.service.SysDictTypeService; +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.List; +import java.util.Map; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("sys/dict/type") +@Api(tags="字典类型") +public class SysDictTypeController { + @Autowired + private SysDictTypeService sysDictTypeService; + + @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 = "dictType", value = "字典类型", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:dict:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + //字典类型 + PageData page = sysDictTypeService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:dict:info") + public Result get(@PathVariable("id") Long id){ + SysDictTypeDTO data = sysDictTypeService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:dict:save") + public Result save(@RequestBody SysDictTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysDictTypeService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:dict:update") + public Result update(@RequestBody SysDictTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDictTypeService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:dict:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysDictTypeService.delete(ids); + + return new Result(); + } + + @GetMapping("all") + @ApiOperation("所有字典数据") + public Result> all(){ + List list = sysDictTypeService.getAllList(); + + return new Result>().ok(list); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysMenuController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysMenuController.java new file mode 100644 index 0000000..6b6d523 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysMenuController.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.annotation.LogOperation; +import io.renren.common.exception.ErrorCode; +import io.renren.common.utils.Result; +import io.renren.common.validator.AssertUtils; +import io.renren.common.validator.ValidatorUtils; +import io.renren.common.validator.group.DefaultGroup; +import io.renren.modules.security.service.ShiroService; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dto.SysMenuDTO; +import io.renren.modules.sys.enums.MenuTypeEnum; +import io.renren.modules.sys.service.SysMenuService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +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 java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/menu") +@Api(tags="菜单管理") +public class SysMenuController { + @Autowired + private SysMenuService sysMenuService; + @Autowired + private ShiroService shiroService; + + @GetMapping("nav") + @ApiOperation("导航") + public Result> nav(){ + UserDetail user = SecurityUser.getUser(); + List list = sysMenuService.getUserMenuList(user, MenuTypeEnum.MENU.value()); + + return new Result>().ok(list); + } + + @GetMapping("permissions") + @ApiOperation("权限标识") + public Result> permissions(){ + UserDetail user = SecurityUser.getUser(); + Set set = shiroService.getUserPermissions(user); + + return new Result>().ok(set); + } + + @GetMapping("list") + @ApiOperation("列表") + @ApiImplicitParam(name = "type", value = "菜单类型 0:菜单 1:按钮 null:全部", paramType = "query", dataType="int") + @RequiresPermissions("sys:menu:list") + public Result> list(Integer type){ + List list = sysMenuService.getAllMenuList(type); + + return new Result>().ok(list); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:menu:info") + public Result get(@PathVariable("id") Long id){ + SysMenuDTO data = sysMenuService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:menu:save") + public Result save(@RequestBody SysMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysMenuService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:menu:update") + public Result update(@RequestBody SysMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysMenuService.update(dto); + + return new Result(); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:menu:delete") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + //判断是否有子菜单或按钮 + List list = sysMenuService.getListPid(id); + if(list.size() > 0){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + + sysMenuService.delete(id); + + return new Result(); + } + + @GetMapping("select") + @ApiOperation("角色菜单权限") + @RequiresPermissions("sys:menu:select") + public Result> select(){ + UserDetail user = SecurityUser.getUser(); + List list = sysMenuService.getUserMenuList(user, null); + + return new Result>().ok(list); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysParamsController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysParamsController.java new file mode 100644 index 0000000..de4f9b8 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysParamsController.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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.common.validator.AssertUtils; +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.sys.dto.SysParamsDTO; +import io.renren.modules.sys.excel.SysParamsExcel; +import io.renren.modules.sys.service.SysParamsService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("sys/params") +@Api(tags="参数管理") +public class SysParamsController { + @Autowired + private SysParamsService sysParamsService; + + @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 = "paramCode", value = "参数编码", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:params:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysParamsService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:params:info") + public Result get(@PathVariable("id") Long id){ + SysParamsDTO data = sysParamsService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:params:save") + public Result save(@RequestBody SysParamsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysParamsService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:params:update") + public Result update(@RequestBody SysParamsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysParamsService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:params:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysParamsService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("sys:params:export") + @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysParamsService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysParamsExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysRoleController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysRoleController.java new file mode 100644 index 0000000..ce7a76f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysRoleController.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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.AssertUtils; +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.sys.dto.SysRoleDTO; +import io.renren.modules.sys.service.SysRoleDataScopeService; +import io.renren.modules.sys.service.SysRoleMenuService; +import io.renren.modules.sys.service.SysRoleService; +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.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/role") +@Api(tags="角色管理") +public class SysRoleController { + @Autowired + private SysRoleService sysRoleService; + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysRoleDataScopeService sysRoleDataScopeService; + + @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 = "name", value = "角色名", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:role:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysRoleService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("list") + @ApiOperation("列表") + @RequiresPermissions("sys:role:list") + public Result> list(){ + List data = sysRoleService.list(new HashMap<>(1)); + + return new Result>().ok(data); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:role:info") + public Result get(@PathVariable("id") Long id){ + SysRoleDTO data = sysRoleService.get(id); + + //查询角色对应的菜单 + List menuIdList = sysRoleMenuService.getMenuIdList(id); + data.setMenuIdList(menuIdList); + + //查询角色对应的数据权限 + List deptIdList = sysRoleDataScopeService.getDeptIdList(id); + data.setDeptIdList(deptIdList); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:role:save") + public Result save(@RequestBody SysRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysRoleService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:role:update") + public Result update(@RequestBody SysRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysRoleService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:role:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysRoleService.delete(ids); + + return new Result(); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java new file mode 100644 index 0000000..a389d6e --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysUserController.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.controller; + +import io.renren.common.annotation.LogOperation; +import io.renren.common.constant.Constant; +import io.renren.common.exception.ErrorCode; +import io.renren.common.page.PageData; +import io.renren.common.utils.ConvertUtils; +import io.renren.common.utils.ExcelUtils; +import io.renren.common.utils.Result; +import io.renren.common.validator.AssertUtils; +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.security.password.PasswordUtils; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dto.PasswordDTO; +import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.excel.SysUserExcel; +import io.renren.modules.sys.service.SysRoleUserService; +import io.renren.modules.sys.service.SysUserService; +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 javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/sys/user") +@Api(tags="用户管理") +public class SysUserController { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysRoleUserService sysRoleUserService; + + @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 = "username", value = "用户名", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "gender", value = "性别", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType="String") + }) + @RequiresPermissions("sys:user:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysUserService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("sys:user:info") + public Result get(@PathVariable("id") Long id){ + SysUserDTO data = sysUserService.get(id); + + //用户角色列表 + List roleIdList = sysRoleUserService.getRoleIdList(id); + data.setRoleIdList(roleIdList); + + return new Result().ok(data); + } + + @GetMapping("info") + @ApiOperation("登录用户信息") + public Result info(){ + SysUserDTO data = ConvertUtils.sourceToTarget(SecurityUser.getUser(), SysUserDTO.class); + return new Result().ok(data); + } + + @PutMapping("password") + @ApiOperation("修改密码") + @LogOperation("修改密码") + public Result password(@RequestBody PasswordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto); + + UserDetail user = SecurityUser.getUser(); + + //原密码不正确 + if(!PasswordUtils.matches(dto.getPassword(), user.getPassword())){ + return new Result().error(ErrorCode.PASSWORD_ERROR); + } + + sysUserService.updatePassword(user.getId(), dto.getNewPassword()); + + return new Result(); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("sys:user:save") + public Result save(@RequestBody SysUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysUserService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("sys:user:update") + public Result update(@RequestBody SysUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysUserService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("sys:user:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysUserService.deleteBatchIds(Arrays.asList(ids)); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("sys:user:export") + @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysUserService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysUserExcel.class); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDeptDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDeptDao.java new file mode 100644 index 0000000..d098933 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDeptDao.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysDeptEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysDeptDao extends BaseDao { + + List getList(Map params); + + SysDeptEntity getById(Long id); + + /** + * 获取所有部门的id、pid列表 + */ + List getIdAndPidList(); + + /** + * 根据部门ID,获取所有子部门ID列表 + * @param id 部门ID + */ + List getSubDeptIdList(String id); + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDictDataDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDictDataDao.java new file mode 100644 index 0000000..61ec809 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDictDataDao.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.DictData; +import io.renren.modules.sys.entity.SysDictDataEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 字典数据 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysDictDataDao extends BaseDao { + + /** + * 字典数据列表 + */ + List getDictDataList(); +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDictTypeDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDictTypeDao.java new file mode 100644 index 0000000..fa6e05d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDictTypeDao.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.DictType; +import io.renren.modules.sys.entity.SysDictTypeEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysDictTypeDao extends BaseDao { + + /** + * 字典类型列表 + */ + List getDictTypeList(); + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java new file mode 100644 index 0000000..039c14d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysMenuDao.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysMenuDao extends BaseDao { + + SysMenuEntity getById(@Param("id") Long id); + + /** + * 查询所有菜单列表 + * + * @param menuType 菜单类型 + */ + List getMenuList(@Param("menuType") Integer menuType); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param menuType 菜单类型 + */ + List getUserMenuList(@Param("userId") Long userId, @Param("menuType") Integer menuType); + + /** + * 查询用户权限列表 + * @param userId 用户ID + */ + List getUserPermissionsList(Long userId); + + /** + * 查询所有权限列表 + */ + List getPermissionsList(); + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(Long pid); + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysParamsDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysParamsDao.java new file mode 100644 index 0000000..1d4c0cb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysParamsDao.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysParamsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysParamsDao extends BaseDao { + /** + * 根据参数编码,查询value + * @param paramCode 参数编码 + * @return 参数值 + */ + String getValueByCode(String paramCode); + + /** + * 获取参数编码列表 + * @param ids ids + * @return 返回参数编码列表 + */ + List getParamCodeList(Long[] ids); + + /** + * 根据参数编码,更新value + * @param paramCode 参数编码 + * @param paramValue 参数值 + */ + int updateValueByCode(@Param("paramCode") String paramCode, @Param("paramValue") String paramValue); +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleDao.java new file mode 100644 index 0000000..68c7664 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysRoleDao extends BaseDao { + + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleDataScopeDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleDataScopeDao.java new file mode 100644 index 0000000..8ad26c8 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleDataScopeDao.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysRoleDataScopeEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleDataScopeDao extends BaseDao { + + /** + * 根据角色ID,获取部门ID列表 + */ + List getDeptIdList(Long roleId); + + /** + * 获取用户的部门数据权限列表 + */ + List getDataScopeList(Long userId); + + /** + * 根据角色id,删除角色数据权限关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleMenuDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleMenuDao.java new file mode 100644 index 0000000..ed9252b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleMenuDao.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysRoleMenuDao extends BaseDao { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(Long roleId); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(Long menuId); +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleUserDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleUserDao.java new file mode 100644 index 0000000..0038b12 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysRoleUserDao.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysRoleUserEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleUserDao extends BaseDao { + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据用户id,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(Long[] userIds); + + /** + * 角色ID列表 + * @param userId 用户ID + * + * @return + */ + List getRoleIdList(Long userId); +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java new file mode 100644 index 0000000..fc3c46b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysUserDao.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.sys.entity.SysUserEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysUserDao extends BaseDao { + + List getList(Map params); + + SysUserEntity getById(Long id); + + SysUserEntity getByUsername(String username); + + int updatePassword(@Param("id") Long id, @Param("newPassword") String newPassword); + + /** + * 根据部门ID,查询用户数 + */ + int getCountByDeptId(Long deptId); + + /** + * 根据部门ID,查询用户ID列表 + */ + List getUserIdListByDeptId(List deptIdList); +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/PasswordDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/PasswordDTO.java new file mode 100644 index 0000000..bc3f79d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/PasswordDTO.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 修改密码 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "修改密码") +public class PasswordDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "原密码") + @NotBlank(message="{sysuser.password.require}") + private String password; + + @ApiModelProperty(value = "新密码") + @NotBlank(message="{sysuser.password.require}") + private String newPassword; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDeptDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDeptDTO.java new file mode 100644 index 0000000..e9f3166 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDeptDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.renren.common.utils.TreeNode; +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 javax.validation.constraints.Min; +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 + */ +@ApiModel(value = "部门管理") +public class SysDeptDTO extends TreeNode 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 = "上级ID") + @NotNull(message="{sysdept.pid.require}", groups = DefaultGroup.class) + private Long pid; + + @ApiModelProperty(value = "部门名称") + @NotBlank(message="{sysdept.name.require}", groups = DefaultGroup.class) + private String name; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "上级部门名称") + private String parentName; + + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public Long getPid() { + return pid; + } + + @Override + public void setPid(Long pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictDataDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictDataDTO.java new file mode 100644 index 0000000..46b6ab6 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictDataDTO.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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 javax.validation.constraints.Min; +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 + */ +@Data +@ApiModel(value = "字典数据") +public class SysDictDataDTO 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 = "字典类型ID") + @NotNull(message="{sysdict.type.require}", groups = DefaultGroup.class) + private Long dictTypeId; + + @ApiModelProperty(value = "字典标签") + @NotBlank(message="{sysdict.label.require}", groups = DefaultGroup.class) + private String dictLabel; + + @ApiModelProperty(value = "字典值") + private String dictValue; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "更新时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date updateDate; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java new file mode 100644 index 0000000..81ae398 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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 javax.validation.constraints.Min; +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 + */ +@Data +@ApiModel(value = "字典类型") +public class SysDictTypeDTO 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 = "字典类型") + @NotBlank(message="{sysdict.type.require}", groups = DefaultGroup.class) + private String dictType; + + @ApiModelProperty(value = "字典名称") + @NotBlank(message="{sysdict.name.require}", groups = DefaultGroup.class) + private String dictName; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "更新时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date updateDate; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysMenuDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysMenuDTO.java new file mode 100644 index 0000000..e6a7b5e --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysMenuDTO.java @@ -0,0 +1,157 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.renren.common.utils.TreeNode; +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 org.hibernate.validator.constraints.Range; + +import javax.validation.constraints.Min; +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 + */ +@ApiModel(value = "菜单管理") +public class SysMenuDTO extends TreeNode 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 = "上级ID") + @NotNull(message="{sysmenu.pid.require}", groups = DefaultGroup.class) + private Long pid; + + @ApiModelProperty(value = "菜单名称") + @NotBlank(message="{sysmenu.name.require}", groups = DefaultGroup.class) + private String name; + + @ApiModelProperty(value = "菜单URL") + private String url; + + @ApiModelProperty(value = "类型 0:菜单 1:按钮") + @Range(min=0, max=1, message = "{sysmenu.type.range}", groups = DefaultGroup.class) + private Integer menuType; + + @ApiModelProperty(value = "菜单图标") + private String icon; + + @ApiModelProperty(value = "授权(多个用逗号分隔,如:sys:user:list,sys:user:save)") + private String permissions; + + @ApiModelProperty(value = "排序") + @Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class) + private Integer sort; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "上级菜单名称") + private String parentName; + + @Override + public Long getId() { + return id; + } + + @Override + public void setId(Long id) { + this.id = id; + } + + @Override + public Long getPid() { + return pid; + } + + @Override + public void setPid(Long pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Integer getMenuType() { + return menuType; + } + + public void setMenuType(Integer menuType) { + this.menuType = menuType; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getPermissions() { + return permissions; + } + + public void setPermissions(String permissions) { + this.permissions = permissions; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getParentName() { + return parentName; + } + + public void setParentName(String parentName) { + this.parentName = parentName; + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysParamsDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysParamsDTO.java new file mode 100644 index 0000000..bf275a7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysParamsDTO.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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 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 SysParamsDTO 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 = "参数编码") + @NotBlank(message="{sysparams.paramcode.require}", groups = DefaultGroup.class) + private String paramCode; + + @ApiModelProperty(value = "参数值") + @NotBlank(message="{sysparams.paramvalue.require}", groups = DefaultGroup.class) + private String paramValue; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "更新时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date updateDate; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysRoleDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysRoleDTO.java new file mode 100644 index 0000000..a57b4b3 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysRoleDTO.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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 javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "角色管理") +public class SysRoleDTO 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 = "角色名称") + @NotBlank(message="{sysrole.name.require}", groups = DefaultGroup.class) + private String name; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "菜单ID列表") + private List menuIdList; + + @ApiModelProperty(value = "部门ID列表") + private List deptIdList; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysUserDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysUserDTO.java new file mode 100644 index 0000000..c42a66f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysUserDTO.java @@ -0,0 +1,93 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Null; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "用户管理") +public class SysUserDTO 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 = "用户名", required = true) + @NotBlank(message="{sysuser.username.require}", groups = DefaultGroup.class) + private String username; + + @ApiModelProperty(value = "密码") + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + @NotBlank(message="{sysuser.password.require}", groups = AddGroup.class) + private String password; + + @ApiModelProperty(value = "姓名", required = true) + @NotBlank(message="{sysuser.realname.require}", groups = DefaultGroup.class) + private String realName; + + @ApiModelProperty(value = "头像") + private String headUrl; + + @ApiModelProperty(value = "性别 0:男 1:女 2:保密", required = true) + @Range(min=0, max=2, message = "{sysuser.gender.range}", groups = DefaultGroup.class) + private Integer gender; + + @ApiModelProperty(value = "邮箱") + @Email(message="{sysuser.email.error}", groups = DefaultGroup.class) + private String email; + + @ApiModelProperty(value = "手机号") + private String mobile; + + @ApiModelProperty(value = "部门ID", required = true) + @NotNull(message="{sysuser.deptId.require}", groups = DefaultGroup.class) + private Long deptId; + + @ApiModelProperty(value = "状态 0:停用 1:正常", required = true) + @Range(min=0, max=1, message = "{sysuser.status.range}", groups = DefaultGroup.class) + private Integer status; + + @ApiModelProperty(value = "创建时间") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Date createDate; + + @ApiModelProperty(value = "超级管理员 0:否 1:是") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + private Integer superAdmin; + + @ApiModelProperty(value = "角色ID列表") + private List roleIdList; + + @ApiModelProperty(value = "部门名称") + private String deptName; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SystemDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SystemDTO.java new file mode 100644 index 0000000..1412b41 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SystemDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.dto; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 系统数据 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "系统数据") +public class SystemDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long sysTime; + private String osName; + private String osArch; + private String osVersion; + private String userLanguage; + private String userDir; + private Long totalPhysical; + private Long freePhysical; + private BigDecimal memoryRate; + private Integer processors; + private String jvmName; + private String javaVersion; + private String javaHome; + private Long javaTotalMemory; + private Long javaFreeMemory; + private Long javaMaxMemory; + private String userName; + private BigDecimal systemCpuLoad; + private String userTimezone; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/DictData.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/DictData.java new file mode 100644 index 0000000..4b5d451 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/DictData.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +/** + * 字典数据 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class DictData { + @JsonIgnore + private Long dictTypeId; + private String dictLabel; + private String dictValue; +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/DictType.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/DictType.java new file mode 100644 index 0000000..a391710 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/DictType.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class DictType { + @JsonIgnore + private Long id; + private String dictType; + private List dataList = new ArrayList<>(); +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDeptEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDeptEntity.java new file mode 100644 index 0000000..9f85551 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDeptEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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("sys_dept") +public class SysDeptEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 上级ID + */ + private Long pid; + /** + * 所有上级ID,用逗号分开 + */ + private String pids; + /** + * 部门名称 + */ + private String name; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 上级部门名称 + */ + @TableField(exist = false) + private String parentName; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictDataEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictDataEntity.java new file mode 100644 index 0000000..b84197b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictDataEntity.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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("sys_dict_data") +public class SysDictDataEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 字典类型ID + */ + private Long dictTypeId; + /** + * 字典标签 + */ + private String dictLabel; + /** + * 字典值 + */ + private String dictValue; + /** + * 备注 + */ + private String remark; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @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/sys/entity/SysDictTypeEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictTypeEntity.java new file mode 100644 index 0000000..2a830ef --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysDictTypeEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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("sys_dict_type") +public class SysDictTypeEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 字典类型 + */ + private String dictType; + /** + * 字典名称 + */ + private String dictName; + /** + * 备注 + */ + private String remark; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @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/sys/entity/SysMenuEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysMenuEntity.java new file mode 100644 index 0000000..3168339 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysMenuEntity.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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("sys_menu") +public class SysMenuEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 父菜单ID,一级菜单为0 + */ + private Long pid; + /** + * 菜单名称 + */ + private String name; + /** + * 菜单URL + */ + private String url; + /** + * 授权(多个用逗号分隔,如:sys:user:list,sys:user:save) + */ + private String permissions; + /** + * 类型 0:菜单 1:按钮 + */ + private Integer menuType; + /** + * 菜单图标 + */ + private String icon; + /** + * 排序 + */ + private Integer sort; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysParamsEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysParamsEntity.java new file mode 100644 index 0000000..fb7e62d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysParamsEntity.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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 + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_params") +public class SysParamsEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 参数编码 + */ + private String paramCode; + /** + * 参数值 + */ + private String paramValue; + /** + * 类型 0:系统参数 1:非系统参数 + */ + private Integer paramType; + /** + * 备注 + */ + 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/sys/entity/SysRoleDataScopeEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleDataScopeEntity.java new file mode 100644 index 0000000..38188f8 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleDataScopeEntity.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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_role_data_scope") +public class SysRoleDataScopeEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private Long roleId; + /** + * 部门ID + */ + private Long deptId; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleEntity.java new file mode 100644 index 0000000..ed02e52 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleEntity.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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("sys_role") +public class SysRoleEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色名称 + */ + private String name; + /** + * 备注 + */ + private String remark; + /** + * 部门ID + */ + @TableField(fill = FieldFill.INSERT) + private Long deptId; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleMenuEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleMenuEntity.java new file mode 100644 index 0000000..a654e6d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleMenuEntity.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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_role_menu") +public class SysRoleMenuEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 角色ID + */ + private Long roleId; + /** + * 菜单ID + */ + private Long menuId; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleUserEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleUserEntity.java new file mode 100644 index 0000000..d793da5 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysRoleUserEntity.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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_role_user") +public class SysRoleUserEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private Long roleId; + /** + * 用户ID + */ + private Long userId; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/entity/SysUserEntity.java b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysUserEntity.java new file mode 100644 index 0000000..864c7eb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/entity/SysUserEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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("sys_user") +public class SysUserEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 用户名 + */ + private String username; + /** + * 密码 + */ + private String password; + /** + * 姓名 + */ + private String realName; + /** + * 头像 + */ + private String headUrl; + /** + * 性别 0:男 1:女 2:保密 + */ + private Integer gender; + /** + * 邮箱 + */ + private String email; + /** + * 手机号 + */ + private String mobile; + /** + * 部门ID + */ + private Long deptId; + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + /** + * 状态 0:停用 1:正常 + */ + private Integer status; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + /** + * 部门名称 + */ + @TableField(exist=false) + private String deptName; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/enums/MenuTypeEnum.java b/renren-admin/src/main/java/io/renren/modules/sys/enums/MenuTypeEnum.java new file mode 100644 index 0000000..3cf2ba9 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/enums/MenuTypeEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.enums; + +/** + * 菜单类型枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum MenuTypeEnum { + /** + * 菜单 + */ + MENU(0), + /** + * 按钮 + */ + BUTTON(1); + + private int value; + + MenuTypeEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/enums/SuperAdminEnum.java b/renren-admin/src/main/java/io/renren/modules/sys/enums/SuperAdminEnum.java new file mode 100644 index 0000000..1c32493 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/enums/SuperAdminEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.enums; + +/** + * 超级管理员枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum SuperAdminEnum { + YES(1), + NO(0); + + private int value; + + SuperAdminEnum(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/sys/enums/UserStatusEnum.java b/renren-admin/src/main/java/io/renren/modules/sys/enums/UserStatusEnum.java new file mode 100644 index 0000000..ae114b4 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/enums/UserStatusEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.enums; + +/** + * 用户状态 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum UserStatusEnum { + DISABLE(0), + ENABLED(1); + + private int value; + + UserStatusEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/excel/SysParamsExcel.java b/renren-admin/src/main/java/io/renren/modules/sys/excel/SysParamsExcel.java new file mode 100644 index 0000000..f913e89 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/excel/SysParamsExcel.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysParamsExcel { + @Excel(name = "参数编码") + private String paramCode; + @Excel(name = "参数值") + private String paramValue; + @Excel(name = "备注") + private String remark; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/excel/SysUserExcel.java b/renren-admin/src/main/java/io/renren/modules/sys/excel/SysUserExcel.java new file mode 100644 index 0000000..287bde2 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/excel/SysUserExcel.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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 SysUserExcel { + @Excel(name = "用户名") + private String username; + @Excel(name = "姓名") + private String realName; + @Excel(name = "性别", replace = {"男_0", "女_1", "保密_2"}) + private Integer gender; + @Excel(name = "邮箱") + private String email; + @Excel(name = "手机号") + private String mobile; + @Excel(name = "部门名称") + private String deptName; + @Excel(name = "状态", replace = {"停用_0", "正常_1"}) + private Integer status; + @Excel(name = "备注") + private String remark; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/redis/SysParamsRedis.java b/renren-admin/src/main/java/io/renren/modules/sys/redis/SysParamsRedis.java new file mode 100644 index 0000000..99af7b5 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/redis/SysParamsRedis.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.redis; + +import io.renren.common.redis.RedisKeys; +import io.renren.common.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class SysParamsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] paramCodes) { + String key = RedisKeys.getSysParamsKey(); + redisUtils.hDel(key, paramCodes); + } + + public void set(String paramCode, String paramValue){ + if(paramValue == null){ + return ; + } + String key = RedisKeys.getSysParamsKey(); + redisUtils.hSet(key, paramCode, paramValue); + } + + public String get(String paramCode){ + String key = RedisKeys.getSysParamsKey(); + return (String)redisUtils.hGet(key, paramCode); + } + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysDeptService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDeptService.java new file mode 100644 index 0000000..5f1047f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDeptService.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.service.BaseService; +import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.entity.SysDeptEntity; + +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysDeptService extends BaseService { + + List list(Map params); + + SysDeptDTO get(Long id); + + void save(SysDeptDTO dto); + + void update(SysDeptDTO dto); + + void delete(Long id); + + /** + * 根据部门ID,获取本部门及子部门ID列表 + * @param id 部门ID + */ + List getSubDeptIdList(Long id); +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictDataService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictDataService.java new file mode 100644 index 0000000..8f67ccb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictDataService.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.page.PageData; +import io.renren.common.service.BaseService; +import io.renren.modules.sys.dto.SysDictDataDTO; +import io.renren.modules.sys.entity.SysDictDataEntity; + +import java.util.Map; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysDictDataService extends BaseService { + + PageData page(Map params); + + SysDictDataDTO get(Long id); + + void save(SysDictDataDTO dto); + + void update(SysDictDataDTO dto); + + void delete(Long[] ids); + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictTypeService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictTypeService.java new file mode 100644 index 0000000..6c051ae --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictTypeService.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.page.PageData; +import io.renren.common.service.BaseService; +import io.renren.modules.sys.dto.SysDictTypeDTO; +import io.renren.modules.sys.entity.DictType; +import io.renren.modules.sys.entity.SysDictTypeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysDictTypeService extends BaseService { + + PageData page(Map params); + + SysDictTypeDTO get(Long id); + + void save(SysDictTypeDTO dto); + + void update(SysDictTypeDTO dto); + + void delete(Long[] ids); + + /** + * 获取所有字典 + */ + List getAllList(); + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysMenuService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysMenuService.java new file mode 100644 index 0000000..8243978 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysMenuService.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.service.BaseService; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dto.SysMenuDTO; +import io.renren.modules.sys.entity.SysMenuEntity; + +import java.util.List; + + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysMenuService extends BaseService { + + SysMenuDTO get(Long id); + + void save(SysMenuDTO dto); + + void update(SysMenuDTO dto); + + void delete(Long id); + + /** + * 菜单列表 + * + * @param menuType 菜单类型 + */ + List getAllMenuList(Integer menuType); + + /** + * 用户菜单列表 + * + * @param user 用户 + * @param menuType 菜单类型 + */ + List getUserMenuList(UserDetail user, Integer menuType); + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(Long pid); +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysParamsService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysParamsService.java new file mode 100644 index 0000000..0629aec --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysParamsService.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + + +import io.renren.common.page.PageData; +import io.renren.common.service.BaseService; +import io.renren.modules.sys.dto.SysParamsDTO; +import io.renren.modules.sys.entity.SysParamsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysParamsService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysParamsDTO get(Long id); + + void save(SysParamsDTO dto); + + void update(SysParamsDTO dto); + + void delete(Long[] ids); + + /** + * 根据参数编码,获取参数的value值 + * + * @param paramCode 参数编码 + */ + String getValue(String paramCode); + + /** + * 根据参数编码,获取value的Object对象 + * @param paramCode 参数编码 + * @param clazz Object对象 + */ + T getValueObject(String paramCode, Class clazz); + + /** + * 根据参数编码,更新value + * @param paramCode 参数编码 + * @param paramValue 参数值 + */ + int updateValueByCode(String paramCode, String paramValue); +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleDataScopeService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleDataScopeService.java new file mode 100644 index 0000000..59f8668 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleDataScopeService.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.service.BaseService; +import io.renren.modules.sys.entity.SysRoleDataScopeEntity; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleDataScopeService extends BaseService { + + /** + * 根据角色ID,获取部门ID列表 + */ + List getDeptIdList(Long roleId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param deptIdList 部门ID列表 + */ + void saveOrUpdate(Long roleId, List deptIdList); + + /** + * 根据角色id,删除角色数据权限关系 + * @param roleId 角色ids + */ + void deleteByRoleIds(Long[] roleId); +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleMenuService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleMenuService.java new file mode 100644 index 0000000..e7d54a1 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleMenuService.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.service.BaseService; +import io.renren.modules.sys.entity.SysRoleMenuEntity; + +import java.util.List; + + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysRoleMenuService extends BaseService { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(Long roleId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param menuIdList 菜单ID列表 + */ + void saveOrUpdate(Long roleId, List menuIdList); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(Long menuId); +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleService.java new file mode 100644 index 0000000..b0fd212 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleService.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + + +import io.renren.common.page.PageData; +import io.renren.common.service.BaseService; +import io.renren.modules.sys.dto.SysRoleDTO; +import io.renren.modules.sys.entity.SysRoleEntity; + +import java.util.List; +import java.util.Map; + + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysRoleService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysRoleDTO get(Long id); + + void save(SysRoleDTO dto); + + void update(SysRoleDTO dto); + + void delete(Long[] ids); + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleUserService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleUserService.java new file mode 100644 index 0000000..de33bda --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysRoleUserService.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.service.BaseService; +import io.renren.modules.sys.entity.SysRoleUserEntity; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleUserService extends BaseService { + + /** + * 保存或修改 + * @param userId 用户ID + * @param roleIdList 角色ID列表 + */ + void saveOrUpdate(Long userId, List roleIdList); + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据用户id,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(Long[] userIds); + + /** + * 角色ID列表 + * @param userId 用户ID + */ + List getRoleIdList(Long userId); +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysUserService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysUserService.java new file mode 100644 index 0000000..78f68f3 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysUserService.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service; + +import io.renren.common.page.PageData; +import io.renren.common.service.BaseService; +import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.entity.SysUserEntity; + +import java.util.List; +import java.util.Map; + + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysUserService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysUserDTO get(Long id); + + SysUserDTO getByUsername(String username); + + void save(SysUserDTO dto); + + void update(SysUserDTO dto); + + void delete(Long[] ids); + + /** + * 修改密码 + * @param id 用户ID + * @param newPassword 新密码 + */ + void updatePassword(Long id, String newPassword); + + /** + * 根据部门ID,查询用户数 + */ + int getCountByDeptId(Long deptId); + + /** + * 根据部门ID,查询用户Id列表 + */ + List getUserIdListByDeptId(List deptIdList); + +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDeptServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..0a0c7e9 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import io.renren.common.constant.Constant; +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.common.utils.ConvertUtils; +import io.renren.common.utils.TreeUtils; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dao.SysDeptDao; +import io.renren.modules.sys.dao.SysUserDao; +import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.entity.SysDeptEntity; +import io.renren.modules.sys.enums.SuperAdminEnum; +import io.renren.modules.sys.service.SysDeptService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@Service +public class SysDeptServiceImpl extends BaseServiceImpl implements SysDeptService { + @Autowired + private SysUserDao sysUserDao; + + @Override + public List list(Map params) { + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", getSubDeptIdList(user.getDeptId())); + } + + //查询部门列表 + List entityList = baseDao.getList(params); + + List dtoList = ConvertUtils.sourceToTarget(entityList, SysDeptDTO.class); + + return TreeUtils.build(dtoList); + } + + @Override + public SysDeptDTO get(Long id) { + //超级管理员,部门ID为null + if(id == null){ + return null; + } + + SysDeptEntity entity = baseDao.getById(id); + + return ConvertUtils.sourceToTarget(entity, SysDeptDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDeptDTO dto) { + SysDeptEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptEntity.class); + + entity.setPids(getPidList(entity.getPid())); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDeptDTO dto) { + SysDeptEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptEntity.class); + + //上级部门不能为自身 + if(entity.getId().equals(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_DEPT_ERROR); + } + + //上级部门不能为下级部门 + List subDeptList = getSubDeptIdList(entity.getId()); + if(subDeptList.contains(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_DEPT_ERROR); + } + + entity.setPids(getPidList(entity.getPid())); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + //判断是否有子部门 + List subList = getSubDeptIdList(id); + if(subList.size() > 1){ + throw new RenException(ErrorCode.DEPT_SUB_DELETE_ERROR); + } + + //判断部门下面是否有用户 + int count = sysUserDao.getCountByDeptId(id); + if(count > 0){ + throw new RenException(ErrorCode.DEPT_USER_DELETE_ERROR); + } + + //删除 + baseDao.deleteById(id); + } + + @Override + public List getSubDeptIdList(Long id) { + List deptIdList = baseDao.getSubDeptIdList("%" + id + "%"); + deptIdList.add(id); + + return deptIdList; + } + + /** + * 获取所有上级部门ID + * @param pid 上级ID + */ + private String getPidList(Long pid){ + //顶级部门,无上级部门 + if(Constant.DEPT_ROOT.equals(pid)){ + return Constant.DEPT_ROOT + ""; + } + + //所有部门的id、pid列表 + List deptList = baseDao.getIdAndPidList(); + + //list转map + Map map = new HashMap<>(deptList.size()); + for(SysDeptEntity entity : deptList){ + map.put(entity.getId(), entity); + } + + //递归查询所有上级部门ID列表 + List pidList = new ArrayList<>(); + getPidTree(pid, map, pidList); + + return StringUtils.join(pidList, ","); + } + + private void getPidTree(Long pid, Map map, List pidList) { + //顶级部门,无上级部门 + if(Constant.DEPT_ROOT.equals(pid)){ + return ; + } + + //上级部门存在 + SysDeptEntity parent = map.get(pid); + if(parent != null){ + getPidTree(parent.getPid(), map, pidList); + } + + pidList.add(pid); + } +} diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictDataServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictDataServiceImpl.java new file mode 100644 index 0000000..739da51 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictDataServiceImpl.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.renren.common.page.PageData; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.common.utils.ConvertUtils; +import io.renren.modules.sys.dao.SysDictDataDao; +import io.renren.modules.sys.dto.SysDictDataDTO; +import io.renren.modules.sys.entity.SysDictDataEntity; +import io.renren.modules.sys.service.SysDictDataService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Map; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysDictDataServiceImpl extends BaseServiceImpl implements SysDictDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, "sort", true), + getWrapper(params) + ); + + return getPageData(page, SysDictDataDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String dictTypeId = (String) params.get("dictTypeId"); + String dictLabel = (String) params.get("dictLabel"); + String dictValue = (String) params.get("dictValue"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("dict_type_id", dictTypeId); + wrapper.like(StringUtils.isNotBlank(dictLabel), "dict_label", dictLabel); + wrapper.like(StringUtils.isNotBlank(dictValue), "dict_value", dictValue); + + return wrapper; + } + + @Override + public SysDictDataDTO get(Long id) { + SysDictDataEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysDictDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDictDataDTO dto) { + SysDictDataEntity entity = ConvertUtils.sourceToTarget(dto, SysDictDataEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDictDataDTO dto) { + SysDictDataEntity entity = ConvertUtils.sourceToTarget(dto, SysDictDataEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictTypeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictTypeServiceImpl.java new file mode 100644 index 0000000..35c348b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictTypeServiceImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.renren.common.page.PageData; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.common.utils.ConvertUtils; +import io.renren.modules.sys.dao.SysDictDataDao; +import io.renren.modules.sys.dao.SysDictTypeDao; +import io.renren.modules.sys.dto.SysDictTypeDTO; +import io.renren.modules.sys.entity.DictData; +import io.renren.modules.sys.entity.DictType; +import io.renren.modules.sys.entity.SysDictTypeEntity; +import io.renren.modules.sys.service.SysDictTypeService; +import org.apache.commons.lang3.StringUtils; +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.List; +import java.util.Map; + +/** + * 字典类型 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysDictTypeServiceImpl extends BaseServiceImpl implements SysDictTypeService { + @Autowired + private SysDictDataDao sysDictDataDao; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, "sort", true), + getWrapper(params) + ); + + return getPageData(page, SysDictTypeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String dictType = (String) params.get("dictType"); + String dictName = (String) params.get("dictName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(dictType), "dict_type", dictType); + wrapper.like(StringUtils.isNotBlank(dictName), "dict_name", dictName); + + return wrapper; + } + + @Override + public SysDictTypeDTO get(Long id) { + SysDictTypeEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysDictTypeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDictTypeDTO dto) { + SysDictTypeEntity entity = ConvertUtils.sourceToTarget(dto, SysDictTypeEntity.class); + + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDictTypeDTO dto) { + SysDictTypeEntity entity = ConvertUtils.sourceToTarget(dto, SysDictTypeEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getAllList() { + List typeList = baseDao.getDictTypeList(); + List dataList = sysDictDataDao.getDictDataList(); + for(DictType type : typeList){ + for(DictData data : dataList){ + if(type.getId().equals(data.getDictTypeId())){ + type.getDataList().add(data); + } + } + } + return typeList; + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java new file mode 100644 index 0000000..dd48197 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import io.renren.common.constant.Constant; +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.common.utils.ConvertUtils; +import io.renren.common.utils.TreeUtils; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dao.SysMenuDao; +import io.renren.modules.sys.dto.SysMenuDTO; +import io.renren.modules.sys.entity.SysMenuEntity; +import io.renren.modules.sys.enums.SuperAdminEnum; +import io.renren.modules.sys.service.SysMenuService; +import io.renren.modules.sys.service.SysRoleMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Service +public class SysMenuServiceImpl extends BaseServiceImpl implements SysMenuService { + @Autowired + private SysRoleMenuService sysRoleMenuService; + + @Override + public SysMenuDTO get(Long id) { + SysMenuEntity entity = baseDao.getById(id); + + SysMenuDTO dto = ConvertUtils.sourceToTarget(entity, SysMenuDTO.class); + + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysMenuDTO dto) { + SysMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysMenuEntity.class); + + //保存菜单 + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysMenuDTO dto) { + SysMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysMenuEntity.class); + + //上级菜单不能为自身 + if(entity.getId().equals(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_MENU_ERROR); + } + + //更新菜单 + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + //删除菜单 + deleteById(id); + + //删除角色菜单关系 + sysRoleMenuService.deleteByMenuId(id); + } + + @Override + public List getAllMenuList(Integer menuType) { + List menuList = baseDao.getMenuList(menuType); + + List dtoList = ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + + return TreeUtils.build(dtoList, Constant.MENU_ROOT); + } + + @Override + public List getUserMenuList(UserDetail user, Integer menuType) { + List menuList; + + //系统管理员,拥有最高权限 + if(user.getSuperAdmin() == SuperAdminEnum.YES.value()){ + menuList = baseDao.getMenuList(menuType); + }else { + menuList = baseDao.getUserMenuList(user.getId(), menuType); + } + + List dtoList = ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + + return TreeUtils.build(dtoList); + } + + @Override + public List getListPid(Long pid) { + List menuList = baseDao.getListPid(pid); + + return ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysParamsServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysParamsServiceImpl.java new file mode 100644 index 0000000..3a15a2c --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysParamsServiceImpl.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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.exception.ErrorCode; +import io.renren.common.exception.RenException; +import io.renren.common.page.PageData; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.common.utils.ConvertUtils; +import io.renren.common.utils.JsonUtils; +import io.renren.modules.sys.dao.SysParamsDao; +import io.renren.modules.sys.dto.SysParamsDTO; +import io.renren.modules.sys.entity.SysParamsEntity; +import io.renren.modules.sys.redis.SysParamsRedis; +import io.renren.modules.sys.service.SysParamsService; +import org.apache.commons.lang3.StringUtils; +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.List; +import java.util.Map; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysParamsServiceImpl extends BaseServiceImpl implements SysParamsService { + @Autowired + private SysParamsRedis sysParamsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysParamsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysParamsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String paramCode = (String) params.get("paramCode"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("param_type", 1); + wrapper.like(StringUtils.isNotBlank(paramCode), "param_code", paramCode); + + return wrapper; + } + + @Override + public SysParamsDTO get(Long id) { + SysParamsEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysParamsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysParamsDTO dto) { + SysParamsEntity entity = ConvertUtils.sourceToTarget(dto, SysParamsEntity.class); + insert(entity); + + sysParamsRedis.set(entity.getParamCode(), entity.getParamValue()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysParamsDTO dto) { + SysParamsEntity entity = ConvertUtils.sourceToTarget(dto, SysParamsEntity.class); + updateById(entity); + + sysParamsRedis.set(entity.getParamCode(), entity.getParamValue()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除Redis数据 + List paramCodeList = baseDao.getParamCodeList(ids); + String[] paramCodes = paramCodeList.toArray(new String[paramCodeList.size()]); + sysParamsRedis.delete(paramCodes); + + //删除 + deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public String getValue(String paramCode) { + String paramValue = sysParamsRedis.get(paramCode); + if(paramValue == null){ + paramValue = baseDao.getValueByCode(paramCode); + + sysParamsRedis.set(paramCode, paramValue); + } + return paramValue; + } + + @Override + public T getValueObject(String paramCode, Class clazz) { + String paramValue = getValue(paramCode); + if(StringUtils.isNotBlank(paramValue)){ + return JsonUtils.parseObject(paramValue, clazz); + } + + try { + return clazz.newInstance(); + } catch (Exception e) { + throw new RenException(ErrorCode.PARAMS_GET_ERROR); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int updateValueByCode(String paramCode, String paramValue) { + int count = baseDao.updateValueByCode(paramCode, paramValue); + sysParamsRedis.set(paramCode, paramValue); + return count; + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java new file mode 100644 index 0000000..1dcd2d9 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleDataScopeServiceImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import cn.hutool.core.collection.CollUtil; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.modules.sys.dao.SysRoleDataScopeDao; +import io.renren.modules.sys.entity.SysRoleDataScopeEntity; +import io.renren.modules.sys.service.SysRoleDataScopeService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleDataScopeServiceImpl extends BaseServiceImpl + implements SysRoleDataScopeService { + + @Override + public List getDeptIdList(Long roleId) { + return baseDao.getDeptIdList(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(Long roleId, List deptIdList) { + //先删除角色数据权限关系 + deleteByRoleIds(new Long[]{roleId}); + + //角色没有一个数据权限的情况 + if(CollUtil.isEmpty(deptIdList)){ + return ; + } + + //保存角色数据权限关系 + for(Long deptId : deptIdList){ + SysRoleDataScopeEntity sysRoleDataScopeEntity = new SysRoleDataScopeEntity(); + sysRoleDataScopeEntity.setDeptId(deptId); + sysRoleDataScopeEntity.setRoleId(roleId); + + //保存 + insert(sysRoleDataScopeEntity); + } + } + + @Override + public void deleteByRoleIds(Long[] roleIds) { + baseDao.deleteByRoleIds(roleIds); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleMenuServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleMenuServiceImpl.java new file mode 100644 index 0000000..6f66b4f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleMenuServiceImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import cn.hutool.core.collection.CollUtil; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.modules.sys.dao.SysRoleMenuDao; +import io.renren.modules.sys.entity.SysRoleMenuEntity; +import io.renren.modules.sys.service.SysRoleMenuService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + + +/** + * 角色与菜单对应关系 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysRoleMenuServiceImpl extends BaseServiceImpl implements SysRoleMenuService { + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(Long roleId, List menuIdList) { + //先删除角色菜单关系 + deleteByRoleIds(new Long[]{roleId}); + + //角色没有一个菜单权限的情况 + if(CollUtil.isEmpty(menuIdList)){ + return ; + } + + //保存角色菜单关系 + for(Long menuId : menuIdList){ + SysRoleMenuEntity sysRoleMenuEntity = new SysRoleMenuEntity(); + sysRoleMenuEntity.setMenuId(menuId); + sysRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(sysRoleMenuEntity); + } + } + + @Override + public List getMenuIdList(Long roleId){ + return baseDao.getMenuIdList(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleIds(Long[] roleIds) { + baseDao.deleteByRoleIds(roleIds); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByMenuId(Long menuId) { + baseDao.deleteByMenuId(menuId); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..5ceb247 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.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.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dao.SysRoleDao; +import io.renren.modules.sys.dto.SysRoleDTO; +import io.renren.modules.sys.entity.SysRoleEntity; +import io.renren.modules.sys.enums.SuperAdminEnum; +import io.renren.modules.sys.service.*; +import org.apache.commons.lang3.StringUtils; +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.List; +import java.util.Map; + +/** + * 角色 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysRoleServiceImpl extends BaseServiceImpl implements SysRoleService { + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysRoleDataScopeService sysRoleDataScopeService; + @Autowired + private SysRoleUserService sysRoleUserService; + @Autowired + private SysDeptService sysDeptService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysRoleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String name = (String)params.get("name"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(name), "name", name); + + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + List deptIdList = sysDeptService.getSubDeptIdList(user.getDeptId()); + wrapper.in(deptIdList != null, "dept_id", deptIdList); + } + + return wrapper; + } + + @Override + public SysRoleDTO get(Long id) { + SysRoleEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysRoleDTO dto) { + SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class); + + //保存角色 + insert(entity); + + //保存角色菜单关系 + sysRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + + //保存角色数据权限关系 + sysRoleDataScopeService.saveOrUpdate(entity.getId(), dto.getDeptIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysRoleDTO dto) { + SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class); + + //更新角色 + updateById(entity); + + //更新角色菜单关系 + sysRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + + //更新角色数据权限关系 + sysRoleDataScopeService.saveOrUpdate(entity.getId(), dto.getDeptIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除角色 + baseDao.deleteBatchIds(Arrays.asList(ids)); + + //删除角色用户关系 + sysRoleUserService.deleteByRoleIds(ids); + + //删除角色菜单关系 + sysRoleMenuService.deleteByRoleIds(ids); + + //删除角色数据权限关系 + sysRoleDataScopeService.deleteByRoleIds(ids); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleUserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleUserServiceImpl.java new file mode 100644 index 0000000..691886d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysRoleUserServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +import cn.hutool.core.collection.CollUtil; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.modules.sys.dao.SysRoleUserDao; +import io.renren.modules.sys.entity.SysRoleUserEntity; +import io.renren.modules.sys.service.SysRoleUserService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleUserServiceImpl extends BaseServiceImpl implements SysRoleUserService { + + @Override + public void saveOrUpdate(Long userId, List roleIdList) { + //先删除角色用户关系 + deleteByUserIds(new Long[]{userId}); + + //用户没有一个角色权限的情况 + if(CollUtil.isEmpty(roleIdList)){ + return ; + } + + //保存角色用户关系 + for(Long roleId : roleIdList){ + SysRoleUserEntity sysRoleUserEntity = new SysRoleUserEntity(); + sysRoleUserEntity.setUserId(userId); + sysRoleUserEntity.setRoleId(roleId); + + //保存 + insert(sysRoleUserEntity); + } + } + + @Override + public void deleteByRoleIds(Long[] roleIds) { + baseDao.deleteByRoleIds(roleIds); + } + + @Override + public void deleteByUserIds(Long[] userIds) { + baseDao.deleteByUserIds(userIds); + } + + @Override + public List getRoleIdList(Long userId) { + + return baseDao.getRoleIdList(userId); + } +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..27a4780 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysUserServiceImpl.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.modules.sys.service.impl; + +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.security.password.PasswordUtils; +import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.sys.dao.SysUserDao; +import io.renren.modules.sys.dto.SysUserDTO; +import io.renren.modules.sys.entity.SysUserEntity; +import io.renren.modules.sys.enums.SuperAdminEnum; +import io.renren.modules.sys.service.SysDeptService; +import io.renren.modules.sys.service.SysRoleUserService; +import io.renren.modules.sys.service.SysUserService; +import org.apache.commons.lang3.StringUtils; +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.List; +import java.util.Map; + + +/** + * 系统用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysUserServiceImpl extends BaseServiceImpl implements SysUserService { + @Autowired + private SysRoleUserService sysRoleUserService; + @Autowired + private SysDeptService sysDeptService; + + @Override + public PageData page(Map params) { + //转换成like + paramsToLike(params, "username"); + + //分页 + IPage page = getPage(params, Constant.CREATE_DATE, false); + + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", sysDeptService.getSubDeptIdList(user.getDeptId())); + } + + //查询 + List list = baseDao.getList(params); + + return getPageData(list, page.getTotal(), SysUserDTO.class); + } + + @Override + public List list(Map params) { + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if(user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", sysDeptService.getSubDeptIdList(user.getDeptId())); + } + + List entityList = baseDao.getList(params); + + return ConvertUtils.sourceToTarget(entityList, SysUserDTO.class); + } + + @Override + public SysUserDTO get(Long id) { + SysUserEntity entity = baseDao.getById(id); + + return ConvertUtils.sourceToTarget(entity, SysUserDTO.class); + } + + @Override + public SysUserDTO getByUsername(String username) { + SysUserEntity entity = baseDao.getByUsername(username); + return ConvertUtils.sourceToTarget(entity, SysUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysUserDTO dto) { + SysUserEntity entity = ConvertUtils.sourceToTarget(dto, SysUserEntity.class); + + //密码加密 + String password = PasswordUtils.encode(entity.getPassword()); + entity.setPassword(password); + + //保存用户 + entity.setSuperAdmin(SuperAdminEnum.NO.value()); + insert(entity); + + //保存角色用户关系 + sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysUserDTO dto) { + SysUserEntity entity = ConvertUtils.sourceToTarget(dto, SysUserEntity.class); + + //密码加密 + if(StringUtils.isBlank(dto.getPassword())){ + entity.setPassword(null); + }else{ + String password = PasswordUtils.encode(entity.getPassword()); + entity.setPassword(password); + } + + //更新用户 + updateById(entity); + + //更新角色用户关系 + sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList()); + } + + @Override + public void delete(Long[] ids) { + //删除用户 + baseDao.deleteBatchIds(Arrays.asList(ids)); + + //删除角色用户关系 + sysRoleUserService.deleteByUserIds(ids); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updatePassword(Long id, String newPassword) { + newPassword = PasswordUtils.encode(newPassword); + + baseDao.updatePassword(id, newPassword); + } + + @Override + public int getCountByDeptId(Long deptId) { + return baseDao.getCountByDeptId(deptId); + } + + @Override + public List getUserIdListByDeptId(List deptIdList) { + return baseDao.getUserIdListByDeptId(deptIdList); + } + +} diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/AddressBookController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/AddressBookController.java new file mode 100644 index 0000000..dbf588b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/AddressBookController.java @@ -0,0 +1,116 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.AddressBookDTO; +import io.renren.modules.takeout.excel.AddressBookExcel; +import io.renren.modules.takeout.service.AddressBookService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 地址管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/addressbook") +@Api(tags="地址管理") +public class AddressBookController { + @Autowired + private AddressBookService addressBookService; + + @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("takeout:addressbook:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = addressBookService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:addressbook:info") + public Result get(@PathVariable("id") Long id){ + AddressBookDTO data = addressBookService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:addressbook:save") + public Result save(@RequestBody AddressBookDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + addressBookService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:addressbook:update") + public Result update(@RequestBody AddressBookDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + addressBookService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:addressbook:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + addressBookService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:addressbook:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = addressBookService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, AddressBookExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/CategoryController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/CategoryController.java new file mode 100644 index 0000000..8cc03f2 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/CategoryController.java @@ -0,0 +1,120 @@ +package io.renren.modules.takeout.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.common.validator.AssertUtils; +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.front.bean.Category; +import io.renren.modules.front.utils.R; +import io.renren.modules.takeout.dto.CategoryDTO; +import io.renren.modules.takeout.entity.CategoryEntity; +import io.renren.modules.takeout.excel.CategoryExcel; +import io.renren.modules.takeout.service.CategoryService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 菜品及套餐分类 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/category") +@Api(tags="菜品及套餐分类") +public class CategoryController { + @Autowired + private CategoryService categoryService; + + @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("takeout:category:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = categoryService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:category:info") + public Result get(@PathVariable("id") Long id){ + CategoryDTO data = categoryService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:category:save") + public Result save(@RequestBody CategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + categoryService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:category:update") + public Result update(@RequestBody CategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + categoryService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:category:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + categoryService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:category:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = categoryService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, CategoryExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/DishController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/DishController.java new file mode 100644 index 0000000..6151b62 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/DishController.java @@ -0,0 +1,126 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.DishDTO; +import io.renren.modules.takeout.excel.DishExcel; +import io.renren.modules.takeout.service.DishService; +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.data.redis.core.RedisTemplate; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 菜品管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/dish") +@Api(tags="菜品管理") +public class DishController { + @Autowired + private DishService dishService; + + @Autowired + private RedisTemplate redisTemplate; + + @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("takeout:dish:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = dishService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:dish:info") + public Result get(@PathVariable("id") Long id){ + DishDTO data = dishService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:dish:save") + public Result save(@RequestBody DishDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + dishService.save(dto); + //清除当前分类下的菜品信息 + redisTemplate.delete("dish_" + dto.getCategoryId() + "_1"); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:dish:update") + public Result update(@RequestBody DishDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + dishService.update(dto); + //清除当前分类下的菜品信息 + redisTemplate.delete("dish_" + dto.getCategoryId() + "_1"); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:dish:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + dishService.delete(ids); + //清除所有的菜品缓存数据 + redisTemplate.delete("dish_*"); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:dish:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = dishService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, DishExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/DishFlavorController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/DishFlavorController.java new file mode 100644 index 0000000..91eddfb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/DishFlavorController.java @@ -0,0 +1,116 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.DishFlavorDTO; +import io.renren.modules.takeout.excel.DishFlavorExcel; +import io.renren.modules.takeout.service.DishFlavorService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 菜品口味关系表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/dishflavor") +@Api(tags="菜品口味关系表") +public class DishFlavorController { + @Autowired + private DishFlavorService dishFlavorService; + + @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("takeout:dishflavor:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = dishFlavorService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:dishflavor:info") + public Result get(@PathVariable("id") Long id){ + DishFlavorDTO data = dishFlavorService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:dishflavor:save") + public Result save(@RequestBody DishFlavorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + dishFlavorService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:dishflavor:update") + public Result update(@RequestBody DishFlavorDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + dishFlavorService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:dishflavor:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + dishFlavorService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:dishflavor:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = dishFlavorService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, DishFlavorExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrderDetailController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrderDetailController.java new file mode 100644 index 0000000..746d5f7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrderDetailController.java @@ -0,0 +1,116 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.OrderDetailDTO; +import io.renren.modules.takeout.excel.OrderDetailExcel; +import io.renren.modules.takeout.service.OrderDetailService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 订单明细表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/orderdetail") +@Api(tags="订单明细表") +public class OrderDetailController { + @Autowired + private OrderDetailService orderDetailService; + + @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("takeout:orderdetail:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = orderDetailService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:orderdetail:info") + public Result get(@PathVariable("id") Long id){ + OrderDetailDTO data = orderDetailService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:orderdetail:save") + public Result save(@RequestBody OrderDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + orderDetailService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:orderdetail:update") + public Result update(@RequestBody OrderDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + orderDetailService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:orderdetail:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + orderDetailService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:orderdetail:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = orderDetailService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, OrderDetailExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrdersController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrdersController.java new file mode 100644 index 0000000..30da486 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/OrdersController.java @@ -0,0 +1,116 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.OrdersDTO; +import io.renren.modules.takeout.excel.OrdersExcel; +import io.renren.modules.takeout.service.OrdersService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 订单表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/orders") +@Api(tags="订单表") +public class OrdersController { + @Autowired + private OrdersService ordersService; + + @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("takeout:orders:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = ordersService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:orders:info") + public Result get(@PathVariable("id") Long id){ + OrdersDTO data = ordersService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:orders:save") + public Result save(@RequestBody OrdersDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + ordersService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:orders:update") + public Result update(@RequestBody OrdersDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + ordersService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:orders:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + ordersService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:orders:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = ordersService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, OrdersExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/SetmealController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/SetmealController.java new file mode 100644 index 0000000..49a17e7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/SetmealController.java @@ -0,0 +1,120 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.SetmealDTO; +import io.renren.modules.takeout.excel.SetmealExcel; +import io.renren.modules.takeout.service.SetmealService; +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.cache.annotation.CacheEvict; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 套餐 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/setmeal") +@Api(tags="套餐") +public class SetmealController { + @Autowired + private SetmealService setmealService; + + @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("takeout:setmeal:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = setmealService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:setmeal:info") + public Result get(@PathVariable("id") Long id){ + SetmealDTO data = setmealService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:setmeal:save") + @CacheEvict(value = "setmealCache", allEntries = true) + public Result save(@RequestBody SetmealDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + setmealService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:setmeal:update") + @CacheEvict(value = "setmealCache", allEntries = true) + public Result update(@RequestBody SetmealDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + setmealService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:setmeal:delete") + @CacheEvict(value = "setmealCache", allEntries = true) + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + setmealService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:setmeal:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = setmealService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SetmealExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/SetmealDishController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/SetmealDishController.java new file mode 100644 index 0000000..d99f392 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/SetmealDishController.java @@ -0,0 +1,116 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.SetmealDishDTO; +import io.renren.modules.takeout.excel.SetmealDishExcel; +import io.renren.modules.takeout.service.SetmealDishService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 套餐菜品关系 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/setmealdish") +@Api(tags="套餐菜品关系") +public class SetmealDishController { + @Autowired + private SetmealDishService setmealDishService; + + @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("takeout:setmealdish:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = setmealDishService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:setmealdish:info") + public Result get(@PathVariable("id") Long id){ + SetmealDishDTO data = setmealDishService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:setmealdish:save") + public Result save(@RequestBody SetmealDishDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + setmealDishService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:setmealdish:update") + public Result update(@RequestBody SetmealDishDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + setmealDishService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:setmealdish:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + setmealDishService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:setmealdish:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = setmealDishService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SetmealDishExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/ShoppingCartController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/ShoppingCartController.java new file mode 100644 index 0000000..898e92c --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/ShoppingCartController.java @@ -0,0 +1,116 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.ShoppingCartDTO; +import io.renren.modules.takeout.excel.ShoppingCartExcel; +import io.renren.modules.takeout.service.ShoppingCartService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 购物车 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/shoppingcart") +@Api(tags="购物车") +public class ShoppingCartController { + @Autowired + private ShoppingCartService shoppingCartService; + + @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("takeout:shoppingcart:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = shoppingCartService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:shoppingcart:info") + public Result get(@PathVariable("id") Long id){ + ShoppingCartDTO data = shoppingCartService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:shoppingcart:save") + public Result save(@RequestBody ShoppingCartDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + shoppingCartService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:shoppingcart:update") + public Result update(@RequestBody ShoppingCartDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + shoppingCartService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:shoppingcart:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + shoppingCartService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:shoppingcart:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = shoppingCartService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, ShoppingCartExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/controller/UserController.java b/renren-admin/src/main/java/io/renren/modules/takeout/controller/UserController.java new file mode 100644 index 0000000..4e6257d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/controller/UserController.java @@ -0,0 +1,116 @@ +package io.renren.modules.takeout.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.common.validator.AssertUtils; +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.takeout.dto.UserDTO; +import io.renren.modules.takeout.excel.UserExcel; +import io.renren.modules.takeout.service.UserService; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 用户信息 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@RestController +@RequestMapping("takeout/user") +@Api(tags="用户信息") +public class UserController { + @Autowired + private UserService userService; + + @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("takeout:user:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = userService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("takeout:user:info") + public Result get(@PathVariable("id") Long id){ + UserDTO data = userService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("takeout:user:save") + public Result save(@RequestBody UserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + userService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("takeout:user:update") + public Result update(@RequestBody UserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + userService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("takeout:user:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + userService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("takeout:user:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = userService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, UserExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/AddressBookDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/AddressBookDao.java new file mode 100644 index 0000000..21a840d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/AddressBookDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.AddressBookEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 地址管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface AddressBookDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/CategoryDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/CategoryDao.java new file mode 100644 index 0000000..9063688 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/CategoryDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.CategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 菜品及套餐分类 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface CategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/DishDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/DishDao.java new file mode 100644 index 0000000..824c3f3 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/DishDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.DishEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 菜品管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface DishDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/DishFlavorDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/DishFlavorDao.java new file mode 100644 index 0000000..5d53c81 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/DishFlavorDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.DishFlavorEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 菜品口味关系表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface DishFlavorDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/OrderDetailDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/OrderDetailDao.java new file mode 100644 index 0000000..f0faeac --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/OrderDetailDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.OrderDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订单明细表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface OrderDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/OrdersDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/OrdersDao.java new file mode 100644 index 0000000..67ee029 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/OrdersDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.OrdersEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订单表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface OrdersDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/SetmealDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/SetmealDao.java new file mode 100644 index 0000000..942f3be --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/SetmealDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.SetmealEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 套餐 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface SetmealDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/SetmealDishDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/SetmealDishDao.java new file mode 100644 index 0000000..429aefb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/SetmealDishDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.SetmealDishEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 套餐菜品关系 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface SetmealDishDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/ShoppingCartDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/ShoppingCartDao.java new file mode 100644 index 0000000..3fcd570 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/ShoppingCartDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.ShoppingCartEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 购物车 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface ShoppingCartDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dao/UserDao.java b/renren-admin/src/main/java/io/renren/modules/takeout/dao/UserDao.java new file mode 100644 index 0000000..74c54d4 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dao/UserDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.takeout.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.takeout.entity.UserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户信息 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Mapper +public interface UserDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/AddressBookDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/AddressBookDTO.java new file mode 100644 index 0000000..6a83b4c --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/AddressBookDTO.java @@ -0,0 +1,80 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 地址管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "地址管理") +public class AddressBookDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "用户id") + private Long userId; + + @ApiModelProperty(value = "收货人") + private String consignee; + + @ApiModelProperty(value = "性别 0 男 1 女") + private Integer gender; + + @ApiModelProperty(value = "手机号") + private String phone; + + @ApiModelProperty(value = "省级区划编号") + private String provinceCode; + + @ApiModelProperty(value = "省级名称") + private String provinceName; + + @ApiModelProperty(value = "市级区划编号") + private String cityCode; + + @ApiModelProperty(value = "市级名称") + private String cityName; + + @ApiModelProperty(value = "区级区划编号") + private String districtCode; + + @ApiModelProperty(value = "区级名称") + private String districtName; + + @ApiModelProperty(value = "详细地址") + private String detail; + + @ApiModelProperty(value = "标签") + private String label; + + @ApiModelProperty(value = "默认 0 否 1是") + private Integer isDefault; + + @ApiModelProperty(value = "创建人") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + @ApiModelProperty(value = "是否删除") + private Integer isDeleted; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/CategoryDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/CategoryDTO.java new file mode 100644 index 0000000..6930949 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/CategoryDTO.java @@ -0,0 +1,47 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 菜品及套餐分类 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "菜品及套餐分类") +public class CategoryDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "类型 1 菜品分类 2 套餐分类") + private Integer type; + + @ApiModelProperty(value = "分类名称") + private String name; + + @ApiModelProperty(value = "顺序") + private Integer sort; + + @ApiModelProperty(value = "创建人") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/DishDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/DishDTO.java new file mode 100644 index 0000000..ece2ff4 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/DishDTO.java @@ -0,0 +1,65 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 菜品管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "菜品管理") +public class DishDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "菜品名称") + private String name; + + @ApiModelProperty(value = "菜品分类id") + private Long categoryId; + + @ApiModelProperty(value = "菜品价格") + private BigDecimal price; + + @ApiModelProperty(value = "商品码") + private String code; + + @ApiModelProperty(value = "图片") + private String image; + + @ApiModelProperty(value = "描述信息") + private String description; + + @ApiModelProperty(value = "0 停售 1 起售") + private Integer status; + + @ApiModelProperty(value = "顺序") + private Integer sort; + + @ApiModelProperty(value = "创建人") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + @ApiModelProperty(value = "是否删除") + private Integer isDeleted; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/DishFlavorDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/DishFlavorDTO.java new file mode 100644 index 0000000..e8e221f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/DishFlavorDTO.java @@ -0,0 +1,50 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 菜品口味关系表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "菜品口味关系表") +public class DishFlavorDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "菜品") + private Long dishId; + + @ApiModelProperty(value = "口味名称") + private String name; + + @ApiModelProperty(value = "口味数据list") + private String value; + + @ApiModelProperty(value = "创建人") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + @ApiModelProperty(value = "是否删除") + private Integer isDeleted; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/OrderDetailDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/OrderDetailDTO.java new file mode 100644 index 0000000..3fa7ec8 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/OrderDetailDTO.java @@ -0,0 +1,49 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 订单明细表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "订单明细表") +public class OrderDetailDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "名字") + private String name; + + @ApiModelProperty(value = "图片") + private String image; + + @ApiModelProperty(value = "订单id") + private Long orderId; + + @ApiModelProperty(value = "菜品id") + private Long dishId; + + @ApiModelProperty(value = "套餐id") + private Long setmealId; + + @ApiModelProperty(value = "口味") + private String dishFlavor; + + @ApiModelProperty(value = "数量") + private Integer number; + + @ApiModelProperty(value = "金额") + private BigDecimal amount; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/OrdersDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/OrdersDTO.java new file mode 100644 index 0000000..cd65d57 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/OrdersDTO.java @@ -0,0 +1,65 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "订单表") +public class OrdersDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "订单号") + private String number; + + @ApiModelProperty(value = "订单状态 1待付款,2待派送,3已派送,4已完成,5已取消") + private Integer status; + + @ApiModelProperty(value = "下单用户") + private Long userId; + + @ApiModelProperty(value = "地址id") + private Long addressBookId; + + @ApiModelProperty(value = "下单时间") + private Date orderTime; + + @ApiModelProperty(value = "结账时间") + private Date checkoutTime; + + @ApiModelProperty(value = "支付方式 1微信,2支付宝") + private Integer payMethod; + + @ApiModelProperty(value = "实收金额") + private BigDecimal amount; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "") + private String phone; + + @ApiModelProperty(value = "") + private String address; + + @ApiModelProperty(value = "") + private String userName; + + @ApiModelProperty(value = "") + private String consignee; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/SetmealDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/SetmealDTO.java new file mode 100644 index 0000000..cf7d727 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/SetmealDTO.java @@ -0,0 +1,62 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 套餐 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "套餐") +public class SetmealDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "菜品分类id") + private Long categoryId; + + @ApiModelProperty(value = "套餐名称") + private String name; + + @ApiModelProperty(value = "套餐价格") + private BigDecimal price; + + @ApiModelProperty(value = "状态 0:停用 1:启用") + private Integer status; + + @ApiModelProperty(value = "编码") + private String code; + + @ApiModelProperty(value = "描述信息") + private String description; + + @ApiModelProperty(value = "图片") + private String image; + + @ApiModelProperty(value = "创建人") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + @ApiModelProperty(value = "是否删除") + private Integer isDeleted; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/SetmealDishDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/SetmealDishDTO.java new file mode 100644 index 0000000..3ecc8f4 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/SetmealDishDTO.java @@ -0,0 +1,59 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 套餐菜品关系 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "套餐菜品关系") +public class SetmealDishDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "套餐id ") + private String setmealId; + + @ApiModelProperty(value = "菜品id") + private String dishId; + + @ApiModelProperty(value = "菜品名称 (冗余字段)") + private String name; + + @ApiModelProperty(value = "菜品原价(冗余字段)") + private BigDecimal price; + + @ApiModelProperty(value = "份数") + private Integer copies; + + @ApiModelProperty(value = "排序") + private Integer sort; + + @ApiModelProperty(value = "创建人") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + @ApiModelProperty(value = "是否删除") + private Integer isDeleted; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/ShoppingCartDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/ShoppingCartDTO.java new file mode 100644 index 0000000..692420d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/ShoppingCartDTO.java @@ -0,0 +1,62 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 购物车 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "购物车") +public class ShoppingCartDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Long id; + + @ApiModelProperty(value = "名称") + private String name; + + @ApiModelProperty(value = "图片") + private String image; + + @ApiModelProperty(value = "主键") + private Long userId; + + @ApiModelProperty(value = "菜品id") + private Long dishId; + + @ApiModelProperty(value = "套餐id") + private Long setmealId; + + @ApiModelProperty(value = "口味") + private String dishFlavor; + + @ApiModelProperty(value = "数量") + private Integer number; + + @ApiModelProperty(value = "金额") + private BigDecimal amount; + + @ApiModelProperty(value = "创建者") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "更新者") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/dto/UserDTO.java b/renren-admin/src/main/java/io/renren/modules/takeout/dto/UserDTO.java new file mode 100644 index 0000000..832aab0 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/dto/UserDTO.java @@ -0,0 +1,62 @@ +package io.renren.modules.takeout.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 用户信息 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@ApiModel(value = "用户信息") +public class UserDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id") + private Long id; + + @ApiModelProperty(value = "姓名") + private String name; + + @ApiModelProperty(value = "手机号") + private String phone; + + @ApiModelProperty(value = "性别 0:男 1:女 2:保密") + private Integer gender; + + @ApiModelProperty(value = "身份证号") + private String idNumber; + + @ApiModelProperty(value = "头像") + private String avatarUrl; + + @ApiModelProperty(value = "状态 0:禁用,1:正常") + private Integer status; + + @ApiModelProperty(value = "微信openid") + private String openid; + + @ApiModelProperty(value = "微信昵称") + private String nickName; + + @ApiModelProperty(value = "创建者") + private Long creator; + + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "更新者") + private Long updater; + + @ApiModelProperty(value = "更新时间") + private Date updateDate; + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/AddressBookEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/AddressBookEntity.java new file mode 100644 index 0000000..c7a5d1a --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/AddressBookEntity.java @@ -0,0 +1,94 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 地址管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("address_book") +public class AddressBookEntity { + + /** + * 主键 + */ + 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; + /** + * 创建人 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 修改人 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 是否删除 + */ + private Integer isDeleted; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/CategoryEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/CategoryEntity.java new file mode 100644 index 0000000..a23ca27 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/CategoryEntity.java @@ -0,0 +1,50 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 菜品及套餐分类 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("category") +public class CategoryEntity { + + /** + * 主键 + */ + private Long id; + /** + * 类型 1 菜品分类 2 套餐分类 + */ + private Integer type; + /** + * 分类名称 + */ + private String name; + /** + * 顺序 + */ + private Integer sort; + /** + * 创建人 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 修改人 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/DishEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/DishEntity.java new file mode 100644 index 0000000..1163bf9 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/DishEntity.java @@ -0,0 +1,75 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 菜品管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("dish") +public class DishEntity { + + /** + * 主键 + */ + private Long id; + /** + * 菜品名称 + */ + private String name; + /** + * 菜品分类id + */ + private Long categoryId; + /** + * 菜品价格 + */ + private BigDecimal price; + /** + * 商品码 + */ + private String code; + /** + * 图片 + */ + private String image; + /** + * 描述信息 + */ + private String description; + /** + * 0 停售 1 起售 + */ + private Integer status; + /** + * 顺序 + */ + private Integer sort; + /** + * 创建人 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 修改人 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 是否删除 + */ + private Integer isDeleted; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/DishFlavorEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/DishFlavorEntity.java new file mode 100644 index 0000000..7289a76 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/DishFlavorEntity.java @@ -0,0 +1,54 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 菜品口味关系表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("dish_flavor") +public class DishFlavorEntity { + + /** + * 主键 + */ + private Long id; + /** + * 菜品 + */ + private Long dishId; + /** + * 口味名称 + */ + private String name; + /** + * 口味数据list + */ + private String value; + /** + * 创建人 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 修改人 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 是否删除 + */ + private Integer isDeleted; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/OrderDetailEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/OrderDetailEntity.java new file mode 100644 index 0000000..e25739a --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/OrderDetailEntity.java @@ -0,0 +1,54 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 订单明细表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("order_detail") +public class OrderDetailEntity { + + /** + * 主键 + */ + 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; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/OrdersEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/OrdersEntity.java new file mode 100644 index 0000000..d6f7d90 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/OrdersEntity.java @@ -0,0 +1,75 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("orders") +public class OrdersEntity { + + /** + * 主键 + */ + private Long id; + /** + * 订单号 + */ + private String number; + /** + * 订单状态 1待付款,2待派送,3已派送,4已完成,5已取消 + */ + private Integer status; + /** + * 下单用户 + */ + private Long userId; + /** + * 地址id + */ + private Long addressBookId; + /** + * 下单时间 + */ + private Date orderTime; + /** + * 结账时间 + */ + private Date checkoutTime; + /** + * 支付方式 1微信,2支付宝 + */ + private Integer payMethod; + /** + * 实收金额 + */ + private BigDecimal amount; + /** + * 备注 + */ + private String remark; + /** + * + */ + private String phone; + /** + * + */ + private String address; + /** + * + */ + private String userName; + /** + * + */ + private String consignee; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/SetmealDishEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/SetmealDishEntity.java new file mode 100644 index 0000000..6e9593b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/SetmealDishEntity.java @@ -0,0 +1,67 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 套餐菜品关系 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("setmeal_dish") +public class SetmealDishEntity { + + /** + * 主键 + */ + private Long id; + /** + * 套餐id + */ + private String setmealId; + /** + * 菜品id + */ + private String dishId; + /** + * 菜品名称 (冗余字段) + */ + private String name; + /** + * 菜品原价(冗余字段) + */ + private BigDecimal price; + /** + * 份数 + */ + private Integer copies; + /** + * 排序 + */ + private Integer sort; + /** + * 创建人 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 修改人 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 是否删除 + */ + private Integer isDeleted; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/SetmealEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/SetmealEntity.java new file mode 100644 index 0000000..b943197 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/SetmealEntity.java @@ -0,0 +1,71 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 套餐 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("setmeal") +public class SetmealEntity { + + /** + * 主键 + */ + private Long id; + /** + * 菜品分类id + */ + private Long categoryId; + /** + * 套餐名称 + */ + private String name; + /** + * 套餐价格 + */ + private BigDecimal price; + /** + * 状态 0:停用 1:启用 + */ + private Integer status; + /** + * 编码 + */ + private String code; + /** + * 描述信息 + */ + private String description; + /** + * 图片 + */ + private String image; + /** + * 创建人 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 修改人 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; + /** + * 是否删除 + */ + private Integer isDeleted; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/ShoppingCartEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/ShoppingCartEntity.java new file mode 100644 index 0000000..6139e34 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/ShoppingCartEntity.java @@ -0,0 +1,71 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 购物车 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("shopping_cart") +public class ShoppingCartEntity { + + /** + * 主键 + */ + 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; + /** + * 创建者 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 更新者 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/entity/UserEntity.java b/renren-admin/src/main/java/io/renren/modules/takeout/entity/UserEntity.java new file mode 100644 index 0000000..d304b8f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/entity/UserEntity.java @@ -0,0 +1,70 @@ +package io.renren.modules.takeout.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +@TableName("user") +public class UserEntity { + + /** + * id + */ + 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; + /** + * 创建者 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + /** + * 更新者 + */ + private Long updater; + /** + * 更新时间 + */ + private Date updateDate; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/AddressBookExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/AddressBookExcel.java new file mode 100644 index 0000000..328c548 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/AddressBookExcel.java @@ -0,0 +1,55 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 地址管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class AddressBookExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "用户id") + private Long userId; + @Excel(name = "收货人") + private String consignee; + @Excel(name = "性别 0 男 1 女") + private Integer gender; + @Excel(name = "手机号") + private String phone; + @Excel(name = "省级区划编号") + private String provinceCode; + @Excel(name = "省级名称") + private String provinceName; + @Excel(name = "市级区划编号") + private String cityCode; + @Excel(name = "市级名称") + private String cityName; + @Excel(name = "区级区划编号") + private String districtCode; + @Excel(name = "区级名称") + private String districtName; + @Excel(name = "详细地址") + private String detail; + @Excel(name = "标签") + private String label; + @Excel(name = "默认 0 否 1是") + private Integer isDefault; + @Excel(name = "创建人") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "修改人") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + @Excel(name = "是否删除") + private Integer isDeleted; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/CategoryExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/CategoryExcel.java new file mode 100644 index 0000000..ea87b94 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/CategoryExcel.java @@ -0,0 +1,33 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 菜品及套餐分类 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class CategoryExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "类型 1 菜品分类 2 套餐分类") + private Integer type; + @Excel(name = "分类名称") + private String name; + @Excel(name = "顺序") + private Integer sort; + @Excel(name = "创建人") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "修改人") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/DishExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/DishExcel.java new file mode 100644 index 0000000..d360b2c --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/DishExcel.java @@ -0,0 +1,46 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 菜品管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class DishExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "菜品名称") + private String name; + @Excel(name = "菜品分类id") + private Long categoryId; + @Excel(name = "菜品价格") + private BigDecimal price; + @Excel(name = "商品码") + private String code; + @Excel(name = "图片") + private String image; + @Excel(name = "描述信息") + private String description; + @Excel(name = "0 停售 1 起售") + private Integer status; + @Excel(name = "顺序") + private Integer sort; + @Excel(name = "创建人") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "修改人") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + @Excel(name = "是否删除") + private Integer isDeleted; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/DishFlavorExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/DishFlavorExcel.java new file mode 100644 index 0000000..ff05544 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/DishFlavorExcel.java @@ -0,0 +1,35 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 菜品口味关系表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class DishFlavorExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "菜品") + private Long dishId; + @Excel(name = "口味名称") + private String name; + @Excel(name = "口味数据list") + private String value; + @Excel(name = "创建人") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "修改人") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + @Excel(name = "是否删除") + private Integer isDeleted; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/OrderDetailExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/OrderDetailExcel.java new file mode 100644 index 0000000..ff119f7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/OrderDetailExcel.java @@ -0,0 +1,35 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 订单明细表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class OrderDetailExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "名字") + private String name; + @Excel(name = "图片") + private String image; + @Excel(name = "订单id") + private Long orderId; + @Excel(name = "菜品id") + private Long dishId; + @Excel(name = "套餐id") + private Long setmealId; + @Excel(name = "口味") + private String dishFlavor; + @Excel(name = "数量") + private Integer number; + @Excel(name = "金额") + private BigDecimal amount; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/OrdersExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/OrdersExcel.java new file mode 100644 index 0000000..ab47c74 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/OrdersExcel.java @@ -0,0 +1,46 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 订单表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class OrdersExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "订单号") + private String number; + @Excel(name = "订单状态 1待付款,2待派送,3已派送,4已完成,5已取消") + private Integer status; + @Excel(name = "下单用户") + private Long userId; + @Excel(name = "地址id") + private Long addressBookId; + @Excel(name = "下单时间") + private Date orderTime; + @Excel(name = "结账时间") + private Date checkoutTime; + @Excel(name = "支付方式 1微信,2支付宝") + private Integer payMethod; + @Excel(name = "实收金额") + private BigDecimal amount; + @Excel(name = "备注") + private String remark; + @Excel(name = "") + private String phone; + @Excel(name = "") + private String address; + @Excel(name = "") + private String userName; + @Excel(name = "") + private String consignee; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/SetmealDishExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/SetmealDishExcel.java new file mode 100644 index 0000000..3a91863 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/SetmealDishExcel.java @@ -0,0 +1,42 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 套餐菜品关系 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class SetmealDishExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "套餐id ") + private String setmealId; + @Excel(name = "菜品id") + private String dishId; + @Excel(name = "菜品名称 (冗余字段)") + private String name; + @Excel(name = "菜品原价(冗余字段)") + private BigDecimal price; + @Excel(name = "份数") + private Integer copies; + @Excel(name = "排序") + private Integer sort; + @Excel(name = "创建人") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "修改人") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + @Excel(name = "是否删除") + private Integer isDeleted; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/SetmealExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/SetmealExcel.java new file mode 100644 index 0000000..376a473 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/SetmealExcel.java @@ -0,0 +1,44 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 套餐 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class SetmealExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "菜品分类id") + private Long categoryId; + @Excel(name = "套餐名称") + private String name; + @Excel(name = "套餐价格") + private BigDecimal price; + @Excel(name = "状态 0:停用 1:启用") + private Integer status; + @Excel(name = "编码") + private String code; + @Excel(name = "描述信息") + private String description; + @Excel(name = "图片") + private String image; + @Excel(name = "创建人") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "修改人") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + @Excel(name = "是否删除") + private Integer isDeleted; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/ShoppingCartExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/ShoppingCartExcel.java new file mode 100644 index 0000000..2239cd7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/ShoppingCartExcel.java @@ -0,0 +1,44 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 购物车 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class ShoppingCartExcel { + @Excel(name = "主键") + private Long id; + @Excel(name = "名称") + private String name; + @Excel(name = "图片") + private String image; + @Excel(name = "主键") + private Long userId; + @Excel(name = "菜品id") + private Long dishId; + @Excel(name = "套餐id") + private Long setmealId; + @Excel(name = "口味") + private String dishFlavor; + @Excel(name = "数量") + private Integer number; + @Excel(name = "金额") + private BigDecimal amount; + @Excel(name = "创建者") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "更新者") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/excel/UserExcel.java b/renren-admin/src/main/java/io/renren/modules/takeout/excel/UserExcel.java new file mode 100644 index 0000000..dc833f9 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/excel/UserExcel.java @@ -0,0 +1,43 @@ +package io.renren.modules.takeout.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Data +public class UserExcel { + @Excel(name = "id") + private Long id; + @Excel(name = "姓名") + private String name; + @Excel(name = "手机号") + private String phone; + @Excel(name = "性别 0:男 1:女 2:保密") + private Integer gender; + @Excel(name = "身份证号") + private String idNumber; + @Excel(name = "头像") + private String avatarUrl; + @Excel(name = "状态 0:禁用,1:正常") + private Integer status; + @Excel(name = "微信openid") + private String openid; + @Excel(name = "微信昵称") + private String nickName; + @Excel(name = "创建者") + private Long creator; + @Excel(name = "创建时间") + private Date createDate; + @Excel(name = "更新者") + private Long updater; + @Excel(name = "更新时间") + private Date updateDate; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/AddressBookService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/AddressBookService.java new file mode 100644 index 0000000..00de373 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/AddressBookService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.AddressBookDTO; +import io.renren.modules.takeout.entity.AddressBookEntity; + +/** + * 地址管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface AddressBookService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/CategoryService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/CategoryService.java new file mode 100644 index 0000000..6ba7364 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/CategoryService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.CategoryDTO; +import io.renren.modules.takeout.entity.CategoryEntity; + +/** + * 菜品及套餐分类 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface CategoryService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/DishFlavorService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/DishFlavorService.java new file mode 100644 index 0000000..ca6108b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/DishFlavorService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.DishFlavorDTO; +import io.renren.modules.takeout.entity.DishFlavorEntity; + +/** + * 菜品口味关系表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface DishFlavorService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/DishService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/DishService.java new file mode 100644 index 0000000..9fc0d93 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/DishService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.DishDTO; +import io.renren.modules.takeout.entity.DishEntity; + +/** + * 菜品管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface DishService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/OrderDetailService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/OrderDetailService.java new file mode 100644 index 0000000..936644d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/OrderDetailService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.OrderDetailDTO; +import io.renren.modules.takeout.entity.OrderDetailEntity; + +/** + * 订单明细表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface OrderDetailService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/OrdersService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/OrdersService.java new file mode 100644 index 0000000..aa2b5bd --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/OrdersService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.OrdersDTO; +import io.renren.modules.takeout.entity.OrdersEntity; + +/** + * 订单表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface OrdersService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/SetmealDishService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/SetmealDishService.java new file mode 100644 index 0000000..c582b0a --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/SetmealDishService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.SetmealDishDTO; +import io.renren.modules.takeout.entity.SetmealDishEntity; + +/** + * 套餐菜品关系 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface SetmealDishService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/SetmealService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/SetmealService.java new file mode 100644 index 0000000..58f1cfb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/SetmealService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.SetmealDTO; +import io.renren.modules.takeout.entity.SetmealEntity; + +/** + * 套餐 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface SetmealService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/ShoppingCartService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/ShoppingCartService.java new file mode 100644 index 0000000..860bcee --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/ShoppingCartService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.ShoppingCartDTO; +import io.renren.modules.takeout.entity.ShoppingCartEntity; + +/** + * 购物车 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface ShoppingCartService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/UserService.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/UserService.java new file mode 100644 index 0000000..93f103f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/UserService.java @@ -0,0 +1,15 @@ +package io.renren.modules.takeout.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.takeout.dto.UserDTO; +import io.renren.modules.takeout.entity.UserEntity; + +/** + * 用户信息 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +public interface UserService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/AddressBookServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/AddressBookServiceImpl.java new file mode 100644 index 0000000..00bc88c --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/AddressBookServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.AddressBookDao; +import io.renren.modules.takeout.dto.AddressBookDTO; +import io.renren.modules.takeout.entity.AddressBookEntity; +import io.renren.modules.takeout.service.AddressBookService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 地址管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class AddressBookServiceImpl extends CrudServiceImpl implements AddressBookService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/CategoryServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/CategoryServiceImpl.java new file mode 100644 index 0000000..defa849 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/CategoryServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.CategoryDao; +import io.renren.modules.takeout.dto.CategoryDTO; +import io.renren.modules.takeout.entity.CategoryEntity; +import io.renren.modules.takeout.service.CategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 菜品及套餐分类 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class CategoryServiceImpl extends CrudServiceImpl implements CategoryService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/DishFlavorServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/DishFlavorServiceImpl.java new file mode 100644 index 0000000..b9b3f8d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/DishFlavorServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.DishFlavorDao; +import io.renren.modules.takeout.dto.DishFlavorDTO; +import io.renren.modules.takeout.entity.DishFlavorEntity; +import io.renren.modules.takeout.service.DishFlavorService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 菜品口味关系表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class DishFlavorServiceImpl extends CrudServiceImpl implements DishFlavorService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/DishServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/DishServiceImpl.java new file mode 100644 index 0000000..475a0a6 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/DishServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.DishDao; +import io.renren.modules.takeout.dto.DishDTO; +import io.renren.modules.takeout.entity.DishEntity; +import io.renren.modules.takeout.service.DishService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 菜品管理 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class DishServiceImpl extends CrudServiceImpl implements DishService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrderDetailServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrderDetailServiceImpl.java new file mode 100644 index 0000000..ad811c9 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrderDetailServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.OrderDetailDao; +import io.renren.modules.takeout.dto.OrderDetailDTO; +import io.renren.modules.takeout.entity.OrderDetailEntity; +import io.renren.modules.takeout.service.OrderDetailService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 订单明细表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class OrderDetailServiceImpl extends CrudServiceImpl implements OrderDetailService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrdersServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrdersServiceImpl.java new file mode 100644 index 0000000..87677ac --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/OrdersServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.OrdersDao; +import io.renren.modules.takeout.dto.OrdersDTO; +import io.renren.modules.takeout.entity.OrdersEntity; +import io.renren.modules.takeout.service.OrdersService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 订单表 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class OrdersServiceImpl extends CrudServiceImpl implements OrdersService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/SetmealDishServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/SetmealDishServiceImpl.java new file mode 100644 index 0000000..155eb4b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/SetmealDishServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.SetmealDishDao; +import io.renren.modules.takeout.dto.SetmealDishDTO; +import io.renren.modules.takeout.entity.SetmealDishEntity; +import io.renren.modules.takeout.service.SetmealDishService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 套餐菜品关系 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class SetmealDishServiceImpl extends CrudServiceImpl implements SetmealDishService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/SetmealServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/SetmealServiceImpl.java new file mode 100644 index 0000000..c3cc0c7 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/SetmealServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.SetmealDao; +import io.renren.modules.takeout.dto.SetmealDTO; +import io.renren.modules.takeout.entity.SetmealEntity; +import io.renren.modules.takeout.service.SetmealService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 套餐 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class SetmealServiceImpl extends CrudServiceImpl implements SetmealService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/ShoppingCartServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/ShoppingCartServiceImpl.java new file mode 100644 index 0000000..a911abb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/ShoppingCartServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.ShoppingCartDao; +import io.renren.modules.takeout.dto.ShoppingCartDTO; +import io.renren.modules.takeout.entity.ShoppingCartEntity; +import io.renren.modules.takeout.service.ShoppingCartService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 购物车 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class ShoppingCartServiceImpl extends CrudServiceImpl implements ShoppingCartService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/UserServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..072b81f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/takeout/service/impl/UserServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.takeout.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.modules.takeout.dao.UserDao; +import io.renren.modules.takeout.dto.UserDTO; +import io.renren.modules.takeout.entity.UserEntity; +import io.renren.modules.takeout.service.UserService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 用户信息 + * + * @author zyx + * @since 1.0.0 2023-06-09 + */ +@Service +public class UserServiceImpl extends CrudServiceImpl implements UserService { + + @Override + public QueryWrapper getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/resources/application-dev.yml b/renren-admin/src/main/resources/application-dev.yml new file mode 100644 index 0000000..e6182c4 --- /dev/null +++ b/renren-admin/src/main/resources/application-dev.yml @@ -0,0 +1,69 @@ +spring: + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/mt_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: root + password: 123456 + #达梦8 +# driver-class-name: dm.jdbc.driver.DmDriver +# url: jdbc:dm://192.168.10.10:5236/renren_security?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true +# username: renren_security +# password: 12345678 + # #Oracle + # driver-class-name: oracle.jdbc.OracleDriver + # url: jdbc:oracle:thin:@192.168.10.10:1521:xe + # username: renren_security + # password: 123456 + # #SQLServer + # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + # url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_security + # username: sa + # password: 123456 + # #postgresql + # driver-class-name: org.postgresql.Driver + # url: jdbc:postgresql://192.168.10.10:5432/postgres + # username: postgres + # password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 6000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + # validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + #达梦数据库,需要注释掉,其他数据库可以打开 +# filter: +# stat: +# log-slow-sql: true +# slow-sql-millis: 1000 +# merge-sql: false +# wall: +# config: +# multi-statement-allow: true + +##多数据源的配置,需要引用renren-dynamic-datasource +#dynamic: +# datasource: +# slave1: +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://123456:1433;DatabaseName=renren_security +# username: sa +# password: 123456 +# slave2: +# driver-class-name: org.postgresql.Driver +# url: jdbc:postgresql://123456:5432/renren_security +# username: postgres +# password: 123456 \ No newline at end of file diff --git a/renren-admin/src/main/resources/application-prod.yml b/renren-admin/src/main/resources/application-prod.yml new file mode 100644 index 0000000..80d85af --- /dev/null +++ b/renren-admin/src/main/resources/application-prod.yml @@ -0,0 +1,34 @@ +spring: + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/renren_security?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: renren + password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true \ No newline at end of file diff --git a/renren-admin/src/main/resources/application-test.yml b/renren-admin/src/main/resources/application-test.yml new file mode 100644 index 0000000..80d85af --- /dev/null +++ b/renren-admin/src/main/resources/application-test.yml @@ -0,0 +1,34 @@ +spring: + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/renren_security?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: renren + password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true \ No newline at end of file diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml new file mode 100644 index 0000000..45a4b52 --- /dev/null +++ b/renren-admin/src/main/resources/application.yml @@ -0,0 +1,83 @@ +# Tomcat +server: + tomcat: + uri-encoding: UTF-8 + threads: + max: 1000 + min-spare: 30 + port: 8080 + servlet: + context-path: /api + session: + cookie: + http-only: true + +knife4j: + enable: true + basic: + enable: false + username: admin + password: admin + setting: + enableFooter: false + +spring: + # 环境 dev|test|prod + profiles: + active: dev + messages: + encoding: UTF-8 + basename: i18n/messages + mvc: + pathmatch: + matching-strategy: ANT_PATH_MATCHER + servlet: + multipart: + max-file-size: 100MB + max-request-size: 100MB + enabled: true + redis: + database: 0 + host: localhost + port: 6379 + password: # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + +# 是否开启redis缓存 true开启 false关闭 +renren: + redis: + open: true + +#mybatis +mybatis-plus: + mapper-locations: classpath*:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: io.renren.modules.*.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 + id-type: ASSIGN_ID + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + configuration-properties: + prefix: + blobType: BLOB + boolValue: TRUE + +#用于发送邮箱验证码的账户和密码 +email: + #qq + userName: 邮箱账号 + password: 邮箱SMTP服务授权码 \ No newline at end of file diff --git a/renren-admin/src/main/resources/banner.txt b/renren-admin/src/main/resources/banner.txt new file mode 100644 index 0000000..d9219dd --- /dev/null +++ b/renren-admin/src/main/resources/banner.txt @@ -0,0 +1,5 @@ +==================================================================================================================== + + 欢迎使用 renren-security - Powered By https://www.renren.io + +==================================================================================================================== \ No newline at end of file diff --git a/renren-admin/src/main/resources/logback-spring.xml b/renren-admin/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..5deef21 --- /dev/null +++ b/renren-admin/src/main/resources/logback-spring.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/job/ScheduleJobDao.xml b/renren-admin/src/main/resources/mapper/job/ScheduleJobDao.xml new file mode 100644 index 0000000..d53d9e2 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/job/ScheduleJobDao.xml @@ -0,0 +1,14 @@ + + + + + + + + update schedule_job set status = #{status} where id in + + #{id} + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/job/ScheduleJobLogDao.xml b/renren-admin/src/main/resources/mapper/job/ScheduleJobLogDao.xml new file mode 100644 index 0000000..6999238 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/job/ScheduleJobLogDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/log/SysLogErrorDao.xml b/renren-admin/src/main/resources/mapper/log/SysLogErrorDao.xml new file mode 100644 index 0000000..27268c5 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/log/SysLogErrorDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/log/SysLogLoginDao.xml b/renren-admin/src/main/resources/mapper/log/SysLogLoginDao.xml new file mode 100644 index 0000000..ab6ec35 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/log/SysLogLoginDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/log/SysLogOperationDao.xml b/renren-admin/src/main/resources/mapper/log/SysLogOperationDao.xml new file mode 100644 index 0000000..079abc0 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/log/SysLogOperationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/oss/SysOssDao.xml b/renren-admin/src/main/resources/mapper/oss/SysOssDao.xml new file mode 100644 index 0000000..bbb3af4 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/oss/SysOssDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml b/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml new file mode 100644 index 0000000..0941157 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysDeptDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysDictDataDao.xml b/renren-admin/src/main/resources/mapper/sys/SysDictDataDao.xml new file mode 100644 index 0000000..5e8e2f6 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysDictDataDao.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysDictTypeDao.xml b/renren-admin/src/main/resources/mapper/sys/SysDictTypeDao.xml new file mode 100644 index 0000000..6b92d31 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysDictTypeDao.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysMenuDao.xml b/renren-admin/src/main/resources/mapper/sys/SysMenuDao.xml new file mode 100644 index 0000000..3faeb69 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysMenuDao.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysParamsDao.xml b/renren-admin/src/main/resources/mapper/sys/SysParamsDao.xml new file mode 100644 index 0000000..964fc35 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysParamsDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + update sys_params set param_value = #{paramValue} where param_code = #{paramCode} + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysRoleDao.xml b/renren-admin/src/main/resources/mapper/sys/SysRoleDao.xml new file mode 100644 index 0000000..9c39f26 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysRoleDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysRoleDataScopeDao.xml b/renren-admin/src/main/resources/mapper/sys/SysRoleDataScopeDao.xml new file mode 100644 index 0000000..5192393 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysRoleDataScopeDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + delete from sys_role_data_scope where role_id in + + #{roleId} + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysRoleMenuDao.xml b/renren-admin/src/main/resources/mapper/sys/SysRoleMenuDao.xml new file mode 100644 index 0000000..912c2f2 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysRoleMenuDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + delete from sys_role_menu where role_id in + + #{roleId} + + + + + delete from sys_role_menu where menu_id = #{value} + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysRoleUserDao.xml b/renren-admin/src/main/resources/mapper/sys/SysRoleUserDao.xml new file mode 100644 index 0000000..d31e2c4 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysRoleUserDao.xml @@ -0,0 +1,24 @@ + + + + + + + delete from sys_role_user where role_id in + + #{roleId} + + + + + delete from sys_role_user where user_id in + + #{userId} + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml new file mode 100644 index 0000000..cd2f771 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysUserDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + update sys_user set password = #{newPassword} where id = #{id} + + + + + + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/sys/SysUserTokenDao.xml b/renren-admin/src/main/resources/mapper/sys/SysUserTokenDao.xml new file mode 100644 index 0000000..fe77347 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/sys/SysUserTokenDao.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + update sys_user_token set token = #{token} where user_id = #{userId} + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/public/1.png b/renren-admin/src/main/resources/public/1.png new file mode 100644 index 0000000..4c65c74 Binary files /dev/null and b/renren-admin/src/main/resources/public/1.png differ diff --git a/renren-admin/src/main/resources/public/2.png b/renren-admin/src/main/resources/public/2.png new file mode 100644 index 0000000..06a48ec Binary files /dev/null and b/renren-admin/src/main/resources/public/2.png differ diff --git a/renren-admin/src/main/resources/public/favicon.ico b/renren-admin/src/main/resources/public/favicon.ico new file mode 100644 index 0000000..2bd581c Binary files /dev/null and b/renren-admin/src/main/resources/public/favicon.ico differ diff --git a/renren-admin/src/main/resources/public/wechat.jpg b/renren-admin/src/main/resources/public/wechat.jpg new file mode 100644 index 0000000..b3181ca Binary files /dev/null and b/renren-admin/src/main/resources/public/wechat.jpg differ diff --git a/renren-admin/src/test/java/io/renren/DynamicDataSourceTest.java b/renren-admin/src/test/java/io/renren/DynamicDataSourceTest.java new file mode 100644 index 0000000..ff77e56 --- /dev/null +++ b/renren-admin/src/test/java/io/renren/DynamicDataSourceTest.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren; + +import io.renren.service.DynamicDataSourceTestService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * 多数据源测试 + * + * @author Mark sunlightcs@gmail.com + */ +@RunWith(SpringRunner.class) +@SpringBootTest +public class DynamicDataSourceTest { + @Autowired + private DynamicDataSourceTestService dynamicDataSourceTestService; + + @Test + public void test(){ + Long id = 1067246875800000001L; + + dynamicDataSourceTestService.updateUser(id); + dynamicDataSourceTestService.updateUserBySlave1(id); + //dynamicDataSourceTestService.updateUserBySlave2(id); + } + + +} diff --git a/renren-admin/src/test/java/io/renren/RedisTest.java b/renren-admin/src/test/java/io/renren/RedisTest.java new file mode 100644 index 0000000..bc6d982 --- /dev/null +++ b/renren-admin/src/test/java/io/renren/RedisTest.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren; + +import io.renren.common.redis.RedisUtils; +import io.renren.modules.sys.entity.SysUserEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class RedisTest { + @Autowired + private RedisUtils redisUtils; + + @Test + public void contextLoads() { + SysUserEntity user = new SysUserEntity(); + user.setEmail("123456@qq.com"); + redisUtils.set("user", user); + + System.out.println(ToStringBuilder.reflectionToString(redisUtils.get("user"))); + } + +} \ No newline at end of file diff --git a/renren-admin/src/test/java/io/renren/service/DynamicDataSourceTestService.java b/renren-admin/src/test/java/io/renren/service/DynamicDataSourceTestService.java new file mode 100644 index 0000000..db29860 --- /dev/null +++ b/renren-admin/src/test/java/io/renren/service/DynamicDataSourceTestService.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.service; + +import io.renren.commons.dynamic.datasource.annotation.DataSource; +import io.renren.modules.sys.dao.SysUserDao; +import io.renren.modules.sys.entity.SysUserEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 测试多数据源 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +//@DataSource("slave1") +public class DynamicDataSourceTestService { + @Autowired + private SysUserDao sysUserDao; + + //@Transactional + public void updateUser(Long id){ + SysUserEntity user = new SysUserEntity(); + user.setId(id); + user.setMobile("13500000000"); + //sysUserDao.updateById(user); + System.out.println(sysUserDao.selectById(id)); + } + + @DataSource("slave1") + @Transactional + public void updateUserBySlave1(Long id){ + SysUserEntity user = new SysUserEntity(); + user.setId(id); + user.setMobile("13500000001"); + //sysUserDao.updateById(user); + System.out.println(sysUserDao.selectById(id)); + } + +// @DataSource("slave2") +// @Transactional +// public void updateUserBySlave2(Long id){ +// SysUserEntity user = new SysUserEntity(); +// user.setId(id); +// user.setMobile("13500000002"); +// sysUserDao.updateById(user); +// +// //测试事物 +// int i = 1/0; +// } +} \ No newline at end of file diff --git a/renren-api/Dockerfile b/renren-api/Dockerfile new file mode 100644 index 0000000..251b7fc --- /dev/null +++ b/renren-api/Dockerfile @@ -0,0 +1,7 @@ +FROM java:8 +EXPOSE 8081 + +VOLUME /tmp +ADD renren-api.jar /app.jar +RUN bash -c 'touch /app.jar' +ENTRYPOINT ["java","-jar","/app.jar"] diff --git a/renren-api/db/dm8.sql b/renren-api/db/dm8.sql new file mode 100644 index 0000000..7f1bfd0 --- /dev/null +++ b/renren-api/db/dm8.sql @@ -0,0 +1,27 @@ +CREATE TABLE tb_user ( + id bigint NOT NULL, + username varchar(50) NOT NULL, + mobile varchar(20) NOT NULL, + password varchar(64), + create_date datetime, + PRIMARY KEY (id) +); +CREATE UNIQUE INDEX idx_user_username on tb_user(username); + +CREATE TABLE tb_token ( + id bigint NOT NULL, + user_id bigint NOT NULL, + token varchar(100) NOT NULL, + expire_date datetime, + update_date datetime, + PRIMARY KEY (id) +); + +CREATE UNIQUE INDEX idx_token_user_id on tb_token(user_id); +CREATE UNIQUE INDEX idx_token on tb_token(token); + + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (id, username, mobile, password, create_date) VALUES (1067246875800000168, 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', now()); + +commit; diff --git a/renren-api/db/mysql.sql b/renren-api/db/mysql.sql new file mode 100644 index 0000000..ba6f058 --- /dev/null +++ b/renren-api/db/mysql.sql @@ -0,0 +1,25 @@ +-- 用户表 +CREATE TABLE tb_user ( + id bigint NOT NULL COMMENT 'id', + username varchar(50) NOT NULL COMMENT '用户名', + mobile varchar(20) NOT NULL COMMENT '手机号', + password varchar(64) COMMENT '密码', + create_date datetime COMMENT '创建时间', + PRIMARY KEY (id), + UNIQUE INDEX (username) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户'; + +-- 用户Token表 +CREATE TABLE tb_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 '更新时间', + PRIMARY KEY (id), + UNIQUE INDEX (user_id), + UNIQUE INDEX (token) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户Token'; + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (id, username, mobile, password, create_date) VALUES (1067246875900000001, 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', now()); diff --git a/renren-api/db/oracle.sql b/renren-api/db/oracle.sql new file mode 100644 index 0000000..69b44cb --- /dev/null +++ b/renren-api/db/oracle.sql @@ -0,0 +1,24 @@ +CREATE TABLE tb_user ( + id NUMBER(20, 0) NOT NULL, + username varchar(50) NOT NULL, + mobile varchar(20) NOT NULL, + password varchar(64), + create_date date, + PRIMARY KEY (id) +); +CREATE UNIQUE INDEX idx_user_username on tb_user(username); + +CREATE TABLE tb_token ( + id NUMBER(20, 0) NOT NULL, + user_id NUMBER(20, 0) NOT NULL, + token varchar(100) NOT NULL, + expire_date date, + update_date date, + PRIMARY KEY (id) +); +CREATE UNIQUE INDEX idx_token_user_id on tb_token(user_id); +CREATE UNIQUE INDEX idx_token on tb_token(token); + + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (id, username, mobile, password, create_date) VALUES (1067246875900000001, 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', CURRENT_DATE); diff --git a/renren-api/db/postgresql.sql b/renren-api/db/postgresql.sql new file mode 100644 index 0000000..408b32c --- /dev/null +++ b/renren-api/db/postgresql.sql @@ -0,0 +1,24 @@ +CREATE TABLE tb_user ( + id int8 NOT NULL, + username varchar(50) NOT NULL, + mobile varchar(20) NOT NULL, + password varchar(64), + create_date timestamp, + PRIMARY KEY (id), + UNIQUE (username) +); + +CREATE TABLE tb_token ( + id int8 NOT NULL, + user_id int8 NOT NULL, + token varchar(100) NOT NULL, + expire_date timestamp, + update_date timestamp, + PRIMARY KEY (id), + UNIQUE (user_id), + UNIQUE (token) +); + + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (id, username, mobile, password, create_date) VALUES (1067246875900000001, 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', now()); diff --git a/renren-api/db/sqlserver.sql b/renren-api/db/sqlserver.sql new file mode 100644 index 0000000..3a600a4 --- /dev/null +++ b/renren-api/db/sqlserver.sql @@ -0,0 +1,24 @@ +CREATE TABLE tb_user ( + id bigint NOT NULL, + username varchar(50) NOT NULL, + mobile varchar(20) NOT NULL, + password varchar(64), + create_date datetime, + PRIMARY KEY (id), + UNIQUE (username) +); + +CREATE TABLE tb_token ( + id bigint NOT NULL, + user_id bigint NOT NULL, + token varchar(100) NOT NULL, + expire_date datetime, + update_date datetime, + PRIMARY KEY (id), + UNIQUE (user_id), + UNIQUE (token) +); + + +-- 账号:13612345678 密码:admin +INSERT INTO tb_user (id, username, mobile, password, create_date) VALUES (1067246875900000001, 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', getdate()); diff --git a/renren-api/pom.xml b/renren-api/pom.xml new file mode 100644 index 0000000..24fdf05 --- /dev/null +++ b/renren-api/pom.xml @@ -0,0 +1,52 @@ + + + io.renren + renren-security + 5.2.0 + + 4.0.0 + renren-api + jar + renren-api + + + + io.renren + renren-common + 5.2.0 + + + + + ${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-api/src/main/java/io/renren/ApiApplication.java b/renren-api/src/main/java/io/renren/ApiApplication.java new file mode 100644 index 0000000..28ec16a --- /dev/null +++ b/renren-api/src/main/java/io/renren/ApiApplication.java @@ -0,0 +1,32 @@ +/** + * 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; + +/** + * renren-api + * + * @author Mark sunlightcs@gmail.com + */ +@SpringBootApplication +public class ApiApplication extends SpringBootServletInitializer { + + public static void main(String[] args) { + SpringApplication.run(ApiApplication.class, args); + } + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(ApiApplication.class); + } +} diff --git a/renren-api/src/main/java/io/renren/annotation/Login.java b/renren-api/src/main/java/io/renren/annotation/Login.java new file mode 100644 index 0000000..3b9436c --- /dev/null +++ b/renren-api/src/main/java/io/renren/annotation/Login.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.annotation; + +import java.lang.annotation.*; + +/** + * 登录效验 + * @author Mark sunlightcs@gmail.com + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Login { +} diff --git a/renren-api/src/main/java/io/renren/annotation/LoginUser.java b/renren-api/src/main/java/io/renren/annotation/LoginUser.java new file mode 100644 index 0000000..7bf522a --- /dev/null +++ b/renren-api/src/main/java/io/renren/annotation/LoginUser.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 登录用户信息 + * + * @author Mark sunlightcs@gmail.com + */ +@Target(ElementType.PARAMETER) +@Retention(RetentionPolicy.RUNTIME) +public @interface LoginUser { + +} diff --git a/renren-api/src/main/java/io/renren/config/FilterConfig.java b/renren-api/src/main/java/io/renren/config/FilterConfig.java new file mode 100644 index 0000000..68bd80a --- /dev/null +++ b/renren-api/src/main/java/io/renren/config/FilterConfig.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import io.renren.common.xss.XssFilter; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.DispatcherType; + +/** + * Filter配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class FilterConfig { + + @Bean + public FilterRegistrationBean xssFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns("/*"); + registration.setName("xssFilter"); + return registration; + } +} diff --git a/renren-api/src/main/java/io/renren/config/MybatisPlusConfig.java b/renren-api/src/main/java/io/renren/config/MybatisPlusConfig.java new file mode 100644 index 0000000..3885f0f --- /dev/null +++ b/renren-api/src/main/java/io/renren/config/MybatisPlusConfig.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.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 org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * mybatis-plus配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class MybatisPlusConfig { + + /** + * 配置分页等 + */ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor(); + // 分页插件 + mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor()); + // 乐观锁 + mybatisPlusInterceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor()); + // 防止全表更新与删除 + mybatisPlusInterceptor.addInnerInterceptor(new BlockAttackInnerInterceptor()); + + return mybatisPlusInterceptor; + } + +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/config/SwaggerConfig.java b/renren-api/src/main/java/io/renren/config/SwaggerConfig.java new file mode 100644 index 0000000..ad41574 --- /dev/null +++ b/renren-api/src/main/java/io/renren/config/SwaggerConfig.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import com.github.xiaoymin.knife4j.spring.extension.OpenApiExtensionResolver; +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; + +@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.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-api模块接口文档") + .termsOfServiceUrl("https://www.renren.io") + .version("5.x") + .build(); + } + + private List security() { + return newArrayList( + new ApiKey("token", "token", "header") + ); + } + +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/config/WebMvcConfig.java b/renren-api/src/main/java/io/renren/config/WebMvcConfig.java new file mode 100644 index 0000000..3d06e50 --- /dev/null +++ b/renren-api/src/main/java/io/renren/config/WebMvcConfig.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +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 io.renren.common.utils.DateUtils; +import io.renren.interceptor.AuthorizationInterceptor; +import io.renren.resolver.LoginUserHandlerMethodArgumentResolver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.ByteArrayHttpMessageConverter; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.ResourceHttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.TimeZone; + +/** + * MVC配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + @Autowired + private AuthorizationInterceptor authorizationInterceptor; + @Autowired + private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authorizationInterceptor).addPathPatterns("/api/**"); + } + + @Override + public void addArgumentResolvers(List argumentResolvers) { + argumentResolvers.add(loginUserHandlerMethodArgumentResolver); + } + + @Override + public void configureMessageConverters(List> converters) { + converters.add(new ByteArrayHttpMessageConverter()); + converters.add(new StringHttpMessageConverter()); + converters.add(new ResourceHttpMessageConverter()); + converters.add(new AllEncompassingFormHttpMessageConverter()); + converters.add(new StringHttpMessageConverter()); + converters.add(jackson2HttpMessageConverter()); + } + + @Bean + public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() { + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + ObjectMapper mapper = new ObjectMapper(); + + //日期格式转换 + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN)); + mapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); + + //Long类型转String类型 + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(Long.class, ToStringSerializer.instance); + simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); + mapper.registerModule(simpleModule); + + converter.setObjectMapper(mapper); + return converter; + } +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/controller/ApiLoginController.java b/renren-api/src/main/java/io/renren/controller/ApiLoginController.java new file mode 100644 index 0000000..e944813 --- /dev/null +++ b/renren-api/src/main/java/io/renren/controller/ApiLoginController.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.controller; + + +import io.renren.annotation.Login; +import io.renren.common.utils.Result; +import io.renren.common.validator.ValidatorUtils; +import io.renren.dto.LoginDTO; +import io.renren.service.TokenService; +import io.renren.service.UserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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("/api") +@Api(tags="登录接口") +public class ApiLoginController { + @Autowired + private UserService userService; + @Autowired + private TokenService tokenService; + + + @PostMapping("login") + @ApiOperation("登录") + public Result> login(@RequestBody LoginDTO dto){ + //表单校验 + ValidatorUtils.validateEntity(dto); + + //用户登录 + Map map = userService.login(dto); + + return new Result().ok(map); + } + + @Login + @PostMapping("logout") + @ApiOperation("退出") + public Result logout(@ApiIgnore @RequestAttribute("userId") Long userId){ + tokenService.expireToken(userId); + return new Result(); + } + +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/controller/ApiRegisterController.java b/renren-api/src/main/java/io/renren/controller/ApiRegisterController.java new file mode 100644 index 0000000..3f35d55 --- /dev/null +++ b/renren-api/src/main/java/io/renren/controller/ApiRegisterController.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.controller; + +import io.renren.common.utils.Result; +import io.renren.common.validator.ValidatorUtils; +import io.renren.dto.RegisterDTO; +import io.renren.entity.UserEntity; +import io.renren.service.UserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.beans.factory.annotation.Autowired; +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 java.util.Date; + +/** + * 注册接口 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/api") +@Api(tags="注册接口") +public class ApiRegisterController { + @Autowired + private UserService userService; + + @PostMapping("register") + @ApiOperation("注册") + public Result register(@RequestBody RegisterDTO dto){ + //表单校验 + ValidatorUtils.validateEntity(dto); + + UserEntity user = new UserEntity(); + user.setMobile(dto.getMobile()); + user.setUsername(dto.getMobile()); + user.setPassword(DigestUtils.sha256Hex(dto.getPassword())); + user.setCreateDate(new Date()); + userService.insert(user); + + return new Result(); + } +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/controller/ApiTestController.java b/renren-api/src/main/java/io/renren/controller/ApiTestController.java new file mode 100644 index 0000000..e85f55f --- /dev/null +++ b/renren-api/src/main/java/io/renren/controller/ApiTestController.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.controller; + +import io.renren.annotation.Login; +import io.renren.annotation.LoginUser; +import io.renren.common.utils.Result; +import io.renren.entity.UserEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +/** + * 测试接口 + * + * @author Mark sunlightcs@gmail.com + */ +@RestController +@RequestMapping("/api") +@Api(tags="测试接口") +public class ApiTestController { + + @Login + @GetMapping("userInfo") + @ApiOperation(value="获取用户信息", response=UserEntity.class) + public Result userInfo(@ApiIgnore @LoginUser UserEntity user){ + return new Result().ok(user); + } + + @Login + @GetMapping("userId") + @ApiOperation("获取用户ID") + public Result userInfo(@ApiIgnore @RequestAttribute("userId") Long userId){ + return new Result().ok(userId); + } + + @GetMapping("notToken") + @ApiOperation("忽略Token验证测试") + public Result notToken(){ + return new Result().ok("无需token也能访问。。。"); + } + +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/dao/TokenDao.java b/renren-api/src/main/java/io/renren/dao/TokenDao.java new file mode 100644 index 0000000..65e4c66 --- /dev/null +++ b/renren-api/src/main/java/io/renren/dao/TokenDao.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.entity.TokenEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户Token + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface TokenDao extends BaseDao { + TokenEntity getByToken(String token); + + TokenEntity getByUserId(Long userId); +} diff --git a/renren-api/src/main/java/io/renren/dao/UserDao.java b/renren-api/src/main/java/io/renren/dao/UserDao.java new file mode 100644 index 0000000..babcfff --- /dev/null +++ b/renren-api/src/main/java/io/renren/dao/UserDao.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.entity.UserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface UserDao extends BaseDao { + UserEntity getUserByMobile(String mobile); + + UserEntity getUserByUserId(Long userId); +} diff --git a/renren-api/src/main/java/io/renren/dto/LoginDTO.java b/renren-api/src/main/java/io/renren/dto/LoginDTO.java new file mode 100644 index 0000000..935bd1a --- /dev/null +++ b/renren-api/src/main/java/io/renren/dto/LoginDTO.java @@ -0,0 +1,34 @@ +/** + /** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 登录表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "登录表单") +public class LoginDTO { + @ApiModelProperty(value = "手机号") + @NotBlank(message="手机号不能为空") + private String mobile; + + @ApiModelProperty(value = "密码") + @NotBlank(message="密码不能为空") + private String password; + +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/dto/RegisterDTO.java b/renren-api/src/main/java/io/renren/dto/RegisterDTO.java new file mode 100644 index 0000000..ff1f45a --- /dev/null +++ b/renren-api/src/main/java/io/renren/dto/RegisterDTO.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 注册表单 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "注册表单") +public class RegisterDTO { + @ApiModelProperty(value = "手机号") + @NotBlank(message="手机号不能为空") + private String mobile; + + @ApiModelProperty(value = "密码") + @NotBlank(message="密码不能为空") + private String password; + +} diff --git a/renren-api/src/main/java/io/renren/entity/TokenEntity.java b/renren-api/src/main/java/io/renren/entity/TokenEntity.java new file mode 100644 index 0000000..4a5bd75 --- /dev/null +++ b/renren-api/src/main/java/io/renren/entity/TokenEntity.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户Token + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("tb_token") +public class TokenEntity implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId + private Long id; + /** + * 用户ID + */ + private Long userId; + /** + * 用户token + */ + private String token; + /** + * 过期时间 + */ + private Date expireDate; + /** + * 更新时间 + */ + private Date updateDate; + +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/entity/UserEntity.java b/renren-api/src/main/java/io/renren/entity/UserEntity.java new file mode 100644 index 0000000..1934da4 --- /dev/null +++ b/renren-api/src/main/java/io/renren/entity/UserEntity.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@TableName("tb_user") +public class UserEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @TableId + private Long id; + /** + * 用户名 + */ + private String username; + /** + * 手机号 + */ + private String mobile; + /** + * 密码 + */ + @JsonIgnore + private String password; + /** + * 创建时间 + */ + private Date createDate; + +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/exception/RenExceptionHandler.java b/renren-api/src/main/java/io/renren/exception/RenExceptionHandler.java new file mode 100644 index 0000000..9c4a968 --- /dev/null +++ b/renren-api/src/main/java/io/renren/exception/RenExceptionHandler.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.exception; + +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import io.renren.common.utils.Result; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * 异常处理器 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestControllerAdvice +public class RenExceptionHandler { + private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class); + + /** + * 处理自定义异常 + */ + @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); + + return new Result().error(); + } +} \ No newline at end of file diff --git a/renren-api/src/main/java/io/renren/interceptor/AuthorizationInterceptor.java b/renren-api/src/main/java/io/renren/interceptor/AuthorizationInterceptor.java new file mode 100644 index 0000000..c0bfb0e --- /dev/null +++ b/renren-api/src/main/java/io/renren/interceptor/AuthorizationInterceptor.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.interceptor; + +import io.renren.annotation.Login; +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import io.renren.entity.TokenEntity; +import io.renren.service.TokenService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * 权限(Token)验证 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class AuthorizationInterceptor extends HandlerInterceptorAdapter { + @Autowired + private TokenService tokenService; + + public static final String USER_KEY = "userId"; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + Login annotation; + if(handler instanceof HandlerMethod) { + annotation = ((HandlerMethod) handler).getMethodAnnotation(Login.class); + }else{ + return true; + } + + if(annotation == null){ + return true; + } + + //从header中获取token + String token = request.getHeader("token"); + //如果header中不存在token,则从参数中获取token + if(StringUtils.isBlank(token)){ + token = request.getParameter("token"); + } + + //token为空 + if(StringUtils.isBlank(token)){ + throw new RenException(ErrorCode.TOKEN_NOT_EMPTY); + } + + //查询token信息 + TokenEntity tokenEntity = tokenService.getByToken(token); + if(tokenEntity == null || tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()){ + throw new RenException(ErrorCode.TOKEN_INVALID); + } + + //设置userId到request里,后续根据userId,获取用户信息 + request.setAttribute(USER_KEY, tokenEntity.getUserId()); + + return true; + } +} diff --git a/renren-api/src/main/java/io/renren/resolver/LoginUserHandlerMethodArgumentResolver.java b/renren-api/src/main/java/io/renren/resolver/LoginUserHandlerMethodArgumentResolver.java new file mode 100644 index 0000000..c443ff8 --- /dev/null +++ b/renren-api/src/main/java/io/renren/resolver/LoginUserHandlerMethodArgumentResolver.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.resolver; + +import io.renren.annotation.LoginUser; +import io.renren.entity.UserEntity; +import io.renren.interceptor.AuthorizationInterceptor; +import io.renren.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.MethodParameter; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.support.WebDataBinderFactory; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.method.support.ModelAndViewContainer; + +/** + * 有@LoginUser注解的方法参数,注入当前登录用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { + @Autowired + private UserService userService; + + @Override + public boolean supportsParameter(MethodParameter parameter) { + return parameter.getParameterType().isAssignableFrom(UserEntity.class) && parameter.hasParameterAnnotation(LoginUser.class); + } + + @Override + public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer container, + NativeWebRequest request, WebDataBinderFactory factory) throws Exception { + //获取用户ID + Object object = request.getAttribute(AuthorizationInterceptor.USER_KEY, RequestAttributes.SCOPE_REQUEST); + if(object == null){ + return null; + } + + //获取用户信息 + UserEntity user = userService.getUserByUserId((Long)object); + + return user; + } +} diff --git a/renren-api/src/main/java/io/renren/service/TokenService.java b/renren-api/src/main/java/io/renren/service/TokenService.java new file mode 100644 index 0000000..2394400 --- /dev/null +++ b/renren-api/src/main/java/io/renren/service/TokenService.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.service; + +import io.renren.common.service.BaseService; +import io.renren.entity.TokenEntity; + +/** + * 用户Token + * + * @author Mark sunlightcs@gmail.com + */ +public interface TokenService extends BaseService { + + TokenEntity getByToken(String token); + + /** + * 生成token + * @param userId 用户ID + * @return 返回token信息 + */ + TokenEntity createToken(Long userId); + + /** + * 设置token过期 + * @param userId 用户ID + */ + void expireToken(Long userId); + +} diff --git a/renren-api/src/main/java/io/renren/service/UserService.java b/renren-api/src/main/java/io/renren/service/UserService.java new file mode 100644 index 0000000..79dcfb9 --- /dev/null +++ b/renren-api/src/main/java/io/renren/service/UserService.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.service; + +import io.renren.common.service.BaseService; +import io.renren.dto.LoginDTO; +import io.renren.entity.UserEntity; + +import java.util.Map; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +public interface UserService extends BaseService { + + UserEntity getByMobile(String mobile); + + UserEntity getUserByUserId(Long userId); + + /** + * 用户登录 + * @param dto 登录表单 + * @return 返回登录信息 + */ + Map login(LoginDTO dto); +} diff --git a/renren-api/src/main/java/io/renren/service/impl/TokenServiceImpl.java b/renren-api/src/main/java/io/renren/service/impl/TokenServiceImpl.java new file mode 100644 index 0000000..56adb4f --- /dev/null +++ b/renren-api/src/main/java/io/renren/service/impl/TokenServiceImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.service.impl; + +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.dao.TokenDao; +import io.renren.entity.TokenEntity; +import io.renren.service.TokenService; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.UUID; + + +@Service +public class TokenServiceImpl extends BaseServiceImpl implements TokenService { + /** + * 12小时后过期 + */ + private final static int EXPIRE = 3600 * 12; + + @Override + public TokenEntity getByToken(String token) { + return baseDao.getByToken(token); + } + + @Override + public TokenEntity createToken(Long userId) { + //当前时间 + Date now = new Date(); + //过期时间 + Date expireTime = new Date(now.getTime() + EXPIRE * 1000); + + //用户token + String token; + + //判断是否生成过token + TokenEntity tokenEntity = baseDao.getByUserId(userId); + if(tokenEntity == null){ + //生成一个token + token = generateToken(); + + tokenEntity = new TokenEntity(); + tokenEntity.setUserId(userId); + tokenEntity.setToken(token); + tokenEntity.setUpdateDate(now); + tokenEntity.setExpireDate(expireTime); + + //保存token + this.insert(tokenEntity); + }else{ + //判断token是否过期 + if(tokenEntity.getExpireDate().getTime() < System.currentTimeMillis()){ + //token过期,重新生成token + token = generateToken(); + }else { + token = tokenEntity.getToken(); + } + + tokenEntity.setToken(token); + tokenEntity.setUpdateDate(now); + tokenEntity.setExpireDate(expireTime); + + //更新token + this.updateById(tokenEntity); + } + + return tokenEntity; + } + + @Override + public void expireToken(Long userId){ + Date now = new Date(); + + TokenEntity tokenEntity = new TokenEntity(); + tokenEntity.setUserId(userId); + tokenEntity.setUpdateDate(now); + tokenEntity.setExpireDate(now); + + this.updateById(tokenEntity); + } + + private String generateToken(){ + return UUID.randomUUID().toString().replace("-", ""); + } +} diff --git a/renren-api/src/main/java/io/renren/service/impl/UserServiceImpl.java b/renren-api/src/main/java/io/renren/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..fb491a4 --- /dev/null +++ b/renren-api/src/main/java/io/renren/service/impl/UserServiceImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.service.impl; + +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import io.renren.common.service.impl.BaseServiceImpl; +import io.renren.common.validator.AssertUtils; +import io.renren.dao.UserDao; +import io.renren.dto.LoginDTO; +import io.renren.entity.TokenEntity; +import io.renren.entity.UserEntity; +import io.renren.service.TokenService; +import io.renren.service.UserService; +import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +@Service +public class UserServiceImpl extends BaseServiceImpl implements UserService { + @Autowired + private TokenService tokenService; + + @Override + public UserEntity getByMobile(String mobile) { + return baseDao.getUserByMobile(mobile); + } + + @Override + public UserEntity getUserByUserId(Long userId) { + return baseDao.getUserByUserId(userId); + } + + @Override + public Map login(LoginDTO dto) { + UserEntity user = getByMobile(dto.getMobile()); + AssertUtils.isNull(user, ErrorCode.ACCOUNT_PASSWORD_ERROR); + + //密码错误 + if(!user.getPassword().equals(DigestUtils.sha256Hex(dto.getPassword()))){ + throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); + } + + //获取登录token + TokenEntity tokenEntity = tokenService.createToken(user.getId()); + + Map map = new HashMap<>(2); + map.put("token", tokenEntity.getToken()); + map.put("expire", tokenEntity.getExpireDate().getTime() - System.currentTimeMillis()); + + return map; + } + +} \ No newline at end of file diff --git a/renren-api/src/main/resources/application-dev.yml b/renren-api/src/main/resources/application-dev.yml new file mode 100644 index 0000000..b1bb8c9 --- /dev/null +++ b/renren-api/src/main/resources/application-dev.yml @@ -0,0 +1,33 @@ +spring: + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/mt_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: root + password: zyx007 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true diff --git a/renren-api/src/main/resources/application-prod.yml b/renren-api/src/main/resources/application-prod.yml new file mode 100644 index 0000000..fa43e6c --- /dev/null +++ b/renren-api/src/main/resources/application-prod.yml @@ -0,0 +1,33 @@ +spring: + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/renren_security?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: renren + password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true diff --git a/renren-api/src/main/resources/application-test.yml b/renren-api/src/main/resources/application-test.yml new file mode 100644 index 0000000..fa43e6c --- /dev/null +++ b/renren-api/src/main/resources/application-test.yml @@ -0,0 +1,33 @@ +spring: + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/renren_security?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: renren + password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true diff --git a/renren-api/src/main/resources/application.yml b/renren-api/src/main/resources/application.yml new file mode 100644 index 0000000..5185f89 --- /dev/null +++ b/renren-api/src/main/resources/application.yml @@ -0,0 +1,81 @@ +# Tomcat +server: + tomcat: + uri-encoding: UTF-8 + threads: + max: 1000 + min-spare: 30 + port: 8081 + servlet: + context-path: /renren-api + session: + cookie: + http-only: true + +knife4j: + enable: true + basic: + enable: false + username: admin + password: admin + setting: + enableFooter: false + +spring: + # 环境 dev|test|prod + profiles: + active: dev + messages: + encoding: UTF-8 + basename: i18n/messages + # jackson时间格式化 + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + mvc: + pathmatch: + matching-strategy: ANT_PATH_MATCHER + servlet: + multipart: + max-file-size: 100MB + max-request-size: 100MB + enabled: true + redis: + database: 0 + host: 192.168.10.10 + port: 6379 + password: # 密码(默认为空) + timeout: 6000ms # 连接超时时长(毫秒) + jedis: + pool: + max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) + max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) + max-idle: 10 # 连接池中的最大空闲连接 + min-idle: 5 # 连接池中的最小空闲连接 + +renren: + redis: + open: false # 是否开启redis缓存 true开启 false关闭 + + +#mybatis +mybatis-plus: + mapper-locations: classpath*:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: io.renren.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 + id-type: ASSIGN_ID + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + configuration-properties: + prefix: + blobType: BLOB + boolValue: TRUE \ No newline at end of file diff --git a/renren-api/src/main/resources/banner.txt b/renren-api/src/main/resources/banner.txt new file mode 100644 index 0000000..a4028b9 --- /dev/null +++ b/renren-api/src/main/resources/banner.txt @@ -0,0 +1,5 @@ +==================================================================================================================== + + 欢迎使用 renren-api - Powered By https://www.renren.io + +==================================================================================================================== \ No newline at end of file diff --git a/renren-api/src/main/resources/logback-spring.xml b/renren-api/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..5deef21 --- /dev/null +++ b/renren-api/src/main/resources/logback-spring.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-api/src/main/resources/mapper/TokenDao.xml b/renren-api/src/main/resources/mapper/TokenDao.xml new file mode 100644 index 0000000..44665e8 --- /dev/null +++ b/renren-api/src/main/resources/mapper/TokenDao.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/renren-api/src/main/resources/mapper/UserDao.xml b/renren-api/src/main/resources/mapper/UserDao.xml new file mode 100644 index 0000000..8a1e4e9 --- /dev/null +++ b/renren-api/src/main/resources/mapper/UserDao.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/renren-common/pom.xml b/renren-common/pom.xml new file mode 100644 index 0000000..16b2586 --- /dev/null +++ b/renren-common/pom.xml @@ -0,0 +1,24 @@ + + + io.renren + renren-security + 5.2.0 + + 4.0.0 + renren-common + jar + renren-common + + + ${project.artifactId} + + + + com.alibaba + fastjson + 1.2.83 + compile + + + + \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/aspect/RedisAspect.java b/renren-common/src/main/java/io/renren/common/aspect/RedisAspect.java new file mode 100644 index 0000000..cd04001 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/aspect/RedisAspect.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.aspect; + +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * Redis切面处理类 + * + * @author Mark sunlightcs@gmail.com + */ +@Aspect +@Component +public class RedisAspect { + private Logger logger = LoggerFactory.getLogger(getClass()); + /** + * 是否开启redis缓存 true开启 false关闭 + */ + @Value("${renren.redis.open: false}") + private boolean open; + + @Around("execution(* io.renren.common.redis.RedisUtils.*(..))") + public Object around(ProceedingJoinPoint point) throws Throwable { + Object result = null; + if(open){ + try{ + result = point.proceed(); + }catch (Exception e){ + logger.error("redis error", e); + throw new RenException(ErrorCode.REDIS_ERROR); + } + } + return result; + } +} diff --git a/renren-common/src/main/java/io/renren/common/constant/Constant.java b/renren-common/src/main/java/io/renren/common/constant/Constant.java new file mode 100644 index 0000000..15a2a94 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/constant/Constant.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.constant; + +/** + * 常量 + * + * @author Mark sunlightcs@gmail.com + */ +public interface Constant { + /** + * 成功 + */ + int SUCCESS = 1; + /** + * 失败 + */ + int FAIL = 0; + /** + * 菜单根节点标识 + */ + Long MENU_ROOT = 0L; + /** + * 部门根节点标识 + */ + Long DEPT_ROOT = 0L; + /** + * 升序 + */ + String ASC = "asc"; + /** + * 降序 + */ + String DESC = "desc"; + /** + * 创建时间字段名 + */ + String CREATE_DATE = "create_date"; + + /** + * 数据权限过滤 + */ + String SQL_FILTER = "sqlFilter"; + /** + * 当前页码 + */ + String PAGE = "page"; + /** + * 每页显示记录数 + */ + String LIMIT = "limit"; + /** + * 排序字段 + */ + String ORDER_FIELD = "orderField"; + /** + * 排序方式 + */ + String ORDER = "order"; + /** + * token header + */ + String TOKEN_HEADER = "token"; + + /** + * 云存储配置KEY + */ + String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY"; + + /** + * 定时任务状态 + */ + enum ScheduleStatus { + /** + * 暂停 + */ + PAUSE(0), + /** + * 正常 + */ + NORMAL(1); + + private int value; + + ScheduleStatus(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } + + /** + * 云服务商 + */ + enum CloudService { + /** + * 七牛云 + */ + QINIU(1), + /** + * 阿里云 + */ + ALIYUN(2), + /** + * 腾讯云 + */ + QCLOUD(3); + + private int value; + + CloudService(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/convert/DateConverter.java b/renren-common/src/main/java/io/renren/common/convert/DateConverter.java new file mode 100644 index 0000000..5f9ea05 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/convert/DateConverter.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.convert; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.convert.converter.Converter; +import org.springframework.stereotype.Component; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 日期转换 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class DateConverter implements Converter { + private static final Logger logger = LoggerFactory.getLogger(DateConverter.class); + private static List formatList = new ArrayList<>(5); + static { + formatList.add("yyyy-MM"); + formatList.add("yyyy-MM-dd"); + formatList.add("yyyy-MM-dd HH:mm"); + formatList.add("yyyy-MM-dd HH:mm:ss"); + formatList.add("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + } + + @Override + public Date convert(String source) { + String value = source.trim(); + if (StringUtils.isEmpty(value)) { + return null; + } + + if(source.matches("^\\d{4}-\\d{1,2}$")){ + return parseDate(source, formatList.get(0)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}$")){ + return parseDate(source, formatList.get(1)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}$")){ + return parseDate(source, formatList.get(2)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2} {1}\\d{1,2}:\\d{1,2}:\\d{1,2}$")){ + return parseDate(source, formatList.get(3)); + }else if(source.matches("^\\d{4}-\\d{1,2}-\\d{1,2}.*T.*\\d{1,2}:\\d{1,2}:\\d{1,2}.*..*$")){ + return parseDate(source, formatList.get(4)); + } else { + throw new IllegalArgumentException("Invalid boolean value '" + source + "'"); + } + } + + /** + * 格式化日期 + * @param dateStr String 字符型日期 + * @param format String 格式 + * @return Date 日期 + */ + public Date parseDate(String dateStr, String format) { + Date date = null; + try { + DateFormat dateFormat = new SimpleDateFormat(format); + date = dateFormat.parse(dateStr); + } catch (Exception e) { + logger.error("Formatted date with date: {} and format : {} ", dateStr, format); + } + return date; + } + +} diff --git a/renren-common/src/main/java/io/renren/common/dao/BaseDao.java b/renren-common/src/main/java/io/renren/common/dao/BaseDao.java new file mode 100644 index 0000000..1c06a14 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/dao/BaseDao.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 基础Dao + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface BaseDao extends BaseMapper { + +} diff --git a/renren-common/src/main/java/io/renren/common/entity/BaseEntity.java b/renren-common/src/main/java/io/renren/common/entity/BaseEntity.java new file mode 100644 index 0000000..18d1ec8 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/entity/BaseEntity.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 基础实体类,所有实体都需要继承 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public abstract class BaseEntity implements Serializable { + /** + * id + */ + @TableId + private Long id; + /** + * 创建者 + */ + @TableField(fill = FieldFill.INSERT) + private Long creator; + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createDate; +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/exception/ErrorCode.java b/renren-common/src/main/java/io/renren/common/exception/ErrorCode.java new file mode 100644 index 0000000..e4cf514 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/exception/ErrorCode.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.exception; + +/** + * 错误编码,由5位数字组成,前2位为模块编码,后3位为业务编码 + *

+ * 如:10001(10代表系统模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ErrorCode { + int INTERNAL_SERVER_ERROR = 500; + int UNAUTHORIZED = 401; + + int NOT_NULL = 10001; + int DB_RECORD_EXISTS = 10002; + int PARAMS_GET_ERROR = 10003; + int ACCOUNT_PASSWORD_ERROR = 10004; + int ACCOUNT_DISABLE = 10005; + int IDENTIFIER_NOT_NULL = 10006; + int CAPTCHA_ERROR = 10007; + int SUB_MENU_EXIST = 10008; + int PASSWORD_ERROR = 10009; + int SUPERIOR_DEPT_ERROR = 10011; + int SUPERIOR_MENU_ERROR = 10012; + int DATA_SCOPE_PARAMS_ERROR = 10013; + int DEPT_SUB_DELETE_ERROR = 10014; + int DEPT_USER_DELETE_ERROR = 10015; + int UPLOAD_FILE_EMPTY = 10019; + int TOKEN_NOT_EMPTY = 10020; + int TOKEN_INVALID = 10021; + int ACCOUNT_LOCK = 10022; + int OSS_UPLOAD_FILE_ERROR = 10024; + int REDIS_ERROR = 10027; + int JOB_ERROR = 10028; + int INVALID_SYMBOL = 10029; +} diff --git a/renren-common/src/main/java/io/renren/common/exception/ExceptionUtils.java b/renren-common/src/main/java/io/renren/common/exception/ExceptionUtils.java new file mode 100644 index 0000000..ce79649 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/exception/ExceptionUtils.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.exception; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * Exception工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ExceptionUtils { + + /** + * 获取异常信息 + * @param ex 异常 + * @return 返回异常信息 + */ + public static String getErrorStackTrace(Exception ex){ + StringWriter sw = null; + PrintWriter pw = null; + try { + sw = new StringWriter(); + pw = new PrintWriter(sw, true); + ex.printStackTrace(pw); + }finally { + try { + if(pw != null) { + pw.close(); + } + } catch (Exception e) { + + } + try { + if(sw != null) { + sw.close(); + } + } catch (IOException e) { + + } + } + + return sw.toString(); + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/exception/RenException.java b/renren-common/src/main/java/io/renren/common/exception/RenException.java new file mode 100644 index 0000000..baf0825 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/exception/RenException.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.exception; + + +import io.renren.common.utils.MessageUtils; + +/** + * 自定义异常 + * + * @author Mark sunlightcs@gmail.com + */ +public class RenException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private int code; + private String msg; + + public RenException(int code) { + this.code = code; + this.msg = MessageUtils.getMessage(code); + } + + public RenException(int code, String... params) { + this.code = code; + this.msg = MessageUtils.getMessage(code, params); + } + + public RenException(int code, Throwable e) { + super(e); + this.code = code; + this.msg = MessageUtils.getMessage(code); + } + + public RenException(int code, Throwable e, String... params) { + super(e); + this.code = code; + this.msg = MessageUtils.getMessage(code, params); + } + + public RenException(String msg) { + super(msg); + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + } + + public RenException(String msg, Throwable e) { + super(msg, e); + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/page/PageData.java b/renren-common/src/main/java/io/renren/common/page/PageData.java new file mode 100644 index 0000000..c8dd3ce --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/page/PageData.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.page; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@ApiModel(value = "分页数据") +public class PageData implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "总记录数") + private int total; + + @ApiModelProperty(value = "列表数据") + private List list; + + /** + * 分页 + * @param list 列表数据 + * @param total 总记录数 + */ + public PageData(List list, long total) { + this.list = list; + this.total = (int)total; + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/redis/RedisConfig.java b/renren-common/src/main/java/io/renren/common/redis/RedisConfig.java new file mode 100644 index 0000000..f3ccd5f --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/redis/RedisConfig.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.redis; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.cache.RedisCacheWriter; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.*; + +import javax.annotation.Resource; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Redis配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class RedisConfig { + @Resource + private RedisConnectionFactory factory; + + @Bean + public Jackson2JsonRedisSerializer jackson2JsonRedisSerializer(){ + Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class); + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL); + jackson2JsonRedisSerializer.setObjectMapper(objectMapper); + + return jackson2JsonRedisSerializer; + } + + @Bean + public RedisTemplate redisTemplate() { + RedisTemplate redisTemplate = new RedisTemplate<>(); + redisTemplate.setKeySerializer(new StringRedisSerializer()); + redisTemplate.setValueSerializer(jackson2JsonRedisSerializer()); + redisTemplate.setHashKeySerializer(new StringRedisSerializer()); + redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer()); + redisTemplate.setConnectionFactory(factory); + + return redisTemplate; + } + + @Bean + public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { + RedisSerializer redisSerializer = new StringRedisSerializer(); + + ObjectMapper om = new ObjectMapper(); + // 解决jackson2无法反序列化LocalDateTime的问题 + //LocalDatetime序列化 + JavaTimeModule timeModule = new JavaTimeModule(); + timeModule.addDeserializer(LocalDate.class, + new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + timeModule.addDeserializer(LocalDateTime.class, + new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + timeModule.addSerializer(LocalDate.class, + new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + timeModule.addSerializer(LocalDateTime.class, + new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + om.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + om.registerModule(timeModule); + + //设置GenericJackson2JsonRedisSerializer可以将R类的对象类型也能进行JSON保存 + om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY); + GenericJackson2JsonRedisSerializer gen = new GenericJackson2JsonRedisSerializer(om); + + //配置序列化 + RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig(); + RedisCacheConfiguration redisCacheConfiguration = config.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer)) + .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(gen)); + return RedisCacheManager + .builder(RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory)) + .cacheDefaults(redisCacheConfiguration).build(); + } + +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/redis/RedisKeys.java b/renren-common/src/main/java/io/renren/common/redis/RedisKeys.java new file mode 100644 index 0000000..dbcdb6c --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/redis/RedisKeys.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.redis; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class RedisKeys { + /** + * 系统参数Key + */ + public static String getSysParamsKey(){ + return "sys:params"; + } + + /** + * 验证码Key + */ + public static String getCaptchaKey(String uuid){ + return "sys:captcha:" + uuid; + } + + /** + * 登录用户Key + */ + public static String getSecurityUserKey(Long id){ + return "sys:security:user:" + id; + } + + /** + * 系统日志Key + */ + public static String getSysLogKey(){ + return "sys:log"; + } + + /** + * 系统资源Key + */ + public static String getSysResourceKey(){ + return "sys:resource"; + } + + /** + * 用户菜单导航Key + */ + public static String getUserMenuNavKey(Long userId){ + return "sys:user:nav:" + userId; + } + + /** + * 用户权限标识Key + */ + public static String getUserPermissionsKey(Long userId){ + return "sys:user:permissions:" + userId; + } +} diff --git a/renren-common/src/main/java/io/renren/common/redis/RedisUtils.java b/renren-common/src/main/java/io/renren/common/redis/RedisUtils.java new file mode 100644 index 0000000..28ad234 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/redis/RedisUtils.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.redis; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * Redis工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class RedisUtils { + @Autowired + private RedisTemplate redisTemplate; + + /** 默认过期时长为24小时,单位:秒 */ + public final static long DEFAULT_EXPIRE = 60 * 60 * 24L; + /** 过期时长为1小时,单位:秒 */ + public final static long HOUR_ONE_EXPIRE = 60 * 60 * 1L; + /** 过期时长为6小时,单位:秒 */ + public final static long HOUR_SIX_EXPIRE = 60 * 60 * 6L; + /** 不设置过期时长 */ + public final static long NOT_EXPIRE = -1L; + + public void set(String key, Object value, long expire){ + redisTemplate.opsForValue().set(key, value); + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + + public void set(String key, Object value){ + set(key, value, DEFAULT_EXPIRE); + } + + public Object get(String key, long expire) { + Object value = redisTemplate.opsForValue().get(key); + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + return value; + } + + public Object get(String key) { + return get(key, NOT_EXPIRE); + } + + public void delete(String key) { + redisTemplate.delete(key); + } + + public void delete(Collection keys) { + redisTemplate.delete(keys); + } + + public Object hGet(String key, String field) { + return redisTemplate.opsForHash().get(key, field); + } + + public Map hGetAll(String key){ + HashOperations hashOperations = redisTemplate.opsForHash(); + return hashOperations.entries(key); + } + + public void hMSet(String key, Map map){ + hMSet(key, map, DEFAULT_EXPIRE); + } + + public void hMSet(String key, Map map, long expire){ + redisTemplate.opsForHash().putAll(key, map); + + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + + public void hSet(String key, String field, Object value) { + hSet(key, field, value, DEFAULT_EXPIRE); + } + + public void hSet(String key, String field, Object value, long expire) { + redisTemplate.opsForHash().put(key, field, value); + + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + + public void expire(String key, long expire){ + redisTemplate.expire(key, expire, TimeUnit.SECONDS); + } + + public void hDel(String key, Object... fields){ + redisTemplate.opsForHash().delete(key, fields); + } + + public void leftPush(String key, Object value){ + leftPush(key, value, DEFAULT_EXPIRE); + } + + public void leftPush(String key, Object value, long expire){ + redisTemplate.opsForList().leftPush(key, value); + + if(expire != NOT_EXPIRE){ + expire(key, expire); + } + } + + public Object rightPop(String key){ + return redisTemplate.opsForList().rightPop(key); + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/service/BaseService.java b/renren-common/src/main/java/io/renren/common/service/BaseService.java new file mode 100644 index 0000000..6de9f9c --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/service/BaseService.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; + +import java.io.Serializable; +import java.util.Collection; + +/** + * 基础服务接口,所有Service接口都要继承 + * + * @author Mark sunlightcs@gmail.com + */ +public interface BaseService { + Class currentModelClass(); + + /** + *

+ * 插入一条记录(选择字段,策略插入) + *

+ * + * @param entity 实体对象 + */ + boolean insert(T entity); + + /** + *

+ * 插入(批量),该方法不支持 Oracle、SQL Server + *

+ * + * @param entityList 实体对象集合 + */ + boolean insertBatch(Collection entityList); + + /** + *

+ * 插入(批量),该方法不支持 Oracle、SQL Server + *

+ * + * @param entityList 实体对象集合 + * @param batchSize 插入批次数量 + */ + boolean insertBatch(Collection entityList, int batchSize); + + /** + *

+ * 根据 ID 选择修改 + *

+ * + * @param entity 实体对象 + */ + boolean updateById(T entity); + + /** + *

+ * 根据 whereEntity 条件,更新记录 + *

+ * + * @param entity 实体对象 + * @param updateWrapper 实体对象封装操作类 {@link com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper} + */ + boolean update(T entity, Wrapper updateWrapper); + + /** + *

+ * 根据ID 批量更新 + *

+ * + * @param entityList 实体对象集合 + */ + boolean updateBatchById(Collection entityList); + + /** + *

+ * 根据ID 批量更新 + *

+ * + * @param entityList 实体对象集合 + * @param batchSize 更新批次数量 + */ + boolean updateBatchById(Collection entityList, int batchSize); + + /** + *

+ * 根据 ID 查询 + *

+ * + * @param id 主键ID + */ + T selectById(Serializable id); + + /** + *

+ * 根据 ID 删除 + *

+ * + * @param id 主键ID + */ + boolean deleteById(Serializable id); + + /** + *

+ * 删除(根据ID 批量删除) + *

+ * + * @param idList 主键ID列表 + */ + boolean deleteBatchIds(Collection idList); +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/service/CrudService.java b/renren-common/src/main/java/io/renren/common/service/CrudService.java new file mode 100644 index 0000000..78e636c --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/service/CrudService.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package io.renren.common.service; + +import io.renren.common.page.PageData; + +import java.util.List; +import java.util.Map; + +/** + * CRUD基础服务接口 + * + * @author Mark sunlightcs@gmail.com + */ +public interface CrudService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + D get(Long id); + + void save(D dto); + + void update(D dto); + + void delete(Long[] ids); + +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/service/impl/BaseServiceImpl.java b/renren-common/src/main/java/io/renren/common/service/impl/BaseServiceImpl.java new file mode 100644 index 0000000..adfcedd --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/service/impl/BaseServiceImpl.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.enums.SqlMethod; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.core.toolkit.ReflectionKit; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import io.renren.common.constant.Constant; +import io.renren.common.page.PageData; +import io.renren.common.service.BaseService; +import io.renren.common.utils.ConvertUtils; +import org.apache.ibatis.binding.MapperMethod; +import org.apache.ibatis.logging.Log; +import org.apache.ibatis.logging.LogFactory; +import org.apache.ibatis.session.SqlSession; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; + +/** + * 基础服务类,所有Service都要继承 + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class BaseServiceImpl, T> implements BaseService { + @Autowired + protected M baseDao; + protected Log log = LogFactory.getLog(getClass()); + + /** + * 获取分页对象 + * @param params 分页查询参数 + * @param defaultOrderField 默认排序字段 + * @param isAsc 排序方式 + */ + protected IPage getPage(Map params, String defaultOrderField, boolean isAsc) { + //分页参数 + long curPage = 1; + long limit = 10; + + if(params.get(Constant.PAGE) != null){ + curPage = Long.parseLong((String)params.get(Constant.PAGE)); + } + if(params.get(Constant.LIMIT) != null){ + limit = Long.parseLong((String)params.get(Constant.LIMIT)); + } + + //分页对象 + Page page = new Page<>(curPage, limit); + + //分页参数 + params.put(Constant.PAGE, page); + + //排序字段 + String orderField = (String)params.get(Constant.ORDER_FIELD); + String order = (String)params.get(Constant.ORDER); + + //前端字段排序 + if(StringUtils.isNotBlank(orderField) && StringUtils.isNotBlank(order)){ + if(Constant.ASC.equalsIgnoreCase(order)) { + return page.addOrder(OrderItem.asc(orderField)); + }else { + return page.addOrder(OrderItem.desc(orderField)); + } + } + + //没有排序字段,则不排序 + if(StringUtils.isBlank(defaultOrderField)){ + return page; + } + + //默认排序 + if(isAsc) { + page.addOrder(OrderItem.asc(defaultOrderField)); + }else { + page.addOrder(OrderItem.desc(defaultOrderField)); + } + + return page; + } + + protected PageData getPageData(List list, long total, Class target){ + List targetList = ConvertUtils.sourceToTarget(list, target); + + return new PageData<>(targetList, total); + } + + protected PageData getPageData(IPage page, Class target){ + return getPageData(page.getRecords(), page.getTotal(), target); + } + + protected void paramsToLike(Map params, String... likes){ + for (String like : likes){ + String val = (String)params.get(like); + if (StringUtils.isNotBlank(val)){ + params.put(like, "%" + val + "%"); + }else { + params.put(like, null); + } + } + } + + /** + *

+ * 判断数据库操作是否成功 + *

+ *

+ * 注意!! 该方法为 Integer 判断,不可传入 int 基本类型 + *

+ * + * @param result 数据库操作返回影响条数 + * @return boolean + */ + protected static boolean retBool(Integer result) { + return SqlHelper.retBool(result); + } + + protected Class currentMapperClass() { + return (Class) ReflectionKit.getSuperClassGenericType(this.getClass(), BaseServiceImpl.class, 0); + } + + @Override + public Class currentModelClass() { + return (Class)ReflectionKit.getSuperClassGenericType(this.getClass(), BaseServiceImpl.class, 1); + } + + protected String getSqlStatement(SqlMethod sqlMethod) { + return SqlHelper.getSqlStatement(this.currentMapperClass(), sqlMethod); + } + + @Override + public boolean insert(T entity) { + return BaseServiceImpl.retBool(baseDao.insert(entity)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean insertBatch(Collection entityList) { + return insertBatch(entityList, 100); + } + + /** + * 批量插入 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public boolean insertBatch(Collection entityList, int batchSize) { + String sqlStatement = getSqlStatement(SqlMethod.INSERT_ONE); + return executeBatch(entityList, batchSize, (sqlSession, entity) -> sqlSession.insert(sqlStatement, entity)); + } + + /** + * 执行批量操作 + */ + protected boolean executeBatch(Collection list, int batchSize, BiConsumer consumer) { + return SqlHelper.executeBatch(this.currentModelClass(), this.log, list, batchSize, consumer); + } + + + @Override + public boolean updateById(T entity) { + return BaseServiceImpl.retBool(baseDao.updateById(entity)); + } + + @Override + public boolean update(T entity, Wrapper updateWrapper) { + return BaseServiceImpl.retBool(baseDao.update(entity, updateWrapper)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateBatchById(Collection entityList) { + return updateBatchById(entityList, 30); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateBatchById(Collection entityList, int batchSize) { + String sqlStatement = getSqlStatement(SqlMethod.UPDATE_BY_ID); + return executeBatch(entityList, batchSize, (sqlSession, entity) -> { + MapperMethod.ParamMap param = new MapperMethod.ParamMap<>(); + param.put(Constants.ENTITY, entity); + sqlSession.update(sqlStatement, param); + }); + } + + @Override + public T selectById(Serializable id) { + return baseDao.selectById(id); + } + + @Override + public boolean deleteById(Serializable id) { + return SqlHelper.retBool(baseDao.deleteById(id)); + } + + @Override + public boolean deleteBatchIds(Collection idList) { + return SqlHelper.retBool(baseDao.deleteBatchIds(idList)); + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/service/impl/CrudServiceImpl.java b/renren-common/src/main/java/io/renren/common/service/impl/CrudServiceImpl.java new file mode 100644 index 0000000..dc12fca --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/service/impl/CrudServiceImpl.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package io.renren.common.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ReflectionKit; +import io.renren.common.page.PageData; +import io.renren.common.service.CrudService; +import io.renren.common.utils.ConvertUtils; +import org.springframework.beans.BeanUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * CRUD基础服务类 + * + * @author Mark sunlightcs@gmail.com + */ +public abstract class CrudServiceImpl, T, D> extends BaseServiceImpl implements CrudService { + + protected Class currentDtoClass() { + return (Class)ReflectionKit.getSuperClassGenericType(getClass(), CrudServiceImpl.class, 2); + } + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, null, false), + getWrapper(params) + ); + + return getPageData(page, currentDtoClass()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, currentDtoClass()); + } + + public abstract QueryWrapper getWrapper(Map params); + + @Override + public D get(Long id) { + T entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, currentDtoClass()); + } + + @Override + public void save(D dto) { + T entity = ConvertUtils.sourceToTarget(dto, currentModelClass()); + insert(entity); + + //copy主键值到dto + BeanUtils.copyProperties(entity, dto); + } + + @Override + public void update(D dto) { + T entity = ConvertUtils.sourceToTarget(dto, currentModelClass()); + updateById(entity); + } + + @Override + public void delete(Long[] ids) { + baseDao.deleteBatchIds(Arrays.asList(ids)); + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/utils/ConvertUtils.java b/renren-common/src/main/java/io/renren/common/utils/ConvertUtils.java new file mode 100644 index 0000000..f5c7680 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/ConvertUtils.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * 转换工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class ConvertUtils { + private static Logger logger = LoggerFactory.getLogger(ConvertUtils.class); + + public static T sourceToTarget(Object source, Class target){ + if(source == null){ + return null; + } + T targetObject = null; + try { + targetObject = target.newInstance(); + BeanUtils.copyProperties(source, targetObject); + } catch (Exception e) { + logger.error("convert error ", e); + } + + return targetObject; + } + + public static List sourceToTarget(Collection sourceList, Class target){ + if(sourceList == null){ + return null; + } + + List targetList = new ArrayList<>(sourceList.size()); + try { + for(Object source : sourceList){ + T targetObject = target.newInstance(); + BeanUtils.copyProperties(source, targetObject); + targetList.add(targetObject); + } + }catch (Exception e){ + logger.error("convert error ", e); + } + + return targetList; + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/utils/DateUtils.java b/renren-common/src/main/java/io/renren/common/utils/DateUtils.java new file mode 100644 index 0000000..e7d8a37 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/DateUtils.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 日期处理 + * + * @author Mark sunlightcs@gmail.com + */ +public class DateUtils { + /** 时间格式(yyyy-MM-dd) */ + public final static String DATE_PATTERN = "yyyy-MM-dd"; + /** 时间格式(yyyy-MM-dd HH:mm:ss) */ + public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + /** + * 日期格式化 日期格式为:yyyy-MM-dd + * @param date 日期 + * @return 返回yyyy-MM-dd格式日期 + */ + public static String format(Date date) { + return format(date, DATE_PATTERN); + } + + /** + * 日期格式化 日期格式为:yyyy-MM-dd + * @param date 日期 + * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN + * @return 返回yyyy-MM-dd格式日期 + */ + public static String format(Date date, String pattern) { + if(date != null){ + SimpleDateFormat df = new SimpleDateFormat(pattern); + return df.format(date); + } + return null; + } + + /** + * 日期解析 + * @param date 日期 + * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN + * @return 返回Date + */ + public static Date parse(String date, String pattern) { + try { + return new SimpleDateFormat(pattern).parse(date); + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 字符串转换成日期 + * @param strDate 日期字符串 + * @param pattern 日期的格式,如:DateUtils.DATE_TIME_PATTERN + */ + public static Date stringToDate(String strDate, String pattern) { + if (StringUtils.isBlank(strDate)){ + return null; + } + + DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern); + return fmt.parseLocalDateTime(strDate).toDate(); + } + + /** + * 根据周数,获取开始日期、结束日期 + * @param week 周期 0本周,-1上周,-2上上周,1下周,2下下周 + * @return 返回date[0]开始日期、date[1]结束日期 + */ + public static Date[] getWeekStartAndEnd(int week) { + DateTime dateTime = new DateTime(); + LocalDate date = new LocalDate(dateTime.plusWeeks(week)); + + date = date.dayOfWeek().withMinimumValue(); + Date beginDate = date.toDate(); + Date endDate = date.plusDays(6).toDate(); + return new Date[]{beginDate, endDate}; + } + + /** + * 对日期的【秒】进行加/减 + * + * @param date 日期 + * @param seconds 秒数,负数为减 + * @return 加/减几秒后的日期 + */ + public static Date addDateSeconds(Date date, int seconds) { + DateTime dateTime = new DateTime(date); + return dateTime.plusSeconds(seconds).toDate(); + } + + /** + * 对日期的【分钟】进行加/减 + * + * @param date 日期 + * @param minutes 分钟数,负数为减 + * @return 加/减几分钟后的日期 + */ + public static Date addDateMinutes(Date date, int minutes) { + DateTime dateTime = new DateTime(date); + return dateTime.plusMinutes(minutes).toDate(); + } + + /** + * 对日期的【小时】进行加/减 + * + * @param date 日期 + * @param hours 小时数,负数为减 + * @return 加/减几小时后的日期 + */ + public static Date addDateHours(Date date, int hours) { + DateTime dateTime = new DateTime(date); + return dateTime.plusHours(hours).toDate(); + } + + /** + * 对日期的【天】进行加/减 + * + * @param date 日期 + * @param days 天数,负数为减 + * @return 加/减几天后的日期 + */ + public static Date addDateDays(Date date, int days) { + DateTime dateTime = new DateTime(date); + return dateTime.plusDays(days).toDate(); + } + + /** + * 对日期的【周】进行加/减 + * + * @param date 日期 + * @param weeks 周数,负数为减 + * @return 加/减几周后的日期 + */ + public static Date addDateWeeks(Date date, int weeks) { + DateTime dateTime = new DateTime(date); + return dateTime.plusWeeks(weeks).toDate(); + } + + /** + * 对日期的【月】进行加/减 + * + * @param date 日期 + * @param months 月数,负数为减 + * @return 加/减几月后的日期 + */ + public static Date addDateMonths(Date date, int months) { + DateTime dateTime = new DateTime(date); + return dateTime.plusMonths(months).toDate(); + } + + /** + * 对日期的【年】进行加/减 + * + * @param date 日期 + * @param years 年数,负数为减 + * @return 加/减几年后的日期 + */ + public static Date addDateYears(Date date, int years) { + DateTime dateTime = new DateTime(date); + return dateTime.plusYears(years).toDate(); + } +} diff --git a/renren-common/src/main/java/io/renren/common/utils/HttpContextUtils.java b/renren-common/src/main/java/io/renren/common/utils/HttpContextUtils.java new file mode 100644 index 0000000..5eb78dd --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/HttpContextUtils.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +/** + * Http + * + * @author Mark sunlightcs@gmail.com + */ +public class HttpContextUtils { + + public static HttpServletRequest getHttpServletRequest() { + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + if(requestAttributes == null){ + return null; + } + + return ((ServletRequestAttributes) requestAttributes).getRequest(); + } + + public static Map getParameterMap(HttpServletRequest request) { + Enumeration parameters = request.getParameterNames(); + + Map params = new HashMap<>(); + while (parameters.hasMoreElements()) { + String parameter = parameters.nextElement(); + String value = request.getParameter(parameter); + if (StringUtils.isNotBlank(value)) { + params.put(parameter, value); + } + } + + return params; + } + + public static String getDomain(){ + HttpServletRequest request = getHttpServletRequest(); + StringBuffer url = request.getRequestURL(); + return url.delete(url.length() - request.getRequestURI().length(), url.length()).toString(); + } + + public static String getOrigin(){ + HttpServletRequest request = getHttpServletRequest(); + return request.getHeader(HttpHeaders.ORIGIN); + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/utils/IpUtils.java b/renren-common/src/main/java/io/renren/common/utils/IpUtils.java new file mode 100644 index 0000000..933879d --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/IpUtils.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.http.HttpServletRequest; + +/** + * IP地址 + * + * @author Mark sunlightcs@gmail.com + */ +public class IpUtils { + private static Logger logger = LoggerFactory.getLogger(IpUtils.class); + + /** + * 获取IP地址 + * + * 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址 + * 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址 + */ + public static String getIpAddr(HttpServletRequest request) { + String unknown = "unknown"; + String ip = null; + try { + ip = request.getHeader("x-forwarded-for"); + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || ip.length() == 0 || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (StringUtils.isEmpty(ip) || unknown.equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + } catch (Exception e) { + logger.error("IPUtils ERROR ", e); + } + + return ip; + } + +} diff --git a/renren-common/src/main/java/io/renren/common/utils/JsonUtils.java b/renren-common/src/main/java/io/renren/common/utils/JsonUtils.java new file mode 100644 index 0000000..984b033 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/JsonUtils.java @@ -0,0 +1,68 @@ +package io.renren.common.utils; + +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.util.StrUtil; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.ArrayList; +import java.util.List; + +/** + * JSON 工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class JsonUtils { + private static final ObjectMapper objectMapper = new ObjectMapper(); + + public static String toJsonString(Object object) { + try { + return objectMapper.writeValueAsString(object); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static T parseObject(String text, Class clazz) { + if (StrUtil.isEmpty(text)) { + return null; + } + try { + return objectMapper.readValue(text, clazz); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static T parseObject(byte[] bytes, Class clazz) { + if (ArrayUtil.isEmpty(bytes)) { + return null; + } + try { + return objectMapper.readValue(bytes, clazz); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static T parseObject(String text, TypeReference typeReference) { + try { + return objectMapper.readValue(text, typeReference); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static List parseArray(String text, Class clazz) { + if (StrUtil.isEmpty(text)) { + return new ArrayList<>(); + } + try { + return objectMapper.readValue(text, objectMapper.getTypeFactory().constructCollectionType(List.class, clazz)); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + +} diff --git a/renren-common/src/main/java/io/renren/common/utils/MessageUtils.java b/renren-common/src/main/java/io/renren/common/utils/MessageUtils.java new file mode 100644 index 0000000..ae28366 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/MessageUtils.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class MessageUtils { + private static MessageSource messageSource; + static { + messageSource = (MessageSource)SpringContextUtils.getBean("messageSource"); + } + + public static String getMessage(int code){ + return getMessage(code, new String[0]); + } + + public static String getMessage(int code, String... params){ + return messageSource.getMessage(code+"", params, LocaleContextHolder.getLocale()); + } +} diff --git a/renren-common/src/main/java/io/renren/common/utils/Result.java b/renren-common/src/main/java/io/renren/common/utils/Result.java new file mode 100644 index 0000000..801d183 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/Result.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import io.renren.common.exception.ErrorCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; + +/** + * 响应数据 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@ApiModel(value = "响应") +public class Result implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 编码:0表示成功,其他值表示失败 + */ + @ApiModelProperty(value = "编码:0表示成功,其他值表示失败") + private int code = 0; + /** + * 消息内容 + */ + @ApiModelProperty(value = "消息内容") + private String msg = "success"; + /** + * 响应数据 + */ + @ApiModelProperty(value = "响应数据") + private T data; + + public Result ok(T data) { + this.setData(data); + return this; + } + + public boolean success(){ + return code == 0; + } + + public Result error() { + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = MessageUtils.getMessage(this.code); + return this; + } + + public Result error(int code) { + this.code = code; + this.msg = MessageUtils.getMessage(this.code); + return this; + } + + public Result error(int code, String msg) { + this.code = code; + this.msg = msg; + return this; + } + + public Result error(String msg) { + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + return this; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/renren-common/src/main/java/io/renren/common/utils/SpringContextUtils.java b/renren-common/src/main/java/io/renren/common/utils/SpringContextUtils.java new file mode 100644 index 0000000..4e3c1f4 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/SpringContextUtils.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +/** + * Spring Context 工具类 + * + * @author Mark sunlightcs@gmail.com + */ +@Component +public class SpringContextUtils implements ApplicationContextAware { + public static ApplicationContext applicationContext; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) + throws BeansException { + SpringContextUtils.applicationContext = applicationContext; + } + + public static Object getBean(String name) { + return applicationContext.getBean(name); + } + + public static T getBean(Class requiredType) { + return applicationContext.getBean(requiredType); + } + + public static T getBean(String name, Class requiredType) { + return applicationContext.getBean(name, requiredType); + } + + public static boolean containsBean(String name) { + return applicationContext.containsBean(name); + } + + public static boolean isSingleton(String name) { + return applicationContext.isSingleton(name); + } + + public static Class getType(String name) { + return applicationContext.getType(name); + } + +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/utils/TreeNode.java b/renren-common/src/main/java/io/renren/common/utils/TreeNode.java new file mode 100644 index 0000000..fb49d14 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/TreeNode.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 树节点,所有需要实现树节点的,都需要继承该类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ + @Data +public class TreeNode implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private Long id; + /** + * 上级ID + */ + private Long pid; + /** + * 子节点列表 + */ + private List children = new ArrayList<>(); +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/utils/TreeUtils.java b/renren-common/src/main/java/io/renren/common/utils/TreeUtils.java new file mode 100644 index 0000000..e986e66 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/utils/TreeUtils.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.utils; + +import io.renren.common.validator.AssertUtils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * 树形结构工具类,如:菜单、部门等 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class TreeUtils { + + /** + * 根据pid,构建树节点 + */ + public static List build(List treeNodes, Long pid) { + //pid不能为空 + AssertUtils.isNull(pid, "pid"); + + List treeList = new ArrayList<>(); + for(T treeNode : treeNodes) { + if (pid.equals(treeNode.getPid())) { + treeList.add(findChildren(treeNodes, treeNode)); + } + } + + return treeList; + } + + /** + * 查找子节点 + */ + private static T findChildren(List treeNodes, T rootNode) { + for(T treeNode : treeNodes) { + if(rootNode.getId().equals(treeNode.getPid())) { + rootNode.getChildren().add(findChildren(treeNodes, treeNode)); + } + } + return rootNode; + } + + /** + * 构建树节点 + */ + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(T treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(T node : nodeMap.values()) { + T parent = nodeMap.get(node.getPid()); + if(parent != null && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } + +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/validator/AssertUtils.java b/renren-common/src/main/java/io/renren/common/validator/AssertUtils.java new file mode 100644 index 0000000..09a28c5 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/validator/AssertUtils.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ArrayUtil; +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import org.apache.commons.lang3.StringUtils; + +import java.util.List; +import java.util.Map; + +/** + * 校验工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class AssertUtils { + + public static void isBlank(String str, String... params) { + isBlank(str, ErrorCode.NOT_NULL, params); + } + + public static void isBlank(String str, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if (StringUtils.isBlank(str)) { + throw new RenException(code, params); + } + } + + public static void isNull(Object object, String... params) { + isNull(object, ErrorCode.NOT_NULL, params); + } + + public static void isNull(Object object, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if (object == null) { + throw new RenException(code, params); + } + } + + public static void isArrayEmpty(Object[] array, String... params) { + isArrayEmpty(array, ErrorCode.NOT_NULL, params); + } + + public static void isArrayEmpty(Object[] array, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if(ArrayUtil.isEmpty(array)){ + throw new RenException(code, params); + } + } + + public static void isListEmpty(List list, String... params) { + isListEmpty(list, ErrorCode.NOT_NULL, params); + } + + public static void isListEmpty(List list, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if(CollUtil.isEmpty(list)){ + throw new RenException(code, params); + } + } + + public static void isMapEmpty(Map map, String... params) { + isMapEmpty(map, ErrorCode.NOT_NULL, params); + } + + public static void isMapEmpty(Map map, Integer code, String... params) { + if(code == null){ + throw new RenException(ErrorCode.NOT_NULL, "code"); + } + + if(MapUtil.isEmpty(map)){ + throw new RenException(code, params); + } + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/validator/ValidatorUtils.java b/renren-common/src/main/java/io/renren/common/validator/ValidatorUtils.java new file mode 100644 index 0000000..61a02f7 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/validator/ValidatorUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator; + +import io.renren.common.exception.RenException; +import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; +import org.springframework.context.i18n.LocaleContextHolder; +import org.springframework.context.support.ResourceBundleMessageSource; +import org.springframework.validation.beanvalidation.MessageSourceResourceBundleLocator; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import java.util.Locale; +import java.util.Set; + +/** + * hibernate-validator校验工具类 + * 参考文档:http://docs.jboss.org/hibernate/validator/6.0/reference/en-US/html_single/ + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class ValidatorUtils { + + private static ResourceBundleMessageSource getMessageSource() { + ResourceBundleMessageSource bundleMessageSource = new ResourceBundleMessageSource(); + bundleMessageSource.setDefaultEncoding("UTF-8"); + bundleMessageSource.setBasenames("i18n/validation"); + return bundleMessageSource; + } + + /** + * 校验对象 + * @param object 待校验对象 + * @param groups 待校验的组 + */ + public static void validateEntity(Object object, Class... groups) + throws RenException { + Locale.setDefault(LocaleContextHolder.getLocale()); + Validator validator = Validation.byDefaultProvider().configure().messageInterpolator( + new ResourceBundleMessageInterpolator(new MessageSourceResourceBundleLocator(getMessageSource()))) + .buildValidatorFactory().getValidator(); + + Set> constraintViolations = validator.validate(object, groups); + if (!constraintViolations.isEmpty()) { + ConstraintViolation constraint = constraintViolations.iterator().next(); + throw new RenException(constraint.getMessage()); + } + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/validator/group/AddGroup.java b/renren-common/src/main/java/io/renren/common/validator/group/AddGroup.java new file mode 100644 index 0000000..9a8cfb9 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/validator/group/AddGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 新增 Group + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface AddGroup { + +} diff --git a/renren-common/src/main/java/io/renren/common/validator/group/DefaultGroup.java b/renren-common/src/main/java/io/renren/common/validator/group/DefaultGroup.java new file mode 100644 index 0000000..2e69248 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/validator/group/DefaultGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 默认 Group + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface DefaultGroup { + +} diff --git a/renren-common/src/main/java/io/renren/common/validator/group/Group.java b/renren-common/src/main/java/io/renren/common/validator/group/Group.java new file mode 100644 index 0000000..23b2328 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/validator/group/Group.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +import javax.validation.GroupSequence; + +/** + * 定义校验顺序,如果AddGroup组失败,则UpdateGroup组不会再校验 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@GroupSequence({AddGroup.class, UpdateGroup.class}) +public interface Group { + +} diff --git a/renren-common/src/main/java/io/renren/common/validator/group/UpdateGroup.java b/renren-common/src/main/java/io/renren/common/validator/group/UpdateGroup.java new file mode 100644 index 0000000..83ed02c --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/validator/group/UpdateGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.validator.group; + +/** + * 修改 Group + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface UpdateGroup { + +} diff --git a/renren-common/src/main/java/io/renren/common/xss/SqlFilter.java b/renren-common/src/main/java/io/renren/common/xss/SqlFilter.java new file mode 100644 index 0000000..9cf2494 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/xss/SqlFilter.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.xss; + +import io.renren.common.exception.ErrorCode; +import io.renren.common.exception.RenException; +import org.apache.commons.lang3.StringUtils; + +/** + * SQL过滤 + * @author Mark sunlightcs@gmail.com + */ +public class SqlFilter { + + /** + * SQL注入过滤 + * @param str 待验证的字符串 + */ + public static String sqlInject(String str){ + if(StringUtils.isBlank(str)){ + return null; + } + //去掉'|"|;|\字符 + str = StringUtils.replace(str, "'", ""); + str = StringUtils.replace(str, "\"", ""); + str = StringUtils.replace(str, ";", ""); + str = StringUtils.replace(str, "\\", ""); + + //转换成小写 + str = str.toLowerCase(); + + //非法字符 + String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; + + //判断是否包含非法字符 + for(String keyword : keywords){ + if(str.indexOf(keyword) != -1){ + throw new RenException(ErrorCode.INVALID_SYMBOL); + } + } + + return str; + } +} diff --git a/renren-common/src/main/java/io/renren/common/xss/XssFilter.java b/renren-common/src/main/java/io/renren/common/xss/XssFilter.java new file mode 100644 index 0000000..d9936c8 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/xss/XssFilter.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.xss; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +/** + * XSS过滤 + * @author Mark sunlightcs@gmail.com + */ +public class XssFilter implements Filter { + + @Override + public void init(FilterConfig config) { + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper( + (HttpServletRequest) request); + chain.doFilter(xssRequest, response); + } + + @Override + public void destroy() { + } + +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/xss/XssHttpServletRequestWrapper.java b/renren-common/src/main/java/io/renren/common/xss/XssHttpServletRequestWrapper.java new file mode 100644 index 0000000..515b917 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/xss/XssHttpServletRequestWrapper.java @@ -0,0 +1,154 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.xss; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.LinkedHashMap; +import java.util.Map; + + +/** + * XSS过滤处理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { + HttpServletRequest orgRequest; + + public XssHttpServletRequestWrapper(HttpServletRequest request) { + super(request); + orgRequest = request; + } + + @Override + public ServletInputStream getInputStream() throws IOException { + //非json类型,直接返回 + if(!checkContentTypeIsJson()){ + return super.getInputStream(); + } + + //为空,直接返回 + String json = IOUtils.toString(super.getInputStream(), StandardCharsets.UTF_8); + if (StringUtils.isBlank(json)) { + return super.getInputStream(); + } + + //xss过滤 + json = xssEncode(json); + final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)); + return new ServletInputStream() { + @Override + public boolean isFinished() { + return true; + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + @Override + public int read() { + return bis.read(); + } + }; + } + + @Override + public String getParameter(String name) { + String value = super.getParameter(xssEncode(name)); + if (StringUtils.isNotBlank(value)) { + value = xssEncode(value); + } + return value; + } + + @Override + public String[] getParameterValues(String name) { + String[] parameters = super.getParameterValues(name); + if (parameters == null || parameters.length == 0) { + return null; + } + + for (int i = 0; i < parameters.length; i++) { + parameters[i] = xssEncode(parameters[i]); + } + return parameters; + } + + @Override + public Map getParameterMap() { + Map map = new LinkedHashMap<>(); + Map parameters = super.getParameterMap(); + for (String key : parameters.keySet()) { + String[] values = parameters.get(key); + for (int i = 0; i < values.length; i++) { + values[i] = xssEncode(values[i]); + } + map.put(key, values); + } + return map; + } + + @Override + public String getHeader(String name) { + String value = super.getHeader(xssEncode(name)); + if (StringUtils.isNotBlank(value)) { + value = xssEncode(value); + } + return value; + } + + private String xssEncode(String input) { + return XssUtils.filter(input); + } + + /** + * 获取最原始的request + */ + public HttpServletRequest getOrgRequest() { + return orgRequest; + } + + /** + * 获取最原始的request + */ + public static HttpServletRequest getOrgRequest(HttpServletRequest request) { + if (request instanceof XssHttpServletRequestWrapper) { + return ((XssHttpServletRequestWrapper) request).getOrgRequest(); + } + + return request; + } + /** + * 判断是否是json请求,以前缀的方式 + */ + private boolean checkContentTypeIsJson() + { + String header = super.getHeader(HttpHeaders.CONTENT_TYPE); + return StringUtils.startsWithIgnoreCase(header, MediaType.APPLICATION_JSON_VALUE); + } +} \ No newline at end of file diff --git a/renren-common/src/main/java/io/renren/common/xss/XssUtils.java b/renren-common/src/main/java/io/renren/common/xss/XssUtils.java new file mode 100644 index 0000000..8a01255 --- /dev/null +++ b/renren-common/src/main/java/io/renren/common/xss/XssUtils.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.common.xss; + +import org.jsoup.Jsoup; +import org.jsoup.safety.Safelist; + +/** + * XSS过滤工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class XssUtils extends Safelist { + + /** + * XSS过滤 + */ + public static String filter(String html){ + return Jsoup.clean(html, xssWhitelist()); + } + + /** + * XSS过滤白名单 + */ + private static Safelist xssWhitelist(){ + return new Safelist() + //支持的标签 + .addTags("a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl", + "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "i", "img", "li", "ol", "p", "pre", "q", "small", + "strike", "strong","sub", "sup", "table", "tbody", "td","tfoot", "th", "thead", "tr", "u","ul", + "embed","object","param","span") + + //支持的标签属性 + .addAttributes("a", "href", "class", "style", "target", "rel", "nofollow") + .addAttributes("blockquote", "cite") + .addAttributes("code", "class", "style") + .addAttributes("col", "span", "width") + .addAttributes("colgroup", "span", "width") + .addAttributes("img", "align", "alt", "height", "src", "title", "width", "class", "style") + .addAttributes("ol", "start", "type") + .addAttributes("q", "cite") + .addAttributes("table", "summary", "width", "class", "style") + .addAttributes("tr", "abbr", "axis", "colspan", "rowspan", "width", "style") + .addAttributes("td", "abbr", "axis", "colspan", "rowspan", "width", "style") + .addAttributes("th", "abbr", "axis", "colspan", "rowspan", "scope","width", "style") + .addAttributes("ul", "type", "style") + .addAttributes("pre", "class", "style") + .addAttributes("div", "class", "id", "style") + .addAttributes("embed", "src", "wmode", "flashvars", "pluginspage", "allowFullScreen", "allowfullscreen", + "quality", "width", "height", "align", "allowScriptAccess", "allowscriptaccess", "allownetworking", "type") + .addAttributes("object", "type", "id", "name", "data", "width", "height", "style", "classid", "codebase") + .addAttributes("param", "name", "value") + .addAttributes("span", "class", "style") + + //标签属性对应的协议 + .addProtocols("a", "href", "ftp", "http", "https", "mailto") + .addProtocols("img", "src", "http", "https") + .addProtocols("blockquote", "cite", "http", "https") + .addProtocols("cite", "cite", "http", "https") + .addProtocols("q", "cite", "http", "https") + .addProtocols("embed", "src", "http", "https"); + } + + public static void main(String[] args) { + StringBuilder html = new StringBuilder(); + html.append("人人开源"); + + System.out.println(filter(html.toString())); + } + +} \ No newline at end of file diff --git a/renren-common/src/main/resources/i18n/messages.properties b/renren-common/src/main/resources/i18n/messages.properties new file mode 100644 index 0000000..e4c723f --- /dev/null +++ b/renren-common/src/main/resources/i18n/messages.properties @@ -0,0 +1,26 @@ +#Default +500=\u670D\u52A1\u5668\u5185\u90E8\u5F02\u5E38 +401=\u672A\u6388\u6743 +10001={0}\u4E0D\u80FD\u4E3A\u7A7A +10002=\u6570\u636E\u5E93\u4E2D\u5DF2\u5B58\u5728\u8BE5\u8BB0\u5F55 +10003=\u83B7\u53D6\u53C2\u6570\u5931\u8D25 +10004=\u8D26\u53F7\u6216\u5BC6\u7801\u9519\u8BEF +10005=\u8D26\u53F7\u5DF2\u88AB\u505C\u7528 +10006=\u552F\u4E00\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A +10007=\u9A8C\u8BC1\u7801\u4E0D\u6B63\u786E +10008=\u5148\u5220\u9664\u5B50\u83DC\u5355\u6216\u6309\u94AE +10009=\u539F\u5BC6\u7801\u4E0D\u6B63\u786E +10010=\u8D26\u53F7\u4E0D\u5B58\u5728 +10011=\u4E0A\u7EA7\u90E8\u95E8\u9009\u62E9\u9519\u8BEF +10012=\u4E0A\u7EA7\u83DC\u5355\u4E0D\u80FD\u4E3A\u81EA\u8EAB +10013=\u6570\u636E\u6743\u9650\u63A5\u53E3\uFF0C\u53EA\u80FD\u662FMap\u7C7B\u578B\u53C2\u6570 +10014=\u8BF7\u5148\u5220\u9664\u4E0B\u7EA7\u90E8\u95E8 +10015=\u8BF7\u5148\u5220\u9664\u90E8\u95E8\u4E0B\u7684\u7528\u6237 +10019=\u8BF7\u4E0A\u4F20\u6587\u4EF6 +10020=token\u4E0D\u80FD\u4E3A\u7A7A +10021=token\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55 +10022=\u8D26\u53F7\u5DF2\u88AB\u9501\u5B9A +10024=\u4E0A\u4F20\u6587\u4EF6\u5931\u8D25{0} +10027=Redis\u670D\u52A1\u5F02\u5E38 +10028=\u5B9A\u65F6\u4EFB\u52A1\u5931\u8D25 +10029=\u4E0D\u80FD\u5305\u542B\u975E\u6CD5\u5B57\u7B26 \ No newline at end of file diff --git a/renren-common/src/main/resources/i18n/validation.properties b/renren-common/src/main/resources/i18n/validation.properties new file mode 100644 index 0000000..e2c400d --- /dev/null +++ b/renren-common/src/main/resources/i18n/validation.properties @@ -0,0 +1,67 @@ +#\u7B80\u4F53\u4E2D\u6587 +id.require=ID\u4E0D\u80FD\u4E3A\u7A7A +id.null=ID\u5FC5\u987B\u4E3A\u7A7A +pid.require=\u4E0A\u7EA7ID\uFF0C\u4E0D\u80FD\u4E3A\u7A7A +sort.number=\u6392\u5E8F\u503C\u4E0D\u80FD\u5C0F\u4E8E0 + +sysparams.paramcode.require=\u53C2\u6570\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysparams.paramvalue.require=\u53C2\u6570\u503C\u4E0D\u80FD\u4E3A\u7A7A + +sysuser.username.require=\u7528\u6237\u540D\u4E0D\u80FD\u4E3A\u7A7A +sysuser.password.require=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysuser.realname.require=\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A +sysuser.gender.range=\u6027\u522B\u53D6\u503C\u8303\u56F40~2 +sysuser.email.require=\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A +sysuser.email.error=\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E +sysuser.mobile.require=\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A +sysuser.deptId.require=\u90E8\u95E8\u4E0D\u80FD\u4E3A\u7A7A +sysuser.superadmin.range=\u8D85\u7EA7\u7BA1\u7406\u5458\u53D6\u503C\u8303\u56F40~1 +sysuser.status.range=\u72B6\u6001\u53D6\u503C\u8303\u56F40~1 +sysuser.captcha.require=\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A +sysuser.uuid.require=\u552F\u4E00\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A + +sysmenu.pid.require=\u8BF7\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355 +sysmenu.name.require=\u83DC\u5355\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +sysmenu.type.range=\u83DC\u5355\u7C7B\u578B\u53D6\u503C\u8303\u56F40~1 + +sysdept.pid.require=\u8BF7\u9009\u62E9\u4E0A\u7EA7\u90E8\u95E8 +sysdept.name.require=\u90E8\u95E8\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +sysrole.name.require=\u89D2\u8272\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +sysdict.type.require=\u5B57\u5178\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A +sysdict.name.require=\u5B57\u5178\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A +sysdict.label.require=\u5B57\u5178\u6807\u7B7E\u4E0D\u80FD\u4E3A\u7A7A + +schedule.status.range=\u72B6\u6001\u53D6\u503C\u8303\u56F40~1 +schedule.cron.require=cron\u8868\u8FBE\u5F0F\u4E0D\u80FD\u4E3A\u7A7A +schedule.bean.require=bean\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A + +oss.type.range=\u7C7B\u578B\u53D6\u503C\u8303\u56F41~3 + +aliyun.accesskeyid.require=\u963F\u91CC\u4E91AccessKeyId\u4E0D\u80FD\u4E3A\u7A7A +aliyun.accesskeysecret.require=\u963F\u91CC\u4E91AccessKeySecret\u4E0D\u80FD\u4E3A\u7A7A +aliyun.signname.require=\u963F\u91CC\u4E91\u77ED\u4FE1\u7B7E\u540D\u4E0D\u80FD\u4E3A\u7A7A +aliyun.templatecode.require=\u963F\u91CC\u4E91\u77ED\u4FE1\u6A21\u677F\u4E0D\u80FD\u4E3A\u7A7A +aliyun.domain.require=\u963F\u91CC\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +aliyun.domain.url=\u963F\u91CC\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +aliyun.endPoint.require=\u963F\u91CC\u4E91EndPoint\u4E0D\u80FD\u4E3A\u7A7A +aliyun.bucketname.require=\u963F\u91CC\u4E91BucketName\u4E0D\u80FD\u4E3A\u7A7A + +qcloud.appid.require=\u817E\u8BAF\u4E91AppId\u4E0D\u80FD\u4E3A\u7A7A +qcloud.appkey.require=\u817E\u8BAF\u4E91AppKey\u4E0D\u80FD\u4E3A\u7A7A +qcloud.secretId.require=\u817E\u8BAF\u4E91SecretId\u4E0D\u80FD\u4E3A\u7A7A +qcloud.secretkey.require=\u817E\u8BAF\u4E91SecretKey\u4E0D\u80FD\u4E3A\u7A7A +qcloud.signname.require=\u817E\u8BAF\u4E91\u77ED\u4FE1\u7B7E\u540D\u4E0D\u80FD\u4E3A\u7A7A +qcloud.templateid.require=\u817E\u8BAF\u4E91\u77ED\u4FE1\u6A21\u677FID\u4E0D\u80FD\u4E3A\u7A7A +qcloud.domain.require=\u817E\u8BAF\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +qcloud.domain.url=\u817E\u8BAF\u4E91\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +qcloud.bucketname.require=\u817E\u8BAF\u4E91BucketName\u4E0D\u80FD\u4E3A\u7A7A +qcloud.region.require=\u6240\u5C5E\u5730\u533A\u4E0D\u80FD\u4E3A\u7A7A + +qiniu.domain.require=\u4E03\u725B\u7ED1\u5B9A\u7684\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A +qiniu.domain.url=\u4E03\u725B\u7ED1\u5B9A\u7684\u57DF\u540D\u683C\u5F0F\u4E0D\u6B63\u786E +qiniu.accesskey.require=\u4E03\u725BAccessKey\u4E0D\u80FD\u4E3A\u7A7A +qiniu.secretkey.require=\u4E03\u725BSecretKey\u4E0D\u80FD\u4E3A\u7A7A +qiniu.bucketname.require=\u4E03\u725B\u7A7A\u95F4\u540D\u4E0D\u80FD\u4E3A\u7A7A +qiniu.templateId.require=\u4E03\u725B\u6A21\u677FID\u4E0D\u80FD\u4E3A\u7A7A diff --git a/renren-dynamic-datasource/pom.xml b/renren-dynamic-datasource/pom.xml new file mode 100644 index 0000000..fd130a4 --- /dev/null +++ b/renren-dynamic-datasource/pom.xml @@ -0,0 +1,16 @@ + + + io.renren + renren-security + 5.2.0 + + 4.0.0 + renren-dynamic-datasource + jar + 多数据源 + + + ${project.artifactId} + + + \ No newline at end of file diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/annotation/DataSource.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/annotation/DataSource.java new file mode 100644 index 0000000..ea9a99c --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/annotation/DataSource.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.annotation; + +import java.lang.annotation.*; + +/** + * 多数据源注解 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface DataSource { + String value() default ""; +} diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/aspect/DataSourceAspect.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/aspect/DataSourceAspect.java new file mode 100644 index 0000000..9eda526 --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/aspect/DataSourceAspect.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.aspect; + +import io.renren.commons.dynamic.datasource.annotation.DataSource; +import io.renren.commons.dynamic.datasource.config.DynamicContextHolder; +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.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import java.lang.reflect.Method; + +/** + * 多数据源,切面处理类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Aspect +@Component +@Order(Ordered.HIGHEST_PRECEDENCE) +public class DataSourceAspect { + protected Logger logger = LoggerFactory.getLogger(getClass()); + + @Pointcut("@annotation(io.renren.commons.dynamic.datasource.annotation.DataSource) " + + "|| @within(io.renren.commons.dynamic.datasource.annotation.DataSource)") + public void dataSourcePointCut() { + + } + + @Around("dataSourcePointCut()") + public Object around(ProceedingJoinPoint point) throws Throwable { + MethodSignature signature = (MethodSignature) point.getSignature(); + Class targetClass = point.getTarget().getClass(); + Method method = signature.getMethod(); + + DataSource targetDataSource = (DataSource)targetClass.getAnnotation(DataSource.class); + DataSource methodDataSource = method.getAnnotation(DataSource.class); + if(targetDataSource != null || methodDataSource != null){ + String value; + if(methodDataSource != null){ + value = methodDataSource.value(); + }else { + value = targetDataSource.value(); + } + + DynamicContextHolder.push(value); + logger.debug("set datasource is {}", value); + } + + try { + return point.proceed(); + } finally { + DynamicContextHolder.poll(); + logger.debug("clean datasource"); + } + } +} \ No newline at end of file diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicContextHolder.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicContextHolder.java new file mode 100644 index 0000000..5633477 --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicContextHolder.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.config; + +import java.util.ArrayDeque; +import java.util.Deque; + +/** + * 多数据源上下文 + * + * @author Mark sunlightcs@gmail.com + */ +public class DynamicContextHolder { + @SuppressWarnings("unchecked") + private static final ThreadLocal> CONTEXT_HOLDER = new ThreadLocal() { + @Override + protected Object initialValue() { + return new ArrayDeque(); + } + }; + + /** + * 获得当前线程数据源 + * + * @return 数据源名称 + */ + public static String peek() { + return CONTEXT_HOLDER.get().peek(); + } + + /** + * 设置当前线程数据源 + * + * @param dataSource 数据源名称 + */ + public static void push(String dataSource) { + CONTEXT_HOLDER.get().push(dataSource); + } + + /** + * 清空当前线程数据源 + */ + public static void poll() { + Deque deque = CONTEXT_HOLDER.get(); + deque.poll(); + if (deque.isEmpty()) { + CONTEXT_HOLDER.remove(); + } + } + +} \ No newline at end of file diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSource.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSource.java new file mode 100644 index 0000000..df40588 --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSource.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.config; + +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + +/** + * 多数据源 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class DynamicDataSource extends AbstractRoutingDataSource { + + @Override + protected Object determineCurrentLookupKey() { + return DynamicContextHolder.peek(); + } + +} diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSourceConfig.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSourceConfig.java new file mode 100644 index 0000000..1de20b8 --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSourceConfig.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.config; + +import com.alibaba.druid.pool.DruidDataSource; +import io.renren.commons.dynamic.datasource.properties.DataSourceProperties; +import io.renren.commons.dynamic.datasource.properties.DynamicDataSourceProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.HashMap; +import java.util.Map; + +/** + * 配置多数据源 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +@EnableConfigurationProperties(DynamicDataSourceProperties.class) +public class DynamicDataSourceConfig { + @Autowired + private DynamicDataSourceProperties properties; + + @Bean + @ConfigurationProperties(prefix = "spring.datasource.druid") + public DataSourceProperties dataSourceProperties() { + return new DataSourceProperties(); + } + + @Bean + public DynamicDataSource dynamicDataSource(DataSourceProperties dataSourceProperties) { + DynamicDataSource dynamicDataSource = new DynamicDataSource(); + dynamicDataSource.setTargetDataSources(getDynamicDataSource()); + + //默认数据源 + DruidDataSource defaultDataSource = DynamicDataSourceFactory.buildDruidDataSource(dataSourceProperties); + dynamicDataSource.setDefaultTargetDataSource(defaultDataSource); + + return dynamicDataSource; + } + + private Map getDynamicDataSource(){ + Map dataSourcePropertiesMap = properties.getDatasource(); + Map targetDataSources = new HashMap<>(dataSourcePropertiesMap.size()); + dataSourcePropertiesMap.forEach((k, v) -> { + DruidDataSource druidDataSource = DynamicDataSourceFactory.buildDruidDataSource(v); + targetDataSources.put(k, druidDataSource); + }); + + return targetDataSources; + } + +} \ No newline at end of file diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSourceFactory.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSourceFactory.java new file mode 100644 index 0000000..c73fab2 --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/config/DynamicDataSourceFactory.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.config; + +import com.alibaba.druid.pool.DruidDataSource; +import io.renren.commons.dynamic.datasource.properties.DataSourceProperties; + +import java.sql.SQLException; + +/** + * DruidDataSource + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class DynamicDataSourceFactory { + + public static DruidDataSource buildDruidDataSource(DataSourceProperties properties) { + DruidDataSource druidDataSource = new DruidDataSource(); + druidDataSource.setDriverClassName(properties.getDriverClassName()); + druidDataSource.setUrl(properties.getUrl()); + druidDataSource.setUsername(properties.getUsername()); + druidDataSource.setPassword(properties.getPassword()); + + druidDataSource.setInitialSize(properties.getInitialSize()); + druidDataSource.setMaxActive(properties.getMaxActive()); + druidDataSource.setMinIdle(properties.getMinIdle()); + druidDataSource.setMaxWait(properties.getMaxWait()); + druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis()); + druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis()); + druidDataSource.setMaxEvictableIdleTimeMillis(properties.getMaxEvictableIdleTimeMillis()); + druidDataSource.setValidationQuery(properties.getValidationQuery()); + druidDataSource.setValidationQueryTimeout(properties.getValidationQueryTimeout()); + druidDataSource.setTestOnBorrow(properties.isTestOnBorrow()); + druidDataSource.setTestOnReturn(properties.isTestOnReturn()); + druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements()); + druidDataSource.setMaxOpenPreparedStatements(properties.getMaxOpenPreparedStatements()); + druidDataSource.setSharePreparedStatements(properties.isSharePreparedStatements()); + + try { + // druidDataSource.setFilters(properties.getFilters()); + druidDataSource.init(); + } catch (SQLException e) { + e.printStackTrace(); + } + return druidDataSource; + } +} \ No newline at end of file diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/properties/DataSourceProperties.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/properties/DataSourceProperties.java new file mode 100644 index 0000000..3e4d395 --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/properties/DataSourceProperties.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.properties; + +/** + * 多数据源属性 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class DataSourceProperties { + private String driverClassName; + private String url; + private String username; + private String password; + + /** + * Druid默认参数 + */ + private int initialSize = 2; + private int maxActive = 10; + private int minIdle = -1; + private long maxWait = 60 * 1000L; + private long timeBetweenEvictionRunsMillis = 60 * 1000L; + private long minEvictableIdleTimeMillis = 1000L * 60L * 30L; + private long maxEvictableIdleTimeMillis = 1000L * 60L * 60L * 7; + private String validationQuery = "select 1"; + private int validationQueryTimeout = -1; + private boolean testOnBorrow = false; + private boolean testOnReturn = false; + private boolean testWhileIdle = true; + private boolean poolPreparedStatements = false; + private int maxOpenPreparedStatements = -1; + private boolean sharePreparedStatements = false; + private String filters = "stat,wall"; + + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public int getInitialSize() { + return initialSize; + } + + public void setInitialSize(int initialSize) { + this.initialSize = initialSize; + } + + public int getMaxActive() { + return maxActive; + } + + public void setMaxActive(int maxActive) { + this.maxActive = maxActive; + } + + public int getMinIdle() { + return minIdle; + } + + public void setMinIdle(int minIdle) { + this.minIdle = minIdle; + } + + public long getMaxWait() { + return maxWait; + } + + public void setMaxWait(long maxWait) { + this.maxWait = maxWait; + } + + public long getTimeBetweenEvictionRunsMillis() { + return timeBetweenEvictionRunsMillis; + } + + public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { + this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; + } + + public long getMinEvictableIdleTimeMillis() { + return minEvictableIdleTimeMillis; + } + + public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) { + this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; + } + + public long getMaxEvictableIdleTimeMillis() { + return maxEvictableIdleTimeMillis; + } + + public void setMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis) { + this.maxEvictableIdleTimeMillis = maxEvictableIdleTimeMillis; + } + + public String getValidationQuery() { + return validationQuery; + } + + public void setValidationQuery(String validationQuery) { + this.validationQuery = validationQuery; + } + + public int getValidationQueryTimeout() { + return validationQueryTimeout; + } + + public void setValidationQueryTimeout(int validationQueryTimeout) { + this.validationQueryTimeout = validationQueryTimeout; + } + + public boolean isTestOnBorrow() { + return testOnBorrow; + } + + public void setTestOnBorrow(boolean testOnBorrow) { + this.testOnBorrow = testOnBorrow; + } + + public boolean isTestOnReturn() { + return testOnReturn; + } + + public void setTestOnReturn(boolean testOnReturn) { + this.testOnReturn = testOnReturn; + } + + public boolean isTestWhileIdle() { + return testWhileIdle; + } + + public void setTestWhileIdle(boolean testWhileIdle) { + this.testWhileIdle = testWhileIdle; + } + + public boolean isPoolPreparedStatements() { + return poolPreparedStatements; + } + + public void setPoolPreparedStatements(boolean poolPreparedStatements) { + this.poolPreparedStatements = poolPreparedStatements; + } + + public int getMaxOpenPreparedStatements() { + return maxOpenPreparedStatements; + } + + public void setMaxOpenPreparedStatements(int maxOpenPreparedStatements) { + this.maxOpenPreparedStatements = maxOpenPreparedStatements; + } + + public boolean isSharePreparedStatements() { + return sharePreparedStatements; + } + + public void setSharePreparedStatements(boolean sharePreparedStatements) { + this.sharePreparedStatements = sharePreparedStatements; + } + + public String getFilters() { + return filters; + } + + public void setFilters(String filters) { + this.filters = filters; + } +} \ No newline at end of file diff --git a/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/properties/DynamicDataSourceProperties.java b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/properties/DynamicDataSourceProperties.java new file mode 100644 index 0000000..bc97020 --- /dev/null +++ b/renren-dynamic-datasource/src/main/java/io/renren/commons/dynamic/datasource/properties/DynamicDataSourceProperties.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.commons.dynamic.datasource.properties; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * 多数据源属性 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@ConfigurationProperties(prefix = "dynamic") +public class DynamicDataSourceProperties { + private Map datasource = new LinkedHashMap<>(); + + public Map getDatasource() { + return datasource; + } + + public void setDatasource(Map datasource) { + this.datasource = datasource; + } +} diff --git a/renren-generator/pom.xml b/renren-generator/pom.xml new file mode 100644 index 0000000..adb152c --- /dev/null +++ b/renren-generator/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + io.renren + renren-generator + 5.2.0 + jar + renren-generator + + + org.springframework.boot + spring-boot-starter-parent + 2.7.5 + + + + UTF-8 + UTF-8 + 1.8 + 2.2.2 + 1.4.2 + 1.2.14 + 2.6 + 2.11.0 + 1.10 + 1.7 + 4.0 + 11.2.0.3 + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-web + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis.spring.boot.version} + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.spring.boot.version} + + + com.alibaba + druid + ${druid.version} + + + commons-lang + commons-lang + ${commons.lang.version} + + + commons-io + commons-io + ${commons.io.version} + + + commons-configuration + commons-configuration + ${commons.configuration.version} + + + velocity + org.apache.velocity + ${velocity.version} + + + + mysql + mysql-connector-java + + + + com.oracle + ojdbc6 + ${oracle.version} + + + + com.microsoft.sqlserver + sqljdbc4 + ${mssql.version} + + + + org.postgresql + postgresql + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + + + + public + aliyun nexus + https://maven.aliyun.com/repository/public/ + + true + + + false + + + + + diff --git a/renren-generator/src/main/java/io/renren/GeneratorApplication.java b/renren-generator/src/main/java/io/renren/GeneratorApplication.java new file mode 100644 index 0000000..c0dc876 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/GeneratorApplication.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * renren-generator + * + * @author Mark sunlightcs@gmail.com + */ +@SpringBootApplication +public class GeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(GeneratorApplication.class, args); + } +} diff --git a/renren-generator/src/main/java/io/renren/config/DbConfig.java b/renren-generator/src/main/java/io/renren/config/DbConfig.java new file mode 100644 index 0000000..5b67693 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/config/DbConfig.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.config; + +import io.renren.dao.*; +import io.renren.utils.RenException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +/** + * 数据库配置 + * + * @author Mark sunlightcs@gmail.com + */ +@Configuration +public class DbConfig { + @Value("${renren.database: mysql}") + private String database; + @Autowired + private MySQLGeneratorDao mySQLGeneratorDao; + @Autowired + private OracleGeneratorDao oracleGeneratorDao; + @Autowired + private SQLServerGeneratorDao sqlServerGeneratorDao; + @Autowired + private PostgreSQLGeneratorDao postgreSQLGeneratorDao; + + @Bean + @Primary + public GeneratorDao getGeneratorDao(){ + if("mysql".equalsIgnoreCase(database)){ + return mySQLGeneratorDao; + }else if("oracle".equalsIgnoreCase(database)){ + return oracleGeneratorDao; + }else if("sqlserver".equalsIgnoreCase(database)){ + return sqlServerGeneratorDao; + }else if("postgresql".equalsIgnoreCase(database)){ + return postgreSQLGeneratorDao; + }else { + throw new RenException("不支持当前数据库:" + database); + } + } +} diff --git a/renren-generator/src/main/java/io/renren/controller/SysGeneratorController.java b/renren-generator/src/main/java/io/renren/controller/SysGeneratorController.java new file mode 100644 index 0000000..7baef11 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/controller/SysGeneratorController.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.controller; + +import io.renren.service.SysGeneratorService; +import io.renren.utils.PageUtils; +import io.renren.utils.Query; +import io.renren.utils.R; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Map; + +/** + * 代码生成器 + * + * @author Mark sunlightcs@gmail.com + */ +@Controller +@RequestMapping("/sys/generator") +public class SysGeneratorController { + @Autowired + private SysGeneratorService sysGeneratorService; + + /** + * 列表 + */ + @ResponseBody + @RequestMapping("/list") + public R list(@RequestParam Map params){ + PageUtils pageUtil = sysGeneratorService.queryList(new Query(params)); + + return R.ok().put("page", pageUtil); + } + + /** + * 生成代码 + */ + @RequestMapping("/code") + public void code(String tables, HttpServletResponse response) throws IOException{ + byte[] data = sysGeneratorService.generatorCode(tables.split(",")); + + response.reset(); + response.setHeader("Content-Disposition", "attachment; filename=\"renren.zip\""); + response.addHeader("Content-Length", "" + data.length); + response.setContentType("application/octet-stream; charset=UTF-8"); + + IOUtils.write(data, response.getOutputStream()); + } +} diff --git a/renren-generator/src/main/java/io/renren/dao/GeneratorDao.java b/renren-generator/src/main/java/io/renren/dao/GeneratorDao.java new file mode 100644 index 0000000..f9f2335 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/dao/GeneratorDao.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dao; + +import java.util.List; +import java.util.Map; + +/** + * 数据库接口 + * + * @author Mark sunlightcs@gmail.com + */ +public interface GeneratorDao { + List> queryList(Map map); + + Map queryTable(String tableName); + + List> queryColumns(String tableName); +} diff --git a/renren-generator/src/main/java/io/renren/dao/MySQLGeneratorDao.java b/renren-generator/src/main/java/io/renren/dao/MySQLGeneratorDao.java new file mode 100644 index 0000000..65c4ad5 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/dao/MySQLGeneratorDao.java @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dao; + +import org.apache.ibatis.annotations.Mapper; + + +/** + * MySQL代码生成器 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface MySQLGeneratorDao extends GeneratorDao { + + +} diff --git a/renren-generator/src/main/java/io/renren/dao/OracleGeneratorDao.java b/renren-generator/src/main/java/io/renren/dao/OracleGeneratorDao.java new file mode 100644 index 0000000..effd14c --- /dev/null +++ b/renren-generator/src/main/java/io/renren/dao/OracleGeneratorDao.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dao; + +import org.apache.ibatis.annotations.Mapper; + +/** + * Oracle代码生成器 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface OracleGeneratorDao extends GeneratorDao { + +} diff --git a/renren-generator/src/main/java/io/renren/dao/PostgreSQLGeneratorDao.java b/renren-generator/src/main/java/io/renren/dao/PostgreSQLGeneratorDao.java new file mode 100644 index 0000000..14ad34b --- /dev/null +++ b/renren-generator/src/main/java/io/renren/dao/PostgreSQLGeneratorDao.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dao; + +import org.apache.ibatis.annotations.Mapper; + +/** + * PostgreSQL代码生成器 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface PostgreSQLGeneratorDao extends GeneratorDao { + +} diff --git a/renren-generator/src/main/java/io/renren/dao/SQLServerGeneratorDao.java b/renren-generator/src/main/java/io/renren/dao/SQLServerGeneratorDao.java new file mode 100644 index 0000000..ec9c5b5 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/dao/SQLServerGeneratorDao.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.dao; + +import org.apache.ibatis.annotations.Mapper; + +/** + * SQLServer代码生成器 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SQLServerGeneratorDao extends GeneratorDao { + +} diff --git a/renren-generator/src/main/java/io/renren/entity/ColumnEntity.java b/renren-generator/src/main/java/io/renren/entity/ColumnEntity.java new file mode 100644 index 0000000..04fffc4 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/entity/ColumnEntity.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.entity; + +/** + * 列的属性 + * + * @author Mark sunlightcs@gmail.com + */ +public class ColumnEntity { + //列名 + private String columnName; + //列名类型 + private String dataType; + //列名备注 + private String comments; + + //属性名称(第一个字母大写),如:user_name => UserName + private String attrName; + //属性名称(第一个字母小写),如:user_name => userName + private String attrname; + //属性类型 + private String attrType; + //auto_increment + private String extra; + + public String getColumnName() { + return columnName; + } + public void setColumnName(String columnName) { + this.columnName = columnName; + } + public String getDataType() { + return dataType; + } + public void setDataType(String dataType) { + this.dataType = dataType; + } + public String getComments() { + return comments; + } + public void setComments(String comments) { + this.comments = comments; + } + public String getAttrname() { + return attrname; + } + public void setAttrname(String attrname) { + this.attrname = attrname; + } + public String getAttrName() { + return attrName; + } + public void setAttrName(String attrName) { + this.attrName = attrName; + } + public String getAttrType() { + return attrType; + } + public void setAttrType(String attrType) { + this.attrType = attrType; + } + public String getExtra() { + return extra; + } + public void setExtra(String extra) { + this.extra = extra; + } +} diff --git a/renren-generator/src/main/java/io/renren/entity/TableEntity.java b/renren-generator/src/main/java/io/renren/entity/TableEntity.java new file mode 100644 index 0000000..a36289f --- /dev/null +++ b/renren-generator/src/main/java/io/renren/entity/TableEntity.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.entity; + +import java.util.List; + +/** + * 表数据 + * + * @author Mark sunlightcs@gmail.com + */ +public class TableEntity { + //表的名称 + private String tableName; + //表的备注 + private String comments; + //表的主键 + private ColumnEntity pk; + //表的列名(不包含主键) + private List columns; + + //类名(第一个字母大写),如:sys_user => SysUser + private String className; + //类名(第一个字母小写),如:sys_user => sysUser + private String classname; + + public String getTableName() { + return tableName; + } + public void setTableName(String tableName) { + this.tableName = tableName; + } + public String getComments() { + return comments; + } + public void setComments(String comments) { + this.comments = comments; + } + public ColumnEntity getPk() { + return pk; + } + public void setPk(ColumnEntity pk) { + this.pk = pk; + } + public List getColumns() { + return columns; + } + public void setColumns(List columns) { + this.columns = columns; + } + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + public String getClassname() { + return classname; + } + public void setClassname(String classname) { + this.classname = classname; + } +} diff --git a/renren-generator/src/main/java/io/renren/service/SysGeneratorService.java b/renren-generator/src/main/java/io/renren/service/SysGeneratorService.java new file mode 100644 index 0000000..dd6ba66 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/service/SysGeneratorService.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.service; + +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import io.renren.dao.GeneratorDao; +import io.renren.utils.GenUtils; +import io.renren.utils.PageUtils; +import io.renren.utils.Query; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.ByteArrayOutputStream; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipOutputStream; + +/** + * 代码生成器 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysGeneratorService { + @Autowired + private GeneratorDao generatorDao; + + public PageUtils queryList(Query query) { + Page page = PageHelper.startPage(query.getPage(), query.getLimit()); + List> list = generatorDao.queryList(query); + + return new PageUtils(list, (int)page.getTotal(), query.getLimit(), query.getPage()); + } + + public Map queryTable(String tableName) { + return generatorDao.queryTable(tableName); + } + + public List> queryColumns(String tableName) { + return generatorDao.queryColumns(tableName); + } + + public byte[] generatorCode(String[] tableNames) { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(outputStream); + + for(String tableName : tableNames){ + //查询表信息 + Map table = queryTable(tableName); + //查询列信息 + List> columns = queryColumns(tableName); + //生成代码 + GenUtils.generatorCode(table, columns, zip); + } + IOUtils.closeQuietly(zip); + return outputStream.toByteArray(); + } +} diff --git a/renren-generator/src/main/java/io/renren/utils/Assert.java b/renren-generator/src/main/java/io/renren/utils/Assert.java new file mode 100644 index 0000000..295343b --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/Assert.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ +package io.renren.utils; + + +/** + *

+ * 断言类 + *

+ * + * @author miemie + * @since 2018-07-24 + */ +public final class Assert { + + /** + * 断言这个 boolean 为 true + * 为 false 则抛出异常 + * + * @param expression boolean 值 + * @param message 消息 + */ + public static void isTrue(boolean expression, String message, Object... params) { + if (!expression) { + return; + } + } + + /** + * 断言这个 boolean 为 false + * 为 true 则抛出异常 + * + * @param expression boolean 值 + * @param message 消息 + */ + public static void isFalse(boolean expression, String message, Object... params) { + isTrue(!expression, message, params); + } + + /** + * 断言这个 object 为 null + * 不为 null 则抛异常 + * + * @param object 对象 + * @param message 消息 + */ + public static void isNull(Object object, String message, Object... params) { + isTrue(object == null, message, params); + } + + /** + * 断言这个 object 不为 null + * 为 null 则抛异常 + * + * @param object 对象 + * @param message 消息 + */ + public static void notNull(Object object, String message, Object... params) { + isTrue(object != null, message, params); + } + + +} diff --git a/renren-generator/src/main/java/io/renren/utils/DateUtils.java b/renren-generator/src/main/java/io/renren/utils/DateUtils.java new file mode 100644 index 0000000..4992d42 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/DateUtils.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.utils; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 日期处理 + * + * @author Mark sunlightcs@gmail.com + */ +public class DateUtils { + /** 时间格式(yyyy-MM-dd) */ + public final static String DATE_PATTERN = "yyyy-MM-dd"; + /** 时间格式(yyyy-MM-dd HH:mm:ss) */ + public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + public static String format(Date date) { + return format(date, DATE_PATTERN); + } + + public static String format(Date date, String pattern) { + if(date != null){ + SimpleDateFormat df = new SimpleDateFormat(pattern); + return df.format(date); + } + return null; + } +} diff --git a/renren-generator/src/main/java/io/renren/utils/GenUtils.java b/renren-generator/src/main/java/io/renren/utils/GenUtils.java new file mode 100644 index 0000000..27793f0 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/GenUtils.java @@ -0,0 +1,254 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.utils; + +import io.renren.entity.ColumnEntity; +import io.renren.entity.TableEntity; +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.WordUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * 代码生成器 工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class GenUtils { + + public static List getTemplates(){ + List templates = new ArrayList(); + templates.add("template/DTO.java.vm"); + templates.add("template/Entity.java.vm"); + templates.add("template/Dao.java.vm"); + templates.add("template/Dao.xml.vm"); + templates.add("template/Service.java.vm"); + templates.add("template/ServiceImpl.java.vm"); + templates.add("template/Controller.java.vm"); + templates.add("template/Excel.java.vm"); + templates.add("template/index.vue.vm"); + templates.add("template/add-or-update.vue.vm"); + templates.add("template/mysql.vm"); + templates.add("template/sqlserver.vm"); + templates.add("template/oracle.vm"); + templates.add("template/postgresql.vm"); + return templates; + } + + /** + * 生成代码 + */ + public static void generatorCode(Map table, + List> columns, ZipOutputStream zip){ + //配置信息 + Configuration config = getConfig(); + boolean hasBigDecimal = false; + //表信息 + TableEntity tableEntity = new TableEntity(); + tableEntity.setTableName(table.get("tableName")); + tableEntity.setComments(table.get("tableComment")); + //表名转换成Java类名 + String className = tableToJava(tableEntity.getTableName(), config.getString("tablePrefix")); + tableEntity.setClassName(className); + tableEntity.setClassname(StringUtils.uncapitalize(className)); + + //列信息 + List columnsList = new ArrayList<>(); + for(Map column : columns){ + ColumnEntity columnEntity = new ColumnEntity(); + columnEntity.setColumnName(column.get("columnName")); + columnEntity.setDataType(column.get("dataType")); + columnEntity.setComments(column.get("columnComment")); + columnEntity.setExtra(column.get("extra")); + + //列名转换成Java属性名 + String attrName = columnToJava(columnEntity.getColumnName()); + columnEntity.setAttrName(attrName); + columnEntity.setAttrname(StringUtils.uncapitalize(attrName)); + + //列的数据类型,转换成Java类型 + String attrType = config.getString(columnEntity.getDataType(), "unknowType"); + columnEntity.setAttrType(attrType); + if (!hasBigDecimal && attrType.equals("BigDecimal" )) { + hasBigDecimal = true; + } + //是否主键 + if("PRI".equalsIgnoreCase(column.get("columnKey")) && tableEntity.getPk() == null){ + tableEntity.setPk(columnEntity); + } + + columnsList.add(columnEntity); + } + tableEntity.setColumns(columnsList); + + //没主键,则第一个字段为主键 + if(tableEntity.getPk() == null){ + tableEntity.setPk(tableEntity.getColumns().get(0)); + } + + //设置velocity资源加载器 + Properties prop = new Properties(); + prop.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + Velocity.init(prop); + + //封装模板数据 + Map map = new HashMap<>(); + map.put("tableName", tableEntity.getTableName()); + map.put("comments", tableEntity.getComments()); + map.put("pk", tableEntity.getPk()); + map.put("className", tableEntity.getClassName()); + map.put("classname", tableEntity.getClassname()); + map.put("pathName", tableEntity.getClassname().toLowerCase()); + map.put("columns", tableEntity.getColumns()); + map.put("hasBigDecimal", hasBigDecimal); + map.put("version", config.getString("version" )); + map.put("package", config.getString("package" )); + map.put("moduleName", config.getString("moduleName" )); + map.put("author", config.getString("author")); + map.put("email", config.getString("email")); + map.put("datetime", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)); + map.put("date", DateUtils.format(new Date(), DateUtils.DATE_PATTERN)); + + for(int i=0; i<=10; i++){ + map.put("id"+i, IdWorker.getId()); + } + + VelocityContext context = new VelocityContext(map); + + //获取模板列表 + List templates = getTemplates(); + for(String template : templates){ + //渲染模板 + StringWriter sw = new StringWriter(); + Template tpl = Velocity.getTemplate(template, "UTF-8"); + tpl.merge(context, sw); + + try { + //添加到zip + zip.putNextEntry(new ZipEntry(getFileName(template, tableEntity.getClassName(), config.getString("package"), config.getString("moduleName")))); + IOUtils.write(sw.toString(), zip, "UTF-8"); + IOUtils.closeQuietly(sw); + zip.closeEntry(); + } catch (IOException e) { + throw new RenException("渲染模板失败,表名:" + tableEntity.getTableName(), e); + } + } + } + + + /** + * 列名转换成Java属性名 + */ + public static String columnToJava(String columnName) { + return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", ""); + } + + /** + * 表名转换成Java类名 + */ + public static String tableToJava(String tableName, String tablePrefix) { + if(StringUtils.isNotBlank(tablePrefix)){ + tableName = tableName.startsWith(tablePrefix) ? tableName.replaceFirst(tablePrefix, "") : tableName; + } + return columnToJava(tableName); + } + + /** + * 获取配置信息 + */ + public static Configuration getConfig(){ + try { + return new PropertiesConfiguration("generator.properties"); + } catch (ConfigurationException e) { + throw new RenException("获取配置文件失败,", e); + } + } + + /** + * 获取文件名 + */ + public static String getFileName(String template, String className, String packageName, String moduleName) { + String packagePath = "main" + File.separator + "java" + File.separator; + if (StringUtils.isNotBlank(packageName)) { + packagePath += packageName.replace(".", File.separator) + File.separator + "modules" + File.separator + moduleName + File.separator; + } + + if (template.contains("Entity.java.vm" )) { + return packagePath + "entity" + File.separator + className + "Entity.java"; + } + + if (template.contains("Excel.java.vm" )) { + return packagePath + "excel" + File.separator + className + "Excel.java"; + } + + if (template.contains("Dao.java.vm" )) { + return packagePath + "dao" + File.separator + className + "Dao.java"; + } + + if (template.contains("Service.java.vm" )) { + return packagePath + "service" + File.separator + className + "Service.java"; + } + + if (template.contains("ServiceImpl.java.vm" )) { + return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java"; + } + + if (template.contains("Controller.java.vm" )) { + return packagePath + "controller" + File.separator + className + "Controller.java"; + } + + if (template.contains("Dao.xml.vm" )) { + return "main" + File.separator + "resources" + File.separator + "mapper" + File.separator + moduleName + File.separator + className + "Dao.xml"; + } + + if (template.contains("DTO.java.vm" )) { + return packagePath + "dto" + File.separator + className + "DTO.java"; + } + + if (template.contains("index.vue.vm" )) { + return "vue" + File.separator + "views" + File.separator + "modules" + + File.separator + moduleName + File.separator + className.toLowerCase() + ".vue"; + } + + if (template.contains("add-or-update.vue.vm" )) { + return "vue" + File.separator + "views" + File.separator + "modules" + + File.separator + moduleName + File.separator + className.toLowerCase() + "-add-or-update.vue"; + } + + if (template.contains("mysql.vm" )) { + return className.toLowerCase() + ".mysql.sql"; + } + + if (template.contains("oracle.vm" )) { + return className.toLowerCase() + ".oracle.sql"; + } + + if (template.contains("sqlserver.vm" )) { + return className.toLowerCase() + ".sqlserver.sql"; + } + + if (template.contains("postgresql.vm" )) { + return className.toLowerCase() + ".postgresql.sql"; + } + + return null; + } +} diff --git a/renren-generator/src/main/java/io/renren/utils/IdWorker.java b/renren-generator/src/main/java/io/renren/utils/IdWorker.java new file mode 100644 index 0000000..ab649c3 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/IdWorker.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2011-2020, hubin (jobob@qq.com). + *

+ * 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. + */ +package io.renren.utils; + +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; + +/** + *

+ * 高效GUID产生算法(sequence),基于Snowflake实现64位自增ID算法。
+ * 优化开源项目 http://git.oschina.net/yu120/sequence + *

+ * + * @author hubin + * @since 2016-08-01 + */ +public class IdWorker { + + /** + * 主机和进程的机器码 + */ + private static Sequence WORKER = new Sequence(); + + public static long getId() { + return WORKER.nextId(); + } + + public static String getIdStr() { + return String.valueOf(WORKER.nextId()); + } + + /** + *

+ * 有参构造器 + *

+ * + * @param workerId 工作机器 ID + * @param datacenterId 序列号 + */ + public static void initSequence(long workerId, long datacenterId) { + WORKER = new Sequence(workerId, datacenterId); + } + + /** + *

+ * 使用ThreadLocalRandom获取UUID获取更优的效果 去掉"-" + *

+ */ + public static String get32UUID() { + ThreadLocalRandom random = ThreadLocalRandom.current(); + return new UUID(random.nextLong(), random.nextLong()).toString().replace(StringPool.DASH, StringPool.EMPTY); + } + +} diff --git a/renren-generator/src/main/java/io/renren/utils/PageUtils.java b/renren-generator/src/main/java/io/renren/utils/PageUtils.java new file mode 100644 index 0000000..d28ee9f --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/PageUtils.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.utils; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页工具类 + * + * @author Mark sunlightcs@gmail.com + */ +public class PageUtils implements Serializable { + private static final long serialVersionUID = 1L; + //总记录数 + private int totalCount; + //每页记录数 + private int pageSize; + //总页数 + private int totalPage; + //当前页数 + private int currPage; + //列表数据 + private List list; + + /** + * 分页 + * @param list 列表数据 + * @param totalCount 总记录数 + * @param pageSize 每页记录数 + * @param currPage 当前页数 + */ + public PageUtils(List list, int totalCount, int pageSize, int currPage) { + this.list = list; + this.totalCount = totalCount; + this.pageSize = pageSize; + this.currPage = currPage; + this.totalPage = (int)Math.ceil((double)totalCount/pageSize); + } + + public int getTotalCount() { + return totalCount; + } + + public void setTotalCount(int totalCount) { + this.totalCount = totalCount; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getTotalPage() { + return totalPage; + } + + public void setTotalPage(int totalPage) { + this.totalPage = totalPage; + } + + public int getCurrPage() { + return currPage; + } + + public void setCurrPage(int currPage) { + this.currPage = currPage; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + +} diff --git a/renren-generator/src/main/java/io/renren/utils/Query.java b/renren-generator/src/main/java/io/renren/utils/Query.java new file mode 100644 index 0000000..a932f9b --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/Query.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.utils; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * 查询参数 + * + * @author Mark sunlightcs@gmail.com + */ +public class Query extends LinkedHashMap { + private static final long serialVersionUID = 1L; + //当前页码 + private int page; + //每页条数 + private int limit; + + public Query(Map params){ + this.putAll(params); + + //分页参数 + this.page = Integer.parseInt(params.get("page").toString()); + this.limit = Integer.parseInt(params.get("limit").toString()); + this.put("offset", (page - 1) * limit); + this.put("page", page); + this.put("limit", limit); + } + + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public int getLimit() { + return limit; + } + + public void setLimit(int limit) { + this.limit = limit; + } +} diff --git a/renren-generator/src/main/java/io/renren/utils/R.java b/renren-generator/src/main/java/io/renren/utils/R.java new file mode 100644 index 0000000..5d8d90b --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/R.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.utils; + +import java.util.HashMap; +import java.util.Map; + +/** + * 返回数据 + * + * @author Mark sunlightcs@gmail.com + */ +public class R extends HashMap { + private static final long serialVersionUID = 1L; + + public R() { + put("code", 0); + } + + public static R error() { + return error(500, "未知异常,请联系管理员"); + } + + public static R error(String msg) { + return error(500, msg); + } + + public static R error(int code, String msg) { + R r = new R(); + r.put("code", code); + r.put("msg", msg); + return r; + } + + public static R ok(String msg) { + R r = new R(); + r.put("msg", msg); + return r; + } + + public static R ok(Map map) { + R r = new R(); + r.putAll(map); + return r; + } + + public static R ok() { + return new R(); + } + + @Override + public R put(String key, Object value) { + super.put(key, value); + return this; + } +} diff --git a/renren-generator/src/main/java/io/renren/utils/RenException.java b/renren-generator/src/main/java/io/renren/utils/RenException.java new file mode 100644 index 0000000..0275a4a --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/RenException.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.utils; + +/** + * 自定义异常 + * + * @author Mark sunlightcs@gmail.com + */ +public class RenException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private String msg; + private int code = 500; + + public RenException(String msg) { + super(msg); + this.msg = msg; + } + + public RenException(String msg, Throwable e) { + super(msg, e); + this.msg = msg; + } + + public RenException(String msg, int code) { + super(msg); + this.msg = msg; + this.code = code; + } + + public RenException(String msg, int code, Throwable e) { + super(msg, e); + this.msg = msg; + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + +} diff --git a/renren-generator/src/main/java/io/renren/utils/RenExceptionHandler.java b/renren-generator/src/main/java/io/renren/utils/RenExceptionHandler.java new file mode 100644 index 0000000..27a3822 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/RenExceptionHandler.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package io.renren.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +/** + * 异常处理器 + * + * @author Mark sunlightcs@gmail.com + */ +@RestControllerAdvice +public class RenExceptionHandler { + private Logger logger = LoggerFactory.getLogger(getClass()); + + /** + * 处理自定义异常 + */ + @ExceptionHandler(RenException.class) + public R handleRenException(RenException e){ + R r = new R(); + r.put("code", e.getCode()); + r.put("msg", e.getMessage()); + + return r; + } + + @ExceptionHandler(Exception.class) + public R handleException(Exception e){ + logger.error(e.getMessage(), e); + return R.error(); + } +} diff --git a/renren-generator/src/main/java/io/renren/utils/Sequence.java b/renren-generator/src/main/java/io/renren/utils/Sequence.java new file mode 100644 index 0000000..21a3b9b --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/Sequence.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2011-2020, hubin (jobob@qq.com). + *

+ * 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. + */ +package io.renren.utils; + +import org.apache.commons.lang.StringUtils; +import org.apache.ibatis.logging.Log; +import org.apache.ibatis.logging.LogFactory; + +import java.lang.management.ManagementFactory; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.util.concurrent.ThreadLocalRandom; + +/** + *

+ * 分布式高效有序ID生产黑科技(sequence)
+ * 优化开源项目:http://git.oschina.net/yu120/sequence + *

+ * + * @author hubin + * @since 2016-08-18 + */ +public class Sequence { + + private static final Log logger = LogFactory.getLog(Sequence.class); + /** + * 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动) + */ + private final long twepoch = 1288834974657L; + /** + * 机器标识位数 + */ + private final long workerIdBits = 5L; + private final long datacenterIdBits = 5L; + private final long maxWorkerId = -1L ^ (-1L << workerIdBits); + private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); + /** + * 毫秒内自增位 + */ + private final long sequenceBits = 12L; + private final long workerIdShift = sequenceBits; + private final long datacenterIdShift = sequenceBits + workerIdBits; + /** + * 时间戳左移动位 + */ + private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; + private final long sequenceMask = -1L ^ (-1L << sequenceBits); + + private final long workerId; + + /** + * 数据标识 ID 部分 + */ + private final long datacenterId; + /** + * 并发控制 + */ + private long sequence = 0L; + /** + * 上次生产 ID 时间戳 + */ + private long lastTimestamp = -1L; + + public Sequence() { + this.datacenterId = getDatacenterId(maxDatacenterId); + this.workerId = getMaxWorkerId(datacenterId, maxWorkerId); + } + + /** + *

+ * 有参构造器 + *

+ * + * @param workerId 工作机器 ID + * @param datacenterId 序列号 + */ + public Sequence(long workerId, long datacenterId) { + Assert.isFalse(workerId > maxWorkerId || workerId < 0, + String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); + Assert.isFalse(datacenterId > maxDatacenterId || datacenterId < 0, + String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); + this.workerId = workerId; + this.datacenterId = datacenterId; + } + + /** + *

+ * 获取 maxWorkerId + *

+ */ + protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) { + StringBuilder mpid = new StringBuilder(); + mpid.append(datacenterId); + String name = ManagementFactory.getRuntimeMXBean().getName(); + if (StringUtils.isNotEmpty(name)) { + /* + * GET jvmPid + */ + mpid.append(name.split(StringPool.AT)[0]); + } + /* + * MAC + PID 的 hashcode 获取16个低位 + */ + return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1); + } + + /** + *

+ * 数据标识id部分 + *

+ */ + protected static long getDatacenterId(long maxDatacenterId) { + long id = 0L; + try { + InetAddress ip = InetAddress.getLocalHost(); + NetworkInterface network = NetworkInterface.getByInetAddress(ip); + if (network == null) { + id = 1L; + } else { + byte[] mac = network.getHardwareAddress(); + if (null != mac) { + id = ((0x000000FF & (long) mac[mac.length - 1]) | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6; + id = id % (maxDatacenterId + 1); + } + } + } catch (Exception e) { + logger.warn(" getDatacenterId: " + e.getMessage()); + } + return id; + } + + /** + * 获取下一个ID + * + * @return + */ + public synchronized long nextId() { + long timestamp = timeGen(); + //闰秒 + if (timestamp < lastTimestamp) { + long offset = lastTimestamp - timestamp; + if (offset <= 5) { + try { + wait(offset << 1); + timestamp = timeGen(); + if (timestamp < lastTimestamp) { + throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset)); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } else { + throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset)); + } + } + + if (lastTimestamp == timestamp) { + // 相同毫秒内,序列号自增 + sequence = (sequence + 1) & sequenceMask; + if (sequence == 0) { + // 同一毫秒的序列数已经达到最大 + timestamp = tilNextMillis(lastTimestamp); + } + } else { + // 不同毫秒内,序列号置为 1 - 3 随机数 + sequence = ThreadLocalRandom.current().nextLong(1, 3); + } + + lastTimestamp = timestamp; + + // 时间戳部分 | 数据中心部分 | 机器标识部分 | 序列号部分 + return ((timestamp - twepoch) << timestampLeftShift) + | (datacenterId << datacenterIdShift) + | (workerId << workerIdShift) + | sequence; + } + + protected long tilNextMillis(long lastTimestamp) { + long timestamp = timeGen(); + while (timestamp <= lastTimestamp) { + timestamp = timeGen(); + } + return timestamp; + } + + protected long timeGen() { + return SystemClock.now(); + } + +} diff --git a/renren-generator/src/main/java/io/renren/utils/StringPool.java b/renren-generator/src/main/java/io/renren/utils/StringPool.java new file mode 100644 index 0000000..f8bcc27 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/StringPool.java @@ -0,0 +1,95 @@ +package io.renren.utils; + +/** + * Copy to jodd.util + *

+ * Pool of String constants to prevent repeating of + * hard-coded String literals in the code. + * Due to fact that these are public static final + * they will be inlined by java compiler and + * reference to this class will be dropped. + * There is no performance gain of using this pool. + * Read: http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5 + *

    + *
  • Literal strings within the same class in the same package represent references to the same String object.
  • + *
  • Literal strings within different classes in the same package represent references to the same String object.
  • + *
  • Literal strings within different classes in different packages likewise represent references to the same String object.
  • + *
  • Strings computed by constant expressions are computed at compile time and then treated as if they were literals.
  • + *
  • Strings computed by concatenation at run time are newly created and therefore distinct.
  • + *
+ */ +public interface StringPool { + + String AMPERSAND = "&"; + String AND = "and"; + String AT = "@"; + String ASTERISK = "*"; + String STAR = ASTERISK; + String BACK_SLASH = "\\"; + String COLON = ":"; + String COMMA = ","; + String DASH = "-"; + String DOLLAR = "$"; + String DOT = "."; + String DOTDOT = ".."; + String DOT_CLASS = ".class"; + String DOT_JAVA = ".java"; + String DOT_XML = ".xml"; + String EMPTY = ""; + String EQUALS = "="; + String FALSE = "false"; + String SLASH = "/"; + String HASH = "#"; + String HAT = "^"; + String LEFT_BRACE = "{"; + String LEFT_BRACKET = "("; + String LEFT_CHEV = "<"; + String NEWLINE = "\n"; + String N = "n"; + String NO = "no"; + String NULL = "null"; + String OFF = "off"; + String ON = "on"; + String PERCENT = "%"; + String PIPE = "|"; + String PLUS = "+"; + String QUESTION_MARK = "?"; + String EXCLAMATION_MARK = "!"; + String QUOTE = "\""; + String RETURN = "\r"; + String TAB = "\t"; + String RIGHT_BRACE = "}"; + String RIGHT_BRACKET = ")"; + String RIGHT_CHEV = ">"; + String SEMICOLON = ";"; + String SINGLE_QUOTE = "'"; + String BACKTICK = "`"; + String SPACE = " "; + String TILDA = "~"; + String LEFT_SQ_BRACKET = "["; + String RIGHT_SQ_BRACKET = "]"; + String TRUE = "true"; + String UNDERSCORE = "_"; + String UTF_8 = "UTF-8"; + String US_ASCII = "US-ASCII"; + String ISO_8859_1 = "ISO-8859-1"; + String Y = "y"; + String YES = "yes"; + String ONE = "1"; + String ZERO = "0"; + String DOLLAR_LEFT_BRACE = "${"; + String HASH_LEFT_BRACE = "#{"; + String CRLF = "\r\n"; + + String HTML_NBSP = " "; + String HTML_AMP = "&"; + String HTML_QUOTE = """; + String HTML_LT = "<"; + String HTML_GT = ">"; + + // ---------------------------------------------------------------- array + + String[] EMPTY_ARRAY = new String[0]; + + byte[] BYTES_NEW_LINE = StringPool.NEWLINE.getBytes(); +} diff --git a/renren-generator/src/main/java/io/renren/utils/SystemClock.java b/renren-generator/src/main/java/io/renren/utils/SystemClock.java new file mode 100644 index 0000000..6d614a6 --- /dev/null +++ b/renren-generator/src/main/java/io/renren/utils/SystemClock.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2011-2020, hubin (jobob@qq.com). + *

+ * 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. + */ +package io.renren.utils; + +import java.sql.Timestamp; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; + +/** + *

+ * 高并发场景下System.currentTimeMillis()的性能问题的优化 + *

+ *

+ * System.currentTimeMillis()的调用比new一个普通对象要耗时的多(具体耗时高出多少我还没测试过,有人说是100倍左右)
+ * System.currentTimeMillis()之所以慢是因为去跟系统打了一次交道
+ * 后台定时更新时钟,JVM退出时,线程自动回收
+ * 10亿:43410,206,210.72815533980582%
+ * 1亿:4699,29,162.0344827586207%
+ * 1000万:480,12,40.0%
+ * 100万:50,10,5.0%
+ *

+ * + * @author hubin + * @since 2016-08-01 + */ +public class SystemClock { + + private final long period; + private final AtomicLong now; + + private SystemClock(long period) { + this.period = period; + this.now = new AtomicLong(System.currentTimeMillis()); + scheduleClockUpdating(); + } + + private static SystemClock instance() { + return InstanceHolder.INSTANCE; + } + + public static long now() { + return instance().currentTimeMillis(); + } + + public static String nowDate() { + return new Timestamp(instance().currentTimeMillis()).toString(); + } + + private void scheduleClockUpdating() { + ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(runnable -> { + Thread thread = new Thread(runnable, "System Clock"); + thread.setDaemon(true); + return thread; + }); + scheduler.scheduleAtFixedRate(() -> now.set(System.currentTimeMillis()), period, period, TimeUnit.MILLISECONDS); + } + + private long currentTimeMillis() { + return now.get(); + } + + private static class InstanceHolder { + public static final SystemClock INSTANCE = new SystemClock(1); + } +} diff --git a/renren-generator/src/main/resources/application.yml b/renren-generator/src/main/resources/application.yml new file mode 100644 index 0000000..2f45f6b --- /dev/null +++ b/renren-generator/src/main/resources/application.yml @@ -0,0 +1,50 @@ +server: + port: 8082 + servlet: + context-path: /renren-generator + + +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + #MySQL配置 + driverClassName: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/mt_db?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: root + password: 123456 + #oracle配置 +# driverClassName: oracle.jdbc.OracleDriver +# url: jdbc:oracle:thin:@192.168.10.10:1521:xe +# username: renren_security +# password: 123456 + #SQLServer配置 +# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://192.168.10.10:1433;DatabaseName=renren_security +# username: sa +# password: 123456 + #PostgreSQL配置 +# driverClassName: org.postgresql.Driver +# url: jdbc:postgresql://192.168.10.10:5432/renren_security +# username: postgres +# password: 123456 + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + web: + resources: + static-locations: classpath:/static/,classpath:/views/ + + +mybatis: + mapperLocations: classpath:mapper/**/*.xml + + +pagehelper: + reasonable: true + supportMethodsArguments: true + params: count=countSql + + +#指定数据库,可选值有【mysql、oracle、sqlserver、postgresql】 +renren: + database: mysql \ No newline at end of file diff --git a/renren-generator/src/main/resources/generator.properties b/renren-generator/src/main/resources/generator.properties new file mode 100644 index 0000000..30a3d26 --- /dev/null +++ b/renren-generator/src/main/resources/generator.properties @@ -0,0 +1,68 @@ +#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F + +#\u5305\u540D +package=io.renren +moduleName=takeout +#\u4F5C\u8005 +author=zyx +#Email +email= +#\u8868\u524D\u7F00(\u7C7B\u540D\u4E0D\u4F1A\u5305\u542B\u8868\u524D\u7F00) +tablePrefix= +version=1.0.0 + + +#\u7C7B\u578B\u8F6C\u6362\uFF0C\u914D\u7F6E\u4FE1\u606F +tinyint=Integer +smallint=Integer +mediumint=Integer +int=Integer +integer=Integer +bigint=Long +float=Float +double=Double +decimal=BigDecimal +bit=Boolean +bool=Boolean + +char=String +varchar=String +tinytext=String +text=String +mediumtext=String +longtext=String + +date=Date +datetime=Date +timestamp=Date + +NUMBER=Integer +INT=Integer +INTEGER=Integer +BINARY_INTEGER=Integer +LONG=String +FLOAT=Float +BINARY_FLOAT=Float +DOUBLE=Double +BINARY_DOUBLE=Double +DECIMAL=BigDecimal +CHAR=String +VARCHAR=String +VARCHAR2=String +NVARCHAR=String +NVARCHAR2=String +CLOB=String +BLOB=String +DATE=Date +DATETIME=Date +TIMESTAMP=Date +TIMESTAMP(6)=Date + +int8=Long +int4=Integer +int2=Integer +numeric=BigDecimal + +INT16=Short +INT32=Integer +INT64=Long diff --git a/renren-generator/src/main/resources/logback-spring.xml b/renren-generator/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..c8b9f41 --- /dev/null +++ b/renren-generator/src/main/resources/logback-spring.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/mapper/MySQLGeneratorDao.xml b/renren-generator/src/main/resources/mapper/MySQLGeneratorDao.xml new file mode 100644 index 0000000..0e9ad8f --- /dev/null +++ b/renren-generator/src/main/resources/mapper/MySQLGeneratorDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/mapper/OracleGeneratorDao.xml b/renren-generator/src/main/resources/mapper/OracleGeneratorDao.xml new file mode 100644 index 0000000..678843d --- /dev/null +++ b/renren-generator/src/main/resources/mapper/OracleGeneratorDao.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/mapper/PostgreSQLGeneratorDao.xml b/renren-generator/src/main/resources/mapper/PostgreSQLGeneratorDao.xml new file mode 100644 index 0000000..88f6f7c --- /dev/null +++ b/renren-generator/src/main/resources/mapper/PostgreSQLGeneratorDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/mapper/SQLServerGeneratorDao.xml b/renren-generator/src/main/resources/mapper/SQLServerGeneratorDao.xml new file mode 100644 index 0000000..f066975 --- /dev/null +++ b/renren-generator/src/main/resources/mapper/SQLServerGeneratorDao.xml @@ -0,0 +1,90 @@ + + + + + + + + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/css/AdminLTE.min.css b/renren-generator/src/main/resources/static/css/AdminLTE.min.css new file mode 100644 index 0000000..8fbee1f --- /dev/null +++ b/renren-generator/src/main/resources/static/css/AdminLTE.min.css @@ -0,0 +1,7 @@ +/*! + * AdminLTE v2.3.7 + * Author: Almsaeed Studio + * Website: Almsaeed Studio + * License: Open source - MIT + * Please visit http://opensource.org/licenses/MIT for more information +!*/html,body{min-height:100%}.layout-boxed html,.layout-boxed body{height:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:'Source Sans Pro','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:400;overflow-x:hidden;overflow-y:auto}.wrapper{min-height:100%;position:relative;overflow:hidden}.wrapper:before,.wrapper:after{content:" ";display:table}.wrapper:after{clear:both}.layout-boxed .wrapper{max-width:1250px;margin:0 auto;min-height:100%;box-shadow:0 0 8px rgba(0,0,0,0.5);position:relative}.layout-boxed{background:url('../img/boxed-bg.jpg') repeat fixed}.content-wrapper,.right-side,.main-footer{-webkit-transition:-webkit-transform .3s ease-in-out,margin .3s ease-in-out;-moz-transition:-moz-transform .3s ease-in-out,margin .3s ease-in-out;-o-transition:-o-transform .3s ease-in-out,margin .3s ease-in-out;transition:transform .3s ease-in-out,margin .3s ease-in-out;margin-left:230px;z-index:820}.layout-top-nav .content-wrapper,.layout-top-nav .right-side,.layout-top-nav .main-footer{margin-left:0}@media (max-width:767px){.content-wrapper,.right-side,.main-footer{margin-left:0}}@media (min-width:768px){.sidebar-collapse .content-wrapper,.sidebar-collapse .right-side,.sidebar-collapse .main-footer{margin-left:0}}@media (max-width:767px){.sidebar-open .content-wrapper,.sidebar-open .right-side,.sidebar-open .main-footer{-webkit-transform:translate(230px, 0);-ms-transform:translate(230px, 0);-o-transform:translate(230px, 0);transform:translate(230px, 0)}}.content-wrapper,.right-side{min-height:100%;background-color:#ecf0f5;z-index:800}.main-footer{background:#fff;padding:15px;color:#444;border-top:1px solid #d2d6de}.fixed .main-header,.fixed .main-sidebar,.fixed .left-side{position:fixed}.fixed .main-header{top:0;right:0;left:0}.fixed .content-wrapper,.fixed .right-side{padding-top:50px}@media (max-width:767px){.fixed .content-wrapper,.fixed .right-side{padding-top:100px}}.fixed.layout-boxed .wrapper{max-width:100%}body.hold-transition .content-wrapper,body.hold-transition .right-side,body.hold-transition .main-footer,body.hold-transition .main-sidebar,body.hold-transition .left-side,body.hold-transition .main-header .navbar,body.hold-transition .main-header .logo{-webkit-transition:none;-o-transition:none;transition:none}.content{min-height:250px;padding:15px;margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:'Source Sans Pro',sans-serif}a{color:#3c8dbc}a:hover,a:active,a:focus{outline:none;text-decoration:none;color:#72afd2}.page-header{margin:10px 0 20px 0;font-size:22px}.page-header>small{color:#666;display:block;margin-top:5px}.main-header{position:relative;max-height:100px;z-index:1030}.main-header .navbar{-webkit-transition:margin-left .3s ease-in-out;-o-transition:margin-left .3s ease-in-out;transition:margin-left .3s ease-in-out;margin-bottom:0;margin-left:230px;border:none;min-height:50px;border-radius:0}.layout-top-nav .main-header .navbar{margin-left:0}.main-header #navbar-search-input.form-control{background:rgba(255,255,255,0.2);border-color:transparent}.main-header #navbar-search-input.form-control:focus,.main-header #navbar-search-input.form-control:active{border-color:rgba(0,0,0,0.1);background:rgba(255,255,255,0.9)}.main-header #navbar-search-input.form-control::-moz-placeholder{color:#ccc;opacity:1}.main-header #navbar-search-input.form-control:-ms-input-placeholder{color:#ccc}.main-header #navbar-search-input.form-control::-webkit-input-placeholder{color:#ccc}.main-header .navbar-custom-menu,.main-header .navbar-right{float:right}@media (max-width:991px){.main-header .navbar-custom-menu a,.main-header .navbar-right a{color:inherit;background:transparent}}@media (max-width:767px){.main-header .navbar-right{float:none}.navbar-collapse .main-header .navbar-right{margin:7.5px -15px}.main-header .navbar-right>li{color:inherit;border:0}}.main-header .sidebar-toggle{float:left;background-color:transparent;background-image:none;padding:15px 15px;font-family:fontAwesome}.main-header .sidebar-toggle:before{content:"\f0c9"}.main-header .sidebar-toggle:hover{color:#fff}.main-header .sidebar-toggle:focus,.main-header .sidebar-toggle:active{background:transparent}.main-header .sidebar-toggle .icon-bar{display:none}.main-header .navbar .nav>li.user>a>.fa,.main-header .navbar .nav>li.user>a>.glyphicon,.main-header .navbar .nav>li.user>a>.ion{margin-right:5px}.main-header .navbar .nav>li>a>.label{position:absolute;top:9px;right:7px;text-align:center;font-size:9px;padding:2px 3px;line-height:.9}.main-header .logo{-webkit-transition:width .3s ease-in-out;-o-transition:width .3s ease-in-out;transition:width .3s ease-in-out;display:block;float:left;height:50px;font-size:20px;line-height:50px;text-align:center;width:230px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;padding:0 15px;font-weight:300;overflow:hidden}.main-header .logo .logo-lg{display:block}.main-header .logo .logo-mini{display:none}.main-header .navbar-brand{color:#fff}.content-header{position:relative;padding:15px 15px 0 15px}.content-header>h1{margin:0;font-size:24px}.content-header>h1>small{font-size:15px;display:inline-block;padding-left:4px;font-weight:300}.content-header>.breadcrumb{float:right;background:transparent;margin-top:0;margin-bottom:0;font-size:12px;padding:7px 5px;position:absolute;top:15px;right:10px;border-radius:2px}.content-header>.breadcrumb>li>a{color:#444;text-decoration:none;display:inline-block}.content-header>.breadcrumb>li>a>.fa,.content-header>.breadcrumb>li>a>.glyphicon,.content-header>.breadcrumb>li>a>.ion{margin-right:5px}.content-header>.breadcrumb>li+li:before{content:'>\00a0'}@media (max-width:991px){.content-header>.breadcrumb{position:relative;margin-top:5px;top:0;right:0;float:none;background:#d2d6de;padding-left:10px}.content-header>.breadcrumb li:before{color:#97a0b3}}.navbar-toggle{color:#fff;border:0;margin:0;padding:15px 15px}@media (max-width:991px){.navbar-custom-menu .navbar-nav>li{float:left}.navbar-custom-menu .navbar-nav{margin:0;float:left}.navbar-custom-menu .navbar-nav>li>a{padding-top:15px;padding-bottom:15px;line-height:20px}}@media (max-width:767px){.main-header{position:relative}.main-header .logo,.main-header .navbar{width:100%;float:none}.main-header .navbar{margin:0}.main-header .navbar-custom-menu{float:right}}@media (max-width:991px){.navbar-collapse.pull-left{float:none !important}.navbar-collapse.pull-left+.navbar-custom-menu{display:block;position:absolute;top:0;right:40px}}.main-sidebar,.left-side{position:absolute;top:0;left:0;padding-top:50px;min-height:100%;width:230px;z-index:810;-webkit-transition:-webkit-transform .3s ease-in-out,width .3s ease-in-out;-moz-transition:-moz-transform .3s ease-in-out,width .3s ease-in-out;-o-transition:-o-transform .3s ease-in-out,width .3s ease-in-out;transition:transform .3s ease-in-out,width .3s ease-in-out}@media (max-width:767px){.main-sidebar,.left-side{padding-top:100px}}@media (max-width:767px){.main-sidebar,.left-side{-webkit-transform:translate(-230px, 0);-ms-transform:translate(-230px, 0);-o-transform:translate(-230px, 0);transform:translate(-230px, 0)}}@media (min-width:768px){.sidebar-collapse .main-sidebar,.sidebar-collapse .left-side{-webkit-transform:translate(-230px, 0);-ms-transform:translate(-230px, 0);-o-transform:translate(-230px, 0);transform:translate(-230px, 0)}}@media (max-width:767px){.sidebar-open .main-sidebar,.sidebar-open .left-side{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}}.sidebar{padding-bottom:10px}.sidebar-form input:focus{border-color:transparent}.user-panel{position:relative;width:100%;padding:10px;overflow:hidden}.user-panel:before,.user-panel:after{content:" ";display:table}.user-panel:after{clear:both}.user-panel>.image>img{width:100%;max-width:45px;height:auto}.user-panel>.info{padding:5px 5px 5px 15px;line-height:1;position:absolute;left:55px}.user-panel>.info>p{font-weight:600;margin-bottom:9px}.user-panel>.info>a{text-decoration:none;padding-right:5px;margin-top:3px;font-size:11px}.user-panel>.info>a>.fa,.user-panel>.info>a>.ion,.user-panel>.info>a>.glyphicon{margin-right:3px}.sidebar-menu{list-style:none;margin:0;padding:0}.sidebar-menu>li{position:relative;margin:0;padding:0}.sidebar-menu>li>a{padding:12px 5px 12px 15px;display:block}.sidebar-menu>li>a>.fa,.sidebar-menu>li>a>.glyphicon,.sidebar-menu>li>a>.ion{width:20px}.sidebar-menu>li .label,.sidebar-menu>li .badge{margin-right:5px}.sidebar-menu>li .badge{margin-top:3px}.sidebar-menu li.header{padding:10px 25px 10px 15px;font-size:12px}.sidebar-menu li>a>.fa-angle-left,.sidebar-menu li>a>.pull-right-container>.fa-angle-left{width:auto;height:auto;padding:0;margin-right:10px}.sidebar-menu li.active>a>.fa-angle-left,.sidebar-menu li.active>a>.pull-right-container>.fa-angle-left{-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.sidebar-menu li.active>.treeview-menu{display:block}.sidebar-menu .treeview-menu{display:none;list-style:none;padding:0;margin:0;padding-left:5px}.sidebar-menu .treeview-menu .treeview-menu{padding-left:20px}.sidebar-menu .treeview-menu>li{margin:0}.sidebar-menu .treeview-menu>li>a{padding:5px 5px 5px 15px;display:block;font-size:14px}.sidebar-menu .treeview-menu>li>a>.fa,.sidebar-menu .treeview-menu>li>a>.glyphicon,.sidebar-menu .treeview-menu>li>a>.ion{width:20px}.sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-left,.sidebar-menu .treeview-menu>li>a>.pull-right-container>.fa-angle-down,.sidebar-menu .treeview-menu>li>a>.fa-angle-left,.sidebar-menu .treeview-menu>li>a>.fa-angle-down{width:auto}@media (min-width:768px){.sidebar-mini.sidebar-collapse .content-wrapper,.sidebar-mini.sidebar-collapse .right-side,.sidebar-mini.sidebar-collapse .main-footer{margin-left:50px !important;z-index:840}.sidebar-mini.sidebar-collapse .main-sidebar{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0);width:50px !important;z-index:850}.sidebar-mini.sidebar-collapse .sidebar-menu>li{position:relative}.sidebar-mini.sidebar-collapse .sidebar-menu>li>a{margin-right:0}.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>span{border-top-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:not(.treeview)>a>span{border-bottom-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{padding-top:5px;padding-bottom:5px;border-bottom-right-radius:4px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>span:not(.pull-right),.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>.treeview-menu{display:block !important;position:absolute;width:180px;left:50px}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>span{top:0;margin-left:-3px;padding:12px 5px 12px 20px;background-color:inherit}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>.pull-right-container{float:right;width:auto!important;left:200px!important;top:10px!important}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>.pull-right-container>.label:not(:first-of-type){display:none}.sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>.treeview-menu{top:44px;margin-left:0}.sidebar-mini.sidebar-collapse .main-sidebar .user-panel>.info,.sidebar-mini.sidebar-collapse .sidebar-form,.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>span,.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu,.sidebar-mini.sidebar-collapse .sidebar-menu>li>a>.pull-right,.sidebar-mini.sidebar-collapse .sidebar-menu li.header{display:none !important;-webkit-transform:translateZ(0)}.sidebar-mini.sidebar-collapse .main-header .logo{width:50px}.sidebar-mini.sidebar-collapse .main-header .logo>.logo-mini{display:block;margin-left:-15px;margin-right:-15px;font-size:18px}.sidebar-mini.sidebar-collapse .main-header .logo>.logo-lg{display:none}.sidebar-mini.sidebar-collapse .main-header .navbar{margin-left:50px}}.sidebar-menu,.main-sidebar .user-panel,.sidebar-menu>li.header{white-space:nowrap;overflow:hidden}.sidebar-menu:hover{overflow:visible}.sidebar-form,.sidebar-menu>li.header{overflow:hidden;text-overflow:clip}.sidebar-menu li>a{position:relative}.sidebar-menu li>a>.pull-right-container{position:absolute;right:10px;top:50%;margin-top:-7px}.control-sidebar-bg{position:fixed;z-index:1000;bottom:0}.control-sidebar-bg,.control-sidebar{top:0;right:-230px;width:230px;-webkit-transition:right .3s ease-in-out;-o-transition:right .3s ease-in-out;transition:right .3s ease-in-out}.control-sidebar{position:absolute;padding-top:50px;z-index:1010}@media (max-width:768px){.control-sidebar{padding-top:100px}}.control-sidebar>.tab-content{padding:10px 15px}.control-sidebar.control-sidebar-open,.control-sidebar.control-sidebar-open+.control-sidebar-bg{right:0}.control-sidebar-open .control-sidebar-bg,.control-sidebar-open .control-sidebar{right:0}@media (min-width:768px){.control-sidebar-open .content-wrapper,.control-sidebar-open .right-side,.control-sidebar-open .main-footer{margin-right:230px}}.nav-tabs.control-sidebar-tabs>li:first-of-type>a,.nav-tabs.control-sidebar-tabs>li:first-of-type>a:hover,.nav-tabs.control-sidebar-tabs>li:first-of-type>a:focus{border-left-width:0}.nav-tabs.control-sidebar-tabs>li>a{border-radius:0}.nav-tabs.control-sidebar-tabs>li>a,.nav-tabs.control-sidebar-tabs>li>a:hover{border-top:none;border-right:none;border-left:1px solid transparent;border-bottom:1px solid transparent}.nav-tabs.control-sidebar-tabs>li>a .icon{font-size:16px}.nav-tabs.control-sidebar-tabs>li.active>a,.nav-tabs.control-sidebar-tabs>li.active>a:hover,.nav-tabs.control-sidebar-tabs>li.active>a:focus,.nav-tabs.control-sidebar-tabs>li.active>a:active{border-top:none;border-right:none;border-bottom:none}@media (max-width:768px){.nav-tabs.control-sidebar-tabs{display:table}.nav-tabs.control-sidebar-tabs>li{display:table-cell}}.control-sidebar-heading{font-weight:400;font-size:16px;padding:10px 0;margin-bottom:10px}.control-sidebar-subheading{display:block;font-weight:400;font-size:14px}.control-sidebar-menu{list-style:none;padding:0;margin:0 -15px}.control-sidebar-menu>li>a{display:block;padding:10px 15px}.control-sidebar-menu>li>a:before,.control-sidebar-menu>li>a:after{content:" ";display:table}.control-sidebar-menu>li>a:after{clear:both}.control-sidebar-menu>li>a>.control-sidebar-subheading{margin-top:0}.control-sidebar-menu .menu-icon{float:left;width:35px;height:35px;border-radius:50%;text-align:center;line-height:35px}.control-sidebar-menu .menu-info{margin-left:45px;margin-top:3px}.control-sidebar-menu .menu-info>.control-sidebar-subheading{margin:0}.control-sidebar-menu .menu-info>p{margin:0;font-size:11px}.control-sidebar-menu .progress{margin:0}.control-sidebar-dark{color:#b8c7ce}.control-sidebar-dark,.control-sidebar-dark+.control-sidebar-bg{background:#222d32}.control-sidebar-dark .nav-tabs.control-sidebar-tabs{border-bottom:#1c2529}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a{background:#181f23;color:#b8c7ce}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:focus{border-left-color:#141a1d;border-bottom-color:#141a1d}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:active{background:#1c2529}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li>a:hover{color:#fff}.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:hover,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:focus,.control-sidebar-dark .nav-tabs.control-sidebar-tabs>li.active>a:active{background:#222d32;color:#fff}.control-sidebar-dark .control-sidebar-heading,.control-sidebar-dark .control-sidebar-subheading{color:#fff}.control-sidebar-dark .control-sidebar-menu>li>a:hover{background:#1e282c}.control-sidebar-dark .control-sidebar-menu>li>a .menu-info>p{color:#b8c7ce}.control-sidebar-light{color:#5e5e5e}.control-sidebar-light,.control-sidebar-light+.control-sidebar-bg{background:#f9fafc;border-left:1px solid #d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs{border-bottom:#d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a{background:#e8ecf4;color:#444}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:hover,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:focus{border-left-color:#d2d6de;border-bottom-color:#d2d6de}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:hover,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li>a:active{background:#eff1f7}.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:hover,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:focus,.control-sidebar-light .nav-tabs.control-sidebar-tabs>li.active>a:active{background:#f9fafc;color:#111}.control-sidebar-light .control-sidebar-heading,.control-sidebar-light .control-sidebar-subheading{color:#111}.control-sidebar-light .control-sidebar-menu{margin-left:-14px}.control-sidebar-light .control-sidebar-menu>li>a:hover{background:#f4f4f5}.control-sidebar-light .control-sidebar-menu>li>a .menu-info>p{color:#5e5e5e}.dropdown-menu{box-shadow:none;border-color:#eee}.dropdown-menu>li>a{color:#777}.dropdown-menu>li>a>.glyphicon,.dropdown-menu>li>a>.fa,.dropdown-menu>li>a>.ion{margin-right:10px}.dropdown-menu>li>a:hover{background-color:#e1e3e9;color:#333}.dropdown-menu>.divider{background-color:#eee}.navbar-nav>.notifications-menu>.dropdown-menu,.navbar-nav>.messages-menu>.dropdown-menu,.navbar-nav>.tasks-menu>.dropdown-menu{width:280px;padding:0 0 0 0;margin:0;top:100%}.navbar-nav>.notifications-menu>.dropdown-menu>li,.navbar-nav>.messages-menu>.dropdown-menu>li,.navbar-nav>.tasks-menu>.dropdown-menu>li{position:relative}.navbar-nav>.notifications-menu>.dropdown-menu>li.header,.navbar-nav>.messages-menu>.dropdown-menu>li.header,.navbar-nav>.tasks-menu>.dropdown-menu>li.header{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0;background-color:#ffffff;padding:7px 10px;border-bottom:1px solid #f4f4f4;color:#444444;font-size:14px}.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px;font-size:12px;background-color:#fff;padding:7px 10px;border-bottom:1px solid #eeeeee;color:#444 !important;text-align:center}@media (max-width:991px){.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a{background:#fff !important;color:#444 !important}}.navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a:hover,.navbar-nav>.messages-menu>.dropdown-menu>li.footer>a:hover,.navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a:hover{text-decoration:none;font-weight:normal}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu,.navbar-nav>.messages-menu>.dropdown-menu>li .menu,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu{max-height:200px;margin:0;padding:0;list-style:none;overflow-x:hidden}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a,.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a{display:block;white-space:nowrap;border-bottom:1px solid #f4f4f4}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a:hover,.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:hover,.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a:hover{background:#f4f4f4;text-decoration:none}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a{color:#444444;overflow:hidden;text-overflow:ellipsis;padding:10px}.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.glyphicon,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.fa,.navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a>.ion{width:20px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a{margin:0;padding:10px 10px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>div>img{margin:auto 10px auto auto;width:40px;height:40px}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>h4{padding:0;margin:0 0 0 45px;color:#444444;font-size:15px;position:relative}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>h4>small{color:#999999;font-size:10px;position:absolute;top:0;right:0}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a>p{margin:0 0 0 45px;font-size:12px;color:#888888}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:before,.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:after{content:" ";display:table}.navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a:after{clear:both}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a{padding:10px}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a>h3{font-size:14px;padding:0;margin:0 0 10px 0;color:#666666}.navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a>.progress{padding:0;margin:0}.navbar-nav>.user-menu>.dropdown-menu{border-top-right-radius:0;border-top-left-radius:0;padding:1px 0 0 0;border-top-width:0;width:280px}.navbar-nav>.user-menu>.dropdown-menu,.navbar-nav>.user-menu>.dropdown-menu>.user-body{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.navbar-nav>.user-menu>.dropdown-menu>li.user-header{height:175px;padding:10px;text-align:center}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>img{z-index:5;height:90px;width:90px;border:3px solid;border-color:transparent;border-color:rgba(255,255,255,0.2)}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>p{z-index:5;color:#fff;color:rgba(255,255,255,0.8);font-size:17px;margin-top:10px}.navbar-nav>.user-menu>.dropdown-menu>li.user-header>p>small{display:block;font-size:12px}.navbar-nav>.user-menu>.dropdown-menu>.user-body{padding:15px;border-bottom:1px solid #f4f4f4;border-top:1px solid #dddddd}.navbar-nav>.user-menu>.dropdown-menu>.user-body:before,.navbar-nav>.user-menu>.dropdown-menu>.user-body:after{content:" ";display:table}.navbar-nav>.user-menu>.dropdown-menu>.user-body:after{clear:both}.navbar-nav>.user-menu>.dropdown-menu>.user-body a{color:#444 !important}@media (max-width:991px){.navbar-nav>.user-menu>.dropdown-menu>.user-body a{background:#fff !important;color:#444 !important}}.navbar-nav>.user-menu>.dropdown-menu>.user-footer{background-color:#f9f9f9;padding:10px}.navbar-nav>.user-menu>.dropdown-menu>.user-footer:before,.navbar-nav>.user-menu>.dropdown-menu>.user-footer:after{content:" ";display:table}.navbar-nav>.user-menu>.dropdown-menu>.user-footer:after{clear:both}.navbar-nav>.user-menu>.dropdown-menu>.user-footer .btn-default{color:#666666}@media (max-width:991px){.navbar-nav>.user-menu>.dropdown-menu>.user-footer .btn-default:hover{background-color:#f9f9f9}}.navbar-nav>.user-menu .user-image{float:left;width:25px;height:25px;border-radius:50%;margin-right:10px;margin-top:-2px}@media (max-width:767px){.navbar-nav>.user-menu .user-image{float:none;margin-right:0;margin-top:-8px;line-height:10px}}.open:not(.dropup)>.animated-dropdown-menu{backface-visibility:visible !important;-webkit-animation:flipInX .7s both;-o-animation:flipInX .7s both;animation:flipInX .7s both}@keyframes flipInX{0%{transform:perspective(400px) rotate3d(1, 0, 0, 90deg);transition-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotate3d(1, 0, 0, -20deg);transition-timing-function:ease-in}60%{transform:perspective(400px) rotate3d(1, 0, 0, 10deg);opacity:1}80%{transform:perspective(400px) rotate3d(1, 0, 0, -5deg)}100%{transform:perspective(400px)}}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1, 0, 0, 90deg);-webkit-transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1, 0, 0, -20deg);-webkit-transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1, 0, 0, 10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1, 0, 0, -5deg)}100%{-webkit-transform:perspective(400px)}}.navbar-custom-menu>.navbar-nav>li{position:relative}.navbar-custom-menu>.navbar-nav>li>.dropdown-menu{position:absolute;right:0;left:auto}@media (max-width:991px){.navbar-custom-menu>.navbar-nav{float:right}.navbar-custom-menu>.navbar-nav>li{position:static}.navbar-custom-menu>.navbar-nav>li>.dropdown-menu{position:absolute;right:5%;left:auto;border:1px solid #ddd;background:#fff}}.form-control{border-radius:0;box-shadow:none;border-color:#d2d6de}.form-control:focus{border-color:#3c8dbc;box-shadow:none}.form-control::-moz-placeholder,.form-control:-ms-input-placeholder,.form-control::-webkit-input-placeholder{color:#bbb;opacity:1}.form-control:not(select){-webkit-appearance:none;-moz-appearance:none;appearance:none}.form-group.has-success label{color:#00a65a}.form-group.has-success .form-control,.form-group.has-success .input-group-addon{border-color:#00a65a;box-shadow:none}.form-group.has-success .help-block{color:#00a65a}.form-group.has-warning label{color:#f39c12}.form-group.has-warning .form-control,.form-group.has-warning .input-group-addon{border-color:#f39c12;box-shadow:none}.form-group.has-warning .help-block{color:#f39c12}.form-group.has-error label{color:#dd4b39}.form-group.has-error .form-control,.form-group.has-error .input-group-addon{border-color:#dd4b39;box-shadow:none}.form-group.has-error .help-block{color:#dd4b39}.input-group .input-group-addon{border-radius:0;border-color:#d2d6de;background-color:#fff}.btn-group-vertical .btn.btn-flat:first-of-type,.btn-group-vertical .btn.btn-flat:last-of-type{border-radius:0}.icheck>label{padding-left:0}.form-control-feedback.fa{line-height:34px}.input-lg+.form-control-feedback.fa,.input-group-lg+.form-control-feedback.fa,.form-group-lg .form-control+.form-control-feedback.fa{line-height:46px}.input-sm+.form-control-feedback.fa,.input-group-sm+.form-control-feedback.fa,.form-group-sm .form-control+.form-control-feedback.fa{line-height:30px}.progress,.progress>.progress-bar{-webkit-box-shadow:none;box-shadow:none}.progress,.progress>.progress-bar,.progress .progress-bar,.progress>.progress-bar .progress-bar{border-radius:1px}.progress.sm,.progress-sm{height:10px}.progress.sm,.progress-sm,.progress.sm .progress-bar,.progress-sm .progress-bar{border-radius:1px}.progress.xs,.progress-xs{height:7px}.progress.xs,.progress-xs,.progress.xs .progress-bar,.progress-xs .progress-bar{border-radius:1px}.progress.xxs,.progress-xxs{height:3px}.progress.xxs,.progress-xxs,.progress.xxs .progress-bar,.progress-xxs .progress-bar{border-radius:1px}.progress.vertical{position:relative;width:30px;height:200px;display:inline-block;margin-right:10px}.progress.vertical>.progress-bar{width:100%;position:absolute;bottom:0}.progress.vertical.sm,.progress.vertical.progress-sm{width:20px}.progress.vertical.xs,.progress.vertical.progress-xs{width:10px}.progress.vertical.xxs,.progress.vertical.progress-xxs{width:3px}.progress-group .progress-text{font-weight:600}.progress-group .progress-number{float:right}.table tr>td .progress{margin:0}.progress-bar-light-blue,.progress-bar-primary{background-color:#3c8dbc}.progress-striped .progress-bar-light-blue,.progress-striped .progress-bar-primary{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-green,.progress-bar-success{background-color:#00a65a}.progress-striped .progress-bar-green,.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-aqua,.progress-bar-info{background-color:#00c0ef}.progress-striped .progress-bar-aqua,.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-yellow,.progress-bar-warning{background-color:#f39c12}.progress-striped .progress-bar-yellow,.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-red,.progress-bar-danger{background-color:#dd4b39}.progress-striped .progress-bar-red,.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.small-box{border-radius:2px;position:relative;display:block;margin-bottom:20px;box-shadow:0 1px 1px rgba(0,0,0,0.1)}.small-box>.inner{padding:10px}.small-box>.small-box-footer{position:relative;text-align:center;padding:3px 0;color:#fff;color:rgba(255,255,255,0.8);display:block;z-index:10;background:rgba(0,0,0,0.1);text-decoration:none}.small-box>.small-box-footer:hover{color:#fff;background:rgba(0,0,0,0.15)}.small-box h3{font-size:38px;font-weight:bold;margin:0 0 10px 0;white-space:nowrap;padding:0}.small-box p{font-size:15px}.small-box p>small{display:block;color:#f9f9f9;font-size:13px;margin-top:5px}.small-box h3,.small-box p{z-index:5}.small-box .icon{-webkit-transition:all .3s linear;-o-transition:all .3s linear;transition:all .3s linear;position:absolute;top:-10px;right:10px;z-index:0;font-size:90px;color:rgba(0,0,0,0.15)}.small-box:hover{text-decoration:none;color:#f9f9f9}.small-box:hover .icon{font-size:95px}@media (max-width:767px){.small-box{text-align:center}.small-box .icon{display:none}.small-box p{font-size:12px}}.box{position:relative;border-radius:3px;background:#ffffff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;box-shadow:0 1px 1px rgba(0,0,0,0.1)}.box.box-primary{border-top-color:#3c8dbc}.box.box-info{border-top-color:#00c0ef}.box.box-danger{border-top-color:#dd4b39}.box.box-warning{border-top-color:#f39c12}.box.box-success{border-top-color:#00a65a}.box.box-default{border-top-color:#d2d6de}.box.collapsed-box .box-body,.box.collapsed-box .box-footer{display:none}.box .nav-stacked>li{border-bottom:1px solid #f4f4f4;margin:0}.box .nav-stacked>li:last-of-type{border-bottom:none}.box.height-control .box-body{max-height:300px;overflow:auto}.box .border-right{border-right:1px solid #f4f4f4}.box .border-left{border-left:1px solid #f4f4f4}.box.box-solid{border-top:0}.box.box-solid>.box-header .btn.btn-default{background:transparent}.box.box-solid>.box-header .btn:hover,.box.box-solid>.box-header a:hover{background:rgba(0,0,0,0.1)}.box.box-solid.box-default{border:1px solid #d2d6de}.box.box-solid.box-default>.box-header{color:#444;background:#d2d6de;background-color:#d2d6de}.box.box-solid.box-default>.box-header a,.box.box-solid.box-default>.box-header .btn{color:#444}.box.box-solid.box-primary{border:1px solid #3c8dbc}.box.box-solid.box-primary>.box-header{color:#fff;background:#3c8dbc;background-color:#3c8dbc}.box.box-solid.box-primary>.box-header a,.box.box-solid.box-primary>.box-header .btn{color:#fff}.box.box-solid.box-info{border:1px solid #00c0ef}.box.box-solid.box-info>.box-header{color:#fff;background:#00c0ef;background-color:#00c0ef}.box.box-solid.box-info>.box-header a,.box.box-solid.box-info>.box-header .btn{color:#fff}.box.box-solid.box-danger{border:1px solid #dd4b39}.box.box-solid.box-danger>.box-header{color:#fff;background:#dd4b39;background-color:#dd4b39}.box.box-solid.box-danger>.box-header a,.box.box-solid.box-danger>.box-header .btn{color:#fff}.box.box-solid.box-warning{border:1px solid #f39c12}.box.box-solid.box-warning>.box-header{color:#fff;background:#f39c12;background-color:#f39c12}.box.box-solid.box-warning>.box-header a,.box.box-solid.box-warning>.box-header .btn{color:#fff}.box.box-solid.box-success{border:1px solid #00a65a}.box.box-solid.box-success>.box-header{color:#fff;background:#00a65a;background-color:#00a65a}.box.box-solid.box-success>.box-header a,.box.box-solid.box-success>.box-header .btn{color:#fff}.box.box-solid>.box-header>.box-tools .btn{border:0;box-shadow:none}.box.box-solid[class*='bg']>.box-header{color:#fff}.box .box-group>.box{margin-bottom:5px}.box .knob-label{text-align:center;color:#333;font-weight:100;font-size:12px;margin-bottom:0.3em}.box>.overlay,.overlay-wrapper>.overlay,.box>.loading-img,.overlay-wrapper>.loading-img{position:absolute;top:0;left:0;width:100%;height:100%}.box .overlay,.overlay-wrapper .overlay{z-index:50;background:rgba(255,255,255,0.7);border-radius:3px}.box .overlay>.fa,.overlay-wrapper .overlay>.fa{position:absolute;top:50%;left:50%;margin-left:-15px;margin-top:-15px;color:#000;font-size:30px}.box .overlay.dark,.overlay-wrapper .overlay.dark{background:rgba(0,0,0,0.5)}.box-header:before,.box-body:before,.box-footer:before,.box-header:after,.box-body:after,.box-footer:after{content:" ";display:table}.box-header:after,.box-body:after,.box-footer:after{clear:both}.box-header{color:#444;display:block;padding:10px;position:relative}.box-header.with-border{border-bottom:1px solid #f4f4f4}.collapsed-box .box-header.with-border{border-bottom:none}.box-header>.fa,.box-header>.glyphicon,.box-header>.ion,.box-header .box-title{display:inline-block;font-size:18px;margin:0;line-height:1}.box-header>.fa,.box-header>.glyphicon,.box-header>.ion{margin-right:5px}.box-header>.box-tools{position:absolute;right:10px;top:5px}.box-header>.box-tools [data-toggle="tooltip"]{position:relative}.box-header>.box-tools.pull-right .dropdown-menu{right:0;left:auto}.btn-box-tool{padding:5px;font-size:12px;background:transparent;color:#97a0b3}.open .btn-box-tool,.btn-box-tool:hover{color:#606c84}.btn-box-tool.btn:active{box-shadow:none}.box-body{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;padding:10px}.no-header .box-body{border-top-right-radius:3px;border-top-left-radius:3px}.box-body>.table{margin-bottom:0}.box-body .fc{margin-top:5px}.box-body .full-width-chart{margin:-19px}.box-body.no-padding .full-width-chart{margin:-9px}.box-body .box-pane{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:3px}.box-body .box-pane-right{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:0}.box-footer{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-top:1px solid #f4f4f4;padding:10px;background-color:#fff}.chart-legend{margin:10px 0}@media (max-width:991px){.chart-legend>li{float:left;margin-right:10px}}.box-comments{background:#f7f7f7}.box-comments .box-comment{padding:8px 0;border-bottom:1px solid #eee}.box-comments .box-comment:before,.box-comments .box-comment:after{content:" ";display:table}.box-comments .box-comment:after{clear:both}.box-comments .box-comment:last-of-type{border-bottom:0}.box-comments .box-comment:first-of-type{padding-top:0}.box-comments .box-comment img{float:left}.box-comments .comment-text{margin-left:40px;color:#555}.box-comments .username{color:#444;display:block;font-weight:600}.box-comments .text-muted{font-weight:400;font-size:12px}.todo-list{margin:0;padding:0;list-style:none;overflow:auto}.todo-list>li{border-radius:2px;padding:10px;background:#f4f4f4;margin-bottom:2px;border-left:2px solid #e6e7e8;color:#444}.todo-list>li:last-of-type{margin-bottom:0}.todo-list>li>input[type='checkbox']{margin:0 10px 0 5px}.todo-list>li .text{display:inline-block;margin-left:5px;font-weight:600}.todo-list>li .label{margin-left:10px;font-size:9px}.todo-list>li .tools{display:none;float:right;color:#dd4b39}.todo-list>li .tools>.fa,.todo-list>li .tools>.glyphicon,.todo-list>li .tools>.ion{margin-right:5px;cursor:pointer}.todo-list>li:hover .tools{display:inline-block}.todo-list>li.done{color:#999}.todo-list>li.done .text{text-decoration:line-through;font-weight:500}.todo-list>li.done .label{background:#d2d6de !important}.todo-list .danger{border-left-color:#dd4b39}.todo-list .warning{border-left-color:#f39c12}.todo-list .info{border-left-color:#00c0ef}.todo-list .success{border-left-color:#00a65a}.todo-list .primary{border-left-color:#3c8dbc}.todo-list .handle{display:inline-block;cursor:move;margin:0 5px}.chat{padding:5px 20px 5px 10px}.chat .item{margin-bottom:10px}.chat .item:before,.chat .item:after{content:" ";display:table}.chat .item:after{clear:both}.chat .item>img{width:40px;height:40px;border:2px solid transparent;border-radius:50%}.chat .item>.online{border:2px solid #00a65a}.chat .item>.offline{border:2px solid #dd4b39}.chat .item>.message{margin-left:55px;margin-top:-40px}.chat .item>.message>.name{display:block;font-weight:600}.chat .item>.attachment{border-radius:3px;background:#f4f4f4;margin-left:65px;margin-right:15px;padding:10px}.chat .item>.attachment>h4{margin:0 0 5px 0;font-weight:600;font-size:14px}.chat .item>.attachment>p,.chat .item>.attachment>.filename{font-weight:600;font-size:13px;font-style:italic;margin:0}.chat .item>.attachment:before,.chat .item>.attachment:after{content:" ";display:table}.chat .item>.attachment:after{clear:both}.box-input{max-width:200px}.modal .panel-body{color:#444}.info-box{display:block;min-height:90px;background:#fff;width:100%;box-shadow:0 1px 1px rgba(0,0,0,0.1);border-radius:2px;margin-bottom:15px}.info-box small{font-size:14px}.info-box .progress{background:rgba(0,0,0,0.2);margin:5px -10px 5px -10px;height:2px}.info-box .progress,.info-box .progress .progress-bar{border-radius:0}.info-box .progress .progress-bar{background:#fff}.info-box-icon{border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px;display:block;float:left;height:90px;width:90px;text-align:center;font-size:45px;line-height:90px;background:rgba(0,0,0,0.2)}.info-box-icon>img{max-width:100%}.info-box-content{padding:5px 10px;margin-left:90px}.info-box-number{display:block;font-weight:bold;font-size:18px}.progress-description,.info-box-text{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.info-box-text{text-transform:uppercase}.info-box-more{display:block}.progress-description{margin:0}.timeline{position:relative;margin:0 0 30px 0;padding:0;list-style:none}.timeline:before{content:'';position:absolute;top:0;bottom:0;width:4px;background:#ddd;left:31px;margin:0;border-radius:2px}.timeline>li{position:relative;margin-right:10px;margin-bottom:15px}.timeline>li:before,.timeline>li:after{content:" ";display:table}.timeline>li:after{clear:both}.timeline>li>.timeline-item{-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.1);box-shadow:0 1px 1px rgba(0,0,0,0.1);border-radius:3px;margin-top:0;background:#fff;color:#444;margin-left:60px;margin-right:15px;padding:0;position:relative}.timeline>li>.timeline-item>.time{color:#999;float:right;padding:10px;font-size:12px}.timeline>li>.timeline-item>.timeline-header{margin:0;color:#555;border-bottom:1px solid #f4f4f4;padding:10px;font-size:16px;line-height:1.1}.timeline>li>.timeline-item>.timeline-header>a{font-weight:600}.timeline>li>.timeline-item>.timeline-body,.timeline>li>.timeline-item>.timeline-footer{padding:10px}.timeline>li>.fa,.timeline>li>.glyphicon,.timeline>li>.ion{width:30px;height:30px;font-size:15px;line-height:30px;position:absolute;color:#666;background:#d2d6de;border-radius:50%;text-align:center;left:18px;top:0}.timeline>.time-label>span{font-weight:600;padding:5px;display:inline-block;background-color:#fff;border-radius:4px}.timeline-inverse>li>.timeline-item{background:#f0f0f0;border:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none}.timeline-inverse>li>.timeline-item>.timeline-header{border-bottom-color:#ddd}.btn{border-radius:3px;-webkit-box-shadow:none;box-shadow:none;border:1px solid transparent}.btn.uppercase{text-transform:uppercase}.btn.btn-flat{border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;border-width:1px}.btn:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn:focus{outline:none}.btn.btn-file{position:relative;overflow:hidden}.btn.btn-file>input[type='file']{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;opacity:0;filter:alpha(opacity=0);outline:none;background:white;cursor:inherit;display:block}.btn-default{background-color:#f4f4f4;color:#444;border-color:#ddd}.btn-default:hover,.btn-default:active,.btn-default.hover{background-color:#e7e7e7}.btn-primary{background-color:#3c8dbc;border-color:#367fa9}.btn-primary:hover,.btn-primary:active,.btn-primary.hover{background-color:#367fa9}.btn-success{background-color:#00a65a;border-color:#008d4c}.btn-success:hover,.btn-success:active,.btn-success.hover{background-color:#008d4c}.btn-info{background-color:#00c0ef;border-color:#00acd6}.btn-info:hover,.btn-info:active,.btn-info.hover{background-color:#00acd6}.btn-danger{background-color:#dd4b39;border-color:#d73925}.btn-danger:hover,.btn-danger:active,.btn-danger.hover{background-color:#d73925}.btn-warning{background-color:#f39c12;border-color:#e08e0b}.btn-warning:hover,.btn-warning:active,.btn-warning.hover{background-color:#e08e0b}.btn-outline{border:1px solid #fff;background:transparent;color:#fff}.btn-outline:hover,.btn-outline:focus,.btn-outline:active{color:rgba(255,255,255,0.7);border-color:rgba(255,255,255,0.7)}.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn[class*='bg-']:hover{-webkit-box-shadow:inset 0 0 100px rgba(0,0,0,0.2);box-shadow:inset 0 0 100px rgba(0,0,0,0.2)}.btn-app{border-radius:3px;position:relative;padding:15px 5px;margin:0 0 10px 10px;min-width:80px;height:60px;text-align:center;color:#666;border:1px solid #ddd;background-color:#f4f4f4;font-size:12px}.btn-app>.fa,.btn-app>.glyphicon,.btn-app>.ion{font-size:20px;display:block}.btn-app:hover{background:#f4f4f4;color:#444;border-color:#aaa}.btn-app:active,.btn-app:focus{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-app>.badge{position:absolute;top:-3px;right:-10px;font-size:10px;font-weight:400}.callout{border-radius:3px;margin:0 0 20px 0;padding:15px 30px 15px 15px;border-left:5px solid #eee}.callout a{color:#fff;text-decoration:underline}.callout a:hover{color:#eee}.callout h4{margin-top:0;font-weight:600}.callout p:last-child{margin-bottom:0}.callout code,.callout .highlight{background-color:#fff}.callout.callout-danger{border-color:#c23321}.callout.callout-warning{border-color:#c87f0a}.callout.callout-info{border-color:#0097bc}.callout.callout-success{border-color:#00733e}.alert{border-radius:3px}.alert h4{font-weight:600}.alert .icon{margin-right:10px}.alert .close{color:#000;opacity:.2;filter:alpha(opacity=20)}.alert .close:hover{opacity:.5;filter:alpha(opacity=50)}.alert a{color:#fff;text-decoration:underline}.alert-success{border-color:#008d4c}.alert-danger,.alert-error{border-color:#d73925}.alert-warning{border-color:#e08e0b}.alert-info{border-color:#00acd6}.nav>li>a:hover,.nav>li>a:active,.nav>li>a:focus{color:#444;background:#f7f7f7}.nav-pills>li>a{border-radius:0;border-top:3px solid transparent;color:#444}.nav-pills>li>a>.fa,.nav-pills>li>a>.glyphicon,.nav-pills>li>a>.ion{margin-right:5px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{border-top-color:#3c8dbc}.nav-pills>li.active>a{font-weight:600}.nav-stacked>li>a{border-radius:0;border-top:0;border-left:3px solid transparent;color:#444}.nav-stacked>li.active>a,.nav-stacked>li.active>a:hover{background:transparent;color:#444;border-top:0;border-left-color:#3c8dbc}.nav-stacked>li.header{border-bottom:1px solid #ddd;color:#777;margin-bottom:10px;padding:5px 10px;text-transform:uppercase}.nav-tabs-custom{margin-bottom:20px;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,0.1);border-radius:3px}.nav-tabs-custom>.nav-tabs{margin:0;border-bottom-color:#f4f4f4;border-top-right-radius:3px;border-top-left-radius:3px}.nav-tabs-custom>.nav-tabs>li{border-top:3px solid transparent;margin-bottom:-2px;margin-right:5px}.nav-tabs-custom>.nav-tabs>li>a{color:#444;border-radius:0}.nav-tabs-custom>.nav-tabs>li>a.text-muted{color:#999}.nav-tabs-custom>.nav-tabs>li>a,.nav-tabs-custom>.nav-tabs>li>a:hover{background:transparent;margin:0}.nav-tabs-custom>.nav-tabs>li>a:hover{color:#999}.nav-tabs-custom>.nav-tabs>li:not(.active)>a:hover,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:focus,.nav-tabs-custom>.nav-tabs>li:not(.active)>a:active{border-color:transparent}.nav-tabs-custom>.nav-tabs>li.active{border-top-color:#3c8dbc}.nav-tabs-custom>.nav-tabs>li.active>a,.nav-tabs-custom>.nav-tabs>li.active:hover>a{background-color:#fff;color:#444}.nav-tabs-custom>.nav-tabs>li.active>a{border-top-color:transparent;border-left-color:#f4f4f4;border-right-color:#f4f4f4}.nav-tabs-custom>.nav-tabs>li:first-of-type{margin-left:0}.nav-tabs-custom>.nav-tabs>li:first-of-type.active>a{border-left-color:transparent}.nav-tabs-custom>.nav-tabs.pull-right{float:none !important}.nav-tabs-custom>.nav-tabs.pull-right>li{float:right}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type{margin-right:0}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type>a{border-left-width:1px}.nav-tabs-custom>.nav-tabs.pull-right>li:first-of-type.active>a{border-left-color:#f4f4f4;border-right-color:transparent}.nav-tabs-custom>.nav-tabs>li.header{line-height:35px;padding:0 10px;font-size:20px;color:#444}.nav-tabs-custom>.nav-tabs>li.header>.fa,.nav-tabs-custom>.nav-tabs>li.header>.glyphicon,.nav-tabs-custom>.nav-tabs>li.header>.ion{margin-right:5px}.nav-tabs-custom>.tab-content{background:#fff;padding:10px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.nav-tabs-custom .dropdown.open>a:active,.nav-tabs-custom .dropdown.open>a:focus{background:transparent;color:#999}.nav-tabs-custom.tab-primary>.nav-tabs>li.active{border-top-color:#3c8dbc}.nav-tabs-custom.tab-info>.nav-tabs>li.active{border-top-color:#00c0ef}.nav-tabs-custom.tab-danger>.nav-tabs>li.active{border-top-color:#dd4b39}.nav-tabs-custom.tab-warning>.nav-tabs>li.active{border-top-color:#f39c12}.nav-tabs-custom.tab-success>.nav-tabs>li.active{border-top-color:#00a65a}.nav-tabs-custom.tab-default>.nav-tabs>li.active{border-top-color:#d2d6de}.pagination>li>a{background:#fafafa;color:#666}.pagination.pagination-flat>li>a{border-radius:0 !important}.products-list{list-style:none;margin:0;padding:0}.products-list>.item{border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.1);box-shadow:0 1px 1px rgba(0,0,0,0.1);padding:10px 0;background:#fff}.products-list>.item:before,.products-list>.item:after{content:" ";display:table}.products-list>.item:after{clear:both}.products-list .product-img{float:left}.products-list .product-img img{width:50px;height:50px}.products-list .product-info{margin-left:60px}.products-list .product-title{font-weight:600}.products-list .product-description{display:block;color:#999;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.product-list-in-box>.item{-webkit-box-shadow:none;box-shadow:none;border-radius:0;border-bottom:1px solid #f4f4f4}.product-list-in-box>.item:last-of-type{border-bottom-width:0}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{border-top:1px solid #f4f4f4}.table>thead>tr>th{border-bottom:2px solid #f4f4f4}.table tr td .progress{margin-top:5px}.table-bordered{border:1px solid #f4f4f4}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #f4f4f4}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table.no-border,.table.no-border td,.table.no-border th{border:0}table.text-center,table.text-center td,table.text-center th{text-align:center}.table.align th{text-align:left}.table.align td{text-align:right}.label-default{background-color:#d2d6de;color:#444}.direct-chat .box-body{border-bottom-right-radius:0;border-bottom-left-radius:0;position:relative;overflow-x:hidden;padding:0}.direct-chat.chat-pane-open .direct-chat-contacts{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.direct-chat-messages{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0);padding:10px;height:250px;overflow:auto}.direct-chat-msg,.direct-chat-text{display:block}.direct-chat-msg{margin-bottom:10px}.direct-chat-msg:before,.direct-chat-msg:after{content:" ";display:table}.direct-chat-msg:after{clear:both}.direct-chat-messages,.direct-chat-contacts{-webkit-transition:-webkit-transform .5s ease-in-out;-moz-transition:-moz-transform .5s ease-in-out;-o-transition:-o-transform .5s ease-in-out;transition:transform .5s ease-in-out}.direct-chat-text{border-radius:5px;position:relative;padding:5px 10px;background:#d2d6de;border:1px solid #d2d6de;margin:5px 0 0 50px;color:#444}.direct-chat-text:after,.direct-chat-text:before{position:absolute;right:100%;top:15px;border:solid transparent;border-right-color:#d2d6de;content:' ';height:0;width:0;pointer-events:none}.direct-chat-text:after{border-width:5px;margin-top:-5px}.direct-chat-text:before{border-width:6px;margin-top:-6px}.right .direct-chat-text{margin-right:50px;margin-left:0}.right .direct-chat-text:after,.right .direct-chat-text:before{right:auto;left:100%;border-right-color:transparent;border-left-color:#d2d6de}.direct-chat-img{border-radius:50%;float:left;width:40px;height:40px}.right .direct-chat-img{float:right}.direct-chat-info{display:block;margin-bottom:2px;font-size:12px}.direct-chat-name{font-weight:600}.direct-chat-timestamp{color:#999}.direct-chat-contacts-open .direct-chat-contacts{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.direct-chat-contacts{-webkit-transform:translate(101%, 0);-ms-transform:translate(101%, 0);-o-transform:translate(101%, 0);transform:translate(101%, 0);position:absolute;top:0;bottom:0;height:250px;width:100%;background:#222d32;color:#fff;overflow:auto}.contacts-list>li{border-bottom:1px solid rgba(0,0,0,0.2);padding:10px;margin:0}.contacts-list>li:before,.contacts-list>li:after{content:" ";display:table}.contacts-list>li:after{clear:both}.contacts-list>li:last-of-type{border-bottom:none}.contacts-list-img{border-radius:50%;width:40px;float:left}.contacts-list-info{margin-left:45px;color:#fff}.contacts-list-name,.contacts-list-status{display:block}.contacts-list-name{font-weight:600}.contacts-list-status{font-size:12px}.contacts-list-date{color:#aaa;font-weight:normal}.contacts-list-msg{color:#999}.direct-chat-danger .right>.direct-chat-text{background:#dd4b39;border-color:#dd4b39;color:#fff}.direct-chat-danger .right>.direct-chat-text:after,.direct-chat-danger .right>.direct-chat-text:before{border-left-color:#dd4b39}.direct-chat-primary .right>.direct-chat-text{background:#3c8dbc;border-color:#3c8dbc;color:#fff}.direct-chat-primary .right>.direct-chat-text:after,.direct-chat-primary .right>.direct-chat-text:before{border-left-color:#3c8dbc}.direct-chat-warning .right>.direct-chat-text{background:#f39c12;border-color:#f39c12;color:#fff}.direct-chat-warning .right>.direct-chat-text:after,.direct-chat-warning .right>.direct-chat-text:before{border-left-color:#f39c12}.direct-chat-info .right>.direct-chat-text{background:#00c0ef;border-color:#00c0ef;color:#fff}.direct-chat-info .right>.direct-chat-text:after,.direct-chat-info .right>.direct-chat-text:before{border-left-color:#00c0ef}.direct-chat-success .right>.direct-chat-text{background:#00a65a;border-color:#00a65a;color:#fff}.direct-chat-success .right>.direct-chat-text:after,.direct-chat-success .right>.direct-chat-text:before{border-left-color:#00a65a}.users-list>li{width:25%;float:left;padding:10px;text-align:center}.users-list>li img{border-radius:50%;max-width:100%;height:auto}.users-list>li>a:hover,.users-list>li>a:hover .users-list-name{color:#999}.users-list-name,.users-list-date{display:block}.users-list-name{font-weight:600;color:#444;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.users-list-date{color:#999;font-size:12px}.carousel-control.left,.carousel-control.right{background-image:none}.carousel-control>.fa{font-size:40px;position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-20px}.modal{background:rgba(0,0,0,0.3)}.modal-content{border-radius:0;-webkit-box-shadow:0 2px 3px rgba(0,0,0,0.125);box-shadow:0 2px 3px rgba(0,0,0,0.125);border:0}@media (min-width:768px){.modal-content{-webkit-box-shadow:0 2px 3px rgba(0,0,0,0.125);box-shadow:0 2px 3px rgba(0,0,0,0.125)}}.modal-header{border-bottom-color:#f4f4f4}.modal-footer{border-top-color:#f4f4f4}.modal-primary .modal-header,.modal-primary .modal-footer{border-color:#307095}.modal-warning .modal-header,.modal-warning .modal-footer{border-color:#c87f0a}.modal-info .modal-header,.modal-info .modal-footer{border-color:#0097bc}.modal-success .modal-header,.modal-success .modal-footer{border-color:#00733e}.modal-danger .modal-header,.modal-danger .modal-footer{border-color:#c23321}.box-widget{border:none;position:relative}.widget-user .widget-user-header{padding:20px;height:120px;border-top-right-radius:3px;border-top-left-radius:3px}.widget-user .widget-user-username{margin-top:0;margin-bottom:5px;font-size:25px;font-weight:300;text-shadow:0 1px 1px rgba(0,0,0,0.2)}.widget-user .widget-user-desc{margin-top:0}.widget-user .widget-user-image{position:absolute;top:65px;left:50%;margin-left:-45px}.widget-user .widget-user-image>img{width:90px;height:auto;border:3px solid #fff}.widget-user .box-footer{padding-top:30px}.widget-user-2 .widget-user-header{padding:20px;border-top-right-radius:3px;border-top-left-radius:3px}.widget-user-2 .widget-user-username{margin-top:5px;margin-bottom:5px;font-size:25px;font-weight:300}.widget-user-2 .widget-user-desc{margin-top:0}.widget-user-2 .widget-user-username,.widget-user-2 .widget-user-desc{margin-left:75px}.widget-user-2 .widget-user-image>img{width:65px;height:auto;float:left}.mailbox-messages>.table{margin:0}.mailbox-controls{padding:5px}.mailbox-controls.with-border{border-bottom:1px solid #f4f4f4}.mailbox-read-info{border-bottom:1px solid #f4f4f4;padding:10px}.mailbox-read-info h3{font-size:20px;margin:0}.mailbox-read-info h5{margin:0;padding:5px 0 0 0}.mailbox-read-time{color:#999;font-size:13px}.mailbox-read-message{padding:10px}.mailbox-attachments li{float:left;width:200px;border:1px solid #eee;margin-bottom:10px;margin-right:10px}.mailbox-attachment-name{font-weight:bold;color:#666}.mailbox-attachment-icon,.mailbox-attachment-info,.mailbox-attachment-size{display:block}.mailbox-attachment-info{padding:10px;background:#f4f4f4}.mailbox-attachment-size{color:#999;font-size:12px}.mailbox-attachment-icon{text-align:center;font-size:65px;color:#666;padding:20px 10px}.mailbox-attachment-icon.has-img{padding:0}.mailbox-attachment-icon.has-img>img{max-width:100%;height:auto}.lockscreen{background:#d2d6de}.lockscreen-logo{font-size:35px;text-align:center;margin-bottom:25px;font-weight:300}.lockscreen-logo a{color:#444}.lockscreen-wrapper{max-width:400px;margin:0 auto;margin-top:10%}.lockscreen .lockscreen-name{text-align:center;font-weight:600}.lockscreen-item{border-radius:4px;padding:0;background:#fff;position:relative;margin:10px auto 30px auto;width:290px}.lockscreen-image{border-radius:50%;position:absolute;left:-10px;top:-25px;background:#fff;padding:5px;z-index:10}.lockscreen-image>img{border-radius:50%;width:70px;height:70px}.lockscreen-credentials{margin-left:70px}.lockscreen-credentials .form-control{border:0}.lockscreen-credentials .btn{background-color:#fff;border:0;padding:0 10px}.lockscreen-footer{margin-top:10px}.login-logo,.register-logo{font-size:35px;text-align:center;margin-bottom:25px;font-weight:300}.login-logo a,.register-logo a{color:#444}.login-page,.register-page{background:#d2d6de}.login-box,.register-box{width:360px;margin:7% auto}@media (max-width:768px){.login-box,.register-box{width:90%;margin-top:20px}}.login-box-body,.register-box-body{background:#fff;padding:20px;border-top:0;color:#666}.login-box-body .form-control-feedback,.register-box-body .form-control-feedback{color:#777}.login-box-msg,.register-box-msg{margin:0;text-align:center;padding:0 20px 20px 20px}.social-auth-links{margin:10px 0}.error-page{width:600px;margin:20px auto 0 auto}@media (max-width:991px){.error-page{width:100%}}.error-page>.headline{float:left;font-size:100px;font-weight:300}@media (max-width:991px){.error-page>.headline{float:none;text-align:center}}.error-page>.error-content{margin-left:190px;display:block}@media (max-width:991px){.error-page>.error-content{margin-left:0}}.error-page>.error-content>h3{font-weight:300;font-size:25px}@media (max-width:991px){.error-page>.error-content>h3{text-align:center}}.invoice{position:relative;background:#fff;border:1px solid #f4f4f4;padding:20px;margin:10px 25px}.invoice-title{margin-top:0}.profile-user-img{margin:0 auto;width:100px;padding:3px;border:3px solid #d2d6de}.profile-username{font-size:21px;margin-top:5px}.post{border-bottom:1px solid #d2d6de;margin-bottom:15px;padding-bottom:15px;color:#666}.post:last-of-type{border-bottom:0;margin-bottom:0;padding-bottom:0}.post .user-block{margin-bottom:15px}.btn-social{position:relative;padding-left:44px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn-social>:first-child{position:absolute;left:0;top:0;bottom:0;width:32px;line-height:34px;font-size:1.6em;text-align:center;border-right:1px solid rgba(0,0,0,0.2)}.btn-social.btn-lg{padding-left:61px}.btn-social.btn-lg>:first-child{line-height:45px;width:45px;font-size:1.8em}.btn-social.btn-sm{padding-left:38px}.btn-social.btn-sm>:first-child{line-height:28px;width:28px;font-size:1.4em}.btn-social.btn-xs{padding-left:30px}.btn-social.btn-xs>:first-child{line-height:20px;width:20px;font-size:1.2em}.btn-social-icon{position:relative;padding-left:44px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:34px;width:34px;padding:0}.btn-social-icon>:first-child{position:absolute;left:0;top:0;bottom:0;width:32px;line-height:34px;font-size:1.6em;text-align:center;border-right:1px solid rgba(0,0,0,0.2)}.btn-social-icon.btn-lg{padding-left:61px}.btn-social-icon.btn-lg>:first-child{line-height:45px;width:45px;font-size:1.8em}.btn-social-icon.btn-sm{padding-left:38px}.btn-social-icon.btn-sm>:first-child{line-height:28px;width:28px;font-size:1.4em}.btn-social-icon.btn-xs{padding-left:30px}.btn-social-icon.btn-xs>:first-child{line-height:20px;width:20px;font-size:1.2em}.btn-social-icon>:first-child{border:none;text-align:center;width:100%}.btn-social-icon.btn-lg{height:45px;width:45px;padding-left:0;padding-right:0}.btn-social-icon.btn-sm{height:30px;width:30px;padding-left:0;padding-right:0}.btn-social-icon.btn-xs{height:22px;width:22px;padding-left:0;padding-right:0}.btn-adn{color:#fff;background-color:#d87a68;border-color:rgba(0,0,0,0.2)}.btn-adn:focus,.btn-adn.focus{color:#fff;background-color:#ce563f;border-color:rgba(0,0,0,0.2)}.btn-adn:hover{color:#fff;background-color:#ce563f;border-color:rgba(0,0,0,0.2)}.btn-adn:active,.btn-adn.active,.open>.dropdown-toggle.btn-adn{color:#fff;background-color:#ce563f;border-color:rgba(0,0,0,0.2)}.btn-adn:active,.btn-adn.active,.open>.dropdown-toggle.btn-adn{background-image:none}.btn-adn .badge{color:#d87a68;background-color:#fff}.btn-bitbucket{color:#fff;background-color:#205081;border-color:rgba(0,0,0,0.2)}.btn-bitbucket:focus,.btn-bitbucket.focus{color:#fff;background-color:#163758;border-color:rgba(0,0,0,0.2)}.btn-bitbucket:hover{color:#fff;background-color:#163758;border-color:rgba(0,0,0,0.2)}.btn-bitbucket:active,.btn-bitbucket.active,.open>.dropdown-toggle.btn-bitbucket{color:#fff;background-color:#163758;border-color:rgba(0,0,0,0.2)}.btn-bitbucket:active,.btn-bitbucket.active,.open>.dropdown-toggle.btn-bitbucket{background-image:none}.btn-bitbucket .badge{color:#205081;background-color:#fff}.btn-dropbox{color:#fff;background-color:#1087dd;border-color:rgba(0,0,0,0.2)}.btn-dropbox:focus,.btn-dropbox.focus{color:#fff;background-color:#0d6aad;border-color:rgba(0,0,0,0.2)}.btn-dropbox:hover{color:#fff;background-color:#0d6aad;border-color:rgba(0,0,0,0.2)}.btn-dropbox:active,.btn-dropbox.active,.open>.dropdown-toggle.btn-dropbox{color:#fff;background-color:#0d6aad;border-color:rgba(0,0,0,0.2)}.btn-dropbox:active,.btn-dropbox.active,.open>.dropdown-toggle.btn-dropbox{background-image:none}.btn-dropbox .badge{color:#1087dd;background-color:#fff}.btn-facebook{color:#fff;background-color:#3b5998;border-color:rgba(0,0,0,0.2)}.btn-facebook:focus,.btn-facebook.focus{color:#fff;background-color:#2d4373;border-color:rgba(0,0,0,0.2)}.btn-facebook:hover{color:#fff;background-color:#2d4373;border-color:rgba(0,0,0,0.2)}.btn-facebook:active,.btn-facebook.active,.open>.dropdown-toggle.btn-facebook{color:#fff;background-color:#2d4373;border-color:rgba(0,0,0,0.2)}.btn-facebook:active,.btn-facebook.active,.open>.dropdown-toggle.btn-facebook{background-image:none}.btn-facebook .badge{color:#3b5998;background-color:#fff}.btn-flickr{color:#fff;background-color:#ff0084;border-color:rgba(0,0,0,0.2)}.btn-flickr:focus,.btn-flickr.focus{color:#fff;background-color:#cc006a;border-color:rgba(0,0,0,0.2)}.btn-flickr:hover{color:#fff;background-color:#cc006a;border-color:rgba(0,0,0,0.2)}.btn-flickr:active,.btn-flickr.active,.open>.dropdown-toggle.btn-flickr{color:#fff;background-color:#cc006a;border-color:rgba(0,0,0,0.2)}.btn-flickr:active,.btn-flickr.active,.open>.dropdown-toggle.btn-flickr{background-image:none}.btn-flickr .badge{color:#ff0084;background-color:#fff}.btn-foursquare{color:#fff;background-color:#f94877;border-color:rgba(0,0,0,0.2)}.btn-foursquare:focus,.btn-foursquare.focus{color:#fff;background-color:#f71752;border-color:rgba(0,0,0,0.2)}.btn-foursquare:hover{color:#fff;background-color:#f71752;border-color:rgba(0,0,0,0.2)}.btn-foursquare:active,.btn-foursquare.active,.open>.dropdown-toggle.btn-foursquare{color:#fff;background-color:#f71752;border-color:rgba(0,0,0,0.2)}.btn-foursquare:active,.btn-foursquare.active,.open>.dropdown-toggle.btn-foursquare{background-image:none}.btn-foursquare .badge{color:#f94877;background-color:#fff}.btn-github{color:#fff;background-color:#444;border-color:rgba(0,0,0,0.2)}.btn-github:focus,.btn-github.focus{color:#fff;background-color:#2b2b2b;border-color:rgba(0,0,0,0.2)}.btn-github:hover{color:#fff;background-color:#2b2b2b;border-color:rgba(0,0,0,0.2)}.btn-github:active,.btn-github.active,.open>.dropdown-toggle.btn-github{color:#fff;background-color:#2b2b2b;border-color:rgba(0,0,0,0.2)}.btn-github:active,.btn-github.active,.open>.dropdown-toggle.btn-github{background-image:none}.btn-github .badge{color:#444;background-color:#fff}.btn-google{color:#fff;background-color:#dd4b39;border-color:rgba(0,0,0,0.2)}.btn-google:focus,.btn-google.focus{color:#fff;background-color:#c23321;border-color:rgba(0,0,0,0.2)}.btn-google:hover{color:#fff;background-color:#c23321;border-color:rgba(0,0,0,0.2)}.btn-google:active,.btn-google.active,.open>.dropdown-toggle.btn-google{color:#fff;background-color:#c23321;border-color:rgba(0,0,0,0.2)}.btn-google:active,.btn-google.active,.open>.dropdown-toggle.btn-google{background-image:none}.btn-google .badge{color:#dd4b39;background-color:#fff}.btn-instagram{color:#fff;background-color:#3f729b;border-color:rgba(0,0,0,0.2)}.btn-instagram:focus,.btn-instagram.focus{color:#fff;background-color:#305777;border-color:rgba(0,0,0,0.2)}.btn-instagram:hover{color:#fff;background-color:#305777;border-color:rgba(0,0,0,0.2)}.btn-instagram:active,.btn-instagram.active,.open>.dropdown-toggle.btn-instagram{color:#fff;background-color:#305777;border-color:rgba(0,0,0,0.2)}.btn-instagram:active,.btn-instagram.active,.open>.dropdown-toggle.btn-instagram{background-image:none}.btn-instagram .badge{color:#3f729b;background-color:#fff}.btn-linkedin{color:#fff;background-color:#007bb6;border-color:rgba(0,0,0,0.2)}.btn-linkedin:focus,.btn-linkedin.focus{color:#fff;background-color:#005983;border-color:rgba(0,0,0,0.2)}.btn-linkedin:hover{color:#fff;background-color:#005983;border-color:rgba(0,0,0,0.2)}.btn-linkedin:active,.btn-linkedin.active,.open>.dropdown-toggle.btn-linkedin{color:#fff;background-color:#005983;border-color:rgba(0,0,0,0.2)}.btn-linkedin:active,.btn-linkedin.active,.open>.dropdown-toggle.btn-linkedin{background-image:none}.btn-linkedin .badge{color:#007bb6;background-color:#fff}.btn-microsoft{color:#fff;background-color:#2672ec;border-color:rgba(0,0,0,0.2)}.btn-microsoft:focus,.btn-microsoft.focus{color:#fff;background-color:#125acd;border-color:rgba(0,0,0,0.2)}.btn-microsoft:hover{color:#fff;background-color:#125acd;border-color:rgba(0,0,0,0.2)}.btn-microsoft:active,.btn-microsoft.active,.open>.dropdown-toggle.btn-microsoft{color:#fff;background-color:#125acd;border-color:rgba(0,0,0,0.2)}.btn-microsoft:active,.btn-microsoft.active,.open>.dropdown-toggle.btn-microsoft{background-image:none}.btn-microsoft .badge{color:#2672ec;background-color:#fff}.btn-openid{color:#fff;background-color:#f7931e;border-color:rgba(0,0,0,0.2)}.btn-openid:focus,.btn-openid.focus{color:#fff;background-color:#da7908;border-color:rgba(0,0,0,0.2)}.btn-openid:hover{color:#fff;background-color:#da7908;border-color:rgba(0,0,0,0.2)}.btn-openid:active,.btn-openid.active,.open>.dropdown-toggle.btn-openid{color:#fff;background-color:#da7908;border-color:rgba(0,0,0,0.2)}.btn-openid:active,.btn-openid.active,.open>.dropdown-toggle.btn-openid{background-image:none}.btn-openid .badge{color:#f7931e;background-color:#fff}.btn-pinterest{color:#fff;background-color:#cb2027;border-color:rgba(0,0,0,0.2)}.btn-pinterest:focus,.btn-pinterest.focus{color:#fff;background-color:#9f191f;border-color:rgba(0,0,0,0.2)}.btn-pinterest:hover{color:#fff;background-color:#9f191f;border-color:rgba(0,0,0,0.2)}.btn-pinterest:active,.btn-pinterest.active,.open>.dropdown-toggle.btn-pinterest{color:#fff;background-color:#9f191f;border-color:rgba(0,0,0,0.2)}.btn-pinterest:active,.btn-pinterest.active,.open>.dropdown-toggle.btn-pinterest{background-image:none}.btn-pinterest .badge{color:#cb2027;background-color:#fff}.btn-reddit{color:#000;background-color:#eff7ff;border-color:rgba(0,0,0,0.2)}.btn-reddit:focus,.btn-reddit.focus{color:#000;background-color:#bcddff;border-color:rgba(0,0,0,0.2)}.btn-reddit:hover{color:#000;background-color:#bcddff;border-color:rgba(0,0,0,0.2)}.btn-reddit:active,.btn-reddit.active,.open>.dropdown-toggle.btn-reddit{color:#000;background-color:#bcddff;border-color:rgba(0,0,0,0.2)}.btn-reddit:active,.btn-reddit.active,.open>.dropdown-toggle.btn-reddit{background-image:none}.btn-reddit .badge{color:#eff7ff;background-color:#000}.btn-soundcloud{color:#fff;background-color:#f50;border-color:rgba(0,0,0,0.2)}.btn-soundcloud:focus,.btn-soundcloud.focus{color:#fff;background-color:#c40;border-color:rgba(0,0,0,0.2)}.btn-soundcloud:hover{color:#fff;background-color:#c40;border-color:rgba(0,0,0,0.2)}.btn-soundcloud:active,.btn-soundcloud.active,.open>.dropdown-toggle.btn-soundcloud{color:#fff;background-color:#c40;border-color:rgba(0,0,0,0.2)}.btn-soundcloud:active,.btn-soundcloud.active,.open>.dropdown-toggle.btn-soundcloud{background-image:none}.btn-soundcloud .badge{color:#f50;background-color:#fff}.btn-tumblr{color:#fff;background-color:#2c4762;border-color:rgba(0,0,0,0.2)}.btn-tumblr:focus,.btn-tumblr.focus{color:#fff;background-color:#1c2d3f;border-color:rgba(0,0,0,0.2)}.btn-tumblr:hover{color:#fff;background-color:#1c2d3f;border-color:rgba(0,0,0,0.2)}.btn-tumblr:active,.btn-tumblr.active,.open>.dropdown-toggle.btn-tumblr{color:#fff;background-color:#1c2d3f;border-color:rgba(0,0,0,0.2)}.btn-tumblr:active,.btn-tumblr.active,.open>.dropdown-toggle.btn-tumblr{background-image:none}.btn-tumblr .badge{color:#2c4762;background-color:#fff}.btn-twitter{color:#fff;background-color:#55acee;border-color:rgba(0,0,0,0.2)}.btn-twitter:focus,.btn-twitter.focus{color:#fff;background-color:#2795e9;border-color:rgba(0,0,0,0.2)}.btn-twitter:hover{color:#fff;background-color:#2795e9;border-color:rgba(0,0,0,0.2)}.btn-twitter:active,.btn-twitter.active,.open>.dropdown-toggle.btn-twitter{color:#fff;background-color:#2795e9;border-color:rgba(0,0,0,0.2)}.btn-twitter:active,.btn-twitter.active,.open>.dropdown-toggle.btn-twitter{background-image:none}.btn-twitter .badge{color:#55acee;background-color:#fff}.btn-vimeo{color:#fff;background-color:#1ab7ea;border-color:rgba(0,0,0,0.2)}.btn-vimeo:focus,.btn-vimeo.focus{color:#fff;background-color:#1295bf;border-color:rgba(0,0,0,0.2)}.btn-vimeo:hover{color:#fff;background-color:#1295bf;border-color:rgba(0,0,0,0.2)}.btn-vimeo:active,.btn-vimeo.active,.open>.dropdown-toggle.btn-vimeo{color:#fff;background-color:#1295bf;border-color:rgba(0,0,0,0.2)}.btn-vimeo:active,.btn-vimeo.active,.open>.dropdown-toggle.btn-vimeo{background-image:none}.btn-vimeo .badge{color:#1ab7ea;background-color:#fff}.btn-vk{color:#fff;background-color:#587ea3;border-color:rgba(0,0,0,0.2)}.btn-vk:focus,.btn-vk.focus{color:#fff;background-color:#466482;border-color:rgba(0,0,0,0.2)}.btn-vk:hover{color:#fff;background-color:#466482;border-color:rgba(0,0,0,0.2)}.btn-vk:active,.btn-vk.active,.open>.dropdown-toggle.btn-vk{color:#fff;background-color:#466482;border-color:rgba(0,0,0,0.2)}.btn-vk:active,.btn-vk.active,.open>.dropdown-toggle.btn-vk{background-image:none}.btn-vk .badge{color:#587ea3;background-color:#fff}.btn-yahoo{color:#fff;background-color:#720e9e;border-color:rgba(0,0,0,0.2)}.btn-yahoo:focus,.btn-yahoo.focus{color:#fff;background-color:#500a6f;border-color:rgba(0,0,0,0.2)}.btn-yahoo:hover{color:#fff;background-color:#500a6f;border-color:rgba(0,0,0,0.2)}.btn-yahoo:active,.btn-yahoo.active,.open>.dropdown-toggle.btn-yahoo{color:#fff;background-color:#500a6f;border-color:rgba(0,0,0,0.2)}.btn-yahoo:active,.btn-yahoo.active,.open>.dropdown-toggle.btn-yahoo{background-image:none}.btn-yahoo .badge{color:#720e9e;background-color:#fff}.fc-button{background:#f4f4f4;background-image:none;color:#444;border-color:#ddd;border-bottom-color:#ddd}.fc-button:hover,.fc-button:active,.fc-button.hover{background-color:#e9e9e9}.fc-header-title h2{font-size:15px;line-height:1.6em;color:#666;margin-left:10px}.fc-header-right{padding-right:10px}.fc-header-left{padding-left:10px}.fc-widget-header{background:#fafafa}.fc-grid{width:100%;border:0}.fc-widget-header:first-of-type,.fc-widget-content:first-of-type{border-left:0;border-right:0}.fc-widget-header:last-of-type,.fc-widget-content:last-of-type{border-right:0}.fc-toolbar{padding:10px;margin:0}.fc-day-number{font-size:20px;font-weight:300;padding-right:10px}.fc-color-picker{list-style:none;margin:0;padding:0}.fc-color-picker>li{float:left;font-size:30px;margin-right:5px;line-height:30px}.fc-color-picker>li .fa{-webkit-transition:-webkit-transform linear .3s;-moz-transition:-moz-transform linear .3s;-o-transition:-o-transform linear .3s;transition:transform linear .3s}.fc-color-picker>li .fa:hover{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);-o-transform:rotate(30deg);transform:rotate(30deg)}#add-new-event{-webkit-transition:all linear .3s;-o-transition:all linear .3s;transition:all linear .3s}.external-event{padding:5px 10px;font-weight:bold;margin-bottom:4px;box-shadow:0 1px 1px rgba(0,0,0,0.1);text-shadow:0 1px 1px rgba(0,0,0,0.1);border-radius:3px;cursor:move}.external-event:hover{box-shadow:inset 0 0 90px rgba(0,0,0,0.2)}.select2-container--default.select2-container--focus,.select2-selection.select2-container--focus,.select2-container--default:focus,.select2-selection:focus,.select2-container--default:active,.select2-selection:active{outline:none}.select2-container--default .select2-selection--single,.select2-selection .select2-selection--single{border:1px solid #d2d6de;border-radius:0;padding:6px 12px;height:34px}.select2-container--default.select2-container--open{border-color:#3c8dbc}.select2-dropdown{border:1px solid #d2d6de;border-radius:0}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#3c8dbc;color:white}.select2-results__option{padding:6px 12px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{padding-left:0;padding-right:0;height:auto;margin-top:-4px}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:6px;padding-left:20px}.select2-container--default .select2-selection--single .select2-selection__arrow{height:28px;right:3px}.select2-container--default .select2-selection--single .select2-selection__arrow b{margin-top:0}.select2-dropdown .select2-search__field,.select2-search--inline .select2-search__field{border:1px solid #d2d6de}.select2-dropdown .select2-search__field:focus,.select2-search--inline .select2-search__field:focus{outline:none;border:1px solid #3c8dbc}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option[aria-selected=true],.select2-container--default .select2-results__option[aria-selected=true]:hover{color:#444}.select2-container--default .select2-selection--multiple{border:1px solid #d2d6de;border-radius:0}.select2-container--default .select2-selection--multiple:focus{border-color:#3c8dbc}.select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#d2d6de}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#3c8dbc;border-color:#367fa9;padding:1px 10px;color:#fff}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{margin-right:5px;color:rgba(255,255,255,0.7)}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#fff}.select2-container .select2-selection--single .select2-selection__rendered{padding-right:10px}.pad{padding:10px}.margin{margin:10px}.margin-bottom{margin-bottom:20px}.margin-bottom-none{margin-bottom:0}.margin-r-5{margin-right:5px}.inline{display:inline}.description-block{display:block;margin:10px 0;text-align:center}.description-block.margin-bottom{margin-bottom:25px}.description-block>.description-header{margin:0;padding:0;font-weight:600;font-size:16px}.description-block>.description-text{text-transform:uppercase}.bg-red,.bg-yellow,.bg-aqua,.bg-blue,.bg-light-blue,.bg-green,.bg-navy,.bg-teal,.bg-olive,.bg-lime,.bg-orange,.bg-fuchsia,.bg-purple,.bg-maroon,.bg-black,.bg-red-active,.bg-yellow-active,.bg-aqua-active,.bg-blue-active,.bg-light-blue-active,.bg-green-active,.bg-navy-active,.bg-teal-active,.bg-olive-active,.bg-lime-active,.bg-orange-active,.bg-fuchsia-active,.bg-purple-active,.bg-maroon-active,.bg-black-active,.callout.callout-danger,.callout.callout-warning,.callout.callout-info,.callout.callout-success,.alert-success,.alert-danger,.alert-error,.alert-warning,.alert-info,.label-danger,.label-info,.label-warning,.label-primary,.label-success,.modal-primary .modal-body,.modal-primary .modal-header,.modal-primary .modal-footer,.modal-warning .modal-body,.modal-warning .modal-header,.modal-warning .modal-footer,.modal-info .modal-body,.modal-info .modal-header,.modal-info .modal-footer,.modal-success .modal-body,.modal-success .modal-header,.modal-success .modal-footer,.modal-danger .modal-body,.modal-danger .modal-header,.modal-danger .modal-footer{color:#fff !important}.bg-gray{color:#000;background-color:#d2d6de !important}.bg-gray-light{background-color:#f7f7f7}.bg-black{background-color:#111 !important}.bg-red,.callout.callout-danger,.alert-danger,.alert-error,.label-danger,.modal-danger .modal-body{background-color:#dd4b39 !important}.bg-yellow,.callout.callout-warning,.alert-warning,.label-warning,.modal-warning .modal-body{background-color:#f39c12 !important}.bg-aqua,.callout.callout-info,.alert-info,.label-info,.modal-info .modal-body{background-color:#00c0ef !important}.bg-blue{background-color:#0073b7 !important}.bg-light-blue,.label-primary,.modal-primary .modal-body{background-color:#3c8dbc !important}.bg-green,.callout.callout-success,.alert-success,.label-success,.modal-success .modal-body{background-color:#00a65a !important}.bg-navy{background-color:#001f3f !important}.bg-teal{background-color:#39cccc !important}.bg-olive{background-color:#3d9970 !important}.bg-lime{background-color:#01ff70 !important}.bg-orange{background-color:#ff851b !important}.bg-fuchsia{background-color:#f012be !important}.bg-purple{background-color:#605ca8 !important}.bg-maroon{background-color:#d81b60 !important}.bg-gray-active{color:#000;background-color:#b5bbc8 !important}.bg-black-active{background-color:#000 !important}.bg-red-active,.modal-danger .modal-header,.modal-danger .modal-footer{background-color:#d33724 !important}.bg-yellow-active,.modal-warning .modal-header,.modal-warning .modal-footer{background-color:#db8b0b !important}.bg-aqua-active,.modal-info .modal-header,.modal-info .modal-footer{background-color:#00a7d0 !important}.bg-blue-active{background-color:#005384 !important}.bg-light-blue-active,.modal-primary .modal-header,.modal-primary .modal-footer{background-color:#357ca5 !important}.bg-green-active,.modal-success .modal-header,.modal-success .modal-footer{background-color:#008d4c !important}.bg-navy-active{background-color:#001a35 !important}.bg-teal-active{background-color:#30bbbb !important}.bg-olive-active{background-color:#368763 !important}.bg-lime-active{background-color:#00e765 !important}.bg-orange-active{background-color:#ff7701 !important}.bg-fuchsia-active{background-color:#db0ead !important}.bg-purple-active{background-color:#555299 !important}.bg-maroon-active{background-color:#ca195a !important}[class^="bg-"].disabled{opacity:.65;filter:alpha(opacity=65)}.text-red{color:#dd4b39 !important}.text-yellow{color:#f39c12 !important}.text-aqua{color:#00c0ef !important}.text-blue{color:#0073b7 !important}.text-black{color:#111 !important}.text-light-blue{color:#3c8dbc !important}.text-green{color:#00a65a !important}.text-gray{color:#d2d6de !important}.text-navy{color:#001f3f !important}.text-teal{color:#39cccc !important}.text-olive{color:#3d9970 !important}.text-lime{color:#01ff70 !important}.text-orange{color:#ff851b !important}.text-fuchsia{color:#f012be !important}.text-purple{color:#605ca8 !important}.text-maroon{color:#d81b60 !important}.link-muted{color:#7a869d}.link-muted:hover,.link-muted:focus{color:#606c84}.link-black{color:#666}.link-black:hover,.link-black:focus{color:#999}.hide{display:none !important}.no-border{border:0 !important}.no-padding{padding:0 !important}.no-margin{margin:0 !important}.no-shadow{box-shadow:none !important}.list-unstyled,.chart-legend,.contacts-list,.users-list,.mailbox-attachments{list-style:none;margin:0;padding:0}.list-group-unbordered>.list-group-item{border-left:0;border-right:0;border-radius:0;padding-left:0;padding-right:0}.flat{border-radius:0 !important}.text-bold,.text-bold.table td,.text-bold.table th{font-weight:700}.text-sm{font-size:12px}.jqstooltip{padding:5px !important;width:auto !important;height:auto !important}.bg-teal-gradient{background:#39cccc !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #39cccc), color-stop(1, #7adddd)) !important;background:-ms-linear-gradient(bottom, #39cccc, #7adddd) !important;background:-moz-linear-gradient(center bottom, #39cccc 0, #7adddd 100%) !important;background:-o-linear-gradient(#7adddd, #39cccc) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7adddd', endColorstr='#39cccc', GradientType=0) !important;color:#fff}.bg-light-blue-gradient{background:#3c8dbc !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #3c8dbc), color-stop(1, #67a8ce)) !important;background:-ms-linear-gradient(bottom, #3c8dbc, #67a8ce) !important;background:-moz-linear-gradient(center bottom, #3c8dbc 0, #67a8ce 100%) !important;background:-o-linear-gradient(#67a8ce, #3c8dbc) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#67a8ce', endColorstr='#3c8dbc', GradientType=0) !important;color:#fff}.bg-blue-gradient{background:#0073b7 !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #0073b7), color-stop(1, #0089db)) !important;background:-ms-linear-gradient(bottom, #0073b7, #0089db) !important;background:-moz-linear-gradient(center bottom, #0073b7 0, #0089db 100%) !important;background:-o-linear-gradient(#0089db, #0073b7) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0089db', endColorstr='#0073b7', GradientType=0) !important;color:#fff}.bg-aqua-gradient{background:#00c0ef !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #00c0ef), color-stop(1, #14d1ff)) !important;background:-ms-linear-gradient(bottom, #00c0ef, #14d1ff) !important;background:-moz-linear-gradient(center bottom, #00c0ef 0, #14d1ff 100%) !important;background:-o-linear-gradient(#14d1ff, #00c0ef) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#14d1ff', endColorstr='#00c0ef', GradientType=0) !important;color:#fff}.bg-yellow-gradient{background:#f39c12 !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #f39c12), color-stop(1, #f7bc60)) !important;background:-ms-linear-gradient(bottom, #f39c12, #f7bc60) !important;background:-moz-linear-gradient(center bottom, #f39c12 0, #f7bc60 100%) !important;background:-o-linear-gradient(#f7bc60, #f39c12) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7bc60', endColorstr='#f39c12', GradientType=0) !important;color:#fff}.bg-purple-gradient{background:#605ca8 !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #605ca8), color-stop(1, #9491c4)) !important;background:-ms-linear-gradient(bottom, #605ca8, #9491c4) !important;background:-moz-linear-gradient(center bottom, #605ca8 0, #9491c4 100%) !important;background:-o-linear-gradient(#9491c4, #605ca8) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#9491c4', endColorstr='#605ca8', GradientType=0) !important;color:#fff}.bg-green-gradient{background:#00a65a !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #00a65a), color-stop(1, #00ca6d)) !important;background:-ms-linear-gradient(bottom, #00a65a, #00ca6d) !important;background:-moz-linear-gradient(center bottom, #00a65a 0, #00ca6d 100%) !important;background:-o-linear-gradient(#00ca6d, #00a65a) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ca6d', endColorstr='#00a65a', GradientType=0) !important;color:#fff}.bg-red-gradient{background:#dd4b39 !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #dd4b39), color-stop(1, #e47365)) !important;background:-ms-linear-gradient(bottom, #dd4b39, #e47365) !important;background:-moz-linear-gradient(center bottom, #dd4b39 0, #e47365 100%) !important;background:-o-linear-gradient(#e47365, #dd4b39) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e47365', endColorstr='#dd4b39', GradientType=0) !important;color:#fff}.bg-black-gradient{background:#111 !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #111), color-stop(1, #2b2b2b)) !important;background:-ms-linear-gradient(bottom, #111, #2b2b2b) !important;background:-moz-linear-gradient(center bottom, #111 0, #2b2b2b 100%) !important;background:-o-linear-gradient(#2b2b2b, #111) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2b2b2b', endColorstr='#111111', GradientType=0) !important;color:#fff}.bg-maroon-gradient{background:#d81b60 !important;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #d81b60), color-stop(1, #e73f7c)) !important;background:-ms-linear-gradient(bottom, #d81b60, #e73f7c) !important;background:-moz-linear-gradient(center bottom, #d81b60 0, #e73f7c 100%) !important;background:-o-linear-gradient(#e73f7c, #d81b60) !important;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e73f7c', endColorstr='#d81b60', GradientType=0) !important;color:#fff}.description-block .description-icon{font-size:16px}.no-pad-top{padding-top:0}.position-static{position:static !important}.list-header{font-size:15px;padding:10px 4px;font-weight:bold;color:#666}.list-seperator{height:1px;background:#f4f4f4;margin:15px 0 9px 0}.list-link>a{padding:4px;color:#777}.list-link>a:hover{color:#222}.font-light{font-weight:300}.user-block:before,.user-block:after{content:" ";display:table}.user-block:after{clear:both}.user-block img{width:40px;height:40px;float:left}.user-block .username,.user-block .description,.user-block .comment{display:block;margin-left:50px}.user-block .username{font-size:16px;font-weight:600}.user-block .description{color:#999;font-size:13px}.user-block.user-block-sm .username,.user-block.user-block-sm .description,.user-block.user-block-sm .comment{margin-left:40px}.user-block.user-block-sm .username{font-size:14px}.img-sm,.img-md,.img-lg,.box-comments .box-comment img,.user-block.user-block-sm img{float:left}.img-sm,.box-comments .box-comment img,.user-block.user-block-sm img{width:30px !important;height:30px !important}.img-sm+.img-push{margin-left:40px}.img-md{width:60px;height:60px}.img-md+.img-push{margin-left:70px}.img-lg{width:100px;height:100px}.img-lg+.img-push{margin-left:110px}.img-bordered{border:3px solid #d2d6de;padding:3px}.img-bordered-sm{border:2px solid #d2d6de;padding:2px}.attachment-block{border:1px solid #f4f4f4;padding:5px;margin-bottom:10px;background:#f7f7f7}.attachment-block .attachment-img{max-width:100px;max-height:100px;height:auto;float:left}.attachment-block .attachment-pushed{margin-left:110px}.attachment-block .attachment-heading{margin:0}.attachment-block .attachment-text{color:#555}.connectedSortable{min-height:100px}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sort-highlight{background:#f4f4f4;border:1px dashed #ddd;margin-bottom:10px}.full-opacity-hover{opacity:.65;filter:alpha(opacity=65)}.full-opacity-hover:hover{opacity:1;filter:alpha(opacity=100)}.chart{position:relative;overflow:hidden;width:100%}.chart svg,.chart canvas{width:100% !important}@media print{.no-print,.main-sidebar,.left-side,.main-header,.content-header{display:none !important}.content-wrapper,.right-side,.main-footer{margin-left:0 !important;min-height:0 !important;-webkit-transform:translate(0, 0) !important;-ms-transform:translate(0, 0) !important;-o-transform:translate(0, 0) !important;transform:translate(0, 0) !important}.fixed .content-wrapper,.fixed .right-side{padding-top:0 !important}.invoice{width:100%;border:0;margin:0;padding:0}.invoice-col{float:left;width:33.3333333%}.table-responsive{overflow:auto}.table-responsive>.table tr th,.table-responsive>.table tr td{white-space:normal !important}} \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/css/all-skins.min.css b/renren-generator/src/main/resources/static/css/all-skins.min.css new file mode 100644 index 0000000..e1d2398 --- /dev/null +++ b/renren-generator/src/main/resources/static/css/all-skins.min.css @@ -0,0 +1 @@ +.skin-blue .main-header .navbar{background-color:#3c8dbc}.skin-blue .main-header .navbar .nav>li>a{color:#fff}.skin-blue .main-header .navbar .nav>li>a:hover,.skin-blue .main-header .navbar .nav>li>a:active,.skin-blue .main-header .navbar .nav>li>a:focus,.skin-blue .main-header .navbar .nav .open>a,.skin-blue .main-header .navbar .nav .open>a:hover,.skin-blue .main-header .navbar .nav .open>a:focus,.skin-blue .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-blue .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-blue .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-blue .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-blue .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue .main-header .logo{background-color:#367fa9;color:#fff;border-bottom:0 solid transparent}.skin-blue .main-header .logo:hover{background-color:#357ca5}.skin-blue .main-header li.user-header{background-color:#3c8dbc}.skin-blue .content-header{background:transparent}.skin-blue .wrapper,.skin-blue .main-sidebar,.skin-blue .left-side{background-color:#222d32}.skin-blue .user-panel>.info,.skin-blue .user-panel>.info>a{color:#fff}.skin-blue .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-blue .sidebar-menu>li>a{border-left:3px solid transparent}.skin-blue .sidebar-menu>li:hover>a,.skin-blue .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#3c8dbc}.skin-blue .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-blue .sidebar a{color:#b8c7ce}.skin-blue .sidebar a:hover{text-decoration:none}.skin-blue .treeview-menu>li>a{color:#8aa4af}.skin-blue .treeview-menu>li.active>a,.skin-blue .treeview-menu>li>a:hover{color:#fff}.skin-blue .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-blue .sidebar-form input[type="text"],.skin-blue .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-blue .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-blue .sidebar-form input[type="text"]:focus,.skin-blue .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}.skin-blue-light .main-header .navbar{background-color:#3c8dbc}.skin-blue-light .main-header .navbar .nav>li>a{color:#fff}.skin-blue-light .main-header .navbar .nav>li>a:hover,.skin-blue-light .main-header .navbar .nav>li>a:active,.skin-blue-light .main-header .navbar .nav>li>a:focus,.skin-blue-light .main-header .navbar .nav .open>a,.skin-blue-light .main-header .navbar .nav .open>a:hover,.skin-blue-light .main-header .navbar .nav .open>a:focus,.skin-blue-light .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-blue-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue-light .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-blue-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-blue-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue-light .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue-light .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue-light .main-header .logo:hover{background-color:#3b8ab8}.skin-blue-light .main-header li.user-header{background-color:#3c8dbc}.skin-blue-light .content-header{background:transparent}.skin-blue-light .wrapper,.skin-blue-light .main-sidebar,.skin-blue-light .left-side{background-color:#f9fafc}.skin-blue-light .content-wrapper,.skin-blue-light .main-footer{border-left:1px solid #d2d6de}.skin-blue-light .user-panel>.info,.skin-blue-light .user-panel>.info>a{color:#444}.skin-blue-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-blue-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-blue-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-blue-light .sidebar-menu>li:hover>a,.skin-blue-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-blue-light .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-blue-light .sidebar-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-blue-light .sidebar a{color:#444}.skin-blue-light .sidebar a:hover{text-decoration:none}.skin-blue-light .treeview-menu>li>a{color:#777}.skin-blue-light .treeview-menu>li.active>a,.skin-blue-light .treeview-menu>li>a:hover{color:#000}.skin-blue-light .treeview-menu>li.active>a{font-weight:600}.skin-blue-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-blue-light .sidebar-form input[type="text"],.skin-blue-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-blue-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-blue-light .sidebar-form input[type="text"]:focus,.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-blue-light .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}.skin-black .main-header{-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.skin-black .main-header .navbar-toggle{color:#333}.skin-black .main-header .navbar-brand{color:#333;border-right:1px solid #eee}.skin-black .main-header .navbar{background-color:#fff}.skin-black .main-header .navbar .nav>li>a{color:#333}.skin-black .main-header .navbar .nav>li>a:hover,.skin-black .main-header .navbar .nav>li>a:active,.skin-black .main-header .navbar .nav>li>a:focus,.skin-black .main-header .navbar .nav .open>a,.skin-black .main-header .navbar .nav .open>a:hover,.skin-black .main-header .navbar .nav .open>a:focus,.skin-black .main-header .navbar .nav>.active>a{background:#fff;color:#999}.skin-black .main-header .navbar .sidebar-toggle{color:#333}.skin-black .main-header .navbar .sidebar-toggle:hover{color:#999;background:#fff}.skin-black .main-header .navbar>.sidebar-toggle{color:#333;border-right:1px solid #eee}.skin-black .main-header .navbar .navbar-nav>li>a{border-right:1px solid #eee}.skin-black .main-header .navbar .navbar-custom-menu .navbar-nav>li>a,.skin-black .main-header .navbar .navbar-right>li>a{border-left:1px solid #eee;border-right-width:0}.skin-black .main-header>.logo{background-color:#fff;color:#333;border-bottom:0 solid transparent;border-right:1px solid #eee}.skin-black .main-header>.logo:hover{background-color:#fcfcfc}@media (max-width:767px){.skin-black .main-header>.logo{background-color:#222;color:#fff;border-bottom:0 solid transparent;border-right:none}.skin-black .main-header>.logo:hover{background-color:#1f1f1f}}.skin-black .main-header li.user-header{background-color:#222}.skin-black .content-header{background:transparent;box-shadow:none}.skin-black .wrapper,.skin-black .main-sidebar,.skin-black .left-side{background-color:#222d32}.skin-black .user-panel>.info,.skin-black .user-panel>.info>a{color:#fff}.skin-black .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-black .sidebar-menu>li>a{border-left:3px solid transparent}.skin-black .sidebar-menu>li:hover>a,.skin-black .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#fff}.skin-black .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-black .sidebar a{color:#b8c7ce}.skin-black .sidebar a:hover{text-decoration:none}.skin-black .treeview-menu>li>a{color:#8aa4af}.skin-black .treeview-menu>li.active>a,.skin-black .treeview-menu>li>a:hover{color:#fff}.skin-black .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-black .sidebar-form input[type="text"],.skin-black .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-black .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-black .sidebar-form input[type="text"]:focus,.skin-black .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-black .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-black .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.skin-black .pace .pace-progress{background:#222}.skin-black .pace .pace-activity{border-top-color:#222;border-left-color:#222}.skin-black-light .main-header{-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.skin-black-light .main-header .navbar-toggle{color:#333}.skin-black-light .main-header .navbar-brand{color:#333;border-right:1px solid #eee}.skin-black-light .main-header .navbar{background-color:#fff}.skin-black-light .main-header .navbar .nav>li>a{color:#333}.skin-black-light .main-header .navbar .nav>li>a:hover,.skin-black-light .main-header .navbar .nav>li>a:active,.skin-black-light .main-header .navbar .nav>li>a:focus,.skin-black-light .main-header .navbar .nav .open>a,.skin-black-light .main-header .navbar .nav .open>a:hover,.skin-black-light .main-header .navbar .nav .open>a:focus,.skin-black-light .main-header .navbar .nav>.active>a{background:#fff;color:#999}.skin-black-light .main-header .navbar .sidebar-toggle{color:#333}.skin-black-light .main-header .navbar .sidebar-toggle:hover{color:#999;background:#fff}.skin-black-light .main-header .navbar>.sidebar-toggle{color:#333;border-right:1px solid #eee}.skin-black-light .main-header .navbar .navbar-nav>li>a{border-right:1px solid #eee}.skin-black-light .main-header .navbar .navbar-custom-menu .navbar-nav>li>a,.skin-black-light .main-header .navbar .navbar-right>li>a{border-left:1px solid #eee;border-right-width:0}.skin-black-light .main-header>.logo{background-color:#fff;color:#333;border-bottom:0 solid transparent;border-right:1px solid #eee}.skin-black-light .main-header>.logo:hover{background-color:#fcfcfc}@media (max-width:767px){.skin-black-light .main-header>.logo{background-color:#222;color:#fff;border-bottom:0 solid transparent;border-right:none}.skin-black-light .main-header>.logo:hover{background-color:#1f1f1f}}.skin-black-light .main-header li.user-header{background-color:#222}.skin-black-light .content-header{background:transparent;box-shadow:none}.skin-black-light .wrapper,.skin-black-light .main-sidebar,.skin-black-light .left-side{background-color:#f9fafc}.skin-black-light .content-wrapper,.skin-black-light .main-footer{border-left:1px solid #d2d6de}.skin-black-light .user-panel>.info,.skin-black-light .user-panel>.info>a{color:#444}.skin-black-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-black-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-black-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-black-light .sidebar-menu>li:hover>a,.skin-black-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-black-light .sidebar-menu>li.active{border-left-color:#fff}.skin-black-light .sidebar-menu>li.active>a{font-weight:600}.skin-black-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-black-light .sidebar a{color:#444}.skin-black-light .sidebar a:hover{text-decoration:none}.skin-black-light .treeview-menu>li>a{color:#777}.skin-black-light .treeview-menu>li.active>a,.skin-black-light .treeview-menu>li>a:hover{color:#000}.skin-black-light .treeview-menu>li.active>a{font-weight:600}.skin-black-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-black-light .sidebar-form input[type="text"],.skin-black-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-black-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-black-light .sidebar-form input[type="text"]:focus,.skin-black-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-black-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-black-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-black-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-green .main-header .navbar{background-color:#00a65a}.skin-green .main-header .navbar .nav>li>a{color:#fff}.skin-green .main-header .navbar .nav>li>a:hover,.skin-green .main-header .navbar .nav>li>a:active,.skin-green .main-header .navbar .nav>li>a:focus,.skin-green .main-header .navbar .nav .open>a,.skin-green .main-header .navbar .nav .open>a:hover,.skin-green .main-header .navbar .nav .open>a:focus,.skin-green .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-green .main-header .navbar .sidebar-toggle{color:#fff}.skin-green .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-green .main-header .navbar .sidebar-toggle{color:#fff}.skin-green .main-header .navbar .sidebar-toggle:hover{background-color:#008d4c}@media (max-width:767px){.skin-green .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-green .main-header .navbar .dropdown-menu li a{color:#fff}.skin-green .main-header .navbar .dropdown-menu li a:hover{background:#008d4c}}.skin-green .main-header .logo{background-color:#008d4c;color:#fff;border-bottom:0 solid transparent}.skin-green .main-header .logo:hover{background-color:#008749}.skin-green .main-header li.user-header{background-color:#00a65a}.skin-green .content-header{background:transparent}.skin-green .wrapper,.skin-green .main-sidebar,.skin-green .left-side{background-color:#222d32}.skin-green .user-panel>.info,.skin-green .user-panel>.info>a{color:#fff}.skin-green .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-green .sidebar-menu>li>a{border-left:3px solid transparent}.skin-green .sidebar-menu>li:hover>a,.skin-green .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#00a65a}.skin-green .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-green .sidebar a{color:#b8c7ce}.skin-green .sidebar a:hover{text-decoration:none}.skin-green .treeview-menu>li>a{color:#8aa4af}.skin-green .treeview-menu>li.active>a,.skin-green .treeview-menu>li>a:hover{color:#fff}.skin-green .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-green .sidebar-form input[type="text"],.skin-green .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-green .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-green .sidebar-form input[type="text"]:focus,.skin-green .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-green .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-green .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.skin-green-light .main-header .navbar{background-color:#00a65a}.skin-green-light .main-header .navbar .nav>li>a{color:#fff}.skin-green-light .main-header .navbar .nav>li>a:hover,.skin-green-light .main-header .navbar .nav>li>a:active,.skin-green-light .main-header .navbar .nav>li>a:focus,.skin-green-light .main-header .navbar .nav .open>a,.skin-green-light .main-header .navbar .nav .open>a:hover,.skin-green-light .main-header .navbar .nav .open>a:focus,.skin-green-light .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-green-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-green-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-green-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-green-light .main-header .navbar .sidebar-toggle:hover{background-color:#008d4c}@media (max-width:767px){.skin-green-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-green-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-green-light .main-header .navbar .dropdown-menu li a:hover{background:#008d4c}}.skin-green-light .main-header .logo{background-color:#00a65a;color:#fff;border-bottom:0 solid transparent}.skin-green-light .main-header .logo:hover{background-color:#00a157}.skin-green-light .main-header li.user-header{background-color:#00a65a}.skin-green-light .content-header{background:transparent}.skin-green-light .wrapper,.skin-green-light .main-sidebar,.skin-green-light .left-side{background-color:#f9fafc}.skin-green-light .content-wrapper,.skin-green-light .main-footer{border-left:1px solid #d2d6de}.skin-green-light .user-panel>.info,.skin-green-light .user-panel>.info>a{color:#444}.skin-green-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-green-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-green-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-green-light .sidebar-menu>li:hover>a,.skin-green-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-green-light .sidebar-menu>li.active{border-left-color:#00a65a}.skin-green-light .sidebar-menu>li.active>a{font-weight:600}.skin-green-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-green-light .sidebar a{color:#444}.skin-green-light .sidebar a:hover{text-decoration:none}.skin-green-light .treeview-menu>li>a{color:#777}.skin-green-light .treeview-menu>li.active>a,.skin-green-light .treeview-menu>li>a:hover{color:#000}.skin-green-light .treeview-menu>li.active>a{font-weight:600}.skin-green-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-green-light .sidebar-form input[type="text"],.skin-green-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-green-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-green-light .sidebar-form input[type="text"]:focus,.skin-green-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-green-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-green-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-green-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-red .main-header .navbar{background-color:#dd4b39}.skin-red .main-header .navbar .nav>li>a{color:#fff}.skin-red .main-header .navbar .nav>li>a:hover,.skin-red .main-header .navbar .nav>li>a:active,.skin-red .main-header .navbar .nav>li>a:focus,.skin-red .main-header .navbar .nav .open>a,.skin-red .main-header .navbar .nav .open>a:hover,.skin-red .main-header .navbar .nav .open>a:focus,.skin-red .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-red .main-header .navbar .sidebar-toggle{color:#fff}.skin-red .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-red .main-header .navbar .sidebar-toggle{color:#fff}.skin-red .main-header .navbar .sidebar-toggle:hover{background-color:#d73925}@media (max-width:767px){.skin-red .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-red .main-header .navbar .dropdown-menu li a{color:#fff}.skin-red .main-header .navbar .dropdown-menu li a:hover{background:#d73925}}.skin-red .main-header .logo{background-color:#d73925;color:#fff;border-bottom:0 solid transparent}.skin-red .main-header .logo:hover{background-color:#d33724}.skin-red .main-header li.user-header{background-color:#dd4b39}.skin-red .content-header{background:transparent}.skin-red .wrapper,.skin-red .main-sidebar,.skin-red .left-side{background-color:#222d32}.skin-red .user-panel>.info,.skin-red .user-panel>.info>a{color:#fff}.skin-red .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-red .sidebar-menu>li>a{border-left:3px solid transparent}.skin-red .sidebar-menu>li:hover>a,.skin-red .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#dd4b39}.skin-red .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-red .sidebar a{color:#b8c7ce}.skin-red .sidebar a:hover{text-decoration:none}.skin-red .treeview-menu>li>a{color:#8aa4af}.skin-red .treeview-menu>li.active>a,.skin-red .treeview-menu>li>a:hover{color:#fff}.skin-red .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-red .sidebar-form input[type="text"],.skin-red .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-red .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-red .sidebar-form input[type="text"]:focus,.skin-red .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-red .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-red .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.skin-red-light .main-header .navbar{background-color:#dd4b39}.skin-red-light .main-header .navbar .nav>li>a{color:#fff}.skin-red-light .main-header .navbar .nav>li>a:hover,.skin-red-light .main-header .navbar .nav>li>a:active,.skin-red-light .main-header .navbar .nav>li>a:focus,.skin-red-light .main-header .navbar .nav .open>a,.skin-red-light .main-header .navbar .nav .open>a:hover,.skin-red-light .main-header .navbar .nav .open>a:focus,.skin-red-light .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-red-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-red-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-red-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-red-light .main-header .navbar .sidebar-toggle:hover{background-color:#d73925}@media (max-width:767px){.skin-red-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-red-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-red-light .main-header .navbar .dropdown-menu li a:hover{background:#d73925}}.skin-red-light .main-header .logo{background-color:#dd4b39;color:#fff;border-bottom:0 solid transparent}.skin-red-light .main-header .logo:hover{background-color:#dc4735}.skin-red-light .main-header li.user-header{background-color:#dd4b39}.skin-red-light .content-header{background:transparent}.skin-red-light .wrapper,.skin-red-light .main-sidebar,.skin-red-light .left-side{background-color:#f9fafc}.skin-red-light .content-wrapper,.skin-red-light .main-footer{border-left:1px solid #d2d6de}.skin-red-light .user-panel>.info,.skin-red-light .user-panel>.info>a{color:#444}.skin-red-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-red-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-red-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-red-light .sidebar-menu>li:hover>a,.skin-red-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-red-light .sidebar-menu>li.active{border-left-color:#dd4b39}.skin-red-light .sidebar-menu>li.active>a{font-weight:600}.skin-red-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-red-light .sidebar a{color:#444}.skin-red-light .sidebar a:hover{text-decoration:none}.skin-red-light .treeview-menu>li>a{color:#777}.skin-red-light .treeview-menu>li.active>a,.skin-red-light .treeview-menu>li>a:hover{color:#000}.skin-red-light .treeview-menu>li.active>a{font-weight:600}.skin-red-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-red-light .sidebar-form input[type="text"],.skin-red-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-red-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-red-light .sidebar-form input[type="text"]:focus,.skin-red-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-red-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-red-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-red-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-yellow .main-header .navbar{background-color:#f39c12}.skin-yellow .main-header .navbar .nav>li>a{color:#fff}.skin-yellow .main-header .navbar .nav>li>a:hover,.skin-yellow .main-header .navbar .nav>li>a:active,.skin-yellow .main-header .navbar .nav>li>a:focus,.skin-yellow .main-header .navbar .nav .open>a,.skin-yellow .main-header .navbar .nav .open>a:hover,.skin-yellow .main-header .navbar .nav .open>a:focus,.skin-yellow .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-yellow .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-yellow .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow .main-header .navbar .sidebar-toggle:hover{background-color:#e08e0b}@media (max-width:767px){.skin-yellow .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-yellow .main-header .navbar .dropdown-menu li a{color:#fff}.skin-yellow .main-header .navbar .dropdown-menu li a:hover{background:#e08e0b}}.skin-yellow .main-header .logo{background-color:#e08e0b;color:#fff;border-bottom:0 solid transparent}.skin-yellow .main-header .logo:hover{background-color:#db8b0b}.skin-yellow .main-header li.user-header{background-color:#f39c12}.skin-yellow .content-header{background:transparent}.skin-yellow .wrapper,.skin-yellow .main-sidebar,.skin-yellow .left-side{background-color:#222d32}.skin-yellow .user-panel>.info,.skin-yellow .user-panel>.info>a{color:#fff}.skin-yellow .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-yellow .sidebar-menu>li>a{border-left:3px solid transparent}.skin-yellow .sidebar-menu>li:hover>a,.skin-yellow .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#f39c12}.skin-yellow .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-yellow .sidebar a{color:#b8c7ce}.skin-yellow .sidebar a:hover{text-decoration:none}.skin-yellow .treeview-menu>li>a{color:#8aa4af}.skin-yellow .treeview-menu>li.active>a,.skin-yellow .treeview-menu>li>a:hover{color:#fff}.skin-yellow .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-yellow .sidebar-form input[type="text"],.skin-yellow .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-yellow .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-yellow .sidebar-form input[type="text"]:focus,.skin-yellow .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-yellow .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-yellow .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.skin-yellow-light .main-header .navbar{background-color:#f39c12}.skin-yellow-light .main-header .navbar .nav>li>a{color:#fff}.skin-yellow-light .main-header .navbar .nav>li>a:hover,.skin-yellow-light .main-header .navbar .nav>li>a:active,.skin-yellow-light .main-header .navbar .nav>li>a:focus,.skin-yellow-light .main-header .navbar .nav .open>a,.skin-yellow-light .main-header .navbar .nav .open>a:hover,.skin-yellow-light .main-header .navbar .nav .open>a:focus,.skin-yellow-light .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-yellow-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-yellow-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-yellow-light .main-header .navbar .sidebar-toggle:hover{background-color:#e08e0b}@media (max-width:767px){.skin-yellow-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-yellow-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-yellow-light .main-header .navbar .dropdown-menu li a:hover{background:#e08e0b}}.skin-yellow-light .main-header .logo{background-color:#f39c12;color:#fff;border-bottom:0 solid transparent}.skin-yellow-light .main-header .logo:hover{background-color:#f39a0d}.skin-yellow-light .main-header li.user-header{background-color:#f39c12}.skin-yellow-light .content-header{background:transparent}.skin-yellow-light .wrapper,.skin-yellow-light .main-sidebar,.skin-yellow-light .left-side{background-color:#f9fafc}.skin-yellow-light .content-wrapper,.skin-yellow-light .main-footer{border-left:1px solid #d2d6de}.skin-yellow-light .user-panel>.info,.skin-yellow-light .user-panel>.info>a{color:#444}.skin-yellow-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-yellow-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-yellow-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-yellow-light .sidebar-menu>li:hover>a,.skin-yellow-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-yellow-light .sidebar-menu>li.active{border-left-color:#f39c12}.skin-yellow-light .sidebar-menu>li.active>a{font-weight:600}.skin-yellow-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-yellow-light .sidebar a{color:#444}.skin-yellow-light .sidebar a:hover{text-decoration:none}.skin-yellow-light .treeview-menu>li>a{color:#777}.skin-yellow-light .treeview-menu>li.active>a,.skin-yellow-light .treeview-menu>li>a:hover{color:#000}.skin-yellow-light .treeview-menu>li.active>a{font-weight:600}.skin-yellow-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-yellow-light .sidebar-form input[type="text"],.skin-yellow-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-yellow-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-yellow-light .sidebar-form input[type="text"]:focus,.skin-yellow-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-yellow-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-yellow-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-yellow-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-purple .main-header .navbar{background-color:#605ca8}.skin-purple .main-header .navbar .nav>li>a{color:#fff}.skin-purple .main-header .navbar .nav>li>a:hover,.skin-purple .main-header .navbar .nav>li>a:active,.skin-purple .main-header .navbar .nav>li>a:focus,.skin-purple .main-header .navbar .nav .open>a,.skin-purple .main-header .navbar .nav .open>a:hover,.skin-purple .main-header .navbar .nav .open>a:focus,.skin-purple .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-purple .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-purple .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple .main-header .navbar .sidebar-toggle:hover{background-color:#555299}@media (max-width:767px){.skin-purple .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-purple .main-header .navbar .dropdown-menu li a{color:#fff}.skin-purple .main-header .navbar .dropdown-menu li a:hover{background:#555299}}.skin-purple .main-header .logo{background-color:#555299;color:#fff;border-bottom:0 solid transparent}.skin-purple .main-header .logo:hover{background-color:#545096}.skin-purple .main-header li.user-header{background-color:#605ca8}.skin-purple .content-header{background:transparent}.skin-purple .wrapper,.skin-purple .main-sidebar,.skin-purple .left-side{background-color:#222d32}.skin-purple .user-panel>.info,.skin-purple .user-panel>.info>a{color:#fff}.skin-purple .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-purple .sidebar-menu>li>a{border-left:3px solid transparent}.skin-purple .sidebar-menu>li:hover>a,.skin-purple .sidebar-menu>li.active>a{color:#fff;background:#1e282c;border-left-color:#605ca8}.skin-purple .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-purple .sidebar a{color:#b8c7ce}.skin-purple .sidebar a:hover{text-decoration:none}.skin-purple .treeview-menu>li>a{color:#8aa4af}.skin-purple .treeview-menu>li.active>a,.skin-purple .treeview-menu>li>a:hover{color:#fff}.skin-purple .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-purple .sidebar-form input[type="text"],.skin-purple .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-purple .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-purple .sidebar-form input[type="text"]:focus,.skin-purple .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-purple .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-purple .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.skin-purple-light .main-header .navbar{background-color:#605ca8}.skin-purple-light .main-header .navbar .nav>li>a{color:#fff}.skin-purple-light .main-header .navbar .nav>li>a:hover,.skin-purple-light .main-header .navbar .nav>li>a:active,.skin-purple-light .main-header .navbar .nav>li>a:focus,.skin-purple-light .main-header .navbar .nav .open>a,.skin-purple-light .main-header .navbar .nav .open>a:hover,.skin-purple-light .main-header .navbar .nav .open>a:focus,.skin-purple-light .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-purple-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple-light .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-purple-light .main-header .navbar .sidebar-toggle{color:#fff}.skin-purple-light .main-header .navbar .sidebar-toggle:hover{background-color:#555299}@media (max-width:767px){.skin-purple-light .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-purple-light .main-header .navbar .dropdown-menu li a{color:#fff}.skin-purple-light .main-header .navbar .dropdown-menu li a:hover{background:#555299}}.skin-purple-light .main-header .logo{background-color:#605ca8;color:#fff;border-bottom:0 solid transparent}.skin-purple-light .main-header .logo:hover{background-color:#5d59a6}.skin-purple-light .main-header li.user-header{background-color:#605ca8}.skin-purple-light .content-header{background:transparent}.skin-purple-light .wrapper,.skin-purple-light .main-sidebar,.skin-purple-light .left-side{background-color:#f9fafc}.skin-purple-light .content-wrapper,.skin-purple-light .main-footer{border-left:1px solid #d2d6de}.skin-purple-light .user-panel>.info,.skin-purple-light .user-panel>.info>a{color:#444}.skin-purple-light .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-purple-light .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-purple-light .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-purple-light .sidebar-menu>li:hover>a,.skin-purple-light .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-purple-light .sidebar-menu>li.active{border-left-color:#605ca8}.skin-purple-light .sidebar-menu>li.active>a{font-weight:600}.skin-purple-light .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-purple-light .sidebar a{color:#444}.skin-purple-light .sidebar a:hover{text-decoration:none}.skin-purple-light .treeview-menu>li>a{color:#777}.skin-purple-light .treeview-menu>li.active>a,.skin-purple-light .treeview-menu>li>a:hover{color:#000}.skin-purple-light .treeview-menu>li.active>a{font-weight:600}.skin-purple-light .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-purple-light .sidebar-form input[type="text"],.skin-purple-light .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-purple-light .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-purple-light .sidebar-form input[type="text"]:focus,.skin-purple-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-purple-light .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-purple-light .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-purple-light.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}} \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/css/bootstrap.min.css b/renren-generator/src/main/resources/static/css/bootstrap.min.css new file mode 100644 index 0000000..ed3905e --- /dev/null +++ b/renren-generator/src/main/resources/static/css/bootstrap.min.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/css/font-awesome.min.css b/renren-generator/src/main/resources/static/css/font-awesome.min.css new file mode 100644 index 0000000..540440c --- /dev/null +++ b/renren-generator/src/main/resources/static/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/renren-generator/src/main/resources/static/css/main.css b/renren-generator/src/main/resources/static/css/main.css new file mode 100644 index 0000000..a6ed176 --- /dev/null +++ b/renren-generator/src/main/resources/static/css/main.css @@ -0,0 +1,54 @@ +html { overflow-x:hidden; } +.content-header { + position: relative; + padding: 0 0 3px 8px +} + +.content-header>.breadcrumb { + position: relative; + top: 0; + right: 0; + float: none; + margin-top: 0px; + padding-left: 10px; + background: #ecf0f5; +} + +.main-footer { + padding: 7px; + color: #444; + border-top: 1px solid #eee; +} + +[v-cloak] { + display: none; +} + +.grid-btn{ + margin-bottom:12px; +} +.grid-btn .btn{ + margin-right:10px; +} +.pointer{cursor: pointer;} + +.ml-10 { margin-left:0 !important; } +@media (min-width: 768px) { + .ml-10 { margin-left:10px !important; } + .col-sm-10 {width: 70%;padding-left: 0px;} + .col-sm-2 {width: 24%;} +} +tbody > tr > th {font-weight: normal; } +.panel .table { margin:0 0; } +.panel .pagination { margin:0; } +.panel-default>.panel-heading {background-color: #f5f5f5;} +.row{ + border-top: 1px solid #ddd; + margin:0; + padding:20px 2px 0px 2px; +} +.col-xs-6{padding-left: 0px;padding-right: 0px;} +.form-horizontal .form-group {margin-left:0px;margin-right:0px;} +.form-horizontal{ + width:550px;padding-top:20px; +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/favicon.ico b/renren-generator/src/main/resources/static/favicon.ico new file mode 100644 index 0000000..2bd581c Binary files /dev/null and b/renren-generator/src/main/resources/static/favicon.ico differ diff --git a/renren-generator/src/main/resources/static/fonts/FontAwesome.otf b/renren-generator/src/main/resources/static/fonts/FontAwesome.otf new file mode 100644 index 0000000..401ec0f Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/FontAwesome.otf differ diff --git a/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.eot b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..e9f60ca Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.eot differ diff --git a/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.svg b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..855c845 --- /dev/null +++ b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.ttf b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.ttf differ diff --git a/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.woff b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..400014a Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.woff differ diff --git a/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.woff2 b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/fontawesome-webfont.woff2 differ diff --git a/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.eot b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..b93a495 Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.eot differ diff --git a/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.svg b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..94fb549 --- /dev/null +++ b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..1413fc6 Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf differ diff --git a/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.woff b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..9e61285 Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.woff differ diff --git a/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/renren-generator/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/renren-generator/src/main/resources/static/js/common.js b/renren-generator/src/main/resources/static/js/common.js new file mode 100644 index 0000000..2594d4c --- /dev/null +++ b/renren-generator/src/main/resources/static/js/common.js @@ -0,0 +1,83 @@ +//jqGrid的配置信息 +$.jgrid.defaults.width = 1000; +$.jgrid.defaults.responsive = true; +$.jgrid.defaults.styleUI = 'Bootstrap'; + +//工具集合Tools +window.T = {}; + +// 获取请求参数 +// 使用示例 +// location.href = http://localhost:8080/index.html?id=123 +// T.p('id') --> 123; +var url = function(name) { + var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); + var r = window.location.search.substr(1).match(reg); + if(r!=null)return unescape(r[2]); return null; +}; +T.p = url; + +//全局配置 +$.ajaxSetup({ + dataType: "json", + contentType: "application/json", + cache: false +}); + +function hasPermission(permission) { + if (window.parent.permissions.indexOf(permission) > -1) { + return true; + } else { + return false; + } +} + +//重写alert +window.alert = function(msg, callback){ + parent.layer.alert(msg, function(index){ + parent.layer.close(index); + if(typeof(callback) === "function"){ + callback("ok"); + } + }); +} + +//重写confirm式样框 +window.confirm = function(msg, callback){ + parent.layer.confirm(msg, {btn: ['确定','取消']}, + function(){//确定事件 + if(typeof(callback) === "function"){ + callback("ok"); + } + }); +} + +//选择一条记录 +function getSelectedRow() { + var grid = $("#jqGrid"); + var rowKey = grid.getGridParam("selrow"); + if(!rowKey){ + alert("请选择一条记录"); + return ; + } + + var selectedIDs = grid.getGridParam("selarrrow"); + if(selectedIDs.length > 1){ + alert("只能选择一条记录"); + return ; + } + + return selectedIDs[0]; +} + +//选择多条记录 +function getSelectedRows() { + var grid = $("#jqGrid"); + var rowKey = grid.getGridParam("selrow"); + if(!rowKey){ + alert("请选择一条记录"); + return ; + } + + return grid.getGridParam("selarrrow"); +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/js/generator.js b/renren-generator/src/main/resources/static/js/generator.js new file mode 100644 index 0000000..f19a8f2 --- /dev/null +++ b/renren-generator/src/main/resources/static/js/generator.js @@ -0,0 +1,60 @@ +$(function () { + $("#jqGrid").jqGrid({ + url: 'sys/generator/list', + datatype: "json", + colModel: [ + { label: '表名', name: 'tableName', width: 100, key: true }, + { label: '表备注', name: 'tableComment', width: 100 }, + { label: '创建时间', name: 'createTime', width: 100 } + ], + viewrecords: true, + height: 385, + rowNum: 10, + rowList : [10,30,50,100,200], + rownumbers: true, + rownumWidth: 25, + autowidth:true, + multiselect: true, + pager: "#jqGridPager", + jsonReader : { + root: "page.list", + page: "page.currPage", + total: "page.totalPage", + records: "page.totalCount" + }, + prmNames : { + page:"page", + rows:"limit", + order: "order" + }, + gridComplete:function(){ + //隐藏grid底部滚动条 + $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); + } + }); +}); + +var vm = new Vue({ + el:'#rrapp', + data:{ + q:{ + tableName: null + } + }, + methods: { + query: function () { + $("#jqGrid").jqGrid('setGridParam',{ + postData:{'tableName': vm.q.tableName}, + page:1 + }).trigger("reloadGrid"); + }, + generator: function() { + var tableNames = getSelectedRows(); + if(tableNames == null){ + return ; + } + location.href = "sys/generator/code?tables=" + tableNames.join(); + } + } +}); + diff --git a/renren-generator/src/main/resources/static/js/index.js b/renren-generator/src/main/resources/static/js/index.js new file mode 100644 index 0000000..3a8d122 --- /dev/null +++ b/renren-generator/src/main/resources/static/js/index.js @@ -0,0 +1,52 @@ +//iframe自适应 +$(window).on('resize', function() { + var $content = $('.content'); + $content.height($(this).height() - 120); + $content.find('iframe').each(function() { + $(this).height($content.height()); + }); +}).resize(); + + +var vm = new Vue({ + el:'#rrapp', + data:{ + main:"main.html", + navTitle:"欢迎页" + }, + methods: { + donate: function () { + layer.open({ + type: 2, + title: false, + area: ['806px', '467px'], + closeBtn: 1, + shadeClose: false, + content: ['http://cdn.renren.io/donate.jpg', 'no'] + }); + } + } +}); + +//路由 +var router = new Router(); +var menus = ["main.html","generator.html"]; +routerList(router, menus); +router.start(); + +function routerList(router, menus){ + for(var index in menus){ + router.add('#'+menus[index], function() { + var url = window.location.hash; + + //替换iframe的url + vm.main = url.replace('#', ''); + + //导航菜单展开 + $(".treeview-menu li").removeClass("active"); + $("a[href='"+url+"']").parents("li").addClass("active"); + + vm.navTitle = $("a[href='"+url+"']").text(); + }); + } +} diff --git a/renren-generator/src/main/resources/static/libs/app.js b/renren-generator/src/main/resources/static/libs/app.js new file mode 100644 index 0000000..bd5ecd2 --- /dev/null +++ b/renren-generator/src/main/resources/static/libs/app.js @@ -0,0 +1,763 @@ +/*! AdminLTE app.js + * ================ + * Main JS application file for AdminLTE v2. This file + * should be included in all pages. It controls some layout + * options and implements exclusive AdminLTE plugins. + * + * @Author Almsaeed Studio + * @Support + * @Email + * @version 2.3.7 + * @license MIT + */ + +//Make sure jQuery has been loaded before app.js +if (typeof jQuery === "undefined") { + throw new Error("AdminLTE requires jQuery"); +} + +/* AdminLTE + * + * @type Object + * @description $.AdminLTE is the main object for the template's app. + * It's used for implementing functions and options related + * to the template. Keeping everything wrapped in an object + * prevents conflict with other plugins and is a better + * way to organize our code. + */ +$.AdminLTE = {}; + +/* -------------------- + * - AdminLTE Options - + * -------------------- + * Modify these options to suit your implementation + */ +$.AdminLTE.options = { + //Add slimscroll to navbar menus + //This requires you to load the slimscroll plugin + //in every page before app.js + navbarMenuSlimscroll: true, + navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar + navbarMenuHeight: "200px", //The height of the inner menu + //General animation speed for JS animated elements such as box collapse/expand and + //sidebar treeview slide up/down. This options accepts an integer as milliseconds, + //'fast', 'normal', or 'slow' + animationSpeed: 'fast', + //Sidebar push menu toggle button selector + sidebarToggleSelector: "[data-toggle='offcanvas']", + //Activate sidebar push menu + sidebarPushMenu: true, + //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin) + sidebarSlimScroll: true, + //Enable sidebar expand on hover effect for sidebar mini + //This option is forced to true if both the fixed layout and sidebar mini + //are used together + sidebarExpandOnHover: false, + //BoxRefresh Plugin + enableBoxRefresh: true, + //Bootstrap.js tooltip + enableBSToppltip: true, + BSTooltipSelector: "[data-toggle='tooltip']", + //Enable Fast Click. Fastclick.js creates a more + //native touch experience with touch devices. If you + //choose to enable the plugin, make sure you load the script + //before AdminLTE's app.js + enableFastclick: false, + //Control Sidebar Options + enableControlSidebar: true, + controlSidebarOptions: { + //Which button should trigger the open/close event + toggleBtnSelector: "[data-toggle='control-sidebar']", + //The sidebar selector + selector: ".control-sidebar", + //Enable slide over content + slide: true + }, + //Box Widget Plugin. Enable this plugin + //to allow boxes to be collapsed and/or removed + enableBoxWidget: true, + //Box Widget plugin options + boxWidgetOptions: { + boxWidgetIcons: { + //Collapse icon + collapse: 'fa-minus', + //Open icon + open: 'fa-plus', + //Remove icon + remove: 'fa-times' + }, + boxWidgetSelectors: { + //Remove button selector + remove: '[data-widget="remove"]', + //Collapse button selector + collapse: '[data-widget="collapse"]' + } + }, + //Direct Chat plugin options + directChat: { + //Enable direct chat by default + enable: true, + //The button to open and close the chat contacts pane + contactToggleSelector: '[data-widget="chat-pane-toggle"]' + }, + //Define the set of colors to use globally around the website + colors: { + lightBlue: "#3c8dbc", + red: "#f56954", + green: "#00a65a", + aqua: "#00c0ef", + yellow: "#f39c12", + blue: "#0073b7", + navy: "#001F3F", + teal: "#39CCCC", + olive: "#3D9970", + lime: "#01FF70", + orange: "#FF851B", + fuchsia: "#F012BE", + purple: "#8E24AA", + maroon: "#D81B60", + black: "#222222", + gray: "#d2d6de" + }, + //The standard screen sizes that bootstrap uses. + //If you change these in the variables.less file, change + //them here too. + screenSizes: { + xs: 480, + sm: 768, + md: 992, + lg: 1200 + } +}; + +/* ------------------ + * - Implementation - + * ------------------ + * The next block of code implements AdminLTE's + * functions and plugins as specified by the + * options above. + */ +$(function () { + "use strict"; + + //Fix for IE page transitions + $("body").removeClass("hold-transition"); + + //Extend options if external options exist + if (typeof AdminLTEOptions !== "undefined") { + $.extend(true, + $.AdminLTE.options, + AdminLTEOptions); + } + + //Easy access to options + var o = $.AdminLTE.options; + + //Set up the object + _init(); + + //Activate the layout maker + $.AdminLTE.layout.activate(); + + //Enable sidebar tree view controls + $.AdminLTE.tree('.sidebar'); + + //Enable control sidebar + if (o.enableControlSidebar) { + $.AdminLTE.controlSidebar.activate(); + } + + //Add slimscroll to navbar dropdown + if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') { + $(".navbar .menu").slimscroll({ + height: o.navbarMenuHeight, + alwaysVisible: false, + size: o.navbarMenuSlimscrollWidth + }).css("width", "100%"); + } + + //Activate sidebar push menu + if (o.sidebarPushMenu) { + $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector); + } + + //Activate Bootstrap tooltip + if (o.enableBSToppltip) { + $('body').tooltip({ + selector: o.BSTooltipSelector + }); + } + + //Activate box widget + if (o.enableBoxWidget) { + $.AdminLTE.boxWidget.activate(); + } + + //Activate fast click + if (o.enableFastclick && typeof FastClick != 'undefined') { + FastClick.attach(document.body); + } + + //Activate direct chat widget + if (o.directChat.enable) { + $(document).on('click', o.directChat.contactToggleSelector, function () { + var box = $(this).parents('.direct-chat').first(); + box.toggleClass('direct-chat-contacts-open'); + }); + } + + /* + * INITIALIZE BUTTON TOGGLE + * ------------------------ + */ + $('.btn-group[data-toggle="btn-toggle"]').each(function () { + var group = $(this); + $(this).find(".btn").on('click', function (e) { + group.find(".btn.active").removeClass("active"); + $(this).addClass("active"); + e.preventDefault(); + }); + + }); +}); + +/* ---------------------------------- + * - Initialize the AdminLTE Object - + * ---------------------------------- + * All AdminLTE functions are implemented below. + */ +function _init() { + 'use strict'; + /* Layout + * ====== + * Fixes the layout height in case min-height fails. + * + * @type Object + * @usage $.AdminLTE.layout.activate() + * $.AdminLTE.layout.fix() + * $.AdminLTE.layout.fixSidebar() + */ + $.AdminLTE.layout = { + activate: function () { + var _this = this; + _this.fix(); + _this.fixSidebar(); + $(window, ".wrapper").resize(function () { + _this.fix(); + _this.fixSidebar(); + }); + }, + fix: function () { + //Get window height and the wrapper height + var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight(); + var window_height = $(window).height(); + var sidebar_height = $(".sidebar").height(); + //Set the min-height of the content and sidebar based on the + //the height of the document. + if ($("body").hasClass("fixed")) { + $(".content-wrapper, .right-side").css('min-height', window_height - $('.main-footer').outerHeight()); + } else { + var postSetWidth; + if (window_height >= sidebar_height) { + $(".content-wrapper, .right-side").css('min-height', window_height - neg); + postSetWidth = window_height - neg; + } else { + $(".content-wrapper, .right-side").css('min-height', sidebar_height); + postSetWidth = sidebar_height; + } + + //Fix for the control sidebar height + var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector); + if (typeof controlSidebar !== "undefined") { + if (controlSidebar.height() > postSetWidth) + $(".content-wrapper, .right-side").css('min-height', controlSidebar.height()); + } + + } + }, + fixSidebar: function () { + //Make sure the body tag has the .fixed class + if (!$("body").hasClass("fixed")) { + if (typeof $.fn.slimScroll != 'undefined') { + $(".sidebar").slimScroll({destroy: true}).height("auto"); + } + return; + } else if (typeof $.fn.slimScroll == 'undefined' && window.console) { + window.console.error("Error: the fixed layout requires the slimscroll plugin!"); + } + //Enable slimscroll for fixed layout + if ($.AdminLTE.options.sidebarSlimScroll) { + if (typeof $.fn.slimScroll != 'undefined') { + //Destroy if it exists + $(".sidebar").slimScroll({destroy: true}).height("auto"); + //Add slimscroll + $(".sidebar").slimscroll({ + height: ($(window).height() - $(".main-header").height()) + "px", + color: "rgba(0,0,0,0.2)", + size: "3px" + }); + } + } + } + }; + + /* PushMenu() + * ========== + * Adds the push menu functionality to the sidebar. + * + * @type Function + * @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']") + */ + $.AdminLTE.pushMenu = { + activate: function (toggleBtn) { + //Get the screen sizes + var screenSizes = $.AdminLTE.options.screenSizes; + + //Enable sidebar toggle + $(document).on('click', toggleBtn, function (e) { + e.preventDefault(); + + //Enable sidebar push menu + if ($(window).width() > (screenSizes.sm - 1)) { + if ($("body").hasClass('sidebar-collapse')) { + $("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu'); + } else { + $("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu'); + } + } + //Handle sidebar push menu for small screens + else { + if ($("body").hasClass('sidebar-open')) { + $("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); + } else { + $("body").addClass('sidebar-open').trigger('expanded.pushMenu'); + } + } + }); + + $(".content-wrapper").click(function () { + //Enable hide menu when clicking on the content-wrapper on small screens + if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) { + $("body").removeClass('sidebar-open'); + } + }); + + //Enable expand on hover for sidebar mini + if ($.AdminLTE.options.sidebarExpandOnHover + || ($('body').hasClass('fixed') + && $('body').hasClass('sidebar-mini'))) { + this.expandOnHover(); + } + }, + expandOnHover: function () { + var _this = this; + var screenWidth = $.AdminLTE.options.screenSizes.sm - 1; + //Expand sidebar on hover + $('.main-sidebar').hover(function () { + if ($('body').hasClass('sidebar-mini') + && $("body").hasClass('sidebar-collapse') + && $(window).width() > screenWidth) { + _this.expand(); + } + }, function () { + if ($('body').hasClass('sidebar-mini') + && $('body').hasClass('sidebar-expanded-on-hover') + && $(window).width() > screenWidth) { + _this.collapse(); + } + }); + }, + expand: function () { + $("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover'); + }, + collapse: function () { + if ($('body').hasClass('sidebar-expanded-on-hover')) { + $('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse'); + } + } + }; + + /* Tree() + * ====== + * Converts the sidebar into a multilevel + * tree view menu. + * + * @type Function + * @Usage: $.AdminLTE.tree('.sidebar') + */ + $.AdminLTE.tree = function (menu) { + var _this = this; + var animationSpeed = $.AdminLTE.options.animationSpeed; + $(document).off('click', menu + ' li a') + .on('click', menu + ' li a', function (e) { + //Get the clicked link and the next element + var $this = $(this); + var checkElement = $this.next(); + + //Check if the next element is a menu and is visible + if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { + //Close the menu + checkElement.slideUp(animationSpeed, function () { + checkElement.removeClass('menu-open'); + //Fix the layout in case the sidebar stretches over the height of the window + //_this.layout.fix(); + }); + checkElement.parent("li").removeClass("active"); + } + //If the menu is not visible + else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { + //Get the parent menu + var parent = $this.parents('ul').first(); + //Close all open menus within the parent + var ul = parent.find('ul:visible').slideUp(animationSpeed); + //Remove the menu-open class from the parent + ul.removeClass('menu-open'); + //Get the parent li + var parent_li = $this.parent("li"); + + //Open the target menu and add the menu-open class + checkElement.slideDown(animationSpeed, function () { + //Add the class active to the parent li + checkElement.addClass('menu-open'); + parent.find('li.active').removeClass('active'); + parent_li.addClass('active'); + //Fix the layout in case the sidebar stretches over the height of the window + _this.layout.fix(); + }); + } + //if this isn't a link, prevent the page from being redirected + if (checkElement.is('.treeview-menu')) { + e.preventDefault(); + } + }); + }; + + /* ControlSidebar + * ============== + * Adds functionality to the right sidebar + * + * @type Object + * @usage $.AdminLTE.controlSidebar.activate(options) + */ + $.AdminLTE.controlSidebar = { + //instantiate the object + activate: function () { + //Get the object + var _this = this; + //Update options + var o = $.AdminLTE.options.controlSidebarOptions; + //Get the sidebar + var sidebar = $(o.selector); + //The toggle button + var btn = $(o.toggleBtnSelector); + + //Listen to the click event + btn.on('click', function (e) { + e.preventDefault(); + //If the sidebar is not open + if (!sidebar.hasClass('control-sidebar-open') + && !$('body').hasClass('control-sidebar-open')) { + //Open the sidebar + _this.open(sidebar, o.slide); + } else { + _this.close(sidebar, o.slide); + } + }); + + //If the body has a boxed layout, fix the sidebar bg position + var bg = $(".control-sidebar-bg"); + _this._fix(bg); + + //If the body has a fixed layout, make the control sidebar fixed + if ($('body').hasClass('fixed')) { + _this._fixForFixed(sidebar); + } else { + //If the content height is less than the sidebar's height, force max height + if ($('.content-wrapper, .right-side').height() < sidebar.height()) { + _this._fixForContent(sidebar); + } + } + }, + //Open the control sidebar + open: function (sidebar, slide) { + //Slide over content + if (slide) { + sidebar.addClass('control-sidebar-open'); + } else { + //Push the content by adding the open class to the body instead + //of the sidebar itself + $('body').addClass('control-sidebar-open'); + } + }, + //Close the control sidebar + close: function (sidebar, slide) { + if (slide) { + sidebar.removeClass('control-sidebar-open'); + } else { + $('body').removeClass('control-sidebar-open'); + } + }, + _fix: function (sidebar) { + var _this = this; + if ($("body").hasClass('layout-boxed')) { + sidebar.css('position', 'absolute'); + sidebar.height($(".wrapper").height()); + if (_this.hasBindedResize) { + return; + } + $(window).resize(function () { + _this._fix(sidebar); + }); + _this.hasBindedResize = true; + } else { + sidebar.css({ + 'position': 'fixed', + 'height': 'auto' + }); + } + }, + _fixForFixed: function (sidebar) { + sidebar.css({ + 'position': 'fixed', + 'max-height': '100%', + 'overflow': 'auto', + 'padding-bottom': '50px' + }); + }, + _fixForContent: function (sidebar) { + $(".content-wrapper, .right-side").css('min-height', sidebar.height()); + } + }; + + /* BoxWidget + * ========= + * BoxWidget is a plugin to handle collapsing and + * removing boxes from the screen. + * + * @type Object + * @usage $.AdminLTE.boxWidget.activate() + * Set all your options in the main $.AdminLTE.options object + */ + $.AdminLTE.boxWidget = { + selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors, + icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons, + animationSpeed: $.AdminLTE.options.animationSpeed, + activate: function (_box) { + var _this = this; + if (!_box) { + _box = document; // activate all boxes per default + } + //Listen for collapse event triggers + $(_box).on('click', _this.selectors.collapse, function (e) { + e.preventDefault(); + _this.collapse($(this)); + }); + + //Listen for remove event triggers + $(_box).on('click', _this.selectors.remove, function (e) { + e.preventDefault(); + _this.remove($(this)); + }); + }, + collapse: function (element) { + var _this = this; + //Find the box parent + var box = element.parents(".box").first(); + //Find the body and the footer + var box_content = box.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer"); + if (!box.hasClass("collapsed-box")) { + //Convert minus into plus + element.children(":first") + .removeClass(_this.icons.collapse) + .addClass(_this.icons.open); + //Hide the content + box_content.slideUp(_this.animationSpeed, function () { + box.addClass("collapsed-box"); + }); + } else { + //Convert plus into minus + element.children(":first") + .removeClass(_this.icons.open) + .addClass(_this.icons.collapse); + //Show the content + box_content.slideDown(_this.animationSpeed, function () { + box.removeClass("collapsed-box"); + }); + } + }, + remove: function (element) { + //Find the box parent + var box = element.parents(".box").first(); + box.slideUp(this.animationSpeed); + } + }; +} + +/* ------------------ + * - Custom Plugins - + * ------------------ + * All custom plugins are defined below. + */ + +/* + * BOX REFRESH BUTTON + * ------------------ + * This is a custom plugin to use with the component BOX. It allows you to add + * a refresh button to the box. It converts the box's state to a loading state. + * + * @type plugin + * @usage $("#box-widget").boxRefresh( options ); + */ +(function ($) { + + "use strict"; + + $.fn.boxRefresh = function (options) { + + // Render options + var settings = $.extend({ + //Refresh button selector + trigger: ".refresh-btn", + //File source to be loaded (e.g: ajax/src.php) + source: "", + //Callbacks + onLoadStart: function (box) { + return box; + }, //Right after the button has been clicked + onLoadDone: function (box) { + return box; + } //When the source has been loaded + + }, options); + + //The overlay + var overlay = $('
'); + + return this.each(function () { + //if a source is specified + if (settings.source === "") { + if (window.console) { + window.console.log("Please specify a source first - boxRefresh()"); + } + return; + } + //the box + var box = $(this); + //the button + var rBtn = box.find(settings.trigger).first(); + + //On trigger click + rBtn.on('click', function (e) { + e.preventDefault(); + //Add loading overlay + start(box); + + //Perform ajax call + box.find(".box-body").load(settings.source, function () { + done(box); + }); + }); + }); + + function start(box) { + //Add overlay and loading img + box.append(overlay); + + settings.onLoadStart.call(box); + } + + function done(box) { + //Remove overlay and loading img + box.find(overlay).remove(); + + settings.onLoadDone.call(box); + } + + }; + +})(jQuery); + +/* + * EXPLICIT BOX CONTROLS + * ----------------------- + * This is a custom plugin to use with the component BOX. It allows you to activate + * a box inserted in the DOM after the app.js was loaded, toggle and remove box. + * + * @type plugin + * @usage $("#box-widget").activateBox(); + * @usage $("#box-widget").toggleBox(); + * @usage $("#box-widget").removeBox(); + */ +(function ($) { + + 'use strict'; + + $.fn.activateBox = function () { + $.AdminLTE.boxWidget.activate(this); + }; + + $.fn.toggleBox = function () { + var button = $($.AdminLTE.boxWidget.selectors.collapse, this); + $.AdminLTE.boxWidget.collapse(button); + }; + + $.fn.removeBox = function () { + var button = $($.AdminLTE.boxWidget.selectors.remove, this); + $.AdminLTE.boxWidget.remove(button); + }; + +})(jQuery); + +/* + * TODO LIST CUSTOM PLUGIN + * ----------------------- + * This plugin depends on iCheck plugin for checkbox and radio inputs + * + * @type plugin + * @usage $("#todo-widget").todolist( options ); + */ +(function ($) { + + 'use strict'; + + $.fn.todolist = function (options) { + // Render options + var settings = $.extend({ + //When the user checks the input + onCheck: function (ele) { + return ele; + }, + //When the user unchecks the input + onUncheck: function (ele) { + return ele; + } + }, options); + + return this.each(function () { + + if (typeof $.fn.iCheck != 'undefined') { + $('input', this).on('ifChecked', function () { + var ele = $(this).parents("li").first(); + ele.toggleClass("done"); + settings.onCheck.call(ele); + }); + + $('input', this).on('ifUnchecked', function () { + var ele = $(this).parents("li").first(); + ele.toggleClass("done"); + settings.onUncheck.call(ele); + }); + } else { + $('input', this).on('change', function () { + var ele = $(this).parents("li").first(); + ele.toggleClass("done"); + if ($('input', ele).is(":checked")) { + settings.onCheck.call(ele); + } else { + settings.onUncheck.call(ele); + } + }); + } + }); + }; +}(jQuery)); diff --git a/renren-generator/src/main/resources/static/libs/app.min.js b/renren-generator/src/main/resources/static/libs/app.min.js new file mode 100644 index 0000000..51d5010 --- /dev/null +++ b/renren-generator/src/main/resources/static/libs/app.min.js @@ -0,0 +1,13 @@ +/*! AdminLTE app.js + * ================ + * Main JS application file for AdminLTE v2. This file + * should be included in all pages. It controls some layout + * options and implements exclusive AdminLTE plugins. + * + * @Author Almsaeed Studio + * @Support + * @Email + * @version 2.3.7 + * @license MIT + */ +function _init(){"use strict";$.AdminLTE.layout={activate:function(){var a=this;a.fix(),a.fixSidebar(),$(window,".wrapper").resize(function(){a.fix(),a.fixSidebar()})},fix:function(){var a=$(".main-header").outerHeight()+$(".main-footer").outerHeight(),b=$(window).height(),c=$(".sidebar").height();if($("body").hasClass("fixed"))$(".content-wrapper, .right-side").css("min-height",b-$(".main-footer").outerHeight());else{var d;b>=c?($(".content-wrapper, .right-side").css("min-height",b-a),d=b-a):($(".content-wrapper, .right-side").css("min-height",c),d=c);var e=$($.AdminLTE.options.controlSidebarOptions.selector);"undefined"!=typeof e&&e.height()>d&&$(".content-wrapper, .right-side").css("min-height",e.height())}},fixSidebar:function(){return $("body").hasClass("fixed")?("undefined"==typeof $.fn.slimScroll&&window.console&&window.console.error("Error: the fixed layout requires the slimscroll plugin!"),void($.AdminLTE.options.sidebarSlimScroll&&"undefined"!=typeof $.fn.slimScroll&&($(".sidebar").slimScroll({destroy:!0}).height("auto"),$(".sidebar").slimscroll({height:$(window).height()-$(".main-header").height()+"px",color:"rgba(0,0,0,0.2)",size:"3px"})))):void("undefined"!=typeof $.fn.slimScroll&&$(".sidebar").slimScroll({destroy:!0}).height("auto"))}},$.AdminLTE.pushMenu={activate:function(a){var b=$.AdminLTE.options.screenSizes;$(document).on("click",a,function(a){a.preventDefault(),$(window).width()>b.sm-1?$("body").hasClass("sidebar-collapse")?$("body").removeClass("sidebar-collapse").trigger("expanded.pushMenu"):$("body").addClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").hasClass("sidebar-open")?$("body").removeClass("sidebar-open").removeClass("sidebar-collapse").trigger("collapsed.pushMenu"):$("body").addClass("sidebar-open").trigger("expanded.pushMenu")}),$(".content-wrapper").click(function(){$(window).width()<=b.sm-1&&$("body").hasClass("sidebar-open")&&$("body").removeClass("sidebar-open")}),($.AdminLTE.options.sidebarExpandOnHover||$("body").hasClass("fixed")&&$("body").hasClass("sidebar-mini"))&&this.expandOnHover()},expandOnHover:function(){var a=this,b=$.AdminLTE.options.screenSizes.sm-1;$(".main-sidebar").hover(function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-collapse")&&$(window).width()>b&&a.expand()},function(){$("body").hasClass("sidebar-mini")&&$("body").hasClass("sidebar-expanded-on-hover")&&$(window).width()>b&&a.collapse()})},expand:function(){$("body").removeClass("sidebar-collapse").addClass("sidebar-expanded-on-hover")},collapse:function(){$("body").hasClass("sidebar-expanded-on-hover")&&$("body").removeClass("sidebar-expanded-on-hover").addClass("sidebar-collapse")}},$.AdminLTE.tree=function(a){var b=this,c=$.AdminLTE.options.animationSpeed;$(document).off("click",a+" li a").on("click",a+" li a",function(a){var d=$(this),e=d.next();if(e.is(".treeview-menu")&&e.is(":visible")&&!$("body").hasClass("sidebar-collapse"))e.slideUp(c,function(){e.removeClass("menu-open")}),e.parent("li").removeClass("active");else if(e.is(".treeview-menu")&&!e.is(":visible")){var f=d.parents("ul").first(),g=f.find("ul:visible").slideUp(c);g.removeClass("menu-open");var h=d.parent("li");e.slideDown(c,function(){e.addClass("menu-open"),f.find("li.active").removeClass("active"),h.addClass("active"),b.layout.fix()})}e.is(".treeview-menu")&&a.preventDefault()})},$.AdminLTE.controlSidebar={activate:function(){var a=this,b=$.AdminLTE.options.controlSidebarOptions,c=$(b.selector),d=$(b.toggleBtnSelector);d.on("click",function(d){d.preventDefault(),c.hasClass("control-sidebar-open")||$("body").hasClass("control-sidebar-open")?a.close(c,b.slide):a.open(c,b.slide)});var e=$(".control-sidebar-bg");a._fix(e),$("body").hasClass("fixed")?a._fixForFixed(c):$(".content-wrapper, .right-side").height() .box-body, > .box-footer, > form >.box-body, > form > .box-footer");c.hasClass("collapsed-box")?(a.children(":first").removeClass(b.icons.open).addClass(b.icons.collapse),d.slideDown(b.animationSpeed,function(){c.removeClass("collapsed-box")})):(a.children(":first").removeClass(b.icons.collapse).addClass(b.icons.open),d.slideUp(b.animationSpeed,function(){c.addClass("collapsed-box")}))},remove:function(a){var b=a.parents(".box").first();b.slideUp(this.animationSpeed)}}}if("undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");$.AdminLTE={},$.AdminLTE.options={navbarMenuSlimscroll:!0,navbarMenuSlimscrollWidth:"3px",navbarMenuHeight:"200px",animationSpeed:500,sidebarToggleSelector:"[data-toggle='offcanvas']",sidebarPushMenu:!0,sidebarSlimScroll:!0,sidebarExpandOnHover:!1,enableBoxRefresh:!0,enableBSToppltip:!0,BSTooltipSelector:"[data-toggle='tooltip']",enableFastclick:!1,enableControlSidebar:!0,controlSidebarOptions:{toggleBtnSelector:"[data-toggle='control-sidebar']",selector:".control-sidebar",slide:!0},enableBoxWidget:!0,boxWidgetOptions:{boxWidgetIcons:{collapse:"fa-minus",open:"fa-plus",remove:"fa-times"},boxWidgetSelectors:{remove:'[data-widget="remove"]',collapse:'[data-widget="collapse"]'}},directChat:{enable:!0,contactToggleSelector:'[data-widget="chat-pane-toggle"]'},colors:{lightBlue:"#3c8dbc",red:"#f56954",green:"#00a65a",aqua:"#00c0ef",yellow:"#f39c12",blue:"#0073b7",navy:"#001F3F",teal:"#39CCCC",olive:"#3D9970",lime:"#01FF70",orange:"#FF851B",fuchsia:"#F012BE",purple:"#8E24AA",maroon:"#D81B60",black:"#222222",gray:"#d2d6de"},screenSizes:{xs:480,sm:768,md:992,lg:1200}},$(function(){"use strict";$("body").removeClass("hold-transition"),"undefined"!=typeof AdminLTEOptions&&$.extend(!0,$.AdminLTE.options,AdminLTEOptions);var a=$.AdminLTE.options;_init(),$.AdminLTE.layout.activate(),$.AdminLTE.tree(".sidebar"),a.enableControlSidebar&&$.AdminLTE.controlSidebar.activate(),a.navbarMenuSlimscroll&&"undefined"!=typeof $.fn.slimscroll&&$(".navbar .menu").slimscroll({height:a.navbarMenuHeight,alwaysVisible:!1,size:a.navbarMenuSlimscrollWidth}).css("width","100%"),a.sidebarPushMenu&&$.AdminLTE.pushMenu.activate(a.sidebarToggleSelector),a.enableBSToppltip&&$("body").tooltip({selector:a.BSTooltipSelector}),a.enableBoxWidget&&$.AdminLTE.boxWidget.activate(),a.enableFastclick&&"undefined"!=typeof FastClick&&FastClick.attach(document.body),a.directChat.enable&&$(document).on("click",a.directChat.contactToggleSelector,function(){var a=$(this).parents(".direct-chat").first();a.toggleClass("direct-chat-contacts-open")}),$('.btn-group[data-toggle="btn-toggle"]').each(function(){var a=$(this);$(this).find(".btn").on("click",function(b){a.find(".btn.active").removeClass("active"),$(this).addClass("active"),b.preventDefault()})})}),function(a){"use strict";a.fn.boxRefresh=function(b){function c(a){a.append(f),e.onLoadStart.call(a)}function d(a){a.find(f).remove(),e.onLoadDone.call(a)}var e=a.extend({trigger:".refresh-btn",source:"",onLoadStart:function(a){return a},onLoadDone:function(a){return a}},b),f=a('
');return this.each(function(){if(""===e.source)return void(window.console&&window.console.log("Please specify a source first - boxRefresh()"));var b=a(this),f=b.find(e.trigger).first();f.on("click",function(a){a.preventDefault(),c(b),b.find(".box-body").load(e.source,function(){d(b)})})})}}(jQuery),function(a){"use strict";a.fn.activateBox=function(){a.AdminLTE.boxWidget.activate(this)},a.fn.toggleBox=function(){var b=a(a.AdminLTE.boxWidget.selectors.collapse,this);a.AdminLTE.boxWidget.collapse(b)},a.fn.removeBox=function(){var b=a(a.AdminLTE.boxWidget.selectors.remove,this);a.AdminLTE.boxWidget.remove(b)}}(jQuery),function(a){"use strict";a.fn.todolist=function(b){var c=a.extend({onCheck:function(a){return a},onUncheck:function(a){return a}},b);return this.each(function(){"undefined"!=typeof a.fn.iCheck?(a("input",this).on("ifChecked",function(){var b=a(this).parents("li").first();b.toggleClass("done"),c.onCheck.call(b)}),a("input",this).on("ifUnchecked",function(){var b=a(this).parents("li").first();b.toggleClass("done"),c.onUncheck.call(b)})):a("input",this).on("change",function(){var b=a(this).parents("li").first();b.toggleClass("done"),a("input",b).is(":checked")?c.onCheck.call(b):c.onUncheck.call(b)})})}}(jQuery); \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/libs/bootstrap.min.js b/renren-generator/src/main/resources/static/libs/bootstrap.min.js new file mode 100644 index 0000000..9bcd2fc --- /dev/null +++ b/renren-generator/src/main/resources/static/libs/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/libs/fastclick.min.js b/renren-generator/src/main/resources/static/libs/fastclick.min.js new file mode 100644 index 0000000..131e29e --- /dev/null +++ b/renren-generator/src/main/resources/static/libs/fastclick.min.js @@ -0,0 +1 @@ +!function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;sc;c++)a[s[c]]=i(a[s[c]],a);r&&(t.addEventListener("mouseover",this.onMouse,!0),t.addEventListener("mousedown",this.onMouse,!0),t.addEventListener("mouseup",this.onMouse,!0)),t.addEventListener("click",this.onClick,!0),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,r){var i=Node.prototype.removeEventListener;"click"===e?i.call(t,e,n.hijacked||n,r):i.call(t,e,n,r)},t.addEventListener=function(e,n,r){var i=Node.prototype.addEventListener;"click"===e?i.call(t,e,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),r):i.call(t,e,n,r)}),"function"==typeof t.onclick&&(o=t.onclick,t.addEventListener("click",function(e){o(e)},!1),t.onclick=null)}}var n=navigator.userAgent.indexOf("Windows Phone")>=0,r=navigator.userAgent.indexOf("Android")>0&&!n,i=/iP(ad|hone|od)/.test(navigator.userAgent)&&!n,o=i&&/OS 4_\d(_\d)?/.test(navigator.userAgent),s=i&&/OS [6-7]_\d/.test(navigator.userAgent),a=navigator.userAgent.indexOf("BB10")>0;e.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(i&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)},e.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!r;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},e.prototype.sendClick=function(e,t){var n,r;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),r=t.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(e),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},e.prototype.determineEventType=function(e){return r&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},e.prototype.focus=function(e){var t;i&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},e.prototype.updateScrollParent=function(e){var t,n;if(t=e.fastClickScrollParent,!t||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},e.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e},e.prototype.onTouchStart=function(e){var t,n,r;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],i){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!o){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTimen||Math.abs(t.pageY-this.touchStartY)>n?!0:!1},e.prototype.onTouchMove=function(e){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},e.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},e.prototype.onTouchEnd=function(e){var t,n,a,c,l,u=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,s&&(l=e.changedTouches[0],u=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||u,u.fastClickScrollParent=this.targetElement.fastClickScrollParent),a=u.tagName.toLowerCase(),"label"===a){if(t=this.findControl(u)){if(this.focus(u),r)return!1;u=t}}else if(this.needsFocus(u))return e.timeStamp-n>100||i&&window.top!==window&&"input"===a?(this.targetElement=null,!1):(this.focus(u),this.sendClick(u,e),i&&"select"===a||(this.targetElement=null,e.preventDefault()),!1);return i&&!o&&(c=u.fastClickScrollParent,c&&c.fastClickLastScrollTop!==c.scrollTop)?!0:(this.needsClick(u)||(e.preventDefault(),this.sendClick(u,e)),!1)},e.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},e.prototype.onMouse=function(e){return this.targetElement?e.forwardedTouchEvent?!0:e.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1):!0:!0},e.prototype.onClick=function(e){var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail?!0:(t=this.onMouse(e),t||(this.targetElement=null),t)},e.prototype.destroy=function(){var e=this.layer;r&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},e.notNeeded=function(e){var t,n,i,o;if("undefined"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!r)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(a&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.touchAction?!0:(o=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],o>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(-1!==t.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===e.style.touchAction||"manipulation"===e.style.touchAction?!0:!1)},e.attach=function(t,n){return new e(t,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return e}):"undefined"!=typeof t&&t.exports?(t.exports=e.attach,t.exports.FastClick=e):window.FastClick=e}()},{}],2:[function(e){window.Origami={fastclick:e("./bower_components/fastclick/lib/fastclick.js")}},{"./bower_components/fastclick/lib/fastclick.js":1}]},{},[2]);;(function() {function trigger(){document.dispatchEvent(new CustomEvent('o.load'))};document.addEventListener('load',trigger);if (document.readyState==='ready') trigger();}());(function() {function trigger(){document.dispatchEvent(new CustomEvent('o.DOMContentLoaded'))};document.addEventListener('DOMContentLoaded',trigger);if (document.readyState==='interactive') trigger();}()) \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/libs/jquery.min.js b/renren-generator/src/main/resources/static/libs/jquery.min.js new file mode 100644 index 0000000..4024b66 --- /dev/null +++ b/renren-generator/src/main/resources/static/libs/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; +}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}e.vessel(f,function(n,r,d){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){l.parents("."+s[0])[0]||(l.data("display",l.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+s[0]+a).find("."+s[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=d),e.layero=i("#"+s[0]+a),t.scrollbar||s.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",l[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),s.anim[t.anim]&&e.layero.addClass(s.anim[t.anim]).data("anim",!0)}},l.pt.auto=function(e){function t(e){e=l.find(e),e.height(f[1]-c-d-2*(0|parseFloat(e.css("padding"))))}var a=this,o=a.config,l=i("#"+s[0]+e);""===o.area[0]&&o.maxWidth>0&&(r.ie&&r.ie<8&&o.btn&&l.width(l.innerWidth()),l.outerWidth()>o.maxWidth&&l.width(o.maxWidth));var f=[l.innerWidth(),l.innerHeight()],c=l.find(s[1]).outerHeight()||0,d=l.find("."+s[6]).outerHeight()||0;switch(o.type){case 2:t("iframe");break;default:""===o.area[1]?o.fixed&&f[1]>=n.height()&&(f[1]=n.height(),t("."+s[5])):t("."+s[5])}return a},l.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(s[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},l.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var l={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),l.autoLeft=function(){l.left+o[0]-n.width()>0?(l.tipLeft=l.left+l.width-o[0],f.css({right:12,left:"auto"})):l.tipLeft=l.left},l.where=[function(){l.autoLeft(),l.tipTop=l.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){l.tipLeft=l.left+l.width+10,l.tipTop=l.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){l.autoLeft(),l.tipTop=l.top+l.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){l.tipLeft=l.left-o[0]-10,l.tipTop=l.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],l.where[c-1](),1===c?l.top-(n.scrollTop()+o[1]+16)<0&&l.where[2]():2===c?n.width()-(l.left+l.width+o[0]+16)>0||l.where[3]():3===c?l.top-n.scrollTop()+l.height+o[1]+16-n.height()>0&&l.where[0]():4===c&&o[0]+16-l.left>0&&l.where[1](),a.find("."+s[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:l.tipLeft-(t.fixed?n.scrollLeft():0),top:l.tipTop-(t.fixed?n.scrollTop():0)})},l.pt.move=function(){var e=this,t=e.config,a=i(document),l=e.layero,s=l.find(t.move),f=l.find(".layui-layer-resize"),c={};return t.move&&s.css("cursor","move"),s.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(l.css("left")),e.clientY-parseFloat(l.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[l.outerWidth(),l.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],s="fixed"===l.css("position");if(i.preventDefault(),c.stX=s?0:n.scrollLeft(),c.stY=s?0:n.scrollTop(),!t.moveOut){var f=n.width()-l.outerWidth()+c.stX,d=n.height()-l.outerHeight()+c.stY;af&&(a=f),od&&(o=d)}l.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd()),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},l.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+s[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+s[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+s[0])[0]||1==n.attr("layer")&&i("."+s[0]).length<1&&n.removeAttr("layer").show(),n=null})},l.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+s[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},l.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){s.html.attr("layer-full")==e&&(s.html[0].style.removeProperty?s.html[0].style.removeProperty("overflow"):s.html[0].style.removeAttribute("overflow"),s.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+s[4]).attr("times"),i("#"+s[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+s[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+s[0]+e),a=n.find(s[1]).outerHeight()||0,o=n.find("."+s[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+s[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+s[0]+e),r=a.find(".layui-layer-content"),l=a.attr("type"),f=a.find(s[1]).outerHeight()||0,c=a.find("."+s[6]).outerHeight()||0;a.attr("minLeft");l!==o.type[3]&&l!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+s[6]).outerHeight(),l===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+s[0]+e),l=a.find(s[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:l,left:f,top:n.height()-l,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(s[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+s[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(s[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+s[0]+e);o.record(a),s.html.attr("layer-full")||s.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+s[0]+(t||r.index)).find(s[1]);n.html(e)},r.close=function(e){var t=i("#"+s[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var l="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+s[5]+")").remove();for(var a=t.find("."+l),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(l)}else{if(n===o.type[2])try{var f=i("#"+s[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+s[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}};t.data("anim")&&t.addClass(a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),"function"==typeof o.end[e]&&o.end[e](),delete o.end[e],t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),setTimeout(function(){f()},r.ie&&r.ie<10||!t.data("anim")?0:200)}},r.closeAll=function(e){i.each(i("."+s[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var l,s=2==e.formType?'":function(){return''}();return r.open(i.extend({type:1,btn:["确定","取消"],content:s,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){l=e.find(".layui-layer-input"),l.focus()},resize:!1,yes:function(i){var n=l.val();""===n?l.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",l,{tips:1}):t&&t(n,i,l)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{};return r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,n="";if(e>0)for(n=''+t[0].title+"";i"+t[i].title+"";return n}(),content:'
    '+function(){var e=t.length,i=1,n="";if(e>0)for(n='
  • '+(t[0].content||"no content")+"
  • ";i'+(t[i].content||"no content")+"";return n}()+"
",success:function(t){var n=t.find(".layui-layer-title").children(),a=t.find(".layui-layer-tabmain").children();n.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var n=i(this),o=n.index();n.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),a.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)})}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var l={};if(t=t||{},t.photos){var s=t.photos.constructor===Object,f=s?t.photos:{},d=f.data||[],u=f.start||0;if(l.imgIndex=(0|u)+1,t.img=t.img||"img",s){if(0===d.length)return r.msg("没有图片")}else{var y=i(t.photos),p=function(){d=[],y.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),d.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(p(),0===d.length)return;if(n||y.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:d,tab:t.tab},full:t.full}),!0),p()}),!n)return}l.imgprev=function(e){l.imgIndex--,l.imgIndex<1&&(l.imgIndex=d.length),l.tabimg(e)},l.imgnext=function(e,t){l.imgIndex++,l.imgIndex>d.length&&(l.imgIndex=1,t)||l.tabimg(e)},l.keyup=function(e){if(!l.end){var t=e.keyCode;e.preventDefault(),37===t?l.imgprev(!0):39===t?l.imgnext(!0):27===t&&r.close(l.index)}},l.tabimg=function(e){d.length<=1||(f.start=l.imgIndex-1,r.close(l.index),r.photos(t,!0,e))},l.event=function(){l.bigimg.hover(function(){l.imgsee.show()},function(){l.imgsee.hide()}),l.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),l.imgprev()}),l.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),l.imgnext()}),i(document).on("keyup",l.keyup)},l.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(d[u].src,function(n){r.close(l.loadi),l.index=r.open(i.extend({type:1,area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]'+(d[u].alt||
'+(d.length>1?'':"")+'
'+(d[u].alt||"")+""+l.imgIndex+"/"+d.length+"
",success:function(e,i){l.bigimg=e.find(".layui-layer-phimg"),l.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),l.event(e),t.tab&&t.tab(d[u],e)},end:function(){l.end=!0,i(document).off("keyup",l.keyup)}},t))},function(){r.close(l.loadi),r.msg("当前图片地址异常
是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){d.length>1&&l.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),s.html=i("html"),r.open=function(e){var t=new l(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.jquery),e.layer=r,t("layer",r)})):"function"==typeof define?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window); \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/plugins/layer/mobile/layer.js b/renren-generator/src/main/resources/static/plugins/layer/mobile/layer.js new file mode 100644 index 0000000..f9cf693 --- /dev/null +++ b/renren-generator/src/main/resources/static/plugins/layer/mobile/layer.js @@ -0,0 +1,2 @@ +/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */ + ;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'

'+(e?n.title[0]:n.title)+"

":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e=''+n.btn[0]+"",2===t&&(e=''+n.btn[1]+""+e),'
'+e+"
"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='

'+(n.content||"")+"

"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"
':"")+'
"+l+'
'+n.content+"
"+c+"
",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;odiv{line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px}.layui-m-layerbtn{display:box;display:-moz-box;display:-webkit-box;width:100%;height:50px;line-height:50px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2}.layui-m-layerbtn span{display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:14px;cursor:pointer}.layui-m-layerbtn span[yes]{color:#40AFFE}.layui-m-layerbtn span[no]{border-right:1px solid #D0D0D0;border-radius:0 0 0 5px}.layui-m-layerbtn span:active{background-color:#F6F6F6}.layui-m-layerend{position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px}.layui-m-layerend::after,.layui-m-layerend::before{position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px}.layui-m-layerend::after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}body .layui-m-layer .layui-m-layer-footer{position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0}.layui-m-layer-footer .layui-m-layercont{padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn{display:block;height:auto;background:0 0;border-top:none}.layui-m-layer-footer .layui-m-layerbtn span{background-color:rgba(255,255,255,.8)}.layui-m-layer-footer .layui-m-layerbtn span[no]{color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px}.layui-m-layer-footer .layui-m-layerbtn span[yes]{margin-top:10px;border-radius:5px}body .layui-m-layer .layui-m-layer-msg{width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff}.layui-m-layer-msg .layui-m-layercont{padding:10px 20px} \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/default/icon-ext.png b/renren-generator/src/main/resources/static/plugins/layer/skin/default/icon-ext.png new file mode 100644 index 0000000..bbbb669 Binary files /dev/null and b/renren-generator/src/main/resources/static/plugins/layer/skin/default/icon-ext.png differ diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/default/icon.png b/renren-generator/src/main/resources/static/plugins/layer/skin/default/icon.png new file mode 100644 index 0000000..3e17da8 Binary files /dev/null and b/renren-generator/src/main/resources/static/plugins/layer/skin/default/icon.png differ diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/default/layer.css b/renren-generator/src/main/resources/static/plugins/layer/skin/default/layer.css new file mode 100644 index 0000000..b88c0c7 --- /dev/null +++ b/renren-generator/src/main/resources/static/plugins/layer/skin/default/layer.css @@ -0,0 +1 @@ +.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}*html{background-image:url(about:blank);background-attachment:fixed}html #layuicss-skinlayercss{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;box-shadow:1px 1px 50px rgba(0,0,0,.3)}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-load{background:url(loading-1.gif) center center no-repeat #eee}.layui-layer-ico{background:url(icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-move{display:none;position:fixed;*position:absolute;left:0;top:0;width:100%;height:100%;cursor:move;opacity:0;filter:alpha(opacity=0);background-color:#fff;z-index:2147483647}.layui-layer-resize{position:absolute;width:15px;height:15px;right:0;bottom:0;cursor:se-resize}.layui-layer{border-radius:2px;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim{-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:rollIn;animation-name:rollIn}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:bounceOut;animation-name:bounceOut;-webkit-animation-duration:.2s;animation-duration:.2s}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:0 -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 10px 12px;pointer-events:auto;user-select:none;-webkit-user-select:none}.layui-layer-btn a{height:28px;line-height:28px;margin:0 6px;padding:0 15px;border:1px solid #dedede;background-color:#f1f1f1;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.8}.layui-layer-btn .layui-layer-btn0{border-color:#4898d5;background-color:#2e8ded;color:#fff}.layui-layer-btn-l{text-align:left}.layui-layer-btn-c{text-align:center}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:5px 10px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#000}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:1px;border-bottom-style:solid;border-bottom-color:#000}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#BBB5B5;border:none}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-prompt .layui-layer-content{padding:20px}.layui-layer-prompt .layui-layer-btn{padding-top:0}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:43px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}@media screen and (max-width:1100px){.layui-layer-iframe{overflow-y:auto;-webkit-overflow-scrolling:touch}} \ No newline at end of file diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-0.gif b/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-0.gif new file mode 100644 index 0000000..6f3c953 Binary files /dev/null and b/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-0.gif differ diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-1.gif b/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-1.gif new file mode 100644 index 0000000..db3a483 Binary files /dev/null and b/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-1.gif differ diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-2.gif b/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-2.gif new file mode 100644 index 0000000..5bb90fd Binary files /dev/null and b/renren-generator/src/main/resources/static/plugins/layer/skin/default/loading-2.gif differ diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/moon/default.png b/renren-generator/src/main/resources/static/plugins/layer/skin/moon/default.png new file mode 100644 index 0000000..77dfaf3 Binary files /dev/null and b/renren-generator/src/main/resources/static/plugins/layer/skin/moon/default.png differ diff --git a/renren-generator/src/main/resources/static/plugins/layer/skin/moon/style.css b/renren-generator/src/main/resources/static/plugins/layer/skin/moon/style.css new file mode 100644 index 0000000..027dd1e --- /dev/null +++ b/renren-generator/src/main/resources/static/plugins/layer/skin/moon/style.css @@ -0,0 +1 @@ +html #layui_layer_skinmoonstylecss{display:none;position:absolute;width:1989px}body .layer-ext-moon[type=dialog]{min-width:320px}body .layer-ext-moon-msg[type=dialog]{min-width:200px}body .layer-ext-moon .layui-layer-title{background:#f6f6f6;color:#212a31;font-size:16px;font-weight:700;height:46px;line-height:46px;border-bottom:1px solid #D5D5D5}body .layer-ext-moon .layui-layer-content .layui-layer-ico{height:32px;width:32px;top:18.5px}body .layer-ext-moon .layui-layer-ico0{background:url(default.png) -96px 0 no-repeat}body .layer-ext-moon .layui-layer-ico1{background:url(default.png) -224px 0 no-repeat}body .layer-ext-moon .layui-layer-ico2{background:url(default.png) -192px 0 no-repeat}body .layer-ext-moon .layui-layer-ico3{background:url(default.png) -160px 0 no-repeat}body .layer-ext-moon .layui-layer-ico4{background:url(default.png) -320px 0 no-repeat}body .layer-ext-moon .layui-layer-ico5{background:url(default.png) -288px 0 no-repeat}body .layer-ext-moon .layui-layer-ico6{background:url(default.png) -256px 0}body .layer-ext-moon .layui-layer-ico7{background:url(default.png) -128px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin{top:15px;right:15px}body .layer-ext-moon .layui-layer-setwin a{width:16px;height:16px}body .layer-ext-moon .layui-layer-setwin .layui-layer-min cite:hover{background-color:#56abe4}body .layer-ext-moon .layui-layer-setwin .layui-layer-max{background:url(default.png) -80px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-max:hover{background:url(default.png) -64px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin{background:url(default.png) -32px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover{background:url(default.png) -16px 0 no-repeat}body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2{background:url(default.png)}body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover{background:url(default.png) -48px 0}body .layer-ext-moon .layui-layer-padding{padding-top:24px}body .layer-ext-moon .layui-layer-btn{text-align:center;padding-top:15px;padding-bottom:15px;background:#f0f4f7;border-top:1px #c7c7c7 solid}body .layer-ext-moon .layui-layer-btn a{font-size:12px;font-weight:400;margin:0 7px;padding:6px 20px;color:#fff;border:1px solid #0064b6;background:no-repeat #0071ce;border-radius:3px;display:inline-block;height:20px;line-height:20px;text-align:center;vertical-align:middle;text-decoration:none;outline:0}body .layer-ext-moon .layui-layer-btn .layui-layer-btn0{background:#0071ce}body .layer-ext-moon .layui-layer-btn .layui-layer-btn1{background:#fff;color:#404a58;border:1px solid #c0c4cd;border-radius:3px}body .layer-ext-moon .layui-layer-btn .layui-layer-btn2{background:#f60;color:#fff;border:1px solid #f60;border-radius:3px}body .layer-ext-moon .layui-layer-btn .layui-layer-btn3{background:red;color:#fff;border:1px solid red;border-radius:3px}body .layer-ext-moon .layui-layer-title span.layui-layer-tabnow{height:47px} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/Controller.java.vm b/renren-generator/src/main/resources/template/Controller.java.vm new file mode 100644 index 0000000..d664038 --- /dev/null +++ b/renren-generator/src/main/resources/template/Controller.java.vm @@ -0,0 +1,116 @@ +package ${package}.modules.${moduleName}.controller; + +import ${package}.common.annotation.LogOperation; +import ${package}.common.constant.Constant; +import ${package}.common.page.PageData; +import ${package}.common.utils.ExcelUtils; +import ${package}.common.utils.Result; +import ${package}.common.validator.AssertUtils; +import ${package}.common.validator.ValidatorUtils; +import ${package}.common.validator.group.AddGroup; +import ${package}.common.validator.group.DefaultGroup; +import ${package}.common.validator.group.UpdateGroup; +import ${package}.modules.${moduleName}.dto.${className}DTO; +import ${package}.modules.${moduleName}.excel.${className}Excel; +import ${package}.modules.${moduleName}.service.${className}Service; +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 javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * ${comments} + * + * @author ${author} ${email} + * @since ${version} ${date} + */ +@RestController +@RequestMapping("${moduleName}/${pathName}") +@Api(tags="${comments}") +public class ${className}Controller { + @Autowired + private ${className}Service ${classname}Service; + + @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("${moduleName}:${pathName}:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData<${className}DTO> page = ${classname}Service.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("${moduleName}:${pathName}:info") + public Result<${className}DTO> get(@PathVariable("id") Long id){ + ${className}DTO data = ${classname}Service.get(id); + + return new Result<${className}DTO>().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("${moduleName}:${pathName}:save") + public Result save(@RequestBody ${className}DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + ${classname}Service.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("${moduleName}:${pathName}:update") + public Result update(@RequestBody ${className}DTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + ${classname}Service.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("${moduleName}:${pathName}:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + ${classname}Service.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("${moduleName}:${pathName}:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List<${className}DTO> list = ${classname}Service.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, ${className}Excel.class); + } + +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/DTO.java.vm b/renren-generator/src/main/resources/template/DTO.java.vm new file mode 100644 index 0000000..5080f4e --- /dev/null +++ b/renren-generator/src/main/resources/template/DTO.java.vm @@ -0,0 +1,31 @@ +package ${package}.modules.${moduleName}.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +#if(${hasBigDecimal}) +import java.math.BigDecimal; +#end + +/** + * ${comments} + * + * @author ${author} ${email} + * @since ${version} ${date} + */ +@Data +@ApiModel(value = "${comments}") +public class ${className}DTO implements Serializable { + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) + @ApiModelProperty(value = "$column.comments") + private $column.attrType $column.attrname; + +#end + +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/Dao.java.vm b/renren-generator/src/main/resources/template/Dao.java.vm new file mode 100644 index 0000000..3e3554a --- /dev/null +++ b/renren-generator/src/main/resources/template/Dao.java.vm @@ -0,0 +1,16 @@ +package ${package}.modules.${moduleName}.dao; + +import ${package}.common.dao.BaseDao; +import ${package}.modules.${moduleName}.entity.${className}Entity; +import org.apache.ibatis.annotations.Mapper; + +/** + * ${comments} + * + * @author ${author} ${email} + * @since ${version} ${date} + */ +@Mapper +public interface ${className}Dao extends BaseDao<${className}Entity> { + +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/Dao.xml.vm b/renren-generator/src/main/resources/template/Dao.xml.vm new file mode 100644 index 0000000..77acb47 --- /dev/null +++ b/renren-generator/src/main/resources/template/Dao.xml.vm @@ -0,0 +1,13 @@ + + + + + + +#foreach($column in $columns) + +#end + + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/Entity.java.vm b/renren-generator/src/main/resources/template/Entity.java.vm new file mode 100644 index 0000000..ad363f6 --- /dev/null +++ b/renren-generator/src/main/resources/template/Entity.java.vm @@ -0,0 +1,27 @@ +package ${package}.modules.${moduleName}.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +#if(${hasBigDecimal}) +import java.math.BigDecimal; +#end +import java.util.Date; + +/** + * ${comments} + * + * @author ${author} ${email} + * @since ${version} ${date} + */ +@Data +@TableName("${tableName}") +public class ${className}Entity { + +#foreach ($column in $columns) + /** + * $column.comments + */ + private $column.attrType $column.attrname; +#end +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/Excel.java.vm b/renren-generator/src/main/resources/template/Excel.java.vm new file mode 100644 index 0000000..330a021 --- /dev/null +++ b/renren-generator/src/main/resources/template/Excel.java.vm @@ -0,0 +1,24 @@ +package ${package}.modules.${moduleName}.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +#if(${hasBigDecimal}) +import java.math.BigDecimal; +#end +import java.util.Date; + +/** + * ${comments} + * + * @author ${author} ${email} + * @since ${version} ${date} + */ +@Data +public class ${className}Excel { +#foreach ($column in $columns) + @Excel(name = "$!column.comments") + private $column.attrType $column.attrname; +#end + +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/Service.java.vm b/renren-generator/src/main/resources/template/Service.java.vm new file mode 100644 index 0000000..b3ee606 --- /dev/null +++ b/renren-generator/src/main/resources/template/Service.java.vm @@ -0,0 +1,15 @@ +package ${package}.modules.${moduleName}.service; + +import ${package}.common.service.CrudService; +import ${package}.modules.${moduleName}.dto.${className}DTO; +import ${package}.modules.${moduleName}.entity.${className}Entity; + +/** + * ${comments} + * + * @author ${author} ${email} + * @since ${version} ${date} + */ +public interface ${className}Service extends CrudService<${className}Entity, ${className}DTO> { + +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/ServiceImpl.java.vm b/renren-generator/src/main/resources/template/ServiceImpl.java.vm new file mode 100644 index 0000000..60361c9 --- /dev/null +++ b/renren-generator/src/main/resources/template/ServiceImpl.java.vm @@ -0,0 +1,34 @@ +package ${package}.modules.${moduleName}.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import ${package}.common.service.impl.CrudServiceImpl; +import ${package}.modules.${moduleName}.dao.${className}Dao; +import ${package}.modules.${moduleName}.dto.${className}DTO; +import ${package}.modules.${moduleName}.entity.${className}Entity; +import ${package}.modules.${moduleName}.service.${className}Service; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * ${comments} + * + * @author ${author} ${email} + * @since ${version} ${date} + */ +@Service +public class ${className}ServiceImpl extends CrudServiceImpl<${className}Dao, ${className}Entity, ${className}DTO> implements ${className}Service { + + @Override + public QueryWrapper<${className}Entity> getWrapper(Map params){ + String id = (String)params.get("id"); + + QueryWrapper<${className}Entity> wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), "id", id); + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-generator/src/main/resources/template/add-or-update.vue.vm b/renren-generator/src/main/resources/template/add-or-update.vue.vm new file mode 100644 index 0000000..6dbe74e --- /dev/null +++ b/renren-generator/src/main/resources/template/add-or-update.vue.vm @@ -0,0 +1,94 @@ + + + diff --git a/renren-generator/src/main/resources/template/index.vue.vm b/renren-generator/src/main/resources/template/index.vue.vm new file mode 100644 index 0000000..8db5323 --- /dev/null +++ b/renren-generator/src/main/resources/template/index.vue.vm @@ -0,0 +1,72 @@ + + + diff --git a/renren-generator/src/main/resources/template/mysql.vm b/renren-generator/src/main/resources/template/mysql.vm new file mode 100644 index 0000000..6df0745 --- /dev/null +++ b/renren-generator/src/main/resources/template/mysql.vm @@ -0,0 +1,7 @@ +-- 菜单初始SQL +INSERT INTO sys_menu(id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date)VALUES (${id0}, 1067246875800000035, '$!comments', '${moduleName}/${pathName}', NULL, 0, 'icon-desktop', 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 (${id1}, ${id0}, '查看', NULL, '${moduleName}:${pathName}:page,${moduleName}:${pathName}: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 (${id2}, ${id0}, '新增', NULL, '${moduleName}:${pathName}: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 (${id3}, ${id0}, '修改', NULL, '${moduleName}:${pathName}: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 (${id4}, ${id0}, '删除', NULL, '${moduleName}:${pathName}: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 (${id5}, ${id0}, '导出', NULL, '${moduleName}:${pathName}:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now()); diff --git a/renren-generator/src/main/resources/template/oracle.vm b/renren-generator/src/main/resources/template/oracle.vm new file mode 100644 index 0000000..f8e2e53 --- /dev/null +++ b/renren-generator/src/main/resources/template/oracle.vm @@ -0,0 +1,7 @@ +-- 菜单初始SQL +INSERT INTO sys_menu(id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date)VALUES (${id0}, 1067246875800000035, '$!comments', '${moduleName}/${pathName}', NULL, 0, 'icon-desktop', 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 (${id1}, ${id0}, '查看', NULL, '${moduleName}:${pathName}:page,${moduleName}:${pathName}: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 (${id2}, ${id0}, '新增', NULL, '${moduleName}:${pathName}: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 (${id3}, ${id0}, '修改', NULL, '${moduleName}:${pathName}: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 (${id4}, ${id0}, '删除', NULL, '${moduleName}:${pathName}: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 (${id5}, ${id0}, '导出', NULL, '${moduleName}:${pathName}:export', 1, NULL, 4, 1067246875800000001, CURRENT_DATE, 1067246875800000001, CURRENT_DATE); diff --git a/renren-generator/src/main/resources/template/postgresql.vm b/renren-generator/src/main/resources/template/postgresql.vm new file mode 100644 index 0000000..6df0745 --- /dev/null +++ b/renren-generator/src/main/resources/template/postgresql.vm @@ -0,0 +1,7 @@ +-- 菜单初始SQL +INSERT INTO sys_menu(id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date)VALUES (${id0}, 1067246875800000035, '$!comments', '${moduleName}/${pathName}', NULL, 0, 'icon-desktop', 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 (${id1}, ${id0}, '查看', NULL, '${moduleName}:${pathName}:page,${moduleName}:${pathName}: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 (${id2}, ${id0}, '新增', NULL, '${moduleName}:${pathName}: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 (${id3}, ${id0}, '修改', NULL, '${moduleName}:${pathName}: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 (${id4}, ${id0}, '删除', NULL, '${moduleName}:${pathName}: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 (${id5}, ${id0}, '导出', NULL, '${moduleName}:${pathName}:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now()); diff --git a/renren-generator/src/main/resources/template/sqlserver.vm b/renren-generator/src/main/resources/template/sqlserver.vm new file mode 100644 index 0000000..55c6584 --- /dev/null +++ b/renren-generator/src/main/resources/template/sqlserver.vm @@ -0,0 +1,7 @@ +-- 菜单初始SQL +INSERT INTO sys_menu(id, pid, name, url, permissions, menu_type, icon, sort, creator, create_date, updater, update_date)VALUES (${id0}, 1067246875800000035, '$!comments', '${moduleName}/${pathName}', NULL, 0, 'icon-desktop', 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 (${id1}, ${id0}, '查看', NULL, '${moduleName}:${pathName}:page,${moduleName}:${pathName}: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 (${id2}, ${id0}, '新增', NULL, '${moduleName}:${pathName}: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 (${id3}, ${id0}, '修改', NULL, '${moduleName}:${pathName}: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 (${id4}, ${id0}, '删除', NULL, '${moduleName}:${pathName}: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 (${id5}, ${id0}, '导出', NULL, '${moduleName}:${pathName}:export', 1, NULL, 4, 1067246875800000001, getdate(), 1067246875800000001, getdate()); diff --git a/renren-generator/src/main/resources/views/generator.html b/renren-generator/src/main/resources/views/generator.html new file mode 100644 index 0000000..215db65 --- /dev/null +++ b/renren-generator/src/main/resources/views/generator.html @@ -0,0 +1,35 @@ + + + +代码生成器 + + + + + + + + + + + + + + + + +
+
+
+ +
+ 查询 +  生成代码 +
+
+
+
+ + + + \ No newline at end of file diff --git a/renren-generator/src/main/resources/views/index.html b/renren-generator/src/main/resources/views/index.html new file mode 100644 index 0000000..7a28774 --- /dev/null +++ b/renren-generator/src/main/resources/views/index.html @@ -0,0 +1,115 @@ + + + + + + 人人代码生成器 + + + + + + + + + + + + + + + +
+
+ + + +
+ + + + + + + +
+ +
+ +
+ + +
+ +
+ +
+ + +
+ + Copyright © 2018 renren.io All Rights Reserved +
+ + +
+ + + +
+ + + + + + + + + + + + diff --git a/renren-generator/src/main/resources/views/main.html b/renren-generator/src/main/resources/views/main.html new file mode 100644 index 0000000..44dc010 --- /dev/null +++ b/renren-generator/src/main/resources/views/main.html @@ -0,0 +1,29 @@ + + + + + + 欢迎页 + + + + +
+
基本信息
+
+

   获取帮助

+ +

官方微信群

+
    +
  • 扫码下面的二维码,关注【人人开源】公众号,回复【加群】,即可根据提示加入微信群!
  • +
  • 微信群
  • +
+
+
+ + \ No newline at end of file