Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv-springboot
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
bsoft
sv-springboot
Commits
47148483
Commit
47148483
authored
Oct 30, 2019
by
Suvalue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回类型修改
parent
226631ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
bsoft-api/src/main/java/com/bsoft/api/controller/UserController.java
+5
-1
bsoft-api/src/main/resources/mapper/SysUserRoleRsMapper.xml
+14
-4
No files found.
bsoft-api/src/main/java/com/bsoft/api/controller/UserController.java
View file @
47148483
...
@@ -3,6 +3,7 @@ package com.bsoft.api.controller;
...
@@ -3,6 +3,7 @@ package com.bsoft.api.controller;
import
com.bsoft.api.common.Result
;
import
com.bsoft.api.common.Result
;
import
com.bsoft.api.common.annotations.CurrentUser
;
import
com.bsoft.api.common.annotations.CurrentUser
;
import
com.bsoft.api.common.annotations.Token
;
import
com.bsoft.api.common.annotations.Token
;
import
com.bsoft.api.model.SysRole
;
import
com.bsoft.api.model.SysUser
;
import
com.bsoft.api.model.SysUser
;
import
com.bsoft.api.service.SysMenuService
;
import
com.bsoft.api.service.SysMenuService
;
import
com.bsoft.api.service.SysUserRoleRsService
;
import
com.bsoft.api.service.SysUserRoleRsService
;
...
@@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -15,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
@Api
(
tags
=
"用户API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@Api
(
tags
=
"用户API"
,
produces
=
"produces"
,
consumes
=
"consumes"
,
protocols
=
"protocols"
)
@RequestMapping
(
"/user"
)
@RequestMapping
(
"/user"
)
...
@@ -42,7 +45,8 @@ public class UserController {
...
@@ -42,7 +45,8 @@ public class UserController {
@Token
@Token
@ApiOperation
(
"查询用户角色"
)
@ApiOperation
(
"查询用户角色"
)
public
Object
getRoleListByUser
(
@ApiIgnore@CurrentUser
Long
userId
)
throws
Exception
{
public
Object
getRoleListByUser
(
@ApiIgnore@CurrentUser
Long
userId
)
throws
Exception
{
return
Result
.
success
(
sysUserRoleRsService
.
getRoleListByUser
(
userId
));
List
<
SysRole
>
list
=
sysUserRoleRsService
.
getRoleListByUser
(
userId
);
return
Result
.
success
(
list
);
}
}
/**
/**
...
...
bsoft-api/src/main/resources/mapper/SysUserRoleRsMapper.xml
View file @
47148483
...
@@ -9,6 +9,14 @@
...
@@ -9,6 +9,14 @@
<result
column=
"USER_ID"
jdbcType=
"DECIMAL"
property=
"userId"
/>
<result
column=
"USER_ID"
jdbcType=
"DECIMAL"
property=
"userId"
/>
<result
column=
"ROLE_ID"
jdbcType=
"DECIMAL"
property=
"roleId"
/>
<result
column=
"ROLE_ID"
jdbcType=
"DECIMAL"
property=
"roleId"
/>
</resultMap>
</resultMap>
<resultMap
id=
"RoleMap"
type=
"com.bsoft.api.model.SysRole"
>
<id
column=
"ID"
jdbcType=
"DECIMAL"
property=
"id"
/>
<result
column=
"CREATE_DATE"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"CREATE_USERID"
jdbcType=
"DECIMAL"
property=
"createUserid"
/>
<result
column=
"STATE"
jdbcType=
"DECIMAL"
property=
"state"
/>
<result
column=
"ROLE_NAME"
jdbcType=
"VARCHAR"
property=
"roleName"
/>
<result
column=
"ROLE_CODE"
jdbcType=
"DECIMAL"
property=
"roleCode"
/>
</resultMap>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from LL.SYS_USER_ROLE_RS
delete from LL.SYS_USER_ROLE_RS
where ID = #{id,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
...
@@ -40,9 +48,10 @@
...
@@ -40,9 +48,10 @@
select ID, CREATE_DATE, CREATE_USERID, STATE, USER_ID, ROLE_ID
select ID, CREATE_DATE, CREATE_USERID, STATE, USER_ID, ROLE_ID
from LL.SYS_USER_ROLE_RS
from LL.SYS_USER_ROLE_RS
</select>
</select>
<select
id=
"selectRoleByUser"
resultMap=
"BaseResultMap"
>
<select
id=
"selectRoleByUser"
resultMap=
"RoleMap"
>
select ID, CREATE_DATE, CREATE_USERID, STATE, USER_ID, ROLE_ID
select R.*
from LL.SYS_USER_ROLE_RS
from LL.SYS_USER_ROLE_RS ur
where USER_ID=#{userId,jdbcType=DECIMAL}
left join SYS_ROLE r ON ur.role_ID = r.ID
where ur.USER_ID=#{userId,jdbcType=DECIMAL}
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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