Commit 47148483 by Suvalue

返回类型修改

parent 226631ad
...@@ -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);
} }
/** /**
......
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment