补全 api 缺失的方法

This commit is contained in:
chenbowen
2025-09-15 00:31:25 +08:00
parent 2ffed7cc9e
commit bea39f9b57
47 changed files with 1620 additions and 46 deletions

View File

@@ -2,14 +2,13 @@ package cn.iocoder.yudao.module.system.api.dept;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.dept.dto.*;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.List;
@@ -22,6 +21,31 @@ public interface DeptApi {
String PREFIX = ApiConstants.PREFIX + "/dept";
// === 以下为补全的接口方法 ===
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增部门")
CommonResult<Long> createDept(@RequestBody DeptSaveReqDTO createReqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改部门")
CommonResult<Boolean> updateDept(@RequestBody DeptSaveReqDTO updateReqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除部门")
CommonResult<Boolean> deleteDept(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list-all")
@Operation(summary = "获得部门列表")
CommonResult<List<DeptDetailRespDTO>> getDeptList(@RequestParam DeptListReqDTO reqVO);
@GetMapping(PREFIX + "/simple-list")
@Operation(summary = "获得部门精简信息列表")
CommonResult<List<DeptSimpleRespDTO>> getSimpleDeptList();
@GetMapping(PREFIX + "/simple-company-list")
@Operation(summary = "获得公司精简信息列表")
CommonResult<List<DeptSimpleRespDTO>> getSimpleCompanyList();
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得部门信息")
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)

View File

@@ -5,13 +5,14 @@ import cn.hutool.core.map.MapUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.PostRespDTO;
import cn.iocoder.yudao.module.system.api.dept.dto.PostSaveReqDTO;
import cn.iocoder.yudao.module.system.api.dept.dto.PostSimpleRespDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.List;
@@ -23,6 +24,27 @@ public interface PostApi {
String PREFIX = ApiConstants.PREFIX + "/post";
// === 以下为补全的接口方法 ===
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增岗位")
CommonResult<Long> createPost(@RequestBody PostSaveReqDTO createReqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改岗位")
CommonResult<Boolean> updatePost(@RequestBody PostSaveReqDTO updateReqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除岗位")
CommonResult<Boolean> deletePost(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得岗位详情")
CommonResult<PostRespDTO> getPost(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/simple-list")
@Operation(summary = "获得岗位精简信息列表")
CommonResult<List<PostSimpleRespDTO>> getSimplePostList();
@GetMapping(PREFIX + "/valid")
@Operation(summary = "校验岗位是否合法")
@Parameter(name = "ids", description = "岗位编号数组", example = "1,2", required = true)

View File

@@ -0,0 +1,53 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 部门信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门信息 Response DTO")
@Data
public class DeptDetailRespDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "芋道")
private String name;
@Schema(description = "父部门 ID", example = "1024")
private Long parentId;
@Schema(description = "显示顺序", example = "1024")
private Integer sort;
@Schema(description = "负责人的用户编号", example = "2048")
private Long leaderUserId;
@Schema(description = "联系电话", example = "15601691000")
private String phone;
@Schema(description = "邮箱", example = "yudao@iocoder.cn")
private String email;
@Schema(description = "状态,见 CommonStatusEnum 枚举", example = "1")
private Integer status;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "租户编号", example = "1024")
private Long tenantId;
@Schema(description = "是否公司", example = "false")
private Boolean isCompany;
@Schema(description = "是否集团", example = "false")
private Boolean isGroup;
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 部门列表 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门列表 Request DTO")
@Data
public class DeptListReqDTO {
@Schema(description = "部门名称,模糊匹配", example = "芋道")
private String name;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;
@Schema(description = "是否公司", example = "false")
private Boolean isCompany;
@Schema(description = "是否集团", example = "false")
private Boolean isGroup;
}

View File

@@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 部门创建/修改 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门创建/修改 Request DTO")
@Data
public class DeptSaveReqDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "芋道")
private String name;
@Schema(description = "父部门 ID", example = "1024")
private Long parentId;
@Schema(description = "显示顺序", example = "1024")
private Integer sort;
@Schema(description = "负责人的用户编号", example = "2048")
private Long leaderUserId;
@Schema(description = "联系电话", example = "15601691000")
private String phone;
@Schema(description = "邮箱", example = "yudao@iocoder.cn")
private String email;
@Schema(description = "状态,见 CommonStatusEnum 枚举0 开启 1 关闭", example = "0")
private Integer status;
}

View File

@@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 部门精简信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 部门精简信息 Response DTO")
@Data
public class DeptSimpleRespDTO {
@Schema(description = "部门编号", example = "1024")
private Long id;
@Schema(description = "部门名称", example = "芋道")
private String name;
@Schema(description = "父部门 ID", example = "1024")
private Long parentId;
@Schema(description = "是否公司", example = "false")
private Boolean isCompany;
@Schema(description = "是否集团", example = "false")
private Boolean isGroup;
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 岗位分页 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 岗位分页 Request DTO")
@Data
@EqualsAndHashCode(callSuper = true)
public class PostPageReqDTO extends PageParam {
@Schema(description = "岗位编码,模糊匹配", example = "yudao")
private String code;
@Schema(description = "岗位名称,模糊匹配", example = "芋道")
private String name;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;
}

View File

@@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 岗位创建/修改 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 岗位创建/修改 Request DTO")
@Data
public class PostSaveReqDTO {
@Schema(description = "岗位编号", example = "1024")
private Long id;
@Schema(description = "岗位名称", example = "小土豆")
private String name;
@Schema(description = "岗位编码", example = "yudao")
private String code;
@Schema(description = "显示顺序", example = "1024")
private Integer sort;
@Schema(description = "状态", example = "1")
private Integer status;
@Schema(description = "备注", example = "快乐的备注")
private String remark;
}

View File

@@ -0,0 +1,21 @@
package cn.iocoder.yudao.module.system.api.dept.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 岗位信息的精简 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 岗位信息的精简 Response DTO")
@Data
public class PostSimpleRespDTO {
@Schema(description = "岗位序号", example = "1024")
private Long id;
@Schema(description = "岗位名称", example = "小土豆")
private String name;
}

View File

@@ -1,17 +1,20 @@
package cn.iocoder.yudao.module.system.api.dict;
import cn.iocoder.yudao.framework.common.biz.system.dict.DictDataCommonApi;
import io.swagger.v3.oas.annotations.tags.Tag;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataDetailRespDTO;
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataSaveReqDTO;
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataSimpleRespDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.List;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 字典数据")
@@ -19,6 +22,27 @@ public interface DictDataApi extends DictDataCommonApi {
String PREFIX = ApiConstants.PREFIX + "/dict-data";
// === 以下为补全的接口方法 ===
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增字典数据")
CommonResult<Long> createDictData(@RequestBody DictDataSaveReqDTO createReqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改字典数据")
CommonResult<Boolean> updateDictData(@RequestBody DictDataSaveReqDTO updateReqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除字典数据")
CommonResult<Boolean> deleteDictData(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/simple-list")
@Operation(summary = "获得字典数据精简信息列表")
CommonResult<List<DictDataSimpleRespDTO>> getSimpleDictDataList();
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得字典数据详情")
CommonResult<DictDataDetailRespDTO> getDictData(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/valid")
@Operation(summary = "校验字典数据们是否有效")
@Parameters({

View File

@@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.system.api.dict.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 字典数据信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 字典数据信息 Response DTO")
@Data
public class DictDataDetailRespDTO {
@Schema(description = "字典数据编号", example = "1024")
private Long id;
@Schema(description = "显示顺序", example = "1")
private Integer sort;
@Schema(description = "字典标签", example = "")
private String label;
@Schema(description = "字典值", example = "1")
private String value;
@Schema(description = "字典类型", example = "gender")
private String dictType;
@Schema(description = "状态", example = "1")
private Integer status;
@Schema(description = "颜色类型", example = "primary")
private String colorType;
@Schema(description = "css 样式", example = "color: red")
private String cssClass;
@Schema(description = "备注", example = "我是一个角色")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.system.api.dict.dto;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 字典数据分页 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 字典数据分页 Request DTO")
@Data
@EqualsAndHashCode(callSuper = true)
public class DictDataPageReqDTO extends PageParam {
@Schema(description = "字典标签", example = "芋道")
private String label;
@Schema(description = "字典类型,模糊匹配", example = "sys_common_sex")
private String dictType;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;
}

View File

@@ -0,0 +1,42 @@
package cn.iocoder.yudao.module.system.api.dict.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 字典数据创建/修改 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 字典数据创建/修改 Request DTO")
@Data
public class DictDataSaveReqDTO {
@Schema(description = "字典数据编号", example = "1024")
private Long id;
@Schema(description = "显示顺序", example = "1")
private Integer sort;
@Schema(description = "字典标签", example = "")
private String label;
@Schema(description = "字典值", example = "1")
private String value;
@Schema(description = "字典类型", example = "gender")
private String dictType;
@Schema(description = "状态", example = "1")
private Integer status;
@Schema(description = "颜色类型", example = "primary")
private String colorType;
@Schema(description = "css 样式", example = "color: red")
private String cssClass;
@Schema(description = "备注", example = "我是一个角色")
private String remark;
}

View File

@@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.api.dict.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 字典数据精简信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 字典数据精简信息 Response DTO")
@Data
public class DictDataSimpleRespDTO {
@Schema(description = "字典数据编号", example = "1024")
private Long id;
@Schema(description = "字典标签", example = "")
private String label;
@Schema(description = "字典值", example = "1")
private String value;
@Schema(description = "字典类型", example = "gender")
private String dictType;
@Schema(description = "状态", example = "1")
private Integer status;
}

View File

@@ -2,13 +2,13 @@ package cn.iocoder.yudao.module.system.api.permission;
import cn.iocoder.yudao.framework.common.biz.system.permission.PermissionCommonApi;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.permission.dto.*;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.Set;
@@ -19,6 +19,27 @@ public interface PermissionApi extends PermissionCommonApi {
String PREFIX = ApiConstants.PREFIX + "/permission";
// === 以下为补全的接口方法 ===
@GetMapping(PREFIX + "/role-menu-list")
@Operation(summary = "获得角色拥有的菜单编号集合")
CommonResult<Set<Long>> getRoleMenuList(@RequestParam("roleId") Long roleId);
@PostMapping(PREFIX + "/assign-role-menu")
@Operation(summary = "分配角色菜单")
CommonResult<Boolean> assignRoleMenu(@RequestBody PermissionAssignRoleMenuReqDTO reqVO);
@PostMapping(PREFIX + "/assign-role-data-scope")
@Operation(summary = "分配角色数据权限")
CommonResult<Boolean> assignRoleDataScope(@RequestBody PermissionAssignRoleDataScopeReqDTO reqVO);
@GetMapping(PREFIX + "/admin-roles")
@Operation(summary = "获得管理员拥有的角色编号集合")
CommonResult<Set<Long>> listAdminRoles(@RequestParam("userId") Long userId);
@PostMapping(PREFIX + "/assign-user-role")
@Operation(summary = "分配用户角色")
CommonResult<Boolean> assignUserRole(@RequestBody PermissionAssignUserRoleReqDTO reqVO);
@GetMapping(PREFIX + "/user-role-id-list-by-role-id")
@Operation(summary = "获得拥有多个角色的用户编号集合")
@Parameter(name = "roleIds", description = "角色编号集合", example = "1,2", required = true)

View File

@@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.system.api.permission;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

View File

@@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.system.api.permission.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Set;
/**
* 权限分配角色数据权限 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 权限分配角色数据权限 Request DTO")
@Data
public class PermissionAssignRoleDataScopeReqDTO {
@Schema(description = "角色编号", example = "1")
private Long roleId;
@Schema(description = "数据范围", example = "1")
private Integer dataScope;
@Schema(description = "部门编号数组", example = "1,3,5")
private Set<Long> dataScopeDeptIds;
}

View File

@@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.system.api.permission.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Set;
/**
* 权限分配角色菜单 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 权限分配角色菜单 Request DTO")
@Data
public class PermissionAssignRoleMenuReqDTO {
@Schema(description = "角色编号", example = "1")
private Long roleId;
@Schema(description = "菜单编号列表", example = "1,3,5")
private Set<Long> menuIds;
}

View File

@@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.system.api.permission.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Set;
/**
* 权限分配用户角色 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 权限分配用户角色 Request DTO")
@Data
public class PermissionAssignUserRoleReqDTO {
@Schema(description = "用户编号", example = "1")
private Long userId;
@Schema(description = "角色编号数组", example = "1,3,5")
private Set<Long> roleIds;
}

View File

@@ -0,0 +1,48 @@
package cn.iocoder.yudao.module.system.api.permission.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Set;
/**
* 角色信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 角色信息 Response DTO")
@Data
public class RoleDetailRespDTO {
@Schema(description = "角色编号", example = "1024")
private Long id;
@Schema(description = "角色名称", example = "管理员")
private String name;
@Schema(description = "角色标识", example = "admin")
private String code;
@Schema(description = "显示顺序", example = "1024")
private Integer sort;
@Schema(description = "数据范围", example = "1")
private Integer dataScope;
@Schema(description = "数据范围(指定部门数组)", example = "1,2,3")
private Set<Long> dataScopeDeptIds;
@Schema(description = "角色状态", example = "1")
private Integer status;
@Schema(description = "角色类型", example = "1")
private Integer type;
@Schema(description = "备注", example = "我是一个角色")
private String remark;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.system.api.permission.dto;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 角色分页 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 角色分页 Request DTO")
@Data
@EqualsAndHashCode(callSuper = true)
public class RolePageReqDTO extends PageParam {
@Schema(description = "角色名称,模糊匹配", example = "芋道")
private String name;
@Schema(description = "角色标识,模糊匹配", example = "admin")
private String code;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;
@Schema(description = "创建时间")
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.system.api.permission.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Set;
/**
* 角色创建/修改 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 角色创建/修改 Request DTO")
@Data
public class RoleSaveReqDTO {
@Schema(description = "角色编号", example = "1024")
private Long id;
@Schema(description = "角色名称", example = "管理员")
private String name;
@Schema(description = "角色标识", example = "admin")
private String code;
@Schema(description = "显示顺序", example = "1024")
private Integer sort;
@Schema(description = "数据范围", example = "1")
private Integer dataScope;
@Schema(description = "数据范围(指定部门数组)", example = "1,2,3")
private Set<Long> dataScopeDeptIds;
@Schema(description = "角色状态", example = "1")
private Integer status;
@Schema(description = "角色类型", example = "1")
private Integer type;
@Schema(description = "备注", example = "我是一个角色")
private String remark;
}

View File

@@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.system.api.social.dto;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 社交客户端分页 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 社交客户端分页 Request DTO")
@Data
@EqualsAndHashCode(callSuper = true)
public class SocialClientPageReqDTO extends PageParam {
@Schema(description = "应用名,模糊匹配", example = "yudao")
private String name;
@Schema(description = "社交平台的类型", example = "1")
private Integer socialType;
@Schema(description = "用户类型", example = "2")
private Integer userType;
@Schema(description = "客户端编号", example = "wx12345")
private String clientId;
@Schema(description = "状态", example = "1")
private Integer status;
}

View File

@@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.system.api.social.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 社交客户端信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 社交客户端信息 Response DTO")
@Data
public class SocialClientRespDTO {
@Schema(description = "编号", example = "27162")
private Long id;
@Schema(description = "应用名", example = "yudao商城")
private String name;
@Schema(description = "社交平台的类型", example = "31")
private Integer socialType;
@Schema(description = "用户类型", example = "2")
private Integer userType;
@Schema(description = "客户端编号", example = "wwd411c69a39ad2e54")
private String clientId;
@Schema(description = "客户端密钥", example = "peter")
private String clientSecret;
@Schema(description = "授权方的网页应用编号", example = "2000045")
private String agentId;
@Schema(description = "状态", example = "1")
private Integer status;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.api.social.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 社交客户端创建/修改 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 社交客户端创建/修改 Request DTO")
@Data
public class SocialClientSaveReqDTO {
@Schema(description = "编号", example = "27162")
private Long id;
@Schema(description = "应用名", example = "yudao商城")
private String name;
@Schema(description = "社交平台的类型", example = "31")
private Integer socialType;
@Schema(description = "用户类型", example = "2")
private Integer userType;
@Schema(description = "客户端编号", example = "wwd411c69a39ad2e54")
private String clientId;
@Schema(description = "客户端密钥", example = "peter")
private String clientSecret;
@Schema(description = "授权方的网页应用编号", example = "2000045")
private String agentId;
@Schema(description = "状态", example = "1")
private Integer status;
}

View File

@@ -4,6 +4,9 @@ import cn.hutool.core.convert.Convert;
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.api.user.dto.AdminUserSaveReqDTO;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserUpdatePasswordReqDTO;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserUpdateStatusReqDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import com.fhs.core.trans.anno.AutoTrans;
import com.fhs.trans.service.AutoTransable;
@@ -12,8 +15,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.Collections;
@@ -29,6 +31,27 @@ public interface AdminUserApi extends AutoTransable<AdminUserRespDTO> {
String PREFIX = ApiConstants.PREFIX + "/user";
// === 以下为补全的接口方法 ===
@PostMapping(PREFIX + "/create")
@Operation(summary = "新增用户")
CommonResult<Long> createUser(@RequestBody AdminUserSaveReqDTO reqVO);
@PutMapping(PREFIX + "/update")
@Operation(summary = "修改用户")
CommonResult<Boolean> updateUser(@RequestBody AdminUserSaveReqDTO reqVO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除用户")
CommonResult<Boolean> deleteUser(@RequestParam("id") Long id);
@PutMapping(PREFIX + "/update-password")
@Operation(summary = "重置用户密码")
CommonResult<Boolean> updateUserPassword(@RequestBody AdminUserUpdatePasswordReqDTO reqVO);
@PutMapping(PREFIX + "/update-status")
@Operation(summary = "修改用户状态")
CommonResult<Boolean> updateUserStatus(@RequestBody AdminUserUpdateStatusReqDTO reqVO);
@GetMapping(PREFIX + "/get")
@Operation(summary = "通过用户 ID 查询用户")
@Parameter(name = "id", description = "用户编号", example = "1", required = true)

View File

@@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.system.api.user.dto;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/**
* 管理员用户信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 管理员用户信息 Response DTO")
@Data
public class AdminUserDetailRespDTO {
@Schema(description = "用户编号", example = "1")
private Long id;
@Schema(description = "用户账号", example = "yudao")
private String username;
@Schema(description = "用户昵称", example = "芋艿")
private String nickname;
@Schema(description = "备注", example = "我是一个用户")
private String remark;
@Schema(description = "部门ID列表")
private List<Long> deptIds;
@Schema(description = "岗位编号数组", example = "1")
private Set<Long> postIds;
@Schema(description = "用户邮箱", example = "yudao@iocoder.cn")
private String email;
@Schema(description = "手机号码", example = "15601691300")
private String mobile;
@Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1")
private Integer sex;
@Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png")
private String avatar;
@Schema(description = "状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;
@Schema(description = "最后登录 IP", example = "192.168.1.1")
private String loginIp;
@Schema(description = "最后登录时间")
private LocalDateTime loginDate;
@Schema(description = "创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,38 @@
package cn.iocoder.yudao.module.system.api.user.dto;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 管理员用户分页 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 管理员用户分页 Request DTO")
@Data
@EqualsAndHashCode(callSuper = true)
public class AdminUserPageReqDTO extends PageParam {
@Schema(description = "用户账号,模糊匹配", example = "yudao")
private String username;
@Schema(description = "手机号码,模糊匹配", example = "yudao")
private String mobile;
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
private Integer status;
@Schema(description = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]")
private LocalDateTime[] createTime;
@Schema(description = "部门编号,同时筛选子部门", example = "1024")
private Long deptId;
@Schema(description = "角色编号", example = "1024")
private Long roleId;
}

View File

@@ -0,0 +1,53 @@
package cn.iocoder.yudao.module.system.api.user.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Set;
/**
* 管理员用户创建/修改 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 管理员用户创建/修改 Request DTO")
@Data
public class AdminUserSaveReqDTO {
@Schema(description = "用户编号", example = "1024")
private Long id;
@Schema(description = "用户账号", example = "yudao")
private String username;
@Schema(description = "用户昵称", example = "芋艿")
private String nickname;
@Schema(description = "备注", example = "我是一个用户")
private String remark;
@Schema(description = "部门编号数组", example = "1")
private Set<Long> deptIds;
@Schema(description = "岗位编号数组", example = "1")
private Set<Long> postIds;
@Schema(description = "用户邮箱", example = "yudao@iocoder.cn")
private String email;
@Schema(description = "手机号码", example = "15601691300")
private String mobile;
@Schema(description = "用户性别,参见 SexEnum 枚举类", example = "1")
private Integer sex;
@Schema(description = "用户状态", example = "1")
private Integer status;
@Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png")
private String avatar;
@Schema(description = "密码", example = "123456")
private String password;
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.system.api.user.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 管理员用户精简信息 Response DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 管理员用户精简信息 Response DTO")
@Data
public class AdminUserSimpleRespDTO {
@Schema(description = "用户编号", example = "1024")
private Long id;
@Schema(description = "用户昵称", example = "芋道")
private String nickname;
@Schema(description = "部门ID", example = "1")
private Long deptId;
@Schema(description = "部门名称", example = "IT 部")
private String deptName;
}

View File

@@ -0,0 +1,21 @@
package cn.iocoder.yudao.module.system.api.user.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 管理员用户更新密码 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 管理员用户更新密码 Request DTO")
@Data
public class AdminUserUpdatePasswordReqDTO {
@Schema(description = "用户编号", example = "1024")
private Long id;
@Schema(description = "密码", example = "123456")
private String password;
}

View File

@@ -0,0 +1,21 @@
package cn.iocoder.yudao.module.system.api.user.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 管理员用户更新状态 Request DTO
*
* @author system
*/
@Schema(description = "RPC 服务 - 管理员用户更新状态 Request DTO")
@Data
public class AdminUserUpdateStatusReqDTO {
@Schema(description = "用户编号", example = "1024")
private Long id;
@Schema(description = "状态,见 CommonStatusEnum 枚举", example = "1")
private Integer status;
}