Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-auth
Commits
0384d7b0
Commit
0384d7b0
authored
Sep 17, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜单权限管理接口:页面、子页面
parent
af7c4f93
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
318 additions
and
2 deletions
+318
-2
MenuLevelConstants.java
...c/main/java/com/gic/auth/constant/MenuLevelConstants.java
+18
-0
MenuProjectConstants.java
...main/java/com/gic/auth/constant/MenuProjectConstants.java
+14
-0
MenuTypeEnum.java
...api/src/main/java/com/gic/auth/constant/MenuTypeEnum.java
+37
-0
MenuDTO.java
...form-auth-api/src/main/java/com/gic/auth/dto/MenuDTO.java
+97
-0
MenuListQO.java
...rm-auth-api/src/main/java/com/gic/auth/qo/MenuListQO.java
+49
-0
MenuApiService.java
...pi/src/main/java/com/gic/auth/service/MenuApiService.java
+103
-2
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/constant/MenuLevelConstants.java
0 → 100644
View file @
0384d7b0
package
com
.
gic
.
auth
.
constant
;
/**
* 菜单层级
* @ClassName: MenuLevelConstants
* @Description:
* @author guojuxing
* @date 2019/9/17 11:16 AM
*/
public
class
MenuLevelConstants
{
/**
* 最大层级
*/
public
final
static
int
MAX_LEVEL
=
6
;
/**
* 第一层级的父级ID值
*/
public
final
static
int
FIRST_LEVEL_PARENT_ID
=
0
;
}
gic-platform-auth-api/src/main/java/com/gic/auth/constant/MenuProjectConstants.java
0 → 100644
View file @
0384d7b0
package
com
.
gic
.
auth
.
constant
;
/**
* 菜单项目
* @ClassName: MenuProjectConstants
* @Description:
* @author guojuxing
* @date 2019/9/17 11:01 AM
*/
public
class
MenuProjectConstants
{
/**
* 默认项目
*/
public
final
static
String
DEFAULT_PROJECT
=
"gic"
;
}
gic-platform-auth-api/src/main/java/com/gic/auth/constant/MenuTypeEnum.java
0 → 100644
View file @
0384d7b0
package
com
.
gic
.
auth
.
constant
;
/**
* 菜单类型
* @ClassName: MenuTypeEnum
* @Description:
* @author guojuxing
* @date 2019/9/17 11:05 AM
*/
public
enum
MenuTypeEnum
{
PAGE
(
0
,
"页面"
),
ROLE
(
1
,
"权限项"
),
OPERATION
(
2
,
"操作项"
);
private
int
code
;
private
String
message
;
private
MenuTypeEnum
(
int
code
,
String
message
)
{
this
.
code
=
code
;
this
.
message
=
message
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/dto/MenuDTO.java
View file @
0384d7b0
package
com
.
gic
.
auth
.
dto
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
MenuDTO
implements
Serializable
{
/**
* 新增页面参数校验分组
*/
public
interface
SavePageValid
{
}
/**
* 新增gic子页面参数校验分组
*/
public
interface
SaveGICChildPageValid
{
}
/**
* 编辑应用页面参数校验分组(应用页面是查询应用列表接口后自动新增)
*/
public
interface
UpdateAppPageValid
{
}
/**
* 新增应用子页面参数校验分组
*/
public
interface
SaveAppChildPageValid
{
}
/**
* 编辑应用子页面参数校验分组
*/
public
interface
EditAppChildPageValid
{
}
/**
*
*/
private
Integer
menuId
;
...
...
@@ -12,31 +45,39 @@ public class MenuDTO implements Serializable {
/**
* 菜单名称
*/
@NotBlank
(
message
=
"页面名称不能为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
,
SaveAppChildPageValid
.
class
,
EditAppChildPageValid
.
class
})
private
String
menuName
;
/**
* 所在项目
*/
@NotBlank
(
message
=
"应用的app_id不能为空(用来区分应用)"
,
groups
=
{
SaveAppChildPageValid
.
class
})
private
String
project
;
/**
* 菜单路由
*/
@NotBlank
(
message
=
"路径URL不能为空"
,
groups
=
{
SaveGICChildPageValid
.
class
,
SaveAppChildPageValid
.
class
,
EditAppChildPageValid
.
class
})
private
String
menuUrl
;
/**
* 上级菜单id
*/
@NotNull
(
message
=
"创建子页面,父级ID不能为空"
,
groups
=
{
SaveGICChildPageValid
.
class
,
SaveAppChildPageValid
.
class
})
private
Integer
parentId
;
/**
* 0当前页1新开页
*/
@NotNull
(
message
=
"打开方式不能为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
})
private
Integer
target
;
/**
*
*/
@NotBlank
(
message
=
"图标不能为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
})
private
String
iconUrl
;
/**
...
...
@@ -57,8 +98,32 @@ public class MenuDTO implements Serializable {
/**
* 是否显示在菜单栏的菜单,0否1是
*/
@NotNull
(
message
=
"页面类型(是否作为菜单)不能改为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
})
private
Integer
isShow
;
/**
* 页面code
*/
@NotBlank
(
message
=
"页面code不能为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
,
UpdateAppPageValid
.
class
,
SaveAppChildPageValid
.
class
,
EditAppChildPageValid
.
class
})
private
String
menuCode
;
/**
* 父级code
*/
private
String
parentCode
;
/**
* 多选,例如_1_2_格式,如果是GIC菜单 1gic标准版 2gic集团版;如果是应用菜单 1:基础班 2:高级版
*/
@NotBlank
(
message
=
"版本不能为空"
,
groups
=
{
SavePageValid
.
class
,
SaveGICChildPageValid
.
class
})
private
String
menuVersion
;
/**
* 0:页面 1:权限项 2:操作项
*/
private
Integer
menuType
;
private
List
<
MenuDTO
>
children
;
public
Integer
getMenuId
()
{
...
...
@@ -156,4 +221,36 @@ public class MenuDTO implements Serializable {
public
void
setChildren
(
List
<
MenuDTO
>
children
)
{
this
.
children
=
children
;
}
public
String
getMenuCode
()
{
return
menuCode
;
}
public
void
setMenuCode
(
String
menuCode
)
{
this
.
menuCode
=
menuCode
;
}
public
String
getParentCode
()
{
return
parentCode
;
}
public
void
setParentCode
(
String
parentCode
)
{
this
.
parentCode
=
parentCode
;
}
public
String
getMenuVersion
()
{
return
menuVersion
;
}
public
void
setMenuVersion
(
String
menuVersion
)
{
this
.
menuVersion
=
menuVersion
;
}
public
Integer
getMenuType
()
{
return
menuType
;
}
public
void
setMenuType
(
Integer
menuType
)
{
this
.
menuType
=
menuType
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/MenuListQO.java
0 → 100644
View file @
0384d7b0
package
com
.
gic
.
auth
.
qo
;
import
com.gic.enterprise.qo.PageQO
;
/**
* 菜单权限树数据
* @ClassName: MenuListQO
* @Description:
* @author guojuxing
* @date 2019/9/17 4:47 PM
*/
public
class
MenuListQO
extends
PageQO
{
private
static
final
long
serialVersionUID
=
-
8958629938003355714L
;
/**
* 页面名称/code
*/
private
String
search
;
/**
* 1:gic菜单 2:app菜单
*/
private
Integer
isGIC
;
/**
* 0:页面 1:权限项 2:操作项
*/
private
Integer
menuType
;
public
String
getSearch
()
{
return
search
;
}
public
void
setSearch
(
String
search
)
{
this
.
search
=
search
;
}
public
Integer
getIsGIC
()
{
return
isGIC
;
}
public
void
setIsGIC
(
Integer
isGIC
)
{
this
.
isGIC
=
isGIC
;
}
public
Integer
getMenuType
()
{
return
menuType
;
}
public
void
setMenuType
(
Integer
menuType
)
{
this
.
menuType
=
menuType
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuApiService.java
View file @
0384d7b0
...
...
@@ -2,9 +2,16 @@ package com.gic.auth.service;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.MenuDTO
;
import
com.gic.auth.qo.MenuListQO
;
import
java.util.List
;
/**
* 权限树
* @ClassName: MenuApiService
* @Description:
* @author guojuxing
* @date 2019/9/17 10:44 AM
*/
public
interface
MenuApiService
{
/**
* 获取登陆用户的菜单
...
...
@@ -18,8 +25,102 @@ public interface MenuApiService {
* 获取超级管理员菜单
* @param userId
* @param enterpriseId
* @param currentMenu
* @return
*/
ServiceResponse
<
List
<
MenuDTO
>>
getSuperAdminMenu
(
Integer
userId
,
Integer
enterpriseId
);
/**
* 查询gic菜单树数据
* @Title: listMenuTree
* @Description:
* @author guojuxing
* @param params
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
ServiceResponse
<
List
<
MenuDTO
>>
listMenuTree
(
MenuListQO
params
);
/**
* 查询页面下面的权限项列表数据
* @Title: listMenuRoleByParentId
* @Description:
* @author guojuxing
* @param parentId
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>
*/
ServiceResponse
<
List
<
MenuDTO
>>
listMenuRoleByParentId
(
Integer
parentId
);
/**
* 新增页面
* @Title: saveGICPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
saveGICPage
(
MenuDTO
menuDTO
);
/**
* 编辑gic页面
* @Title: updateGICPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updateGICPage
(
MenuDTO
menuDTO
);
/**
* 删除页面、子页面、权限项、操作项
* @Title: deleteMenu
* @Description:
* @author guojuxing
* @param menuId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
deleteMenu
(
Integer
menuId
);
/**
* 新增GIC子页面
* @Title: saveGICChildPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
saveGICChildPage
(
MenuDTO
menuDTO
);
/**
* 编辑gic子页面
* @Title: updateGICChildPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updateGICChildPage
(
MenuDTO
menuDTO
);
/**
* 编辑应用页面
* @Title: updateAppPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updateAppPage
(
MenuDTO
menuDTO
);
/**
* 新增应用子页面
* @Title: saveAppChildPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
saveAppChildPage
(
MenuDTO
menuDTO
);
/**
* 编辑应用子页面
* @Title: updateAppChildPage
* @Description:
* @author guojuxing
* @param menuDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
*/
ServiceResponse
<
Void
>
updateAppChildPage
(
MenuDTO
menuDTO
);
}
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