Merge branch 'refs/heads/zt-test' into test
This commit is contained in:
@@ -4,16 +4,14 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt</artifactId>
|
||||
<artifactId>zt-dsc</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<modules>
|
||||
<module>zt-module-system-api</module>
|
||||
<module>zt-module-system-server</module>
|
||||
<module>zt-module-system-server-app</module>
|
||||
</modules>
|
||||
<artifactId>zt-module-system</artifactId>
|
||||
<artifactId>zt-module-system-dsc</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-system</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>zt-module-system-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
system 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DataBus API -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-databus-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 -->
|
||||
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.collection.CollectionUtils;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.system.api.dept.dto.*;
|
||||
import com.zt.plat.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.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 部门")
|
||||
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);
|
||||
|
||||
@PostMapping(PREFIX + "/list-all")
|
||||
@Operation(summary = "获得部门列表")
|
||||
CommonResult<List<DeptDetailRespDTO>> getDeptList(@RequestBody 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 + "/all-company-list")
|
||||
@Operation(summary = "获得所有公司精简信息列表")
|
||||
CommonResult<List<DeptSimpleRespDTO>> getAllCompanyList();
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得部门信息")
|
||||
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)
|
||||
CommonResult<DeptRespDTO> getDept(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@Operation(summary = "获得部门信息数组")
|
||||
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
|
||||
CommonResult<List<DeptRespDTO>> getDeptList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@Operation(summary = "校验部门是否合法")
|
||||
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
|
||||
CommonResult<Boolean> validateDeptList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得指定编号的部门 Map
|
||||
*
|
||||
* @param ids 部门编号数组
|
||||
* @return 部门 Map
|
||||
*/
|
||||
default Map<Long, DeptRespDTO> getDeptMap(Collection<Long> ids) {
|
||||
List<DeptRespDTO> list = getDeptList(ids).getCheckedData();
|
||||
return CollectionUtils.convertMap(list, DeptRespDTO::getId);
|
||||
}
|
||||
|
||||
@GetMapping(PREFIX + "/list-child")
|
||||
@Operation(summary = "获得指定部门的所有子部门")
|
||||
@Parameter(name = "id", description = "部门编号", example = "1024", required = true)
|
||||
CommonResult<List<DeptRespDTO>> getChildDeptList(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/company-dept-info")
|
||||
@Operation(summary = "获得指定用户的公司部门信息")
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<Set<CompanyDeptInfoRespDTO>> getCompanyDeptInfoListByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping(PREFIX+"/up-find-company-node")
|
||||
@Operation(summary = "获取公司节点信息", description = "通过部门编号,向上追溯部门信息,直到上级部门是公司,返回追溯到的部门信息列表")
|
||||
@Parameter(name = "deptId", description = "部门编号", required = true, example = "1024")
|
||||
CommonResult<List<DeptRespDTO>> upFindCompanyNode(@RequestParam("deptId") Long deptId);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步部门")
|
||||
CommonResult<Boolean> syncDept(@RequestBody DeptSaveReqDTO syncReqDTO);
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.dept.dto.DeptExternalCodeRespDTO;
|
||||
import com.zt.plat.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 java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 部门外部组织编码映射")
|
||||
public interface DeptExternalCodeApi {
|
||||
|
||||
@GetMapping("/get-by-system-and-external")
|
||||
@Operation(summary = "根据外部系统与外部组织编码查询映射")
|
||||
CommonResult<DeptExternalCodeRespDTO> getBySystemCodeAndExternalCode(
|
||||
@RequestParam("systemCode") @Parameter(description = "外部系统标识", required = true) String systemCode,
|
||||
@RequestParam("externalDeptCode") @Parameter(description = "外部组织编码", required = true) String externalDeptCode);
|
||||
|
||||
@GetMapping("/get-by-system-and-dept")
|
||||
@Operation(summary = "根据外部系统与部门编号查询映射")
|
||||
CommonResult<DeptExternalCodeRespDTO> getBySystemCodeAndDeptId(
|
||||
@RequestParam("systemCode") @Parameter(description = "外部系统标识", required = true) String systemCode,
|
||||
@RequestParam("deptId") @Parameter(description = "部门编号", required = true) Long deptId);
|
||||
|
||||
@GetMapping("/list-by-dept")
|
||||
@Operation(summary = "根据部门编号查询映射列表")
|
||||
CommonResult<List<DeptExternalCodeRespDTO>> getListByDeptId(
|
||||
@RequestParam("deptId") @Parameter(description = "部门编号", required = true) Long deptId);
|
||||
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.collection.CollectionUtils;
|
||||
import com.zt.plat.module.system.api.dept.dto.PostRespDTO;
|
||||
import com.zt.plat.module.system.api.dept.dto.PostSaveReqDTO;
|
||||
import com.zt.plat.module.system.api.dept.dto.PostSimpleRespDTO;
|
||||
import com.zt.plat.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.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 岗位")
|
||||
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)
|
||||
CommonResult<Boolean> validPostList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@Operation(summary = "获得岗位列表")
|
||||
@Parameter(name = "ids", description = "岗位编号数组", example = "1,2", required = true)
|
||||
CommonResult<List<PostRespDTO>> getPostList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
default Map<Long, PostRespDTO> getPostMap(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return MapUtil.empty();
|
||||
}
|
||||
|
||||
List<PostRespDTO> list = getPostList(ids).getData();
|
||||
return CollectionUtils.convertMap(list, PostRespDTO::getId);
|
||||
}
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步岗位")
|
||||
CommonResult<Boolean> syncPost(@RequestBody PostSaveReqDTO syncReqDTO);
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 公司部门信息 Response DTO
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 公司部门信息 Response DTO")
|
||||
@Data
|
||||
public class CompanyDeptInfoRespDTO {
|
||||
|
||||
@Schema(description = "公司编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "公司编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxxx")
|
||||
private String companyCode;
|
||||
|
||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "部门编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxxxx")
|
||||
private String deptCode;
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.zt.plat.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 = "ZT")
|
||||
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 = "zt@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;
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "RPC - 部门外部组织编码映射 Response DTO")
|
||||
@Data
|
||||
public class DeptExternalCodeRespDTO {
|
||||
|
||||
@Schema(description = "映射编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "部门编号", example = "2048")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名称", example = "技术部")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "部门编码", example = "DEPT_001")
|
||||
private String deptCode;
|
||||
|
||||
@Schema(description = "外部系统标识", example = "ERP")
|
||||
private String systemCode;
|
||||
|
||||
@Schema(description = "外部组织编码", example = "100200")
|
||||
private String externalDeptCode;
|
||||
|
||||
@Schema(description = "外部组织名称", example = "总部-华东区")
|
||||
private String externalDeptName;
|
||||
|
||||
@Schema(description = "状态", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门列表 Request DTO
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 部门列表 Request DTO")
|
||||
@Data
|
||||
public class DeptListReqDTO {
|
||||
|
||||
@Schema(description = "部门名称,模糊匹配", example = "ZT")
|
||||
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;
|
||||
|
||||
@Schema(description = "部门编号集合,支持多部门查询", example = "[\"1001\", \"1002\"]")
|
||||
private List<String> ids;
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import com.zt.plat.framework.common.enums.CommonStatusEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 公司部门推送消息 Response DTO
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 部门推送消息 Response DTO")
|
||||
@Data
|
||||
public class DeptMsgRespDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 主键编号
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 本系统部门 ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 外部系统标识
|
||||
*/
|
||||
private String systemCode;
|
||||
|
||||
/**
|
||||
* 外部系统组织编码
|
||||
*/
|
||||
private String externalDeptCode;
|
||||
|
||||
/**
|
||||
* 外部系统组织名称
|
||||
*/
|
||||
private String externalDeptName;
|
||||
|
||||
/**
|
||||
* 映射状态
|
||||
* 枚举 {@link CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否发送消息
|
||||
*/
|
||||
private Integer isSendMsg;
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 部门 Response DTO")
|
||||
@Data
|
||||
public class DeptRespDTO {
|
||||
|
||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "部门编码", example = "XXXXXXX")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "父部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long leaderUserId;
|
||||
|
||||
@Schema(description = "部门状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status; // 参见 CommonStatusEnum 枚举
|
||||
|
||||
@Schema(description = "是否公司", example = "false")
|
||||
private Boolean isCompany;
|
||||
|
||||
@Schema(description = "是否集团", example = "false")
|
||||
private Boolean isGroup;
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.zt.plat.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 = "ZT001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "部门名称", example = "ZT")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "部门简称", example = "技术")
|
||||
private String shortName;
|
||||
|
||||
@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 = "zt@iocoder.cn")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举0 开启 1 关闭", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否集团", example = "false")
|
||||
private Boolean isGroup;
|
||||
|
||||
@Schema(description = "是否公司", example = "false")
|
||||
private Boolean isCompany;
|
||||
|
||||
@Schema(description = "部门来源类型", example = "1")
|
||||
private Integer deptSource;
|
||||
|
||||
@Schema(description = "外部系统标识,用于建立编码映射", example = "ERP")
|
||||
private String externalSystemCode;
|
||||
|
||||
@Schema(description = "外部系统组织编码,用于建立映射", example = "ERP-001")
|
||||
private String externalDeptCode;
|
||||
|
||||
@Schema(description = "外部系统组织名称", example = "ERP总部")
|
||||
private String externalDeptName;
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.zt.plat.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 = "ZT")
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import com.zt.plat.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 = "zt")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "岗位名称,模糊匹配", example = "ZT")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 岗位 Response DTO
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 岗位 Response DTO")
|
||||
@Data
|
||||
public class PostRespDTO {
|
||||
|
||||
@Schema(description = "岗位编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小土豆")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "岗位编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "zt")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "岗位排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status; // 参见 CommonStatusEnum 枚举
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.zt.plat.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 = "zt")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "显示顺序", example = "1024")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "快乐的备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dict;
|
||||
|
||||
import com.zt.plat.framework.common.biz.system.dict.DictDataCommonApi;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.system.api.dict.dto.DictDataDetailRespDTO;
|
||||
import com.zt.plat.module.system.api.dict.dto.DictDataPageReqDTO;
|
||||
import com.zt.plat.module.system.api.dict.dto.DictDataSaveReqDTO;
|
||||
import com.zt.plat.module.system.api.dict.dto.DictDataSimpleRespDTO;
|
||||
import com.zt.plat.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.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 字典数据")
|
||||
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);
|
||||
|
||||
@PostMapping(PREFIX + "/page")
|
||||
@Operation(summary = "分页查询字典数据")
|
||||
CommonResult<PageResult<DictDataDetailRespDTO>> getDictDataPage(@RequestBody DictDataPageReqDTO pageReqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@Operation(summary = "校验字典数据们是否有效")
|
||||
@Parameters({
|
||||
@Parameter(name = "dictType", description = "字典类型", example = "SEX", required = true),
|
||||
@Parameter(name = "descriptions", description = "字典数据值的数组", example = "1,2", required = true)
|
||||
})
|
||||
CommonResult<Boolean> validateDictDataList(@RequestParam("dictType") String dictType,
|
||||
@RequestParam("values") Collection<String> values);
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.zt.plat.module.system.api.dict.dto;
|
||||
|
||||
import com.zt.plat.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 = "ZT")
|
||||
private String label;
|
||||
|
||||
@Schema(description = "字典类型,模糊匹配", example = "sys_common_sex")
|
||||
private String dictType;
|
||||
|
||||
@Schema(description = "字典值", example = "1")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.zt.plat.module.system.api.esp;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.dept.dto.*;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 部门推送消息")
|
||||
public interface EspApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/dept-esp";
|
||||
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@Operation(summary = "新增部门")
|
||||
CommonResult<Long> createDept(@RequestBody DeptSaveReqDTO createReqVO);
|
||||
|
||||
|
||||
@PostMapping(PREFIX + "/pushMsg")
|
||||
@Operation(summary = "查询部门消息")
|
||||
CommonResult<List<DeptMsgRespDTO>> selectDepMsg(@RequestBody DeptSaveReqDTO syncReqDTO);
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.zt.plat.module.system.api.esp.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "RPC 服务 - 推送外部系统配置信息 Response DTO")
|
||||
@Data
|
||||
public class EspDto {
|
||||
|
||||
@Schema(description = "部门名称,模糊匹配", example = "ZT")
|
||||
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;
|
||||
|
||||
@Schema(description = "部门编号集合,支持多部门查询", example = "[\"1001\", \"1002\"]")
|
||||
private List<String> ids;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.iwork.dto.*;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* RPC 服务 - iWork 集成
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME, contextId = "iWorkIntegrationApi")
|
||||
@Tag(name = "RPC 服务 - iWork 集成")
|
||||
public interface IWorkIntegrationApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/integration/iwork";
|
||||
|
||||
// ----------------- 认证 / 会话 -----------------
|
||||
|
||||
@PostMapping(PREFIX + "/auth/register")
|
||||
@Operation(summary = "注册 iWork 凭证,获取服务端公钥与 secret")
|
||||
CommonResult<IWorkAuthRegisterRespDTO> register(@RequestBody IWorkAuthRegisterReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/auth/token")
|
||||
@Operation(summary = "申请 iWork Token(独立接口)")
|
||||
CommonResult<IWorkAuthTokenRespDTO> acquireToken(@RequestBody IWorkAuthTokenReqDTO reqDTO);
|
||||
|
||||
// ----------------- 流程类能力 -----------------
|
||||
|
||||
@PostMapping(PREFIX + "/user/resolve")
|
||||
@Operation(summary = "根据外部标识获取 iWork 用户编号")
|
||||
CommonResult<IWorkUserInfoRespDTO> resolveUser(@RequestBody IWorkUserInfoReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/workflow/create")
|
||||
@Operation(summary = "发起 iWork 流程")
|
||||
CommonResult<IWorkOperationRespDTO> createWorkflow(@RequestBody IWorkWorkflowCreateReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/workflow/void")
|
||||
@Operation(summary = "作废 / 干预 iWork 流程")
|
||||
CommonResult<IWorkOperationRespDTO> voidWorkflow(@RequestBody IWorkWorkflowVoidReqDTO reqDTO);
|
||||
|
||||
// ----------------- 人力组织分页接口 -----------------
|
||||
|
||||
@PostMapping(PREFIX + "/hr/subcompany/page")
|
||||
@Operation(summary = "获取 iWork 分部列表")
|
||||
CommonResult<IWorkHrSubcompanyPageRespDTO> listSubcompanies(@RequestBody IWorkSubcompanyQueryReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/hr/department/page")
|
||||
@Operation(summary = "获取 iWork 部门列表")
|
||||
CommonResult<IWorkHrDepartmentPageRespDTO> listDepartments(@RequestBody IWorkDepartmentQueryReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/hr/job-title/page")
|
||||
@Operation(summary = "获取 iWork 岗位列表")
|
||||
CommonResult<IWorkHrJobTitlePageRespDTO> listJobTitles(@RequestBody IWorkJobTitleQueryReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/hr/user/page")
|
||||
@Operation(summary = "获取 iWork 人员列表")
|
||||
CommonResult<IWorkHrUserPageRespDTO> listUsers(@RequestBody IWorkUserQueryReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 注册授权请求 DTO(供其他模块通过 Feign 调用 system-server 时使用)
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthRegisterReqDTO {
|
||||
|
||||
@Schema(description = "iWork 应用编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String appCode;
|
||||
|
||||
@Schema(description = "iWork 网关地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String baseUrl;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 注册授权响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthRegisterRespDTO {
|
||||
|
||||
@Schema(description = "服务端公钥(Base64)")
|
||||
private String publicKey;
|
||||
|
||||
@Schema(description = "服务端下发的 secret")
|
||||
private String secret;
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork Token 申请请求 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthTokenReqDTO {
|
||||
|
||||
@Schema(description = "应用编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String appCode;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork Token 响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkAuthTokenRespDTO {
|
||||
|
||||
@Schema(description = "访问令牌")
|
||||
private String accessToken;
|
||||
|
||||
@Schema(description = "过期时间(秒)")
|
||||
private Long expiresIn;
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 集成接口公用的请求字段(API 专用,不依赖 VO)。
|
||||
*/
|
||||
@Data
|
||||
public class IWorkBaseReqDTO {
|
||||
|
||||
@Schema(description = "配置的 iWork 凭证 appId;为空时使用默认凭证", example = "iwork-app")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "iWork 操作人用户编号", example = "1")
|
||||
private String operatorUserId;
|
||||
|
||||
@Schema(description = "是否强制刷新 token", example = "false")
|
||||
private Boolean forceRefreshToken;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* iWork 部门查询参数。
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IWorkDepartmentQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||
|
||||
@JsonProperty("departmentcode")
|
||||
@Schema(description = "部门编号")
|
||||
private String departmentCode;
|
||||
|
||||
@JsonProperty("departmentname")
|
||||
@Schema(description = "部门名称")
|
||||
private String departmentName;
|
||||
|
||||
@JsonProperty("subcompanyid1")
|
||||
@Schema(description = "分部 ID")
|
||||
private String subcompanyId1;
|
||||
|
||||
@JsonProperty("created")
|
||||
@Schema(description = "创建时间戳(>=)")
|
||||
private String created;
|
||||
|
||||
@JsonProperty("modified")
|
||||
@Schema(description = "修改时间戳(>=)")
|
||||
private String modified;
|
||||
|
||||
@JsonProperty("canceled")
|
||||
@Schema(description = "封存标志,默认查询非封存数据。1:封存")
|
||||
private String canceled;
|
||||
|
||||
@JsonProperty("custom_data")
|
||||
@Schema(description = "自定义字段列表(逗号分隔)")
|
||||
private String customData;
|
||||
|
||||
@JsonProperty("id")
|
||||
@Schema(description = "OA 部门 ID")
|
||||
private String id;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 部门分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrDepartmentPageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "部门编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 岗位分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrJobTitlePageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "岗位编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "岗位名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 分部分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrSubcompanyPageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "分部编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "分部名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* iWork 人员分页响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkHrUserPageRespDTO {
|
||||
|
||||
@Schema(description = "总条数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页数据")
|
||||
private List<Item> list;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "人员编号")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "人员名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* iWork 岗位查询参数。
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IWorkJobTitleQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||
|
||||
@JsonProperty("jobtitlename")
|
||||
@Schema(description = "岗位名称")
|
||||
private String jobTitleName;
|
||||
|
||||
@JsonProperty("created")
|
||||
@Schema(description = "创建时间戳(>=)")
|
||||
private String created;
|
||||
|
||||
@JsonProperty("modified")
|
||||
@Schema(description = "修改时间戳(>=)")
|
||||
private String modified;
|
||||
|
||||
@JsonProperty("id")
|
||||
@Schema(description = "岗位 ID")
|
||||
private String id;
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* iWork 操作结果响应 DTO(结构对齐 VO,独立定义)。
|
||||
*/
|
||||
@Data
|
||||
public class IWorkOperationRespDTO {
|
||||
|
||||
@Schema(description = "iWork 返回的原始数据结构")
|
||||
private Payload payload;
|
||||
|
||||
@Schema(description = "是否判断为成功")
|
||||
private Boolean success;
|
||||
|
||||
@Schema(description = "返回提示信息")
|
||||
private String message;
|
||||
|
||||
@Data
|
||||
public static class Payload {
|
||||
|
||||
@Schema(description = "iWork 返回的业务状态码,例如 SUCCESS")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "iWork 返回的数据体")
|
||||
private PayloadData data;
|
||||
|
||||
@Schema(description = "错误信息对象,通常为空对象")
|
||||
private Map<String, Object> errMsg;
|
||||
|
||||
@Schema(description = "返回失败时的详细信息")
|
||||
private ReqFailMsg reqFailMsg;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class PayloadData {
|
||||
|
||||
@Schema(description = "iWork 生成的请求编号 requestid")
|
||||
@JsonProperty("requestid")
|
||||
private Long requestId;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ReqFailMsg {
|
||||
|
||||
@Schema(description = "失败时的关键参数集合")
|
||||
private Map<String, Object> keyParameters;
|
||||
|
||||
@Schema(description = "失败消息对象")
|
||||
private Map<String, Object> msgInfo;
|
||||
|
||||
@Schema(description = "其他附加参数,例如 doAutoApprove")
|
||||
private Map<String, Object> otherParams;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 人力组织查询基础参数。
|
||||
*/
|
||||
@Data
|
||||
public class IWorkOrgBaseQueryReqDTO {
|
||||
|
||||
@Schema(description = "当前页码", example = "1")
|
||||
private Integer curpage;
|
||||
|
||||
@Schema(description = "每页条数", example = "20")
|
||||
private Integer pagesize;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* iWork 分部查询参数。
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IWorkSubcompanyQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||
|
||||
@JsonProperty("subcompanycode")
|
||||
@Schema(description = "分部编号")
|
||||
private String subcompanyCode;
|
||||
|
||||
@JsonProperty("subcompanyname")
|
||||
@Schema(description = "分部名称")
|
||||
private String subcompanyName;
|
||||
|
||||
@JsonProperty("modified")
|
||||
@Schema(description = "修改时间戳(>=)")
|
||||
private String modified;
|
||||
|
||||
@JsonProperty("canceled")
|
||||
@Schema(description = "封存标志,默认查询非封存数据。1:封存")
|
||||
private String canceled;
|
||||
|
||||
@JsonProperty("custom_data")
|
||||
@Schema(description = "自定义字段列表(逗号分隔)")
|
||||
private String customData;
|
||||
|
||||
@JsonProperty("id")
|
||||
@Schema(description = "OA 分部 ID")
|
||||
private String id;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 根据外部标识解析 iWork 用户请求 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkUserInfoReqDTO {
|
||||
|
||||
@Schema(description = "外部系统中的用户唯一标识", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String externalUserCode;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* iWork 用户解析响应 DTO
|
||||
*/
|
||||
@Data
|
||||
public class IWorkUserInfoRespDTO {
|
||||
|
||||
@Schema(description = "iWork 用户编号")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "iWork 用户名称")
|
||||
private String userName;
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* iWork 人员查询参数。
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class IWorkUserQueryReqDTO extends IWorkOrgBaseQueryReqDTO {
|
||||
|
||||
@JsonProperty("workcode")
|
||||
@Schema(description = "人员编号")
|
||||
private String workCode;
|
||||
|
||||
@JsonProperty("subcompanyid1")
|
||||
@Schema(description = "分部 ID")
|
||||
private String subcompanyId1;
|
||||
|
||||
@JsonProperty("departmentid")
|
||||
@Schema(description = "部门 ID")
|
||||
private String departmentId;
|
||||
|
||||
@JsonProperty("jobtitleid")
|
||||
@Schema(description = "岗位 ID")
|
||||
private String jobTitleId;
|
||||
|
||||
@JsonProperty("id")
|
||||
@Schema(description = "人员 ID")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("loginid")
|
||||
@Schema(description = "登录名")
|
||||
private String loginId;
|
||||
|
||||
@JsonProperty("created")
|
||||
@Schema(description = "创建时间戳(>=)")
|
||||
private String created;
|
||||
|
||||
@JsonProperty("modified")
|
||||
@Schema(description = "修改时间戳(>=)")
|
||||
private String modified;
|
||||
|
||||
@JsonProperty("base_custom_data")
|
||||
@Schema(description = "基本信息自定义字段列表(逗号分隔)")
|
||||
private String baseCustomData;
|
||||
|
||||
@JsonProperty("person_custom_data")
|
||||
@Schema(description = "个人信息自定义字段列表(逗号分隔)")
|
||||
private String personCustomData;
|
||||
|
||||
@JsonProperty("work_custom_data")
|
||||
@Schema(description = "工作信息自定义字段列表(逗号分隔)")
|
||||
private String workCustomData;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 发起 iWork 流程请求 DTO
|
||||
*
|
||||
* 与 IWorkWorkflowCreateReqVO 字段一一对应,便于 Feign 调用。
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class IWorkWorkflowCreateReqDTO extends IWorkBaseReqDTO {
|
||||
|
||||
@Schema(description = "用印申请人(iWork 人员 ID)", example = "1001")
|
||||
private String jbr;
|
||||
|
||||
@Schema(description = "用印部门 ID", example = "2001")
|
||||
private String yybm;
|
||||
|
||||
@Schema(description = "用印单位(分部 ID)", example = "3001")
|
||||
private String fb;
|
||||
|
||||
@Schema(description = "申请时间,格式 yyyy-MM-dd", example = "2025-01-01")
|
||||
private String sqsj;
|
||||
|
||||
@Schema(description = "用印去向")
|
||||
private String yyqx;
|
||||
|
||||
@Schema(description = "用印依据附件 URL")
|
||||
private String yyfkUrl;
|
||||
|
||||
@Schema(description = "用印事由或内容摘要")
|
||||
private String yysy;
|
||||
|
||||
@Schema(description = "用印材料附件 URL(必填)")
|
||||
private String xyywjUrl;
|
||||
|
||||
@Schema(description = "业务回调标识(回调分发使用,≤255 字符)")
|
||||
private String bizCallbackKey;
|
||||
|
||||
@Schema(description = "用印事项")
|
||||
private String yysx;
|
||||
|
||||
@Schema(description = "业务系统单据编号(用于派生流程标题)", example = "DJ-2025-0001")
|
||||
private String ywxtdjbh;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.zt.plat.module.system.api.iwork.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 作废 / 干预 iWork 流程请求 DTO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class IWorkWorkflowVoidReqDTO extends IWorkBaseReqDTO {
|
||||
|
||||
@Schema(description = "流程请求编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "REQ-001")
|
||||
private String requestId;
|
||||
|
||||
@Schema(description = "作废原因")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "额外参数")
|
||||
private Map<String, Object> extraParams;
|
||||
|
||||
@Schema(description = "额外 Form 数据")
|
||||
private Map<String, String> formExtras;
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.zt.plat.module.system.api.logger;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.logger.dto.LoginLogCreateReqDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 登录日志")
|
||||
public interface LoginLogApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/login-log";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@Operation(summary = "创建登录日志")
|
||||
CommonResult<Boolean> createLoginLog(@Valid @RequestBody LoginLogCreateReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.zt.plat.module.system.api.logger;
|
||||
|
||||
import com.zt.plat.framework.common.biz.system.logger.OperateLogCommonApi;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.system.api.logger.dto.OperateLogPageReqDTO;
|
||||
import com.zt.plat.module.system.api.logger.dto.OperateLogRespDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 操作日志")
|
||||
public interface OperateLogApi extends OperateLogCommonApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/operate-log";
|
||||
|
||||
@PostMapping(PREFIX + "/page")
|
||||
@Operation(summary = "获取指定模块的指定数据的操作日志分页")
|
||||
CommonResult<PageResult<OperateLogRespDTO>> getOperateLogPage(@RequestBody OperateLogPageReqDTO pageReqDTO);
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.zt.plat.module.system.api.logger.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 登录日志创建 Request DTO")
|
||||
@Data
|
||||
public class LoginLogCreateReqDTO {
|
||||
|
||||
@Schema(description = "日志类型,参见 LoginLogTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1" )
|
||||
@NotNull(message = "日志类型不能为空")
|
||||
private Integer logType;
|
||||
|
||||
@Schema(description = "链路追踪编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
private String traceId;
|
||||
|
||||
@Schema(description = "用户编号", example = "666")
|
||||
private Long userId;
|
||||
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "2" )
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
@Schema(description = "用户账号", example = "zt")
|
||||
@Size(max = 30, message = "用户账号长度不能超过30个字符")
|
||||
private String username; // 不再强制校验 username 非空,因为 Member 社交登录时,此时暂时没有 username(mobile)!
|
||||
|
||||
@Schema(description = "登录结果,参见 LoginResultEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "登录结果不能为空")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
|
||||
@NotEmpty(message = "用户 IP 不能为空")
|
||||
private String userIp;
|
||||
|
||||
@Schema(description = "浏览器 UserAgent", requiredMode = Schema.RequiredMode.REQUIRED, example = "Mozilla/5.0")
|
||||
private String userAgent;
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.zt.plat.module.system.api.logger.dto;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(name = "RPC 服务 - 操作日志分页 Request DTO")
|
||||
@Data
|
||||
public class OperateLogPageReqDTO extends PageParam {
|
||||
|
||||
@Schema(description = "模块类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "订单")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "模块数据编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "188")
|
||||
private Long bizId;
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "666")
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.zt.plat.module.system.api.logger.dto;
|
||||
|
||||
import com.zt.plat.module.system.api.user.AdminUserApi;
|
||||
import com.fhs.core.trans.anno.Trans;
|
||||
import com.fhs.core.trans.constant.TransType;
|
||||
import com.fhs.core.trans.vo.VO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(name = "RPC 服务 - 系统操作日志 Response DTO")
|
||||
@Data
|
||||
public class OperateLogRespDTO implements VO {
|
||||
|
||||
@Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "链路追踪编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "89aca178-a370-411c-ae02-3f0d672be4ab")
|
||||
private String traceId;
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "666")
|
||||
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "userName")
|
||||
private Long userId;
|
||||
@Schema(description = "用户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT")
|
||||
private String userName;
|
||||
@Schema(description = "用户类型,参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "2" )
|
||||
private Integer userType;
|
||||
@Schema(description = "操作模块类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "订单")
|
||||
private String type;
|
||||
@Schema(description = "操作名", requiredMode = Schema.RequiredMode.REQUIRED, example = "创建订单")
|
||||
private String subType;
|
||||
@Schema(description = "操作模块业务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "188")
|
||||
private Long bizId;
|
||||
@Schema(description = "操作内容", requiredMode = Schema.RequiredMode.REQUIRED,
|
||||
example = "修改编号为 1 的用户信息,将性别从男改成女,将姓名从ZT改成源码")
|
||||
private String action;
|
||||
@Schema(description = "拓展字段", example = "{\"orderId\": \"1\"}")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "请求方法名", requiredMode = Schema.RequiredMode.REQUIRED, example = "GET")
|
||||
private String requestMethod;
|
||||
@Schema(description = "请求地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "/order/get")
|
||||
private String requestUrl;
|
||||
@Schema(description = "用户 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "127.0.0.1")
|
||||
private String userIp;
|
||||
@Schema(description = "浏览器 UserAgent", requiredMode = Schema.RequiredMode.REQUIRED, example = "Mozilla/5.0")
|
||||
private String userAgent;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.zt.plat.module.system.api.mail;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.mail.dto.MailSendSingleToUserReqDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 邮件发送")
|
||||
public interface MailSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/mail/send";
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-admin")
|
||||
@Operation(summary = "发送单条邮件给 Admin 用户", description = "在 mail 为空时,使用 userId 加载对应 Admin 的邮箱")
|
||||
CommonResult<Long> sendSingleMailToAdmin(@Valid @RequestBody MailSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-member")
|
||||
@Operation(summary = "发送单条邮件给 Member 用户", description = "在 mail 为空时,使用 userId 加载对应 Member 的邮箱")
|
||||
CommonResult<Long> sendSingleMailToMember(@Valid @RequestBody MailSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.zt.plat.module.system.api.mail.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 邮件发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Data
|
||||
public class MailSendSingleToUserReqDTO {
|
||||
|
||||
@Schema(description = "用户编号", example = "1024")
|
||||
private Long userId;
|
||||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
|
||||
@Email
|
||||
private String mail;
|
||||
|
||||
@Schema(description = "邮件模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_SEND")
|
||||
@NotNull(message = "邮件模板编号不能为空")
|
||||
private String templateCode;
|
||||
|
||||
@Schema(description = "邮件模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
package com.zt.plat.module.system.api.mq;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Databus 部门变更消息
|
||||
* <p>
|
||||
* 用于跨服务传递部门变更通知
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DatabusDeptChangeMessage implements Serializable {
|
||||
|
||||
/**
|
||||
* 消息 Topic
|
||||
*/
|
||||
public static final String TOPIC = "databus-change-system-dept";
|
||||
|
||||
/**
|
||||
* 事件动作:create-创建 update-更新 delete-删除
|
||||
*/
|
||||
private String action;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 部门简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 上级部门ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 负责人用户ID
|
||||
*/
|
||||
private Long leaderUserId;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否公司
|
||||
*/
|
||||
private Boolean isCompany;
|
||||
|
||||
/**
|
||||
* 是否集团
|
||||
*/
|
||||
private Boolean isGroup;
|
||||
|
||||
/**
|
||||
* 部门来源类型
|
||||
*/
|
||||
private Integer deptSource;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 事件时间
|
||||
*/
|
||||
private LocalDateTime eventTime;
|
||||
|
||||
// ==================== 静态工厂方法 ====================
|
||||
|
||||
public static DatabusDeptChangeMessage create(Long deptId, String deptCode, String deptName, String shortName,
|
||||
Long parentId, Integer sort, Long leaderUserId, String phone,
|
||||
String email, Integer status, Boolean isCompany, Boolean isGroup,
|
||||
Integer deptSource, Long tenantId, LocalDateTime createTime) {
|
||||
return new DatabusDeptChangeMessage()
|
||||
.setAction("create")
|
||||
.setDeptId(deptId)
|
||||
.setDeptCode(deptCode)
|
||||
.setDeptName(deptName)
|
||||
.setShortName(shortName)
|
||||
.setParentId(parentId)
|
||||
.setSort(sort)
|
||||
.setLeaderUserId(leaderUserId)
|
||||
.setPhone(phone)
|
||||
.setEmail(email)
|
||||
.setStatus(status)
|
||||
.setIsCompany(isCompany)
|
||||
.setIsGroup(isGroup)
|
||||
.setDeptSource(deptSource)
|
||||
.setTenantId(tenantId)
|
||||
.setEventTime(createTime != null ? createTime : LocalDateTime.now());
|
||||
}
|
||||
|
||||
public static DatabusDeptChangeMessage update(Long deptId, String deptCode, String deptName, String shortName,
|
||||
Long parentId, Integer sort, Long leaderUserId, String phone,
|
||||
String email, Integer status, Boolean isCompany, Boolean isGroup,
|
||||
Integer deptSource, Long tenantId, LocalDateTime updateTime) {
|
||||
return new DatabusDeptChangeMessage()
|
||||
.setAction("update")
|
||||
.setDeptId(deptId)
|
||||
.setDeptCode(deptCode)
|
||||
.setDeptName(deptName)
|
||||
.setShortName(shortName)
|
||||
.setParentId(parentId)
|
||||
.setSort(sort)
|
||||
.setLeaderUserId(leaderUserId)
|
||||
.setPhone(phone)
|
||||
.setEmail(email)
|
||||
.setStatus(status)
|
||||
.setIsCompany(isCompany)
|
||||
.setIsGroup(isGroup)
|
||||
.setDeptSource(deptSource)
|
||||
.setTenantId(tenantId)
|
||||
.setEventTime(updateTime != null ? updateTime : LocalDateTime.now());
|
||||
}
|
||||
|
||||
public static DatabusDeptChangeMessage delete(Long deptId, Long tenantId) {
|
||||
return new DatabusDeptChangeMessage()
|
||||
.setAction("delete")
|
||||
.setDeptId(deptId)
|
||||
.setTenantId(tenantId)
|
||||
.setEventTime(LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.zt.plat.module.system.api.mq;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Databus 岗位变更消息
|
||||
* <p>
|
||||
* 用于跨服务传递岗位变更通知
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DatabusPostChangeMessage implements Serializable {
|
||||
|
||||
/**
|
||||
* 消息 Topic
|
||||
*/
|
||||
public static final String TOPIC = "databus-change-system-post";
|
||||
|
||||
/**
|
||||
* 事件动作:create-创建 update-更新 delete-删除
|
||||
*/
|
||||
private String action;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private Long postId;
|
||||
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
private String postCode;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String postName;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 租户ID(PostDO 不支持多租户,固定为 null)
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 事件时间
|
||||
*/
|
||||
private LocalDateTime eventTime;
|
||||
|
||||
// ==================== 静态工厂方法 ====================
|
||||
|
||||
public static DatabusPostChangeMessage create(Long postId, String postCode, String postName,
|
||||
Integer sort, Integer status, String remark,
|
||||
LocalDateTime createTime) {
|
||||
return new DatabusPostChangeMessage()
|
||||
.setAction("create")
|
||||
.setPostId(postId)
|
||||
.setPostCode(postCode)
|
||||
.setPostName(postName)
|
||||
.setSort(sort)
|
||||
.setStatus(status)
|
||||
.setRemark(remark)
|
||||
.setTenantId(null) // PostDO 不支持多租户
|
||||
.setEventTime(createTime != null ? createTime : LocalDateTime.now());
|
||||
}
|
||||
|
||||
public static DatabusPostChangeMessage update(Long postId, String postCode, String postName,
|
||||
Integer sort, Integer status, String remark,
|
||||
LocalDateTime updateTime) {
|
||||
return new DatabusPostChangeMessage()
|
||||
.setAction("update")
|
||||
.setPostId(postId)
|
||||
.setPostCode(postCode)
|
||||
.setPostName(postName)
|
||||
.setSort(sort)
|
||||
.setStatus(status)
|
||||
.setRemark(remark)
|
||||
.setTenantId(null) // PostDO 不支持多租户
|
||||
.setEventTime(updateTime != null ? updateTime : LocalDateTime.now());
|
||||
}
|
||||
|
||||
public static DatabusPostChangeMessage delete(Long postId) {
|
||||
return new DatabusPostChangeMessage()
|
||||
.setAction("delete")
|
||||
.setPostId(postId)
|
||||
.setTenantId(null) // PostDO 不支持多租户
|
||||
.setEventTime(LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
package com.zt.plat.module.system.api.mq;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Databus 用户变更消息
|
||||
* <p>
|
||||
* 用于跨服务传递用户变更通知
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DatabusUserChangeMessage implements Serializable {
|
||||
|
||||
/**
|
||||
* 消息 Topic
|
||||
*/
|
||||
public static final String TOPIC = "databus-change-system-user";
|
||||
|
||||
/**
|
||||
* 事件动作:create-创建 update-更新 delete-删除
|
||||
*/
|
||||
private String action;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门ID集合
|
||||
*/
|
||||
private Set<Long> deptIds;
|
||||
|
||||
/**
|
||||
* 岗位ID集合
|
||||
*/
|
||||
private Set<Long> postIds;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 用户性别(0未知 1男 2女)
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 用户来源类型
|
||||
*/
|
||||
private Integer userSource;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 事件时间
|
||||
*/
|
||||
private LocalDateTime eventTime;
|
||||
|
||||
// ==================== 静态工厂方法 ====================
|
||||
|
||||
public static DatabusUserChangeMessage create(Long userId, String username, String nickname, String remark,
|
||||
Set<Long> deptIds, Set<Long> postIds, String email, String mobile,
|
||||
Integer sex, String avatar, Integer status, Integer userSource,
|
||||
Long tenantId, LocalDateTime createTime) {
|
||||
return new DatabusUserChangeMessage()
|
||||
.setAction("create")
|
||||
.setUserId(userId)
|
||||
.setUsername(username)
|
||||
.setNickname(nickname)
|
||||
.setRemark(remark)
|
||||
.setDeptIds(deptIds)
|
||||
.setPostIds(postIds)
|
||||
.setEmail(email)
|
||||
.setMobile(mobile)
|
||||
.setSex(sex)
|
||||
.setAvatar(avatar)
|
||||
.setStatus(status)
|
||||
.setUserSource(userSource)
|
||||
.setTenantId(tenantId)
|
||||
.setEventTime(createTime != null ? createTime : LocalDateTime.now());
|
||||
}
|
||||
|
||||
public static DatabusUserChangeMessage update(Long userId, String username, String nickname, String remark,
|
||||
Set<Long> deptIds, Set<Long> postIds, String email, String mobile,
|
||||
Integer sex, String avatar, Integer status, Integer userSource,
|
||||
Long tenantId, LocalDateTime updateTime) {
|
||||
return new DatabusUserChangeMessage()
|
||||
.setAction("update")
|
||||
.setUserId(userId)
|
||||
.setUsername(username)
|
||||
.setNickname(nickname)
|
||||
.setRemark(remark)
|
||||
.setDeptIds(deptIds)
|
||||
.setPostIds(postIds)
|
||||
.setEmail(email)
|
||||
.setMobile(mobile)
|
||||
.setSex(sex)
|
||||
.setAvatar(avatar)
|
||||
.setStatus(status)
|
||||
.setUserSource(userSource)
|
||||
.setTenantId(tenantId)
|
||||
.setEventTime(updateTime != null ? updateTime : LocalDateTime.now());
|
||||
}
|
||||
|
||||
public static DatabusUserChangeMessage delete(Long userId, Long tenantId) {
|
||||
return new DatabusUserChangeMessage()
|
||||
.setAction("delete")
|
||||
.setUserId(userId)
|
||||
.setTenantId(tenantId)
|
||||
.setEventTime(LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.zt.plat.module.system.api.msg;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.sms.dto.log.SmsLogRespDTO;
|
||||
import com.zt.plat.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 消息发送")
|
||||
public interface MsgSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/msg/send";
|
||||
|
||||
@PostMapping(PREFIX + "/sendTextMsg")
|
||||
@Operation(summary = "发送企业微信文本消息", description = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
CommonResult<Long> sendTextMsg(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/sendImageMsg")
|
||||
@Operation(summary = "发送企业微信图片消息", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendImageMsg(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/sendVoiceMsg")
|
||||
@Operation(summary = "发送企业微信语音消息")
|
||||
CommonResult<SmsLogRespDTO> getSmsLog(@RequestParam("id") Long id);
|
||||
|
||||
@PostMapping(PREFIX + "/sendVideoMsg")
|
||||
@Operation(summary = "发送企业微信视频消息", description = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
CommonResult<Long> sendVideoMsg(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/sendFileMsg")
|
||||
@Operation(summary = "发送企业微信文件消息", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendFileMsg(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/sendTextCardMsg")
|
||||
@Operation(summary = "发送企业微信文本卡片消息")
|
||||
CommonResult<SmsLogRespDTO> sendTextCardMsg(@RequestParam("id") Long id);
|
||||
|
||||
@PostMapping(PREFIX + "/sendTextCardMsgPich01")
|
||||
@Operation(summary = "发送企业微信文本卡片消息 -物资存货智能管理 预警信息", description = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
CommonResult<Long> sendTextCardMsgPich01(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/sendNewsMsg")
|
||||
@Operation(summary = "发送企业微信图文消息", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendNewsMsg(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/sendMpNewsMsg")
|
||||
@Operation(summary = "发送企业微信图文消息(mpnews)")
|
||||
CommonResult<SmsLogRespDTO> sendMpNewsMsg(@RequestParam("id") Long id);
|
||||
|
||||
@PostMapping(PREFIX + "/sendMarkdownMsg")
|
||||
@Operation(summary = "发送企业微信小程序通知消息", description = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
CommonResult<Long> sendMarkdownMsg(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/sendMiniProgramNoticeMsg")
|
||||
@Operation(summary = "发送企业微信图片消息", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendMiniProgramNoticeMsg(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/sendInteractiveTaskCardMsg")
|
||||
@Operation(summary = "发送企业微信任务卡片消息")
|
||||
CommonResult<SmsLogRespDTO> sendInteractiveTaskCardMsg(@RequestParam("id") Long id);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.zt.plat.module.system.api.notify;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 站内信发送")
|
||||
public interface NotifyMessageSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/notify/send";
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-admin")
|
||||
@Operation(summary = "发送单条站内信给 Admin 用户")
|
||||
CommonResult<Long> sendSingleMessageToAdmin(@Valid @RequestBody NotifySendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-member")
|
||||
@Operation(summary = "发送单条站内信给 Member 用户")
|
||||
CommonResult<Long> sendSingleMessageToMember(@Valid @RequestBody NotifySendSingleToUserReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.zt.plat.module.system.api.notify.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 站内信发送给 Admin 或者 Member 用户 Request DTO")
|
||||
@Data
|
||||
public class NotifySendSingleToUserReqDTO {
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "站内信模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_SEND")
|
||||
@NotEmpty(message = "站内信模板编号不能为空")
|
||||
private String templateCode;
|
||||
@Schema(description = "邮件模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* System API 包,定义暴露给其它模块的 API
|
||||
*/
|
||||
package com.zt.plat.module.system.api;
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.zt.plat.module.system.api.permission;
|
||||
|
||||
import com.zt.plat.framework.common.biz.system.permission.PermissionCommonApi;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.permission.dto.*;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import com.zt.plat.module.system.enums.permission.DataScopeEnum;
|
||||
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.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 权限")
|
||||
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)
|
||||
CommonResult<Set<Long>> getUserRoleIdListByRoleIds(@RequestParam("roleIds") Collection<Long> roleIds);
|
||||
|
||||
@GetMapping(PREFIX + "/user-role-id-list-by-user-id")
|
||||
@Operation(summary = "获得用户拥有的角色编号集合")
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<Set<Long>> getUserRoleIdListByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping(PREFIX + "/user-data-permission-level")
|
||||
@Operation(summary = "获得用户的数据权限级别")
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<DataScopeEnum> getUserDataPermissionLevel(@RequestParam("userId") Long userId);
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.zt.plat.module.system.api.permission;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.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 java.util.Collection;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 角色")
|
||||
public interface RoleApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/role";
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@Operation(summary = "校验角色是否合法")
|
||||
@Parameter(name = "ids", description = "角色编号数组", example = "1,2", required = true)
|
||||
CommonResult<Boolean> validRoleList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/has-any-super-admin")
|
||||
@Operation(summary = "判断角色列表中是否有超级管理员")
|
||||
@Parameter(name = "roleIds", description = "角色编号集合", example = "1,2", required = true)
|
||||
CommonResult<Boolean> hasAnySuperAdmin(@RequestParam("roleIds") Collection<Long> roleIds);
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.zt.plat.module.system.api.permission.dto;
|
||||
|
||||
import com.zt.plat.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 = "ZT")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "角色标识,模糊匹配", example = "admin")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.zt.plat.module.system.api.push;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.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;
|
||||
|
||||
/**
|
||||
* 外部系统推送配置 Feign API
|
||||
*
|
||||
* @author ZT Cloud
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 外部系统推送配置")
|
||||
public interface ExternalPushConfigApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/external-push-config";
|
||||
|
||||
/**
|
||||
* 判断是否允许推送到外部系统
|
||||
*
|
||||
* @param companyId 公司编号(可选,为 null 时表示不限制公司)
|
||||
* @param deptId 部门编号(可选,为 null 时只按公司配置判断)
|
||||
* @param businessType 业务类型(可选:PURCHASE/SALE/PRODUCTION,为 null 时表示所有业务类型)
|
||||
* @param externalSystem 外部系统标识(可选:ERP/IWORK/等,为 null 时表示所有外部系统)
|
||||
* @return 是否允许推送(true=允许,false=禁止,默认 true)
|
||||
*/
|
||||
@GetMapping(PREFIX + "/is-push-enabled")
|
||||
@Operation(summary = "判断是否允许推送到外部系统")
|
||||
CommonResult<Boolean> isPushEnabled(
|
||||
@RequestParam(value = "companyId", required = false) @Parameter(description = "公司编号") Long companyId,
|
||||
@RequestParam(value = "deptId", required = false) @Parameter(description = "部门编号") Long deptId,
|
||||
@RequestParam(value = "businessType", required = false) @Parameter(description = "业务类型") String businessType,
|
||||
@RequestParam(value = "externalSystem", required = false) @Parameter(description = "外部系统标识") String externalSystem);
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sequence;
|
||||
|
||||
import com.zt.plat.framework.common.biz.system.sequence.SequenceCommonApi;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author chenbowen
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME, primary = false) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 序列号")
|
||||
public interface SequenceApi extends SequenceCommonApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/sequence";
|
||||
|
||||
@PostMapping(PREFIX + "/next-sequence")
|
||||
@Operation(summary = "获取下一个序列号")
|
||||
@Override
|
||||
CommonResult<String> getNextSequence(@RequestParam("sequenceCode") String sequenceCode,
|
||||
@RequestParam(value = "circulationValue", required = false) String circulationValue,
|
||||
@RequestParam(value = "inputStrs", required = false) List<String> inputStrs);
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sms;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.sms.dto.code.SmsCodeValidateReqDTO;
|
||||
import com.zt.plat.module.system.api.sms.dto.code.SmsCodeSendReqDTO;
|
||||
import com.zt.plat.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 短信验证码")
|
||||
public interface SmsCodeApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/oauth2/sms/code";
|
||||
|
||||
@PostMapping(PREFIX + "/send")
|
||||
@Operation(summary = "创建短信验证码,并进行发送")
|
||||
CommonResult<Boolean> sendSmsCode(@Valid @RequestBody SmsCodeSendReqDTO reqDTO);
|
||||
|
||||
@PutMapping(PREFIX + "/use")
|
||||
@Operation(summary = "验证短信验证码,并进行使用")
|
||||
CommonResult<Boolean> useSmsCode(@Valid @RequestBody SmsCodeUseReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/validate")
|
||||
@Operation(summary = "检查验证码是否有效")
|
||||
CommonResult<Boolean> validateSmsCode(@Valid @RequestBody SmsCodeValidateReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sms;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
||||
import com.zt.plat.module.system.api.sms.dto.log.SmsLogRespDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 短信发送")
|
||||
public interface SmsSendApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/sms/send";
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-admin")
|
||||
@Operation(summary = "发送单条短信给 Admin 用户", description = "在 mobile 为空时,使用 userId 加载对应 Admin 的手机号")
|
||||
CommonResult<Long> sendSingleSmsToAdmin(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/send-single-member")
|
||||
@Operation(summary = "发送单条短信给 Member 用户", description = "在 mobile 为空时,使用 userId 加载对应 Member 的手机号")
|
||||
CommonResult<Long> sendSingleSmsToMember(@Valid @RequestBody SmsSendSingleToUserReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/log/get")
|
||||
@Operation(summary = "根据日志编号查询短信状态")
|
||||
CommonResult<SmsLogRespDTO> getSmsLog(@RequestParam("id") Long id);
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sms.dto.code;
|
||||
|
||||
import com.zt.plat.framework.common.validation.InEnum;
|
||||
import com.zt.plat.framework.common.validation.Mobile;
|
||||
import com.zt.plat.module.system.enums.sms.SmsSceneEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 短信验证码的发送 Request DTO")
|
||||
@Data
|
||||
public class SmsCodeSendReqDTO {
|
||||
|
||||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
|
||||
@Mobile
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
|
||||
private Integer scene;
|
||||
@Schema(description = "发送 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.20.30.40")
|
||||
@NotEmpty(message = "发送 IP 不能为空")
|
||||
private String createIp;
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sms.dto.code;
|
||||
|
||||
import com.zt.plat.framework.common.validation.InEnum;
|
||||
import com.zt.plat.framework.common.validation.Mobile;
|
||||
import com.zt.plat.module.system.enums.sms.SmsSceneEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 短信验证码的使用 Request DTO")
|
||||
@Data
|
||||
public class SmsCodeUseReqDTO {
|
||||
|
||||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
|
||||
@Mobile
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
private Integer scene;
|
||||
|
||||
@Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotEmpty(message = "验证码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "发送 IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.20.30.40")
|
||||
@NotEmpty(message = "使用 IP 不能为空")
|
||||
private String usedIp;
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sms.dto.code;
|
||||
|
||||
import com.zt.plat.framework.common.validation.InEnum;
|
||||
import com.zt.plat.framework.common.validation.Mobile;
|
||||
import com.zt.plat.module.system.enums.sms.SmsSceneEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 短信验证码的校验 Request DTO")
|
||||
@Data
|
||||
public class SmsCodeValidateReqDTO {
|
||||
|
||||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
|
||||
@Mobile
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "发送场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "发送场景不能为空")
|
||||
@InEnum(SmsSceneEnum.class)
|
||||
private Integer scene;
|
||||
|
||||
@Schema(description = "验证码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotEmpty(message = "验证码")
|
||||
private String code;
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sms.dto.code;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class User implements Serializable {
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
private Integer errcode;
|
||||
/**
|
||||
* 对返回码的文本描述内容
|
||||
*/
|
||||
private String errmsg;
|
||||
|
||||
/**
|
||||
* 成员UserID
|
||||
*/
|
||||
private String UserId;
|
||||
|
||||
/**
|
||||
* 手机设备号(由中铝集团在安装时随机生成,删除重装会改变,升级不受影响)
|
||||
*/
|
||||
private String DeviceId;
|
||||
|
||||
/**
|
||||
* 成员身份信息,2:超级管理员, 4:分级管理员,5:普通成员
|
||||
*/
|
||||
private Integer usertype;
|
||||
|
||||
|
||||
/**
|
||||
* 判断受否授权成功
|
||||
*
|
||||
* @return true-授权成功、false-授权失败
|
||||
*/
|
||||
public boolean isAuthorized() {
|
||||
return this.getErrcode() == 0;
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.zt.plat.module.system.api.sms.dto.log;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "RPC 服务 - 短信日志返回 DTO")
|
||||
public class SmsLogRespDTO {
|
||||
|
||||
@Schema(description = "日志编号", example = "123")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "短信渠道编码", example = "HL95")
|
||||
private String channelCode;
|
||||
|
||||
@Schema(description = "模板编码", example = "HL95_TEST")
|
||||
private String templateCode;
|
||||
|
||||
@Schema(description = "短信类型")
|
||||
private Integer templateType;
|
||||
|
||||
@Schema(description = "模板内容")
|
||||
private String templateContent;
|
||||
|
||||
@Schema(description = "模板参数")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
@Schema(description = "短信 API 模板编号")
|
||||
private String apiTemplateId;
|
||||
|
||||
@Schema(description = "手机号", example = "13800138000")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "用户编号", example = "1024")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户类型")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "发送状态")
|
||||
private Integer sendStatus;
|
||||
|
||||
@Schema(description = "发送时间")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@Schema(description = "发送结果编码")
|
||||
private String apiSendCode;
|
||||
|
||||
@Schema(description = "发送结果信息")
|
||||
private String apiSendMsg;
|
||||
|
||||
@Schema(description = "发送请求ID")
|
||||
private String apiRequestId;
|
||||
|
||||
@Schema(description = "发送序列号")
|
||||
private String apiSerialNo;
|
||||
|
||||
@Schema(description = "接收状态")
|
||||
private Integer receiveStatus;
|
||||
|
||||
@Schema(description = "接收时间")
|
||||
private LocalDateTime receiveTime;
|
||||
|
||||
@Schema(description = "接收结果编码")
|
||||
private String apiReceiveCode;
|
||||
|
||||
@Schema(description = "接收结果信息")
|
||||
private String apiReceiveMsg;
|
||||
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.social.dto.*;
|
||||
import com.zt.plat.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.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 社交应用")
|
||||
public interface SocialClientApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/social-client";
|
||||
|
||||
@GetMapping(PREFIX + "/get-authorize-url")
|
||||
@Operation(summary = "获得社交平台的授权 URL")
|
||||
@Parameters({
|
||||
@Parameter(name = "socialType", description = "社交平台的类型", example = "1", required = true),
|
||||
@Parameter(name = "userType", description = "用户类型", example = "1", required = true),
|
||||
@Parameter(name = "redirectUri", description = "重定向 URL", example = "https://www.iocoder.cn", required = true)
|
||||
})
|
||||
CommonResult<String> getAuthorizeUrl(@RequestParam("socialType") Integer socialType,
|
||||
@RequestParam("userType") Integer userType,
|
||||
@RequestParam("redirectUri") String redirectUri);
|
||||
|
||||
@GetMapping(PREFIX + "/create-wx-mp-jsapi-signature")
|
||||
@Operation(summary = "创建微信公众号 JS SDK 初始化所需的签名")
|
||||
@Parameters({
|
||||
@Parameter(name = "userType", description = "用户类型", example = "1", required = true),
|
||||
@Parameter(name = "url", description = "访问 URL", example = "https://www.iocoder.cn", required = true)
|
||||
})
|
||||
CommonResult<SocialWxJsapiSignatureRespDTO> createWxMpJsapiSignature(@RequestParam("userType") Integer userType,
|
||||
@RequestParam("url") String url);
|
||||
|
||||
@GetMapping(PREFIX + "/create-wx-ma-phone-number-info")
|
||||
@Operation(summary = "获得微信小程序的手机信息")
|
||||
@Parameters({
|
||||
@Parameter(name = "userType", description = "用户类型", example = "1", required = true),
|
||||
@Parameter(name = "phoneCode", description = "手机授权码", example = "zt11", required = true)
|
||||
})
|
||||
CommonResult<SocialWxPhoneNumberInfoRespDTO> getWxMaPhoneNumberInfo(@RequestParam("userType") Integer userType,
|
||||
@RequestParam("phoneCode") String phoneCode);
|
||||
|
||||
@PostMapping(PREFIX + "/get-wxa-qrcode")
|
||||
@Operation(summary = "获得小程序二维码")
|
||||
CommonResult<byte[]> getWxaQrcode(@RequestBody SocialWxQrcodeReqDTO reqVO);
|
||||
|
||||
@GetMapping(PREFIX + "/get-wxa-subscribe-template-list")
|
||||
@Operation(summary = "获得微信小程订阅模板")
|
||||
CommonResult<List<SocialWxaSubscribeTemplateRespDTO>> getWxaSubscribeTemplateList(@RequestParam("userType") Integer userType);
|
||||
|
||||
@PostMapping(PREFIX + "/send-wxa-subscribe-message")
|
||||
@Operation(summary = "发送微信小程序订阅消息")
|
||||
CommonResult<Boolean> sendWxaSubscribeMessage(@Valid @RequestBody SocialWxaSubscribeMessageSendReqDTO reqDTO);
|
||||
|
||||
/**
|
||||
* 上传订单发货到微信小程序
|
||||
*
|
||||
* @param userType 用户类型
|
||||
* @param reqDTO 请求
|
||||
*/
|
||||
@PostMapping(PREFIX + "/upload-wxa-order-shipping-info")
|
||||
@Operation(summary = "上传订单发货到微信小程序")
|
||||
CommonResult<Boolean> uploadWxaOrderShippingInfo(@RequestParam("userType") Integer userType,
|
||||
@Valid @RequestBody SocialWxaOrderUploadShippingInfoReqDTO reqDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/notify-wxa-order-confirm-receive")
|
||||
@Operation(summary = "通知订单收货到微信小程序")
|
||||
CommonResult<Boolean> notifyWxaOrderConfirmReceive(@RequestParam("userType") Integer userType,
|
||||
@Valid @RequestBody SocialWxaOrderNotifyConfirmReceiveReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social;
|
||||
|
||||
import com.zt.plat.framework.common.exception.ServiceException;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.social.dto.SocialUserBindReqDTO;
|
||||
import com.zt.plat.module.system.api.social.dto.SocialUserRespDTO;
|
||||
import com.zt.plat.module.system.api.social.dto.SocialUserUnbindReqDTO;
|
||||
import com.zt.plat.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.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 社交用户")
|
||||
public interface SocialUserApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/social-user";
|
||||
|
||||
@PostMapping(PREFIX + "/bind")
|
||||
@Operation(summary = "绑定社交用户")
|
||||
CommonResult<String> bindSocialUser(@Valid @RequestBody SocialUserBindReqDTO reqDTO);
|
||||
|
||||
@DeleteMapping(PREFIX + "/unbind")
|
||||
@Operation(summary = "取消绑定社交用户")
|
||||
CommonResult<Boolean> unbindSocialUser(@Valid @RequestBody SocialUserUnbindReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/get-by-user-id")
|
||||
@Operation(summary = "获得社交用户,基于 userId")
|
||||
@Parameters({
|
||||
@Parameter(name = "userType", description = "用户类型", example = "2", required = true),
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1024", required = true),
|
||||
@Parameter(name = "socialType", description = "社交平台的类型", example = "1", required = true),
|
||||
})
|
||||
CommonResult<SocialUserRespDTO> getSocialUserByUserId(@RequestParam("userType") Integer userType,
|
||||
@RequestParam("userId") Long userId,
|
||||
@RequestParam("socialType") Integer socialType);
|
||||
|
||||
@GetMapping(PREFIX + "/get-by-code")
|
||||
@Operation(summary = "获得社交用") // 在认证信息不正确的情况下,也会抛出 {@link ServiceException} 业务异常
|
||||
@Parameters({
|
||||
@Parameter(name = "userType", description = "用户类型", example = "2", required = true),
|
||||
@Parameter(name = "socialType", description = "社交平台的类型", example = "1", required = true),
|
||||
@Parameter(name = "code", description = "授权码", example = "88888", required = true),
|
||||
@Parameter(name = "state", description = "state", example = "666", required = true),
|
||||
})
|
||||
CommonResult<SocialUserRespDTO> getSocialUserByCode(@RequestParam("userType") Integer userType,
|
||||
@RequestParam("socialType") Integer socialType,
|
||||
@RequestParam("code") String code,
|
||||
@RequestParam("state") String state);
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import com.zt.plat.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 = "zt")
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.zt.plat.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 = "zt商城")
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.zt.plat.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 = "zt商城")
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import com.zt.plat.framework.common.enums.UserTypeEnum;
|
||||
import com.zt.plat.framework.common.validation.InEnum;
|
||||
import com.zt.plat.module.system.enums.social.SocialTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Schema(description = "RPC 服务 - 取消绑定社交用户 Request DTO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SocialUserBindReqDTO {
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@InEnum(UserTypeEnum.class)
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "社交平台的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
@NotNull(message = "社交平台的类型不能为空")
|
||||
private Integer socialType;
|
||||
@Schema(description = "授权码", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw")
|
||||
@NotEmpty(message = "授权码不能为空")
|
||||
private String code;
|
||||
@Schema(description = "state", requiredMode = Schema.RequiredMode.REQUIRED, example = "qtw")
|
||||
@NotEmpty(message = "state 不能为空")
|
||||
private String state;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Schema(description = "RPC 服务 - 社交用户 Response DTO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SocialUserRespDTO {
|
||||
|
||||
@Schema(description = "社交用户 openid", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw")
|
||||
private String openid;
|
||||
|
||||
@Schema(description = "社交用户的昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "ZT源码")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "社交用户的头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.jpg")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "关联的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import com.zt.plat.framework.common.enums.UserTypeEnum;
|
||||
import com.zt.plat.framework.common.validation.InEnum;
|
||||
import com.zt.plat.module.system.enums.social.SocialTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Schema(description = "RPC 服务 - 取消绑定社交用户 Request DTO")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SocialUserUnbindReqDTO {
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@InEnum(UserTypeEnum.class)
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "社交平台的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@InEnum(SocialTypeEnum.class)
|
||||
@NotNull(message = "社交平台的类型不能为空")
|
||||
private Integer socialType;
|
||||
@Schema(description = "社交平台的 openid", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw")
|
||||
@NotEmpty(message = "社交平台的 openid 不能为空")
|
||||
private String openid;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 微信公众号 JSAPI 签名 Response DTO")
|
||||
@Data
|
||||
public class SocialWxJsapiSignatureRespDTO {
|
||||
|
||||
@Schema(description = "微信公众号的 appId", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx123456")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "匿名串", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw")
|
||||
private String nonceStr;
|
||||
|
||||
@Schema(description = "时间戳", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456789")
|
||||
private Long timestamp;
|
||||
|
||||
@Schema(description = "URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "zsw")
|
||||
private String signature;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 微信小程序的手机信息 Response DTO")
|
||||
@Data
|
||||
public class SocialWxPhoneNumberInfoRespDTO {
|
||||
|
||||
@Schema(description = "用户绑定的手机号(国外手机号会有区号)", requiredMode = Schema.RequiredMode.REQUIRED, example = "021-13579246810")
|
||||
private String phoneNumber;
|
||||
|
||||
@Schema(description = "没有区号的手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13579246810")
|
||||
private String purePhoneNumber;
|
||||
@Schema(description = "区号", requiredMode = Schema.RequiredMode.REQUIRED, example = "021")
|
||||
private String countryCode;
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/qr-code/getUnlimitedQRCode.html">获取不限制的小程序码</a>
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 获得获取小程序码 Request DTO")
|
||||
@Data
|
||||
public class SocialWxQrcodeReqDTO {
|
||||
|
||||
/**
|
||||
* 页面路径不能携带参数(参数请放在scene字段里)
|
||||
*/
|
||||
public static final String SCENE = "";
|
||||
/**
|
||||
* 二维码宽度
|
||||
*/
|
||||
public static final Integer WIDTH = 430;
|
||||
/**
|
||||
* 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
|
||||
*/
|
||||
public static final Boolean AUTO_COLOR = true;
|
||||
/**
|
||||
* 检查 page 是否存在
|
||||
*/
|
||||
public static final Boolean CHECK_PATH = true;
|
||||
/**
|
||||
* 是否需要透明底色
|
||||
*
|
||||
* hyaline 为 true 时,生成透明底色的小程序码
|
||||
*/
|
||||
public static final Boolean HYALINE = true;
|
||||
|
||||
@Schema(description = "场景", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
|
||||
@NotEmpty(message = "场景不能为空")
|
||||
private String scene;
|
||||
|
||||
@Schema(description = "页面路径", requiredMode = Schema.RequiredMode.REQUIRED, example = "pages/goods/index")
|
||||
@NotEmpty(message = "页面路径不能为空")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "二维码宽度", example = "430")
|
||||
private Integer width;
|
||||
|
||||
@Schema(description = "是否需要透明底色", example = "true")
|
||||
private Boolean autoColor;
|
||||
|
||||
@Schema(description = "是否检查 page 是否存在", example = "true")
|
||||
private Boolean checkPath;
|
||||
|
||||
@Schema(description = "是否需要透明底色", example = "true")
|
||||
private Boolean hyaline;
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 小程序订单上传购物详情
|
||||
*
|
||||
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/shopping-order/normal-shopping-detail/uploadShoppingInfo.html">上传购物详情</a>
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
public class SocialWxaOrderNotifyConfirmReceiveReqDTO {
|
||||
|
||||
/**
|
||||
* 原支付交易对应的微信订单号
|
||||
*/
|
||||
@NotEmpty(message = "原支付交易对应的微信订单号不能为空")
|
||||
private String transactionId;
|
||||
|
||||
/**
|
||||
* 快递签收时间
|
||||
*/
|
||||
@NotNull(message = "快递签收时间不能为空")
|
||||
private LocalDateTime receivedTime;
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 小程序订单上传购物详情
|
||||
*
|
||||
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/shopping-order/normal-shopping-detail/uploadShoppingInfo.html">上传购物详情</a>
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
public class SocialWxaOrderUploadShippingInfoReqDTO {
|
||||
|
||||
/**
|
||||
* 物流模式 - 实体物流配送采用快递公司进行实体物流配送形式
|
||||
*/
|
||||
public static final Integer LOGISTICS_TYPE_EXPRESS = 1;
|
||||
/**
|
||||
* 物流模式 - 虚拟商品,虚拟商品,例如话费充值,点卡等,无实体配送形式
|
||||
*/
|
||||
public static final Integer LOGISTICS_TYPE_VIRTUAL = 3;
|
||||
/**
|
||||
* 物流模式 - 用户自提
|
||||
*/
|
||||
public static final Integer LOGISTICS_TYPE_PICK_UP = 4;
|
||||
|
||||
/**
|
||||
* 支付者,支付者信息(openid)
|
||||
*/
|
||||
@NotEmpty(message = "支付者,支付者信息(openid)不能为空")
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 原支付交易对应的微信订单号
|
||||
*/
|
||||
@NotEmpty(message = "原支付交易对应的微信订单号不能为空")
|
||||
private String transactionId;
|
||||
|
||||
/**
|
||||
* 物流模式
|
||||
*/
|
||||
@NotNull(message = "物流模式不能为空")
|
||||
private Integer logisticsType;
|
||||
/**
|
||||
* 物流发货单号
|
||||
*/
|
||||
private String logisticsNo;
|
||||
/**
|
||||
* 物流公司编号
|
||||
*
|
||||
* @see <a href="https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list">物流查询插件简介</a>
|
||||
*/
|
||||
private String expressCompany;
|
||||
/**
|
||||
* 商品信息
|
||||
*/
|
||||
@NotEmpty(message = "商品信息不能为空")
|
||||
private String itemDesc;
|
||||
/**
|
||||
* 收件人手机号
|
||||
*/
|
||||
@NotEmpty(message = "收件人手机号")
|
||||
private String receiverContact;
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import com.zt.plat.framework.common.enums.UserTypeEnum;
|
||||
import com.zt.plat.framework.common.validation.InEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 微信小程序订阅消息发送 Request DTO")
|
||||
@Data
|
||||
public class SocialWxaSubscribeMessageSendReqDTO {
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@InEnum(UserTypeEnum.class)
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
|
||||
@Schema(description = "消息模版标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "模版标题")
|
||||
@NotEmpty(message = "消息模版标题不能为空")
|
||||
private String templateTitle;
|
||||
|
||||
@Schema(description = "点击模板卡片后的跳转页面,仅限本小程序内的页面", example = "pages/index?foo=bar")
|
||||
private String page; // 支持带参数,(示例 index?foo=bar )。该字段不填则模板无跳转。
|
||||
|
||||
@Schema(description = "模板内容的参数")
|
||||
private Map<String, String> messages;
|
||||
|
||||
public SocialWxaSubscribeMessageSendReqDTO addMessage(String key, String value) {
|
||||
if (messages == null) {
|
||||
messages = new HashMap<>();
|
||||
}
|
||||
messages.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.zt.plat.module.system.api.social.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 小程序订阅消息模版 Response DTO")
|
||||
@Data
|
||||
public class SocialWxaSubscribeTemplateRespDTO {
|
||||
|
||||
@Schema(description = "模版编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "模版标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "模版标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "模版内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "模版内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "模板内容示例", requiredMode = Schema.RequiredMode.REQUIRED, example = "模版内容示例")
|
||||
private String example;
|
||||
|
||||
@Schema(description = "模版类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private Integer type; // 2:为一次性订阅;3:为长期订阅
|
||||
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
package com.zt.plat.module.system.api.user;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.fhs.core.trans.anno.AutoTrans;
|
||||
import com.fhs.trans.service.AutoTransable;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.collection.CollectionUtils;
|
||||
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.zt.plat.module.system.api.user.dto.AdminUserSaveReqDTO;
|
||||
import com.zt.plat.module.system.api.user.dto.AdminUserUpdatePasswordReqDTO;
|
||||
import com.zt.plat.module.system.api.user.dto.AdminUserUpdateStatusReqDTO;
|
||||
import com.zt.plat.module.system.enums.ApiConstants;
|
||||
import feign.FeignIgnore;
|
||||
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.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.zt.plat.module.system.api.user.AdminUserApi.PREFIX;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO ZT:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 管理员用户")
|
||||
@AutoTrans(namespace = PREFIX, fields = {"nickname"})
|
||||
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)
|
||||
CommonResult<AdminUserRespDTO> getUser(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-subordinate")
|
||||
@Operation(summary = "通过用户 ID 查询用户下属")
|
||||
@Parameter(name = "id", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUserListBySubordinate(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@Operation(summary = "通过用户 ID 查询用户们")
|
||||
@Parameter(name = "ids", description = "部门编号数组", example = "1,2", required = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUserList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-dept-id")
|
||||
@Operation(summary = "获得指定部门的用户数组")
|
||||
@Parameter(name = "deptIds", description = "部门编号数组", example = "1,2", required = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUserListByDeptIds(@RequestParam("deptIds") Collection<Long> deptIds);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-post-id")
|
||||
@Operation(summary = "获得指定岗位的用户数组")
|
||||
@Parameter(name = "postIds", description = "岗位编号数组", example = "2,3", required = true)
|
||||
CommonResult<List<AdminUserRespDTO>> getUserListByPostIds(@RequestParam("postIds") Collection<Long> postIds);
|
||||
|
||||
/**
|
||||
* 获得用户 Map
|
||||
*
|
||||
* @param ids 用户编号数组
|
||||
* @return 用户 Map
|
||||
*/
|
||||
default Map<Long, AdminUserRespDTO> getUserMap(Collection<Long> ids) {
|
||||
List<AdminUserRespDTO> users = getUserList(ids).getCheckedData();
|
||||
return CollectionUtils.convertMap(users, AdminUserRespDTO::getId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户是否有效。如下情况,视为无效:
|
||||
* 1. 用户编号不存在
|
||||
* 2. 用户被禁用
|
||||
*
|
||||
* @param id 用户编号
|
||||
*/
|
||||
default void validateUser(Long id) {
|
||||
validateUserList(Collections.singleton(id));
|
||||
}
|
||||
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
@Operation(summary = "校验用户们是否有效")
|
||||
@Parameter(name = "ids", description = "用户编号数组", example = "3,5", required = true)
|
||||
CommonResult<Boolean> validateUserList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步用户")
|
||||
CommonResult<Boolean> syncUser(@RequestBody AdminUserSaveReqDTO syncReqDTO);
|
||||
|
||||
@Override
|
||||
@FeignIgnore
|
||||
default List<AdminUserRespDTO> selectByIds(List<?> ids) {
|
||||
return getUserList(Convert.toList(Long.class, ids)).getCheckedData();
|
||||
}
|
||||
|
||||
@Override
|
||||
@FeignIgnore
|
||||
default AdminUserRespDTO selectById(Object id) {
|
||||
return getUser(Convert.toLong(id)).getCheckedData();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.zt.plat.module.system.api.user.dto;
|
||||
|
||||
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 = "zt")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "用户昵称", example = "ZT")
|
||||
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 = "zt@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;
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.zt.plat.module.system.api.user.dto;
|
||||
|
||||
import com.zt.plat.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 = "zt")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "手机号码,模糊匹配", example = "zt")
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.zt.plat.module.system.api.user.dto;
|
||||
|
||||
import com.fhs.core.trans.vo.VO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Schema(description = "RPC 服务 - Admin 用户 Response DTO")
|
||||
@Data
|
||||
public class AdminUserRespDTO implements VO {
|
||||
|
||||
@Schema(description = "用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "zhangsan")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "小王")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "工号", example = "A00123")
|
||||
private String workcode;
|
||||
|
||||
@Schema(description = "备注", example = "我是一个用户")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "帐号状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status; // 参见 CommonStatusEnum 枚举
|
||||
|
||||
@Schema(description = "部门编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private List<Long> deptIds;
|
||||
|
||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "1")
|
||||
private Long deptId;
|
||||
|
||||
public Long getDeptId() {
|
||||
if (deptIds != null && !deptIds.isEmpty()) {
|
||||
return deptIds.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Schema(description = "岗位编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 3]")
|
||||
private Set<Long> postIds;
|
||||
|
||||
@Schema(description = "手机号码", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/1.png")
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.zt.plat.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 = "zt")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "用户昵称", example = "ZT")
|
||||
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 = "zt@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;
|
||||
|
||||
@Schema(description = "工号", example = "A00123")
|
||||
private String workcode;
|
||||
|
||||
@Schema(description = "用户来源类型", example = "1")
|
||||
private Integer userSource;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.zt.plat.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 = "ZT")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "部门ID", example = "1")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名称", example = "IT 部")
|
||||
private String deptName;
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.zt.plat.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;
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.zt.plat.module.system.api.userdept;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.system.api.userdept.dto.UserDeptRespDTO;
|
||||
import com.zt.plat.module.system.api.userdept.dto.UserDeptSaveReqDTO;
|
||||
import com.zt.plat.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.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户-部门关系 Feign API
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 用户部门关系")
|
||||
public interface UserDeptApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/user-dept";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@Operation(summary = "新增用户部门关系")
|
||||
CommonResult<Long> createUserDept(@RequestBody UserDeptSaveReqDTO reqVO);
|
||||
|
||||
@PutMapping(PREFIX + "/update")
|
||||
@Operation(summary = "修改用户部门关系")
|
||||
CommonResult<Boolean> updateUserDept(@RequestBody UserDeptSaveReqDTO reqVO);
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete")
|
||||
@Operation(summary = "删除用户部门关系")
|
||||
@Parameter(name = "id", description = "关系编号", example = "1", required = true)
|
||||
CommonResult<Boolean> deleteUserDept(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "通过ID查询用户部门关系")
|
||||
@Parameter(name = "id", description = "关系编号", example = "1", required = true)
|
||||
CommonResult<UserDeptRespDTO> getUserDept(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-user-id")
|
||||
@Operation(summary = "通过用户ID查询用户部门关系列表")
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<List<UserDeptRespDTO>> getUserDeptListByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-dept-id")
|
||||
@Operation(summary = "通过部门ID查询用户部门关系列表")
|
||||
@Parameter(name = "deptId", description = "部门编号", example = "1", required = true)
|
||||
CommonResult<List<UserDeptRespDTO>> getUserDeptListByDeptId(@RequestParam("deptId") Long deptId);
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete-by-user-id")
|
||||
@Operation(summary = "通过用户ID删除用户部门关系")
|
||||
@Parameter(name = "userId", description = "用户编号", example = "1", required = true)
|
||||
CommonResult<Boolean> deleteUserDeptByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
@DeleteMapping(PREFIX + "/delete-by-dept-id")
|
||||
@Operation(summary = "通过部门ID删除用户部门关系")
|
||||
@Parameter(name = "deptId", description = "部门编号", example = "1", required = true)
|
||||
CommonResult<Boolean> deleteUserDeptByDeptId(@RequestParam("deptId") Long deptId);
|
||||
|
||||
// ========== 数据同步专用接口 ==========
|
||||
|
||||
@PostMapping(PREFIX + "/sync")
|
||||
@Operation(summary = "同步用户部门关系")
|
||||
CommonResult<Boolean> syncUserDept(@RequestBody UserDeptSaveReqDTO syncReqDTO);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.zt.plat.module.system.api.userdept.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户部门关系 Response DTO
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Schema(description = "RPC 服务 - 用户部门关系 Response DTO")
|
||||
@Data
|
||||
public class UserDeptRespDTO {
|
||||
|
||||
@Schema(description = "关系编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户编号", example = "1")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "部门编号", example = "100")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "备注", example = "主部门")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user