添加用户名查询
This commit is contained in:
parent
fc71b74d2c
commit
787fb1bc15
@ -134,6 +134,21 @@ public class UserResourceController extends BaseController {
|
|||||||
return userService.listUsers(params);
|
return userService.listUsers(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取用户列表,通过用户名", notes = "获取用户列表,通过用户名接口")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "usernames", value = "用户名列表,下划线分隔", paramType = "query"),
|
||||||
|
})
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@PostMapping("listuserbyusernames")
|
||||||
|
public List<UserDTO> listUserByUsernames(@RequestParam("usernames") String usernames) throws ParamsException, SearchException {
|
||||||
|
if (StringUtils.isBlank(usernames)) {
|
||||||
|
throw new ParamsException("参数usernames不能为空");
|
||||||
|
}
|
||||||
|
Map<String, Object> params = requestParams();
|
||||||
|
params.put("userUsernames", Arrays.asList(usernames.split("_")));
|
||||||
|
return userService.listUsers(params);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "全部用户列表", notes = "全部用户列表接口")
|
@ApiOperation(value = "全部用户列表", notes = "全部用户列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", dataType = "String"),
|
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", dataType = "String"),
|
||||||
|
@ -858,6 +858,13 @@
|
|||||||
#{userIds[${index}]}
|
#{userIds[${index}]}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="userUsernames != null and userUsernames.size > 0">
|
||||||
|
AND
|
||||||
|
t1.user_username IN
|
||||||
|
<foreach collection="userUsernames" index="index" open="(" separator="," close=")">
|
||||||
|
#{userUsernames[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and (sort == 'userUsername' or sort == 'userName' or sort == 'userPhone' or sort == 'userEmail' or sort == 'userState' or sort == 'lastLoginAddress' or sort == 'lastLoginTime')">
|
<when test="sort != null and (sort == 'userUsername' or sort == 'userName' or sort == 'userPhone' or sort == 'userEmail' or sort == 'userState' or sort == 'lastLoginAddress' or sort == 'lastLoginTime')">
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
Loading…
Reference in New Issue
Block a user