Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
35a5f278
Commit
35a5f278
authored
Jun 01, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新sql,添加接口文档到菜单
parent
2cbe1a11
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
48 deletions
+71
-48
sql/guns.sql
+48
-48
src/main/java/com/stylefeng/guns/common/constant/Const.java
+5
-0
src/main/java/com/stylefeng/guns/common/node/MenuNode.java
+18
-0
No files found.
sql/guns.sql
View file @
35a5f278
...
@@ -10,7 +10,7 @@ Target Server Type : MYSQL
...
@@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50621
Target Server Version : 50621
File Encoding : 65001
File Encoding : 65001
Date: 2017-0
5-23 19:22:0
9
Date: 2017-0
6-01 21:42:2
9
*/
*/
SET
FOREIGN_KEY_CHECKS
=
0
;
SET
FOREIGN_KEY_CHECKS
=
0
;
...
@@ -78,7 +78,7 @@ CREATE TABLE `login_log` (
...
@@ -78,7 +78,7 @@ CREATE TABLE `login_log` (
`message`
text
,
`message`
text
,
`ip`
varchar
(
255
)
DEFAULT
NULL
,
`ip`
varchar
(
255
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
11
3
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
11
5
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- ----------------------------
-- Records of login_log
-- Records of login_log
...
@@ -101,12 +101,12 @@ CREATE TABLE `menu` (
...
@@ -101,12 +101,12 @@ CREATE TABLE `menu` (
`status`
int
(
65
)
DEFAULT
NULL
COMMENT
'菜单状态 : 1:启用 0:不启用'
,
`status`
int
(
65
)
DEFAULT
NULL
COMMENT
'菜单状态 : 1:启用 0:不启用'
,
`isopen`
int
(
11
)
DEFAULT
NULL
COMMENT
'是否打开: 1:打开 0:不打开'
,
`isopen`
int
(
11
)
DEFAULT
NULL
COMMENT
'是否打开: 1:打开 0:不打开'
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
49
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
50
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- ----------------------------
-- Records of menu
-- Records of menu
-- ----------------------------
-- ----------------------------
INSERT
INTO
`menu`
VALUES
(
'105'
,
'system'
,
'0'
,
'系统管理'
,
'fa-user'
,
''
,
'
2
'
,
'1'
,
null
,
'1'
,
'1'
);
INSERT
INTO
`menu`
VALUES
(
'105'
,
'system'
,
'0'
,
'系统管理'
,
'fa-user'
,
''
,
'
3
'
,
'1'
,
null
,
'1'
,
'1'
);
INSERT
INTO
`menu`
VALUES
(
'106'
,
'mgr'
,
'system'
,
'用户管理'
,
''
,
'/mgr'
,
'1'
,
'2'
,
null
,
'1'
,
'0'
);
INSERT
INTO
`menu`
VALUES
(
'106'
,
'mgr'
,
'system'
,
'用户管理'
,
''
,
'/mgr'
,
'1'
,
'2'
,
null
,
'1'
,
'0'
);
INSERT
INTO
`menu`
VALUES
(
'107'
,
'mgr_add'
,
'mgr'
,
'添加用户'
,
null
,
'/mgr/add'
,
'1'
,
'3'
,
null
,
'1'
,
'0'
);
INSERT
INTO
`menu`
VALUES
(
'107'
,
'mgr_add'
,
'mgr'
,
'添加用户'
,
null
,
'/mgr/add'
,
'1'
,
'3'
,
null
,
'1'
,
'0'
);
INSERT
INTO
`menu`
VALUES
(
'108'
,
'mgr_edit'
,
'mgr'
,
'修改用户'
,
null
,
'/mgr/edit'
,
'2'
,
'3'
,
null
,
'1'
,
'0'
);
INSERT
INTO
`menu`
VALUES
(
'108'
,
'mgr_edit'
,
'mgr'
,
'修改用户'
,
null
,
'/mgr/edit'
,
'2'
,
'3'
,
null
,
'1'
,
'0'
);
...
@@ -142,6 +142,7 @@ INSERT INTO `menu` VALUES ('143', 'notice_update', 'notice', '修改通知', nul
...
@@ -142,6 +142,7 @@ INSERT INTO `menu` VALUES ('143', 'notice_update', 'notice', '修改通知', nul
INSERT
INTO
`menu`
VALUES
(
'144'
,
'notice_delete'
,
'notice'
,
'删除通知'
,
null
,
'/notice/delete'
,
'3'
,
'3'
,
null
,
'1'
,
null
);
INSERT
INTO
`menu`
VALUES
(
'144'
,
'notice_delete'
,
'notice'
,
'删除通知'
,
null
,
'/notice/delete'
,
'3'
,
'3'
,
null
,
'1'
,
null
);
INSERT
INTO
`menu`
VALUES
(
'145'
,
'hello'
,
'0'
,
'通知'
,
'fa-rocket'
,
'/notice/hello'
,
'1'
,
'1'
,
null
,
'1'
,
null
);
INSERT
INTO
`menu`
VALUES
(
'145'
,
'hello'
,
'0'
,
'通知'
,
'fa-rocket'
,
'/notice/hello'
,
'1'
,
'1'
,
null
,
'1'
,
null
);
INSERT
INTO
`menu`
VALUES
(
'148'
,
'code'
,
'system'
,
'代码生成'
,
'fa-user'
,
'/code'
,
'10'
,
'2'
,
null
,
'1'
,
null
);
INSERT
INTO
`menu`
VALUES
(
'148'
,
'code'
,
'system'
,
'代码生成'
,
'fa-user'
,
'/code'
,
'10'
,
'2'
,
null
,
'1'
,
null
);
INSERT
INTO
`menu`
VALUES
(
'149'
,
'api_mgr'
,
'0'
,
'接口文档'
,
'fa-leaf'
,
'/swagger-ui.html'
,
'2'
,
'1'
,
null
,
'1'
,
null
);
-- ----------------------------
-- ----------------------------
-- Table structure for notice
-- Table structure for notice
...
@@ -160,8 +161,8 @@ CREATE TABLE `notice` (
...
@@ -160,8 +161,8 @@ CREATE TABLE `notice` (
-- ----------------------------
-- ----------------------------
-- Records of notice
-- Records of notice
-- ----------------------------
-- ----------------------------
INSERT
INTO
`notice`
VALUES
(
'6'
,
'
你好'
,
'10'
,
'欢迎使用Guns管理系统!
'
,
'2017-01-11 08:53:20'
,
'1'
);
INSERT
INTO
`notice`
VALUES
(
'6'
,
'
世界'
,
'10'
,
'欢迎使用Guns管理系统
'
,
'2017-01-11 08:53:20'
,
'1'
);
INSERT
INTO
`notice`
VALUES
(
'8'
,
'
世界'
,
null
,
'欢迎使用Guns管护系统!
'
,
'2017-05-10 19:28:57'
,
'1'
);
INSERT
INTO
`notice`
VALUES
(
'8'
,
'
你好'
,
null
,
'你好
'
,
'2017-05-10 19:28:57'
,
'1'
);
-- ----------------------------
-- ----------------------------
-- Table structure for operation_log
-- Table structure for operation_log
...
@@ -178,15 +179,13 @@ CREATE TABLE `operation_log` (
...
@@ -178,15 +179,13 @@ CREATE TABLE `operation_log` (
`succeed`
varchar
(
255
)
DEFAULT
NULL
,
`succeed`
varchar
(
255
)
DEFAULT
NULL
,
`message`
text
,
`message`
text
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
4
27
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
4
48
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- ----------------------------
-- Records of operation_log
-- Records of operation_log
-- ----------------------------
-- ----------------------------
INSERT
INTO
`operation_log`
VALUES
(
'423'
,
'业务日志'
,
'清空业务日志'
,
'1'
,
'com.stylefeng.guns.modular.system.controller.LogController'
,
'delLog'
,
'2017-05-16 23:26:52'
,
'成功'
,
'主键id=null'
);
INSERT
INTO
`operation_log`
VALUES
(
'446'
,
'业务日志'
,
'清空业务日志'
,
'1'
,
'com.stylefeng.guns.modular.system.controller.LogController'
,
'delLog'
,
'2017-06-01 21:42:13'
,
'成功'
,
'主键id=null'
);
INSERT
INTO
`operation_log`
VALUES
(
'424'
,
'业务日志'
,
'清空登录日志'
,
'1'
,
'com.stylefeng.guns.modular.system.controller.LoginLogController'
,
'delLog'
,
'2017-05-16 23:26:56'
,
'成功'
,
'主键id=null'
);
INSERT
INTO
`operation_log`
VALUES
(
'447'
,
'业务日志'
,
'清空登录日志'
,
'1'
,
'com.stylefeng.guns.modular.system.controller.LoginLogController'
,
'delLog'
,
'2017-06-01 21:42:15'
,
'成功'
,
'主键id=null'
);
INSERT
INTO
`operation_log`
VALUES
(
'425'
,
'业务日志'
,
'菜单新增'
,
'1'
,
'com.stylefeng.guns.modular.system.controller.MenuController'
,
'add'
,
'2017-05-23 18:50:55'
,
'成功'
,
'菜单名称=代码生成'
);
INSERT
INTO
`operation_log`
VALUES
(
'426'
,
'业务日志'
,
'配置权限'
,
'1'
,
'com.stylefeng.guns.modular.system.controller.RoleController'
,
'setAuthority'
,
'2017-05-23 18:51:02'
,
'成功'
,
'角色名称=超级管理员,资源名称=系统管理,用户管理,添加用户,修改用户,删除用户,重置密码,冻结用户,解除冻结用户,分配角色,角色管理,添加角色,修改角色,删除角色,配置权限,菜单管理,添加菜单,修改菜单,删除菜单,业务日志,清空日志,监控管理,部门管理,添加部门,修改部门,删除部门,字典管理,添加字典,修改字典,删除字典,登录日志,通知管理,添加通知,修改通知,删除通知,代码生成,通知'
);
-- ----------------------------
-- ----------------------------
-- Table structure for relation
-- Table structure for relation
...
@@ -197,47 +196,48 @@ CREATE TABLE `relation` (
...
@@ -197,47 +196,48 @@ CREATE TABLE `relation` (
`menuid`
int
(
11
)
DEFAULT
NULL
,
`menuid`
int
(
11
)
DEFAULT
NULL
,
`roleid`
int
(
11
)
DEFAULT
NULL
,
`roleid`
int
(
11
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
263
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
300
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- ----------------------------
-- Records of relation
-- Records of relation
-- ----------------------------
-- ----------------------------
INSERT
INTO
`relation`
VALUES
(
'3227'
,
'105'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3263'
,
'105'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3228'
,
'106'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3264'
,
'106'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3229'
,
'107'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3265'
,
'107'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3230'
,
'108'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3266'
,
'108'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3231'
,
'109'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3267'
,
'109'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3232'
,
'110'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3268'
,
'110'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3233'
,
'111'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3269'
,
'111'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3234'
,
'112'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3270'
,
'112'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3235'
,
'113'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3271'
,
'113'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3236'
,
'114'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3272'
,
'114'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3237'
,
'115'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3273'
,
'115'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3238'
,
'116'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3274'
,
'116'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3239'
,
'117'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3275'
,
'117'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3240'
,
'118'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3276'
,
'118'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3241'
,
'119'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3277'
,
'119'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3242'
,
'120'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3278'
,
'120'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3243'
,
'121'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3279'
,
'121'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3244'
,
'122'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3280'
,
'122'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3245'
,
'128'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3281'
,
'128'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3246'
,
'134'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3282'
,
'134'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3247'
,
'130'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3283'
,
'130'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3248'
,
'131'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3284'
,
'131'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3249'
,
'135'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3285'
,
'135'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3250'
,
'136'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3286'
,
'136'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3251'
,
'137'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3287'
,
'137'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3252'
,
'132'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3288'
,
'132'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3253'
,
'138'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3289'
,
'138'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3254'
,
'139'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3290'
,
'139'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3255'
,
'140'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3291'
,
'140'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3256'
,
'133'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3292'
,
'133'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3257'
,
'141'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3293'
,
'141'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3258'
,
'142'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3294'
,
'142'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3259'
,
'143'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3295'
,
'143'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3260'
,
'144'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3296'
,
'144'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3261'
,
'148'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3297'
,
'148'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3262'
,
'145'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3298'
,
'145'
,
'1'
);
INSERT
INTO
`relation`
VALUES
(
'3299'
,
'149'
,
'1'
);
-- ----------------------------
-- ----------------------------
-- Table structure for role
-- Table structure for role
...
...
src/main/java/com/stylefeng/guns/common/constant/Const.java
View file @
35a5f278
...
@@ -28,4 +28,9 @@ public interface Const {
...
@@ -28,4 +28,9 @@ public interface Const {
*/
*/
Integer
ADMIN_ROLE_ID
=
1
;
Integer
ADMIN_ROLE_ID
=
1
;
/**
* 接口文档的菜单名
*/
String
API_MENU_NAME
=
"接口文档"
;
}
}
src/main/java/com/stylefeng/guns/common/node/MenuNode.java
View file @
35a5f278
package
com
.
stylefeng
.
guns
.
common
.
node
;
package
com
.
stylefeng
.
guns
.
common
.
node
;
import
com.stylefeng.guns.common.constant.Const
;
import
com.stylefeng.guns.config.properties.GunsProperties
;
import
com.stylefeng.guns.core.util.SpringContextHolder
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Iterator
;
import
java.util.Iterator
;
...
@@ -283,6 +287,20 @@ public class MenuNode implements Comparable {
...
@@ -283,6 +287,20 @@ public class MenuNode implements Comparable {
}
}
}
}
//如果关闭了接口文档,则不显示接口文档菜单
GunsProperties
gunsProperties
=
SpringContextHolder
.
getBean
(
GunsProperties
.
class
);
if
(!
gunsProperties
.
getSwaggerOpen
()){
List
<
MenuNode
>
menuNodesCopy
=
new
ArrayList
<>();
for
(
MenuNode
menuNode
:
menuNodes
)
{
if
(
Const
.
API_MENU_NAME
.
equals
(
menuNode
.
getName
())){
continue
;
}
else
{
menuNodesCopy
.
add
(
menuNode
);
}
}
menuNodes
=
menuNodesCopy
;
}
return
menuNodes
;
return
menuNodes
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment