mirror of
https://gitee.com/zhijiantianya/yudao-cloud.git
synced 2026-03-22 05:07:16 +08:00
完成 AdminUserApi、SocialUserApi 的 feign 支持
This commit is contained in:
@@ -24,16 +24,16 @@ public interface DeptApi {
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@ApiOperation("获得部门信息")
|
||||
@ApiImplicitParam(name = "id", value = "部门编号", required = true, dataTypeClass = Long.class)
|
||||
@ApiImplicitParam(name = "id", value = "部门编号", example = "1024", required = true, dataTypeClass = Long.class)
|
||||
CommonResult<DeptRespDTO> getDept(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@ApiOperation("获得部门信息数组")
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
CommonResult<List<DeptRespDTO>> getDepts(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
CommonResult<Boolean> validDepts(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface PostApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/post";
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
CommonResult<Boolean> validPosts(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -20,9 +21,10 @@ public interface DictDataApi {
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiOperation("校验字典数据们是否有效")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dictType", value = "字典类型", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "values", value = "字典数据值的数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "dictType", value = "字典类型", example = "SEX", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "values", value = "字典数据值的数组", example = "1,2", required = true, allowMultiple = true)
|
||||
})
|
||||
CommonResult<Boolean> validDictDatas(String dictType, Collection<String> values);
|
||||
CommonResult<Boolean> validDictDatas(@RequestParam("dictType") String dictType,
|
||||
@RequestParam("values") Collection<String> values);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ public interface PermissionApi {
|
||||
|
||||
@GetMapping(PREFIX + "/user-role-id-list-by-role-id")
|
||||
@ApiOperation("获得拥有多个角色的用户编号集合")
|
||||
@ApiImplicitParam(name = "roleIds", value = "角色编号集合", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "roleIds", value = "角色编号集合", example = "1,2", required = true, allowMultiple = true)
|
||||
CommonResult<Set<Long>> getUserRoleIdListByRoleIds(@RequestParam("roleIds") Collection<Long> roleIds);
|
||||
|
||||
@GetMapping(PREFIX + "/has-any-permissions")
|
||||
@ApiOperation("判断是否有权限,任一一个即可")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "permissions", value = "权限", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", example = "1", required = true, dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "permissions", value = "权限", example = "read,write", required = true, allowMultiple = true)
|
||||
})
|
||||
CommonResult<Boolean> hasAnyPermissions(@RequestParam("userId") Long userId,
|
||||
@RequestParam("permissions") String... permissions);
|
||||
@@ -37,15 +37,15 @@ public interface PermissionApi {
|
||||
@GetMapping(PREFIX + "/has-any-roles")
|
||||
@ApiOperation("判断是否有角色,任一一个即可")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "roles", value = "角色数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", example = "1", required = true, dataTypeClass = Long.class),
|
||||
@ApiImplicitParam(name = "roles", value = "角色数组", example = "2", required = true, allowMultiple = true)
|
||||
})
|
||||
CommonResult<Boolean> hasAnyRoles(@RequestParam("userId") Long userId,
|
||||
@RequestParam("roles") String... roles);
|
||||
|
||||
@GetMapping(PREFIX + "/get-dept-data-permission")
|
||||
@ApiOperation("获得登陆用户的部门数据权限")
|
||||
@ApiImplicitParam(name = "userId", value = "部门数据权限", required = true, dataTypeClass = Long.class)
|
||||
@ApiImplicitParam(name = "userId", value = "用户编号", example = "2", required = true, dataTypeClass = Long.class)
|
||||
CommonResult<DeptDataPermissionRespDTO> getDeptDataPermission(@RequestParam("userId") Long userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface RoleApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/role";
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@ApiImplicitParam(name = "ids", value = "角色编号数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "ids", value = "角色编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
CommonResult<Boolean> validRoles(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ import java.util.List;
|
||||
@Api(tags = "RPC 服务 - 敏感词")
|
||||
public interface SensitiveWordApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/oauth2/sensitive-word";
|
||||
String PREFIX = ApiConstants.PREFIX + "/sensitive-word";
|
||||
|
||||
@GetMapping(PREFIX + "/validate-text")
|
||||
@ApiOperation("获得文本所包含的不合法的敏感词数组")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "text", value = "文本", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "tags", value = "标签数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "text", value = "文本", example = "傻瓜", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "tags", value = "标签数组", example = "product,life", required = true, allowMultiple = true)
|
||||
})
|
||||
CommonResult<List<String>> validateText(@RequestParam("text") String text,
|
||||
@RequestParam("tags") List<String> tags);
|
||||
@@ -30,8 +30,8 @@ public interface SensitiveWordApi {
|
||||
@GetMapping(PREFIX + "/is-text-valid")
|
||||
@ApiOperation("判断文本是否包含敏感词")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "text", value = "文本", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "tags", value = "标签数组", required = true, allowMultiple = true)
|
||||
@ApiImplicitParam(name = "text", value = "文本", example = "傻瓜", required = true, dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "tags", value = "标签数组", example = "product,life", required = true, allowMultiple = true)
|
||||
})
|
||||
CommonResult<Boolean> isTextValid(@RequestParam("text") String text,
|
||||
@RequestParam("tags") List<String> tags);
|
||||
|
||||
@@ -15,7 +15,7 @@ import javax.validation.Valid;
|
||||
@Api(tags = "RPC 服务 - 短信发送")
|
||||
public interface SmsSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/oauth2/sms/send";
|
||||
String PREFIX = ApiConstants.PREFIX + "/sms/send";
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-admin")
|
||||
@ApiOperation(value = "发送单条短信给 Admin 用户", notes = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
|
||||
@@ -1,53 +1,52 @@
|
||||
package cn.iocoder.yudao.module.system.api.social;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserUnbindReqDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 社交用户的 API 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 社交用户的")
|
||||
public interface SocialUserApi {
|
||||
|
||||
/**
|
||||
* 获得社交平台的授权 URL
|
||||
*
|
||||
* @param type 社交平台的类型 {@link SocialTypeEnum}
|
||||
* @param redirectUri 重定向 URL
|
||||
* @return 社交平台的授权 URL
|
||||
*/
|
||||
String getAuthorizeUrl(Integer type, String redirectUri);
|
||||
String PREFIX = ApiConstants.PREFIX + "/social-user";
|
||||
|
||||
/**
|
||||
* 绑定社交用户
|
||||
*
|
||||
* @param reqDTO 绑定信息
|
||||
*/
|
||||
void bindSocialUser(@Valid SocialUserBindReqDTO reqDTO);
|
||||
@GetMapping("/get-authorize-url")
|
||||
@ApiOperation("获得社交平台的授权 URL")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "社交平台的类型", example = "1", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "redirectUri", value = "重定向 URL", example = "https://www.iocoder.cn",required = true, dataTypeClass = String.class)
|
||||
})
|
||||
CommonResult<String> getAuthorizeUrl(@RequestParam("type") Integer type,
|
||||
@RequestParam("redirectUri") String redirectUri);
|
||||
|
||||
/**
|
||||
* 取消绑定社交用户
|
||||
*
|
||||
* @param reqDTO 解绑
|
||||
*/
|
||||
void unbindSocialUser(@Valid SocialUserUnbindReqDTO reqDTO);
|
||||
@PostMapping("/bind")
|
||||
@ApiOperation("绑定社交用户")
|
||||
CommonResult<Boolean> bindSocialUser(@Valid @RequestBody SocialUserBindReqDTO reqDTO);
|
||||
|
||||
/**
|
||||
* 获得社交用户的绑定用户编号
|
||||
* 注意,返回的是 MemberUser 或者 AdminUser 的 id 编号!
|
||||
* 在认证信息不正确的情况下,也会抛出 {@link ServiceException} 业务异常
|
||||
*
|
||||
* @param userType 用户类型
|
||||
* @param type 社交平台的类型
|
||||
* @param code 授权码
|
||||
* @param state state
|
||||
* @return 绑定用户编号
|
||||
*/
|
||||
Long getBindUserId(Integer userType, Integer type, String code, String state);
|
||||
@DeleteMapping("/unbind")
|
||||
@ApiOperation("取消绑定社交用户")
|
||||
CommonResult<Boolean> unbindSocialUser(@Valid @RequestBody SocialUserUnbindReqDTO reqDTO);
|
||||
|
||||
@GetMapping("/get-bind-user-id")
|
||||
@ApiOperation("获得社交用户的绑定用户编号")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userType", value = "用户类型", example = "2", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "type", value = "社交平台的类型", example = "1", required = true, dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "code", value = "授权码", required = true, example = "tudou", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "state", value = "state", required = true, example = "coke", dataTypeClass = String.class)
|
||||
})
|
||||
CommonResult<Long> getBindUserId(@RequestParam("userType") Integer userType,
|
||||
@RequestParam("type") Integer type,
|
||||
@RequestParam("code") String code,
|
||||
@RequestParam("state") String state);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package cn.iocoder.yudao.module.system.api.user;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -18,41 +22,25 @@ public interface AdminUserApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/user";
|
||||
|
||||
/**
|
||||
* 通过用户 ID 查询用户
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@GetMapping(PREFIX + "/get")
|
||||
AdminUserRespDTO getUser(Long id);
|
||||
@ApiOperation("通过用户 ID 查询用户")
|
||||
@ApiImplicitParam(name = "id", value = "用户编号", example = "1", required = true, dataTypeClass = Long.class)
|
||||
CommonResult<AdminUserRespDTO> getUser(@RequestParam("id") Long id);
|
||||
|
||||
/**
|
||||
* 通过用户 ID 查询用户们
|
||||
*
|
||||
* @param ids 用户 ID 们
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@GetMapping(PREFIX + "/list")
|
||||
List<AdminUserRespDTO> getUsers(Collection<Long> ids);
|
||||
@ApiOperation("通过用户 ID 查询用户们")
|
||||
@ApiImplicitParam(name = "ids", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUsers(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得指定部门的用户数组
|
||||
*
|
||||
* @param deptIds 部门数组
|
||||
* @return 用户数组
|
||||
*/
|
||||
@GetMapping(PREFIX + "/list-by-dept-id")
|
||||
List<AdminUserRespDTO> getUsersByDeptIds(Collection<Long> deptIds);
|
||||
@ApiOperation("获得指定部门的用户数组")
|
||||
@ApiImplicitParam(name = "deptIds", value = "部门编号数组", example = "1,2", required = true, allowMultiple = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUsersByDeptIds(@RequestParam("deptIds") Collection<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 获得指定岗位的用户数组
|
||||
*
|
||||
* @param postIds 岗位数组
|
||||
* @return 用户数组
|
||||
*/
|
||||
@GetMapping(PREFIX + "/list-by-post-id")
|
||||
List<AdminUserRespDTO> getUsersByPostIds(Collection<Long> postIds);
|
||||
@ApiOperation("获得指定岗位的用户数组")
|
||||
@ApiImplicitParam(name = "postIds", value = "岗位编号数组", example = "2,3", required = true, allowMultiple = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUsersByPostIds(@RequestParam("postIds") Collection<Long> postIds);
|
||||
|
||||
/**
|
||||
* 获得用户 Map
|
||||
@@ -61,18 +49,14 @@ public interface AdminUserApi {
|
||||
* @return 用户 Map
|
||||
*/
|
||||
default Map<Long, AdminUserRespDTO> getUserMap(Collection<Long> ids) {
|
||||
List<AdminUserRespDTO> users = getUsers(ids);
|
||||
return CollectionUtils.convertMap(users, AdminUserRespDTO::getId);
|
||||
CommonResult<List<AdminUserRespDTO>> getUsersResult = getUsers(ids);
|
||||
getUsersResult.checkError();
|
||||
return CollectionUtils.convertMap(getUsersResult.getData(), AdminUserRespDTO::getId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户们是否有效。如下情况,视为无效:
|
||||
* 1. 用户编号不存在
|
||||
* 2. 用户被禁用
|
||||
*
|
||||
* @param ids 用户编号数组
|
||||
*/
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
void validUsers(Set<Long> ids);
|
||||
@ApiOperation("校验用户们是否有效")
|
||||
@ApiImplicitParam(name = "ids", value = "用户编号数组", example = "3,5", required = true)
|
||||
CommonResult<Boolean> validUsers(@RequestParam("ids") Set<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.api.social;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserUnbindReqDTO;
|
||||
import cn.iocoder.yudao.module.system.service.social.SocialUserService;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 社交用户的 API 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.module.system.enums.ApiConstants.VERSION;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@DubboService(version = VERSION) // 提供 Dubbo RPC 接口,给 Dubbo Consumer 调用
|
||||
@Validated
|
||||
public class SocialUserApiImpl implements SocialUserApi {
|
||||
|
||||
@@ -21,24 +23,26 @@ public class SocialUserApiImpl implements SocialUserApi {
|
||||
private SocialUserService socialUserService;
|
||||
|
||||
@Override
|
||||
public String getAuthorizeUrl(Integer type, String redirectUri) {
|
||||
return socialUserService.getAuthorizeUrl(type, redirectUri);
|
||||
public CommonResult<String> getAuthorizeUrl(Integer type, String redirectUri) {
|
||||
return success(socialUserService.getAuthorizeUrl(type, redirectUri));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindSocialUser(SocialUserBindReqDTO reqDTO) {
|
||||
public CommonResult<Boolean> bindSocialUser(SocialUserBindReqDTO reqDTO) {
|
||||
socialUserService.bindSocialUser(reqDTO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbindSocialUser(SocialUserUnbindReqDTO reqDTO) {
|
||||
public CommonResult<Boolean> unbindSocialUser(SocialUserUnbindReqDTO reqDTO) {
|
||||
socialUserService.unbindSocialUser(reqDTO.getUserId(), reqDTO.getUserType(),
|
||||
reqDTO.getType(), reqDTO.getUnionId());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getBindUserId(Integer userType, Integer type, String code, String state) {
|
||||
return socialUserService.getBindUserId(userType, type, code, state);
|
||||
public CommonResult<Long> getBindUserId(Integer userType, Integer type, String code, String state) {
|
||||
return success(socialUserService.getBindUserId(userType, type, code, state));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.api.user;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.convert.user.UserConvert;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
@@ -14,13 +15,9 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.module.system.enums.ApiConstants.VERSION;
|
||||
|
||||
/**
|
||||
* Admin 用户 API 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@DubboService(version = VERSION) // 提供 Dubbo RPC 接口,给 Dubbo Consumer 调用
|
||||
@Validated
|
||||
@@ -30,32 +27,33 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
private AdminUserService userService;
|
||||
|
||||
@Override
|
||||
public AdminUserRespDTO getUser(Long id) {
|
||||
public CommonResult<AdminUserRespDTO> getUser(Long id) {
|
||||
AdminUserDO user = userService.getUser(id);
|
||||
return UserConvert.INSTANCE.convert4(user);
|
||||
return success(UserConvert.INSTANCE.convert4(user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserRespDTO> getUsers(Collection<Long> ids) {
|
||||
public CommonResult<List<AdminUserRespDTO>> getUsers(Collection<Long> ids) {
|
||||
List<AdminUserDO> users = userService.getUsers(ids);
|
||||
return UserConvert.INSTANCE.convertList4(users);
|
||||
return success(UserConvert.INSTANCE.convertList4(users));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserRespDTO> getUsersByDeptIds(Collection<Long> deptIds) {
|
||||
public CommonResult<List<AdminUserRespDTO>> getUsersByDeptIds(Collection<Long> deptIds) {
|
||||
List<AdminUserDO> users = userService.getUsersByDeptIds(deptIds);
|
||||
return UserConvert.INSTANCE.convertList4(users);
|
||||
return success(UserConvert.INSTANCE.convertList4(users));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserRespDTO> getUsersByPostIds(Collection<Long> postIds) {
|
||||
public CommonResult<List<AdminUserRespDTO>> getUsersByPostIds(Collection<Long> postIds) {
|
||||
List<AdminUserDO> users = userService.getUsersByPostIds(postIds);
|
||||
return UserConvert.INSTANCE.convertList4(users);
|
||||
return success(UserConvert.INSTANCE.convertList4(users));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validUsers(Set<Long> ids) {
|
||||
public CommonResult<Boolean> validUsers(Set<Long> ids) {
|
||||
userService.validUsers(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user