v 1.0
1. 新增用户与部门,一对多的关系; 2. 新增管理多部门用户,如果有为公司的多个部门可以进行选择登录(选择后,直到下次变更访问公司前,只能访问此次选择公的业务数据,使用 company_id 控制,后续补充此数据权限的实现); 3. sql 转化工具修复,现在可以正确的对 mysql 进行不同数据库实例的转化了; 4. 所有表格主键,修改为分布式 Id 实现; 5. 补全在初始版本中没有被纳入的其他预制功能模块
This commit is contained in:
47
yudao-module-member/yudao-module-member-api/pom.xml
Normal file
47
yudao-module-member/yudao-module-member-api/pom.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-member</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-member-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
member 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</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>
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.member.api.address;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.member.api.address.dto.MemberAddressRespDTO;
|
||||
import cn.iocoder.yudao.module.member.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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 用户收件地址")
|
||||
public interface MemberAddressApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/address";
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得用户收件地址")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "收件地址编号", required = true, example = "1024"),
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "2048"),
|
||||
})
|
||||
CommonResult<MemberAddressRespDTO> getAddress(@RequestParam("id") Long id,
|
||||
@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping(PREFIX + "/get-default")
|
||||
@Operation(summary = "获得用户默认收件地址")
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "2048")
|
||||
CommonResult<MemberAddressRespDTO> getDefaultAddress(@RequestParam("userId") Long userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.member.api.address.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 用户收件地址 Response DTO")
|
||||
@Data
|
||||
public class MemberAddressRespDTO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "收件人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "地区编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2666")
|
||||
private Integer areaId;
|
||||
|
||||
@Schema(description = "收件详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码 88 小区 106 号")
|
||||
private String detailAddress;
|
||||
|
||||
@Schema(description = "是否默认", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean defaultStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.member.api.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.member.api.config.dto.MemberConfigRespDTO;
|
||||
import cn.iocoder.yudao.module.member.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.GetMapping;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 用户配置")
|
||||
public interface MemberConfigApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/config";
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得用户配置")
|
||||
CommonResult<MemberConfigRespDTO> getConfig();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.member.api.config.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 用户信息 Response DTO")
|
||||
@Data
|
||||
public class MemberConfigRespDTO {
|
||||
|
||||
@Schema(description = "积分抵扣开关", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean pointTradeDeductEnable;
|
||||
|
||||
@Schema(description = "积分抵扣,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer pointTradeDeductUnitPrice; // 1 积分抵扣多少分
|
||||
|
||||
@Schema(description = "积分抵扣最大值", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||
private Integer pointTradeDeductMaxPrice;
|
||||
|
||||
@Schema(description = "1 元赠送多少分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer pointTradeGivePoint;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.member.api.level;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.member.api.level.dto.MemberLevelRespDTO;
|
||||
import cn.iocoder.yudao.module.member.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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 会员等级")
|
||||
public interface MemberLevelApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/level";
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得会员等级")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
CommonResult<MemberLevelRespDTO> getMemberLevel(@RequestParam("id") Long id);
|
||||
|
||||
@PostMapping(PREFIX + "/add")
|
||||
@Operation(summary = "增加会员经验")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "会员编号", required = true, example = "1024"),
|
||||
@Parameter(name = "experience", description = "经验值", required = true, example = "100"),
|
||||
@Parameter(name = "bizType", description = "业务类型", required = true, example = "1"),
|
||||
@Parameter(name = "bizId", description = "业务编号", required = true, example = "1")
|
||||
})
|
||||
CommonResult<Boolean> addExperience(@RequestParam("userId") Long userId,
|
||||
@RequestParam("experience") Integer experience,
|
||||
@RequestParam("bizType") Integer bizType,
|
||||
@RequestParam("bizId") String bizId);
|
||||
|
||||
@PostMapping(PREFIX + "/reduce")
|
||||
@Operation(summary = "扣减会员经验")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "会员编号", required = true, example = "1024"),
|
||||
@Parameter(name = "experience", description = "经验值", required = true, example = "100"),
|
||||
@Parameter(name = "bizType", description = "业务类型", required = true, example = "1"),
|
||||
@Parameter(name = "bizId", description = "业务编号", required = true, example = "1")
|
||||
})
|
||||
CommonResult<Boolean> reduceExperience(@RequestParam("userId") Long userId,
|
||||
@RequestParam("experience") Integer experience,
|
||||
@RequestParam("bizType") Integer bizType,
|
||||
@RequestParam("bizId") String bizId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.member.api.level.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 会员等级 Response DTO")
|
||||
@Data
|
||||
public class MemberLevelRespDTO {
|
||||
|
||||
@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 = "1")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "升级经验", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer experience;
|
||||
|
||||
@Schema(description = "享受折扣", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer discountPercent;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status; // 参见 CommonStatusEnum 枚举
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* 消息队列的消息
|
||||
*/
|
||||
package cn.iocoder.yudao.module.member.api.message;
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.member.api.message.user;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 会员用户创建消息
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@Data
|
||||
public class MemberUserCreateMessage {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* member API 包,定义暴露给其它模块的 API
|
||||
*/
|
||||
package cn.iocoder.yudao.module.member.api;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user