diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ed0d720e6d3dc9b08dcdc42946b901766dae9022 --- /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 Levin丶枫过无痕 + + 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 index 992b691fadf94ac4a47b727a7fabb7d28ae00027..95b8b5db78204f93f0afcaa11e9b481117e9bf6d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,24 @@ ## 开始维护 +[http://demo.battcn.com](http://demo.battcn.com "演示地址") + 鉴于 `dubbo` 已经开始维护了 , 本项目也即将开启维护之旅 -坐等 `apache-dubbo` 与 `dubbo-spring-boot-starter(现在还是开发版)` \ No newline at end of file +坐等 `apache-dubbo` 与 `dubbo-spring-boot-starter(现在还是开发版)` + + +## 技术栈 + +- **spring-boot** +- **dubbo** +- **mybatis** +- **shiro** +- **zookeeper** +- **swagger** + +---------- + +**后续引入 redis、rabbitmq 等技术栈** + + + diff --git a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/ManagementApplication.java b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/ManagementApplication.java index ec65210da69ce36fb37c840b2b54bc101fa7cfa0..ca1e71e9da75cfc0b0ef4315a6f43faf01e65de6 100644 --- a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/ManagementApplication.java +++ b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/ManagementApplication.java @@ -3,11 +3,8 @@ package com.battcn.management.consumer; import com.battcn.swagger.annotation.EnableSwagger2Doc; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.context.ApplicationContext; -import org.springframework.web.bind.annotation.RestController; /** * 主程序启动类 @@ -16,38 +13,15 @@ import org.springframework.web.bind.annotation.RestController; * @version 2.5.1 * @since 2018-01-10 */ -@RestController + @EnableSwagger2Doc -@SpringBootApplication -@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) public class ManagementApplication { public static void main(String[] args) { - ApplicationContext applicationContext = SpringApplication.run(ManagementApplication.class, args); - ApplicationContextUtils.setApplicationContext(applicationContext); + SpringApplication.run(ManagementApplication.class, args); } - static public class ApplicationContextUtils { - - private static ApplicationContext applicationContext; - - public static ApplicationContext getApplicationContext() { - return applicationContext; - } - - private static void setApplicationContext(ApplicationContext applicationContext) { - ApplicationContextUtils.applicationContext = applicationContext; - } - - public static Object getBean(String name) { - return applicationContext.getBean(name); - } - - public static T getBean(Class requiredType) { - return applicationContext.getBean(requiredType); - } - } - } diff --git a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/BattcnLogAspect.java b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/BattcnLogAspect.java index 58d8caf711967eff73ee5b977da3c7f07c50a477..ae9559a3dcbe3d3904907341aa022dff646a8a77 100644 --- a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/BattcnLogAspect.java +++ b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/BattcnLogAspect.java @@ -18,6 +18,8 @@ import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; import javax.servlet.http.HttpServletRequest; @@ -40,10 +42,12 @@ public class BattcnLogAspect { application = "${dubbo.application.id}", url = "dubbo://localhost:20880") private LogService logsService; - @Reference(version = "1.0.0", - application = "${dubbo.application.id}", - url = "dubbo://localhost:20880") - private HttpServletRequest request; + + private final HttpServletRequest request; + + public BattcnLogAspect(@Qualifier HttpServletRequest request) { + this.request = request; + } /** diff --git a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/GlobalExceptionHandler.java b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/GlobalExceptionHandler.java index 5add8fc6606f34429f90c10f861b4a0c685fd161..3b115fee775f860f4acc8b855ec82a65c99d518c 100644 --- a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/GlobalExceptionHandler.java +++ b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/GlobalExceptionHandler.java @@ -17,12 +17,10 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExcep import javax.servlet.http.HttpServletResponse; /** - * ClassName:GrobalExceptionHandler
+ * ClassName:GlobalExceptionHandler
* * @author Levin * @version 1.0 - * @see - * @since 2017年06月15日 */ @ControllerAdvice public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { diff --git a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/shiro/ShiroConfiguration.java b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/shiro/ShiroConfiguration.java index af7a3298034dbe74396e7a1f5f346a68744647bc..95ecae1f25993e67235c71fe44ea02c75f5167b8 100644 --- a/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/shiro/ShiroConfiguration.java +++ b/battcn-consumers/battcn-management-consumer/src/main/java/com/battcn/management/consumer/config/shiro/ShiroConfiguration.java @@ -1,6 +1,5 @@ package com.battcn.management.consumer.config.shiro; -import com.alibaba.dubbo.config.annotation.Reference; import com.alibaba.fastjson.JSON; import com.battcn.system.facade.OperateService; import com.google.common.collect.Maps; @@ -11,9 +10,9 @@ import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSource import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.ImportResource; import java.util.Map; @@ -22,17 +21,11 @@ import java.util.Map; * * @author Levin */ +@ImportResource("classpath:dubbo.xml") @Slf4j -//@Configuration +@Configuration public class ShiroConfiguration { - @Reference(version = "1.0.0", - application = "${dubbo.application.id}", - url = "dubbo://localhost:20880", init = true) - @Autowired(required = false) - private OperateService operateService; - - @Bean public EhCacheManager getEhCacheManager() { EhCacheManager em = new EhCacheManager(); @@ -61,7 +54,7 @@ public class ShiroConfiguration { } @Bean(name = "securityManager") - public DefaultWebSecurityManager getDefaultWebSecurityManager(@Qualifier("authRealm") AuthRealm authRealm) { + public DefaultWebSecurityManager getDefaultWebSecurityManager(AuthRealm authRealm) { DefaultWebSecurityManager defaultWebSecurityManager = new DefaultWebSecurityManager(); defaultWebSecurityManager.setRealm(authRealm); // diff --git a/battcn-consumers/battcn-management-consumer/src/main/resources/dubbo.xml b/battcn-consumers/battcn-management-consumer/src/main/resources/dubbo.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ff1fbd0e89215075120d5429d18fec9ea4cdc6e --- /dev/null +++ b/battcn-consumers/battcn-management-consumer/src/main/resources/dubbo.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git "a/battcn-consumers/battcn-management-consumer/src/main/resources/\344\275\277\347\224\250\351\241\273\347\237\245/battcn-plus.sql" "b/battcn-consumers/battcn-management-consumer/src/main/resources/\344\275\277\347\224\250\351\241\273\347\237\245/battcn-plus.sql" deleted file mode 100644 index 90c0139106813bbb94a70b84354700965a70ecfd..0000000000000000000000000000000000000000 --- "a/battcn-consumers/battcn-management-consumer/src/main/resources/\344\275\277\347\224\250\351\241\273\347\237\245/battcn-plus.sql" +++ /dev/null @@ -1,284 +0,0 @@ - --- ---------------------------- --- 本SQL采用的是MYSQL5.6 如果版本不 < 5.6请去官方安装 --- 否则运行SQL会出现:[Err] 1067 - Invalid default value for 'gmt_create' --- 如果真的想使用,请修改 --- `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' (修改前) --- `gmt_create` datetime DEFAULT NULL COMMENT '创建时间' (修改后) --- ---------------------------- - - -/* -Navicat MySQL Data Transfer - -Source Server : 192.168.18.183 -Source Server Version : 100119 -Source Host : 192.168.18.183:3306 -Source Database : battcn-plus - -Target Server Type : MYSQL -Target Server Version : 100119 -File Encoding : 65001 - -Date: 2017-06-22 09:54:35 -*/ - -SET FOREIGN_KEY_CHECKS=0; - --- ---------------------------- --- Table structure for t_sys_log --- ---------------------------- -DROP TABLE IF EXISTS `t_sys_log`; -CREATE TABLE `t_sys_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', - `account` varchar(50) DEFAULT NULL COMMENT '账号', - `title` varchar(40) DEFAULT NULL COMMENT '标题', - `methods` varchar(128) DEFAULT NULL COMMENT '执行的方法', - `message` varchar(255) DEFAULT NULL COMMENT '消息', - `ip` varchar(15) DEFAULT NULL COMMENT 'IP', - `duration` smallint(5) DEFAULT NULL COMMENT '执行时间', - `params` longtext COMMENT '请求参数', - `url` varchar(255) DEFAULT NULL COMMENT '请求地址', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of t_sys_log --- ---------------------------- - --- ---------------------------- --- Table structure for t_sys_manager --- ---------------------------- -DROP TABLE IF EXISTS `t_sys_manager`; -CREATE TABLE `t_sys_manager` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID', - `account` varchar(50) NOT NULL COMMENT '账号', - `password` varchar(50) NOT NULL COMMENT '密码', - `role_id` tinyint(3) DEFAULT NULL COMMENT '角色', - `name` varchar(50) DEFAULT NULL COMMENT '姓名', - `credential` varchar(100) DEFAULT NULL COMMENT '验证凭证', - `locked` bit(1) DEFAULT b'1' COMMENT '是否启用 0=禁用 1=启用', - `email` varchar(64) DEFAULT NULL COMMENT '邮箱', - `phone` varchar(64) DEFAULT NULL COMMENT '电话', - `sex` varchar(255) DEFAULT NULL COMMENT '性别', - `type` varchar(255) DEFAULT NULL COMMENT '类型', - `photo` varchar(266) DEFAULT NULL COMMENT '头像', - `last_login_ip` varchar(15) DEFAULT NULL COMMENT '登陆IP', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `AK_ACCOUNT` (`account`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户管理表'; - --- ---------------------------- --- Records of t_sys_manager --- ---------------------------- -INSERT INTO `t_sys_manager` VALUES ('1', 'admin', '123456', '1', '秋殇', '9c6c9e22ae8c773c8f07a75b28563152', '', null, null, null, null, null, null, '2017-06-16 08:59:01', '2017-06-16 08:59:01'); -INSERT INTO `t_sys_manager` VALUES ('2', 'battcn', 'battcn', '2', '11333', null, '', null, null, null, null, null, null, '2017-06-19 09:20:14', '2017-06-21 13:49:37'); - --- ---------------------------- --- Table structure for t_sys_menu --- ---------------------------- -DROP TABLE IF EXISTS `t_sys_menu`; -CREATE TABLE `t_sys_menu` ( - `id` int(8) NOT NULL AUTO_INCREMENT COMMENT '自增ID', - `name` varchar(50) NOT NULL COMMENT '名称', - `remark` varchar(2000) DEFAULT NULL COMMENT '备注', - `icon` varchar(100) DEFAULT NULL COMMENT '图标', - `channel` varchar(100) DEFAULT NULL COMMENT '渠道', - `param` varchar(200) DEFAULT NULL, - `locked` bit(1) DEFAULT b'1' COMMENT '是否启用 0=禁用 1=启用', - `pater_id` int(8) DEFAULT NULL COMMENT '父级编号', - `ordno` int(8) DEFAULT NULL COMMENT '排序编号', - `n_level` int(8) DEFAULT NULL COMMENT '级别', - `scort` varchar(100) DEFAULT NULL COMMENT 'tree所需', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`id`), - KEY `FK_Reference` (`pater_id`), - CONSTRAINT `t_sys_menu_ibfk_1` FOREIGN KEY (`pater_id`) REFERENCES `t_sys_menu` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='菜单表'; - --- ---------------------------- --- Records of t_sys_menu --- ---------------------------- -INSERT INTO `t_sys_menu` VALUES ('1', '系统管理', '系统管理', 'fa fa fa-home', '/sys/sys', 'sys', '', null, '6', '0', ',1,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('2', '菜单管理', '菜单管理', 'fa fa-server', '/sys/menu', 'sys:menu', '', '1', '2', '1', ',1,2,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('3', '操作管理', '操作管理', 'fa fa-hand-lizard-o', '/sys/operate', 'sys:operate', '', '1', '3', '1', ',1,3,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('4', '角色管理', '角色管理', 'fa fa-sitemap', '/sys/role', 'sys:role', '', '1', '4', '1', ',1,4,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('5', '帐号管理', '帐号管理', 'fa fa-sun-o', '/sys/manager', 'sys:manager', '', '1', '1', '1', ',1,5,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('6', '日志管理', '日志管理', 'fa fa-comments-o', '/sys/log', 'sys:logs', '', '1', '7', '1', ',1,6,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('7', '字典管理', '字典管理', 'fa fa-newspaper-o', '/sys/dict', 'sys:dict', '\0', '1', '5', '1', ',1,7,', '2017-06-16 09:00:09', '2017-06-21 10:11:01'); -INSERT INTO `t_sys_menu` VALUES ('8', '鏖战工具', '鏖战工具', 'fa fa-cogs', '/battcn/utils', 'battcn:utils', '\0', null, '1', '0', ',8,', '2017-06-16 09:00:09', '2017-06-21 11:44:19'); -INSERT INTO `t_sys_menu` VALUES ('9', '测试', null, null, null, null, '\0', '8', null, '1', ',8,9,', '2017-06-20 19:05:47', '2017-06-21 11:44:57'); - --- ---------------------------- --- Table structure for t_sys_operate --- ---------------------------- -DROP TABLE IF EXISTS `t_sys_operate`; -CREATE TABLE `t_sys_operate` ( - `id` int(8) NOT NULL AUTO_INCREMENT COMMENT '主键', - `menu_id` int(8) NOT NULL COMMENT '菜单ID', - `op` varchar(30) NOT NULL COMMENT '选项', - `name` varchar(64) NOT NULL COMMENT '名字', - `icon` varchar(50) DEFAULT NULL COMMENT '图标', - `remark` varchar(2000) DEFAULT NULL COMMENT '备注', - `ordno` int(11) DEFAULT NULL COMMENT '排序号', - `display` int(1) NOT NULL COMMENT '是否显示出来', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `menu_op` (`menu_id`,`op`) -) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='操作表'; - --- ---------------------------- --- Records of t_sys_operate --- ---------------------------- -INSERT INTO `t_sys_operate` VALUES ('1', '1', 'list', '查看', 'list', null, '1', '0', '2017-06-20 18:52:32', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('2', '2', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('3', '2', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('4', '2', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('5', '2', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('6', '2', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('7', '3', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('8', '3', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('9', '3', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('10', '3', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('11', '3', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-21 10:15:01'); -INSERT INTO `t_sys_operate` VALUES ('12', '4', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('13', '4', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('14', '4', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('15', '4', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('16', '4', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('17', '5', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('18', '5', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('19', '5', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('20', '5', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('21', '5', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('22', '6', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-21 09:29:01'); -INSERT INTO `t_sys_operate` VALUES ('23', '7', 'edit', '编辑', 'edit', null, '2', '1', '2017-06-16 09:01:08', '2017-06-21 09:29:09'); -INSERT INTO `t_sys_operate` VALUES ('24', '7', 'list', '查看', 'list', null, '2', '0', '2017-06-16 09:01:08', '2017-06-21 09:29:10'); -INSERT INTO `t_sys_operate` VALUES ('25', '7', 'remove', '删除', 'remove', null, '1', '1', '2017-06-16 09:01:08', '2017-06-21 09:29:12'); -INSERT INTO `t_sys_operate` VALUES ('26', '7', 'save', '保存', 'save', null, '3', '0', '2017-06-16 09:01:08', '2017-06-21 09:29:13'); -INSERT INTO `t_sys_operate` VALUES ('27', '4', 'permissions', '分配权限', 'permissions', null, '1', '1', '2017-06-20 13:38:21', '2017-06-21 09:29:14'); -INSERT INTO `t_sys_operate` VALUES ('28', '8', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-21 10:09:23'); -INSERT INTO `t_sys_operate` VALUES ('29', '6', 'export', '导出', 'file-excel-o', '导出Excel', '1', '1', '2018-01-17 12:25:43', '2018-01-17 12:36:50'); - --- ---------------------------- --- Table structure for t_sys_role --- ---------------------------- -DROP TABLE IF EXISTS `t_sys_role`; -CREATE TABLE `t_sys_role` ( - `id` int(8) NOT NULL AUTO_INCREMENT COMMENT '主键', - `name` varchar(50) NOT NULL COMMENT '角色名', - `code` varchar(50) DEFAULT NULL COMMENT '编号', - `remark` varchar(200) DEFAULT NULL COMMENT '备注', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of t_sys_role --- ---------------------------- -INSERT INTO `t_sys_role` VALUES ('1', '超级管理员', 'manager', '超级管理员,不听话就封号', '2017-06-16 09:01:23', '2017-06-16 09:01:23'); -INSERT INTO `t_sys_role` VALUES ('2', '测试管理员', 'test', '专门测试没有权限的时候1', '2017-06-16 09:01:23', '2017-06-16 09:01:23'); -INSERT INTO `t_sys_role` VALUES ('3', '开发管理员', 'code', '我是开发不服删数据库', '2017-06-16 09:01:23', '2017-06-20 19:11:31'); - --- ---------------------------- --- Table structure for t_sys_role_operate --- ---------------------------- -DROP TABLE IF EXISTS `t_sys_role_operate`; -CREATE TABLE `t_sys_role_operate` ( - `role_id` int(8) NOT NULL COMMENT '角色ID', - `operate_id` int(8) NOT NULL COMMENT '操作表ID', - `gmt_create` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间', - PRIMARY KEY (`role_id`,`operate_id`), - KEY `operate_id` (`operate_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of t_sys_role_operate --- ---------------------------- -INSERT INTO `t_sys_role_operate` VALUES ('1', '1', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '2', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '3', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '4', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '5', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '6', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '7', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '8', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '9', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '10', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '11', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '12', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '13', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '14', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '15', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '16', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '17', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '18', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '19', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '20', '2017-06-16 09:01:40', '2017-06-16 09:01:40'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '21', '2017-06-16 09:01:40', '2017-06-20 20:17:35'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '22', '2017-06-20 20:17:58', '2017-06-20 20:18:14'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '23', '2017-06-16 09:01:40', '2017-06-20 19:12:06'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '24', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '25', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '26', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '27', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '28', '2017-06-16 09:01:40', '2017-06-20 19:14:27'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '29', '2017-06-16 09:01:40', '2017-06-20 20:18:03'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '30', '2017-06-16 09:01:40', '2017-06-20 20:18:03'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '31', '2017-06-20 20:17:54', '2017-06-20 20:18:11'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '1', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '2', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '3', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '4', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '5', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); - - --- ---------------------------- --- Procedure structure for refreshTreeNodes --- ---------------------------- -DROP PROCEDURE IF EXISTS `refreshTreeNodes`; -DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `refreshTreeNodes`() -BEGIN - -DECLARE LEVEL INT ; -SET LEVEL = 0 ; UPDATE t_sys_menu a -INNER JOIN ( - SELECT - id, - n_level, - concat(',', ID, ',') scort - FROM - t_sys_menu - WHERE - pater_id IS NULL -) b ON a.id = b.id -SET a.n_level = b.n_level, - a.scort = b.scort ; -WHILE FOUND_ROWS() > 0 DO -SET LEVEL = LEVEL + 1 ; UPDATE t_sys_menu a -INNER JOIN ( - SELECT - ID, - n_level, - scort - FROM - t_sys_menu - WHERE - n_level = LEVEL - 1 -) b ON a.pater_id = b.id -SET a.n_level = b.n_level, - a.scort = concat(b.scort, a.ID, ',') ; -END -WHILE ; -END -;; -DELIMITER ; diff --git "a/battcn-consumers/battcn-management-consumer/src/main/resources/\344\275\277\347\224\250\351\241\273\347\237\245/install.sql" "b/battcn-consumers/battcn-management-consumer/src/main/resources/\344\275\277\347\224\250\351\241\273\347\237\245/install.sql" deleted file mode 100644 index 184614b7335309ba613d431dd77b395db5535fc5..0000000000000000000000000000000000000000 --- "a/battcn-consumers/battcn-management-consumer/src/main/resources/\344\275\277\347\224\250\351\241\273\347\237\245/install.sql" +++ /dev/null @@ -1,106 +0,0 @@ -TRUNCATE TABLE `t_sys_manager`; -TRUNCATE TABLE `t_sys_menu`; -TRUNCATE TABLE `t_sys_operate`; -TRUNCATE TABLE `t_sys_role`; -TRUNCATE TABLE `t_sys_role_operate`; - - -INSERT INTO `t_sys_manager` VALUES ('1', 'admin', '123456', '1', '秋殇', '9c6c9e22ae8c773c8f07a75b28563152', '', null, null, null, null, null, null, '2017-06-16 08:59:01', '2017-06-16 08:59:01'); -INSERT INTO `t_sys_manager` VALUES ('2', 'battcn', 'battcn', '2', '11333', null, '', null, null, null, null, null, null, '2017-06-19 09:20:14', '2017-06-21 13:49:37'); - - -INSERT INTO `t_sys_menu` VALUES ('1', '系统管理', '系统管理', 'fa fa fa-home', '/sys/sys', 'sys', '', null, '6', '0', ',1,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('2', '菜单管理', '菜单管理', 'fa fa-server', '/sys/menu', 'sys:menu', '', '1', '2', '1', ',1,2,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('3', '操作管理', '操作管理', 'fa fa-hand-lizard-o', '/sys/operate', 'sys:operate', '', '1', '3', '1', ',1,3,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('4', '角色管理', '角色管理', 'fa fa-sitemap', '/sys/role', 'sys:role', '', '1', '4', '1', ',1,4,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('5', '帐号管理', '帐号管理', 'fa fa-sun-o', '/sys/manager', 'sys:manager', '', '1', '1', '1', ',1,5,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('6', '日志管理', '日志管理', 'fa fa-comments-o', '/sys/log', 'sys:logs', '', '1', '7', '1', ',1,6,', '2017-06-16 09:00:09', '2017-06-20 18:57:17'); -INSERT INTO `t_sys_menu` VALUES ('7', '字典管理', '字典管理', 'fa fa-newspaper-o', '/sys/dict', 'sys:dict', '\0', '1', '5', '1', ',1,7,', '2017-06-16 09:00:09', '2017-06-21 10:11:01'); -INSERT INTO `t_sys_menu` VALUES ('8', '鏖战工具', '鏖战工具', 'fa fa-cogs', '/battcn/utils', 'battcn:utils', '\0', null, '1', '0', ',8,', '2017-06-16 09:00:09', '2017-06-21 11:44:19'); -INSERT INTO `t_sys_menu` VALUES ('9', '测试', null, null, null, null, '\0', '8', null, '1', ',8,9,', '2017-06-20 19:05:47', '2017-06-21 11:44:57'); - - - --- ---------------------------- --- Records of t_sys_operate --- ---------------------------- -INSERT INTO `t_sys_operate` VALUES ('1', '1', 'list', '查看', 'list', null, '1', '0', '2017-06-20 18:52:32', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('2', '2', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('3', '2', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('4', '2', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('5', '2', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('6', '2', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('7', '3', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('8', '3', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('9', '3', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('10', '3', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('11', '3', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-21 10:15:01'); -INSERT INTO `t_sys_operate` VALUES ('12', '4', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('13', '4', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('14', '4', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('15', '4', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('16', '4', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('17', '5', 'edit', '编辑', 'edit', null, '3', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('18', '5', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('19', '5', 'remove', '删除', 'remove', null, '4', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('20', '5', 'save', '保存', 'save', null, '5', '0', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('21', '5', 'add', '新增', 'plus', null, '2', '1', '2017-06-16 09:01:08', '2017-06-20 19:09:41'); -INSERT INTO `t_sys_operate` VALUES ('22', '6', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-21 09:29:01'); -INSERT INTO `t_sys_operate` VALUES ('23', '7', 'edit', '编辑', 'edit', null, '2', '1', '2017-06-16 09:01:08', '2017-06-21 09:29:09'); -INSERT INTO `t_sys_operate` VALUES ('24', '7', 'list', '查看', 'list', null, '2', '0', '2017-06-16 09:01:08', '2017-06-21 09:29:10'); -INSERT INTO `t_sys_operate` VALUES ('25', '7', 'remove', '删除', 'remove', null, '1', '1', '2017-06-16 09:01:08', '2017-06-21 09:29:12'); -INSERT INTO `t_sys_operate` VALUES ('26', '7', 'save', '保存', 'save', null, '3', '0', '2017-06-16 09:01:08', '2017-06-21 09:29:13'); -INSERT INTO `t_sys_operate` VALUES ('27', '4', 'permissions', '分配权限', 'permissions', null, '1', '1', '2017-06-20 13:38:21', '2017-06-21 09:29:14'); -INSERT INTO `t_sys_operate` VALUES ('28', '8', 'list', '查看', 'list', null, '1', '0', '2017-06-16 09:01:08', '2017-06-21 10:09:23'); -INSERT INTO `t_sys_operate` VALUES ('29', '6', 'export', '导出', 'file-excel-o', '导出Excel', '1', '1', '2018-01-17 12:25:43', '2018-01-17 12:36:50'); - - - --- ---------------------------- --- Records of t_sys_role --- ---------------------------- -INSERT INTO `t_sys_role` VALUES ('1', '超级管理员', 'manager', '超级管理员,不听话就封号', '2017-06-16 09:01:23', '2017-06-16 09:01:23'); -INSERT INTO `t_sys_role` VALUES ('2', '测试管理员', 'test', '专门测试没有权限的时候1', '2017-06-16 09:01:23', '2017-06-16 09:01:23'); -INSERT INTO `t_sys_role` VALUES ('3', '开发管理员', 'code', '我是开发不服删数据库', '2017-06-16 09:01:23', '2017-06-20 19:11:31'); - - --- ---------------------------- --- Records of t_sys_role_operate --- ---------------------------- -INSERT INTO `t_sys_role_operate` VALUES ('1', '1', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '2', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '3', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '4', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '5', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '6', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '7', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '8', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '9', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '10', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '11', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '12', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '13', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '14', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '15', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '16', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '17', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '18', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '19', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '20', '2017-06-16 09:01:40', '2017-06-16 09:01:40'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '21', '2017-06-16 09:01:40', '2017-06-20 20:17:35'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '22', '2017-06-20 20:17:58', '2017-06-20 20:18:14'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '23', '2017-06-16 09:01:40', '2017-06-20 19:12:06'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '24', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '25', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '26', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '27', '2017-06-16 09:01:40', '2017-06-20 19:12:07'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '28', '2017-06-16 09:01:40', '2017-06-20 19:14:27'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '29', '2017-06-16 09:01:40', '2017-06-20 20:18:03'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '30', '2017-06-16 09:01:40', '2017-06-20 20:18:03'); -INSERT INTO `t_sys_role_operate` VALUES ('1', '31', '2017-06-20 20:17:54', '2017-06-20 20:18:11'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '1', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '2', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '3', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '4', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); -INSERT INTO `t_sys_role_operate` VALUES ('2', '5', '2017-06-16 09:01:39', '2017-06-16 09:01:39'); - diff --git a/battcn-facades/battcn-system-facade/src/main/java/com/battcn/system/pojo/dto/ShiroPermission.java b/battcn-facades/battcn-system-facade/src/main/java/com/battcn/system/pojo/dto/ShiroPermission.java index 3953e8b4f7314bb59f88404f9e669e36d28b91d9..34fd0c0e92a5c17443d045cc80d0ab1aa40f71e2 100644 --- a/battcn-facades/battcn-system-facade/src/main/java/com/battcn/system/pojo/dto/ShiroPermission.java +++ b/battcn-facades/battcn-system-facade/src/main/java/com/battcn/system/pojo/dto/ShiroPermission.java @@ -1,36 +1,17 @@ package com.battcn.system.pojo.dto; +import lombok.Data; + /** * @author Levin */ -public class ShiroPermission { +@Data +public class ShiroPermission implements java.io.Serializable{ + + private static final long serialVersionUID = 2282773948895767820L; private String menuName; private String path; private String perms; - public String getMenuName() { - return menuName; - } - - public void setMenuName(String menuName) { - this.menuName = menuName; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getPerms() { - return perms; - } - - public void setPerms(String perms) { - this.perms = perms; - } - } diff --git a/battcn-framework/battcn-framework-mybatis/pom.xml b/battcn-framework/battcn-framework-mybatis/pom.xml index b62f4b973ec5348ca0a4c10beb82d1645e15c140..db5d7ff192aea6b91334cde5923098284a50767f 100644 --- a/battcn-framework/battcn-framework-mybatis/pom.xml +++ b/battcn-framework/battcn-framework-mybatis/pom.xml @@ -10,6 +10,10 @@ battcn-framework-mybatis + + org.projectlombok + lombok + mysql mysql-connector-java diff --git a/battcn-framework/battcn-framework-mybatis/src/main/java/com/battcn/framework/mybatis/pojo/RecordEntity.java b/battcn-framework/battcn-framework-mybatis/src/main/java/com/battcn/framework/mybatis/pojo/RecordEntity.java index 18c9241631b9d26a8f8cf434901a5172e6c00434..3c4e4b8aa80977861b085b58869137667b55f573 100644 --- a/battcn-framework/battcn-framework-mybatis/src/main/java/com/battcn/framework/mybatis/pojo/RecordEntity.java +++ b/battcn-framework/battcn-framework-mybatis/src/main/java/com/battcn/framework/mybatis/pojo/RecordEntity.java @@ -13,50 +13,25 @@ public class RecordEntity implements Serializable { private static final long serialVersionUID = 7026470724648329551L; - @Column(name = "created_time", insertable = false, updatable = false) - private Date createdTime; + @Column(name = "gmt_create", insertable = false, updatable = false) + private Date gmtCreate; - @Column(name = "created_by") - private Long createdBy; + @Column(name = "gmt_modified", insertable = false, updatable = false) + private Date gmtModified; - @Column(name = "last_modified_time", insertable = false, updatable = false) - private Date lastModifiedTime; - - @Column(name = "last_modified_by") - private Long lastModifiedBy; - - public RecordEntity() { - } - - public Date getCreatedTime() { - return createdTime; - } - - public void setCreatedTime(Date createdTime) { - this.createdTime = createdTime; - } - - public Long getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(Long createdBy) { - this.createdBy = createdBy; - } - - public Date getLastModifiedTime() { - return lastModifiedTime; + public Date getGmtCreate() { + return gmtCreate; } - public void setLastModifiedTime(Date lastModifiedTime) { - this.lastModifiedTime = lastModifiedTime; + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; } - public Long getLastModifiedBy() { - return lastModifiedBy; + public Date getGmtModified() { + return gmtModified; } - public void setLastModifiedBy(Long lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; } } diff --git a/battcn-parent/pom.xml b/battcn-parent/pom.xml index c8b855c97764b425a6e05d2bc4c7c4479cf50c01..28b0ba7fb200580ae935c83d110029f51dedca9e 100644 --- a/battcn-parent/pom.xml +++ b/battcn-parent/pom.xml @@ -81,6 +81,19 @@ ${project.artifactId} + + + src/main/resources + false + + + src/main/java + + **/*.xml + + false + + diff --git a/battcn-provider/battcn-system-provider/pom.xml b/battcn-provider/battcn-system-provider/pom.xml index 217ad6d04bcc1de2581a579fda15cc1536939fe0..6602fe6d9f846bb3c0bfa3afbac0809348265b04 100644 --- a/battcn-provider/battcn-system-provider/pom.xml +++ b/battcn-provider/battcn-system-provider/pom.xml @@ -43,16 +43,4 @@ - - - - - - - src/main/resources - true - - - - \ No newline at end of file diff --git a/battcn-provider/battcn-system-provider/src/main/java/com/battcn/system/provider/service/MenuServiceImpl.java b/battcn-provider/battcn-system-provider/src/main/java/com/battcn/system/provider/service/MenuServiceImpl.java index 6190ba892bbfd6c009f497fca2bbc07c334245ca..6d27bffe7c01d7f342d42a5d810429722b8ea02f 100644 --- a/battcn-provider/battcn-system-provider/src/main/java/com/battcn/system/provider/service/MenuServiceImpl.java +++ b/battcn-provider/battcn-system-provider/src/main/java/com/battcn/system/provider/service/MenuServiceImpl.java @@ -96,7 +96,6 @@ public class MenuServiceImpl extends BaseServiceImpl implements MenuServic @Override public void saveOrUpdate(Menu menu) { - menu.setLastModifiedTime(new Date()); if (menu.getId() != null) { super.updateSelectiveById(menu); } else { diff --git a/battcn-provider/battcn-system-provider/src/main/resources/application.yml b/battcn-provider/battcn-system-provider/src/main/resources/application.yml index d0c587e5a3ac8e8bfe67dfa3476295965bc81c6b..8ddc21266de527c50efdc8f914ae8b3e146c006c 100644 --- a/battcn-provider/battcn-system-provider/src/main/resources/application.yml +++ b/battcn-provider/battcn-system-provider/src/main/resources/application.yml @@ -41,6 +41,7 @@ endpoints: mybatis: mapper-locations: - classpath:com/battcn/system/provider/mapper/*.xml + type-aliases-package: com.battcn.system.pojo configuration: map-underscore-to-camel-case: true @@ -48,6 +49,7 @@ mapper: identity: MYSQL mappers: - com.battcn.framework.mybatis.mapper.BaseMapper + not-empty: false pagehelper: diff --git a/doc/demo.sql b/doc/provider-system.sql similarity index 100% rename from doc/demo.sql rename to doc/provider-system.sql