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
e7d3ce6b
Commit
e7d3ce6b
authored
Sep 03, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
角色下拉框列表数据接口
parent
8039737a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
1 deletions
+87
-1
TabSysRoleMapper.java
...c/main/java/com/gic/auth/dao/mapper/TabSysRoleMapper.java
+3
-0
RoleService.java
...rvice/src/main/java/com/gic/auth/service/RoleService.java
+13
-0
RoleServiceImpl.java
.../main/java/com/gic/auth/service/impl/RoleServiceImpl.java
+5
-0
RoleApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/RoleApiServiceImpl.java
+10
-0
TabSysRoleMapper.xml
...th-service/src/main/resources/mapper/TabSysRoleMapper.xml
+9
-0
RoleController.java
...main/java/com/gic/auth/web/controller/RoleController.java
+8
-1
RoleSelectVO.java
...h-web/src/main/java/com/gic/auth/web/vo/RoleSelectVO.java
+39
-0
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysRoleMapper.java
View file @
e7d3ce6b
...
...
@@ -75,4 +75,6 @@ public interface TabSysRoleMapper {
* @return int
*/
int
deleteByRoleId
(
@Param
(
"roleId"
)
Integer
roleId
);
List
<
TabSysRole
>
listRoleNoPage
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/RoleService.java
View file @
e7d3ce6b
...
...
@@ -5,6 +5,9 @@ import com.gic.auth.dto.RoleListDTO;
import
com.gic.auth.entity.TabSysRole
;
import
com.gic.auth.qo.RoleListQO
;
import
com.github.pagehelper.Page
;
import
java.util.List
;
/**
* 角色权限接口
* @ClassName: RoleService
...
...
@@ -55,4 +58,14 @@ public interface RoleService {
Page
<
RoleListDTO
>
pageRole
(
RoleListQO
params
);
TabSysRole
getById
(
Integer
id
);
/**
* 列表查询
* @Title: listRole
* @Description:
* @author guojuxing
* @param enterpriseId
* @return java.util.List<com.gic.auth.entity.TabSysRole>
*/
List
<
TabSysRole
>
listRole
(
Integer
enterpriseId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/RoleServiceImpl.java
View file @
e7d3ce6b
...
...
@@ -53,4 +53,9 @@ public class RoleServiceImpl implements RoleService{
public
TabSysRole
getById
(
Integer
id
)
{
return
tabSysRoleMapper
.
selectByPrimaryKey
(
id
);
}
@Override
public
List
<
TabSysRole
>
listRole
(
Integer
enterpriseId
)
{
return
tabSysRoleMapper
.
listRoleNoPage
(
enterpriseId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/RoleApiServiceImpl.java
View file @
e7d3ce6b
...
...
@@ -9,6 +9,7 @@ import com.gic.auth.entity.TabSysRole;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -103,6 +104,15 @@ public class RoleApiServiceImpl implements RoleApiService{
return
ServiceResponse
.
success
(
resultPage
);
}
@Override
public
ServiceResponse
<
List
<
RoleDTO
>>
listRole
(
Integer
enterpriseId
)
{
List
<
TabSysRole
>
list
=
roleService
.
listRole
(
enterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityListNew
(
RoleDTO
.
class
,
list
));
}
return
ServiceResponse
.
success
(
new
ArrayList
<>());
}
private
ServiceResponse
<
Integer
>
saveMenuRole
(
Integer
roleId
,
Integer
enterpriseId
,
String
menuIds
)
{
String
[]
menuIdArr
;
ServiceResponse
<
String
[]>
menuIdResponse
=
ValidSplitUtils
.
validStr
(
menuIds
);
...
...
gic-platform-auth-service/src/main/resources/mapper/TabSysRoleMapper.xml
View file @
e7d3ce6b
...
...
@@ -122,4 +122,12 @@
where role_id = #{roleId}
and status = 1
</update>
<select
id=
"listRoleNoPage"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_role
where status = 1
and enterprise_id = #{enterpriseId}
</select>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/RoleController.java
View file @
e7d3ce6b
package
com
.
gic
.
auth
.
web
.
controller
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -9,8 +8,10 @@ import com.gic.auth.dto.RoleDTO;
import
com.gic.auth.qo.RoleListQO
;
import
com.gic.auth.service.RoleApiService
;
import
com.gic.auth.web.vo.RoleDetailVO
;
import
com.gic.auth.web.vo.RoleSelectVO
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
@RestController
@RequestMapping
(
"/role"
)
...
...
@@ -41,4 +42,10 @@ public class RoleController {
params
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
return
ResultControllerUtils
.
commonResult
(
roleApiService
.
pageRole
(
params
));
}
@RequestMapping
(
"/list-role-no-page"
)
public
RestResponse
listRoleNoPage
()
{
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
return
ResultControllerUtils
.
commonResult
(
roleApiService
.
listRole
(
enterpriseId
),
RoleSelectVO
.
class
);
}
}
gic-platform-auth-web/src/main/java/com/gic/auth/web/vo/RoleSelectVO.java
0 → 100644
View file @
e7d3ce6b
package
com
.
gic
.
auth
.
web
.
vo
;
import
java.io.Serializable
;
/**
* 下拉框列表
* @ClassName: RoleSelectVO
* @Description:
* @author guojuxing
* @date 2019/9/3 4:32 PM
*/
public
class
RoleSelectVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
2667055023531890522L
;
/**
* id
*/
private
Integer
roleId
;
/**
* 管理员角色名称
*/
private
String
roleName
;
public
Integer
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
Integer
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getRoleName
()
{
return
roleName
;
}
public
void
setRoleName
(
String
roleName
)
{
this
.
roleName
=
roleName
;
}
}
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