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
8c209735
Commit
8c209735
authored
Sep 03, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
角色菜单权限接口
parent
4a5ded94
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
424 additions
and
0 deletions
+424
-0
MenuRoleDTO.java
...-auth-api/src/main/java/com/gic/auth/dto/MenuRoleDTO.java
+114
-0
RoleDTO.java
...form-auth-api/src/main/java/com/gic/auth/dto/RoleDTO.java
+118
-0
RoleListDTO.java
...-auth-api/src/main/java/com/gic/auth/dto/RoleListDTO.java
+52
-0
RoleListQO.java
...rm-auth-api/src/main/java/com/gic/auth/qo/RoleListQO.java
+35
-0
MenuRoleApiService.java
...rc/main/java/com/gic/auth/service/MenuRoleApiService.java
+27
-0
RoleApiService.java
...pi/src/main/java/com/gic/auth/service/RoleApiService.java
+56
-0
ValidSplitUtils.java
...api/src/main/java/com/gic/auth/utils/ValidSplitUtils.java
+22
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/dto/MenuRoleDTO.java
0 → 100644
View file @
8c209735
package
com
.
gic
.
auth
.
dto
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 角色菜单关联表
* @ClassName: MenuRoleDTO
* @Description:
* @author guojuxing
* @date 2019/9/3 9:25 AM
*/
public
class
MenuRoleDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8443075887752527332L
;
public
interface
SaveMenuRoleValid
{
}
/**
* id
*/
private
Integer
menuRoleId
;
/**
* 菜单ID
*/
@NotNull
(
message
=
"菜单不能为空"
,
groups
=
{
SaveMenuRoleValid
.
class
})
private
Integer
menuId
;
/**
* 权限ID
*/
@NotNull
(
message
=
"角色不能为空"
,
groups
=
{
SaveMenuRoleValid
.
class
})
private
Integer
roleId
;
/**
* 企业ID
*/
@NotNull
(
message
=
"商户不能为空"
,
groups
=
{
SaveMenuRoleValid
.
class
})
private
Integer
enterpriseId
;
/**
* 状态1:有效 0:无效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
Integer
getMenuRoleId
()
{
return
menuRoleId
;
}
public
void
setMenuRoleId
(
Integer
menuRoleId
)
{
this
.
menuRoleId
=
menuRoleId
;
}
public
Integer
getMenuId
()
{
return
menuId
;
}
public
void
setMenuId
(
Integer
menuId
)
{
this
.
menuId
=
menuId
;
}
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/dto/RoleDTO.java
0 → 100644
View file @
8c209735
package
com
.
gic
.
auth
.
dto
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 角色(权限)
* @ClassName: RoleDTO
* @Description:
* @author guojuxing
* @date 2019/9/3 9:24 AM
*/
public
class
RoleDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5062719637355988468L
;
public
interface
SaveRoleValid
{
}
public
interface
EditRoleValid
{
}
/**
* id
*/
@NotNull
(
message
=
"主键不能为空"
,
groups
=
{
EditRoleValid
.
class
})
private
Integer
roleId
;
/**
* 管理员角色名称
*/
@NotNull
(
message
=
"角色名称不能为空"
,
groups
=
{
SaveRoleValid
.
class
,
EditRoleValid
.
class
})
private
Integer
roleName
;
/**
* 企业ID
*/
@NotNull
(
message
=
"商户不能为空"
,
groups
=
{
SaveRoleValid
.
class
})
private
Integer
enterpriseId
;
/**
* 状态1:有效 0:无效
*/
private
Integer
status
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
* 菜单ID,多个时,用英文逗号隔开
*/
@NotBlank
(
message
=
"菜单不能为空"
,
groups
=
{
SaveRoleValid
.
class
,
EditRoleValid
.
class
})
private
String
menuIds
;
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
public
Integer
getRoleName
()
{
return
roleName
;
}
public
void
setRoleName
(
Integer
roleName
)
{
this
.
roleName
=
roleName
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getMenuIds
()
{
return
menuIds
;
}
public
void
setMenuIds
(
String
menuIds
)
{
this
.
menuIds
=
menuIds
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/dto/RoleListDTO.java
0 → 100644
View file @
8c209735
package
com
.
gic
.
auth
.
dto
;
import
java.io.Serializable
;
/**
* 角色列表
* @ClassName: RoleListDTO
* @Description:
* @author guojuxing
* @date 2019/9/3 11:24 AM
*/
public
class
RoleListDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
4353502986580376589L
;
/**
* id
*/
private
Integer
roleId
;
/**
* 管理员角色名称
*/
private
Integer
roleName
;
/**
* 授权管理员数量
*/
private
Integer
authUserCount
;
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
public
Integer
getRoleName
()
{
return
roleName
;
}
public
void
setRoleName
(
Integer
roleName
)
{
this
.
roleName
=
roleName
;
}
public
Integer
getAuthUserCount
()
{
return
authUserCount
;
}
public
void
setAuthUserCount
(
Integer
authUserCount
)
{
this
.
authUserCount
=
authUserCount
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/qo/RoleListQO.java
0 → 100644
View file @
8c209735
package
com
.
gic
.
auth
.
qo
;
import
com.gic.enterprise.qo.PageQO
;
/**
* 角色列表
* @ClassName: RoleListQO
* @Description:
* @author guojuxing
* @date 2019/9/3 9:31 AM
*/
public
class
RoleListQO
extends
PageQO
{
private
static
final
long
serialVersionUID
=
8853942177147842496L
;
/**
* 管理角色名称
*/
private
String
search
;
private
Integer
enterpriseId
;
public
String
getSearch
()
{
return
search
;
}
public
void
setSearch
(
String
search
)
{
this
.
search
=
search
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/MenuRoleApiService.java
0 → 100644
View file @
8c209735
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.MenuRoleDTO
;
import
java.util.List
;
/**
* 角色菜单关联
* @ClassName: MenuRoleApiService
* @Description:
* @author guojuxing
* @date 2019/9/3 9:33 AM
*/
public
interface
MenuRoleApiService
{
/**
* 根据角色ID查询列表
* @Title: listMenuRoleByRoleId
* @Description:
* @author guojuxing
* @param roleId
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuRoleDTO>>
*/
ServiceResponse
<
List
<
MenuRoleDTO
>>
listMenuRoleByRoleId
(
Integer
roleId
);
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/RoleApiService.java
0 → 100644
View file @
8c209735
package
com
.
gic
.
auth
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.RoleDTO
;
import
com.gic.auth.dto.RoleListDTO
;
import
com.gic.auth.qo.RoleListQO
;
/**
* 角色权限接口
* @ClassName: RoleApiService
* @Description:
* @author guojuxing
* @date 2019/9/3 9:34 AM
*/
public
interface
RoleApiService
{
/**
* 新增角色
* @Title: save
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
ServiceResponse
<
Integer
>
save
(
RoleDTO
dto
);
/**
* 编辑
* @Title: update
* @Description:
* @author guojuxing
* @param dto
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
*/
ServiceResponse
<
Integer
>
update
(
RoleDTO
dto
);
/**
* 详情
* @Title: getById
* @Description:
* @author guojuxing
* @param id
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.RoleDTO>
*/
ServiceResponse
<
RoleDTO
>
getById
(
Integer
id
);
/**
* 分页查询列表
* @Title: pageRole
* @Description:
* @author guojuxing
* @param params
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.auth.dto.RoleDTO>>
*/
ServiceResponse
<
Page
<
RoleListDTO
>>
pageRole
(
RoleListQO
params
);
}
gic-platform-auth-api/src/main/java/com/gic/auth/utils/ValidSplitUtils.java
0 → 100644
View file @
8c209735
package
com
.
gic
.
auth
.
utils
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.error.ErrorCode
;
import
org.apache.commons.lang.StringUtils
;
/**
* 英文逗号隔开的数据校验
* @ClassName: ValidSplitUtils
* @Description:
* @author guojuxing
* @date 2019/9/3 10:05 AM
*/
public
class
ValidSplitUtils
{
public
static
ServiceResponse
<
String
[]>
validStr
(
String
param
)
{
if
(!
StringUtils
.
isNumeric
(
param
.
replaceAll
(
","
,
""
)))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"数据格式有误,不是英文逗号隔开的数据"
);
}
String
[]
strArr
=
param
.
split
(
","
);
return
ServiceResponse
.
success
(
strArr
);
}
}
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