mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 16:05:08 +08:00
trade: 分销业务review代码修改
This commit is contained in:
@ -1,52 +0,0 @@
|
||||
package cn.iocoder.yudao.module.trade.api.brokerage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils;
|
||||
import cn.iocoder.yudao.module.trade.api.brokerage.dto.BrokerageUserDTO;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
// TODO @疯狂:是不是不需要这个啦?
|
||||
/**
|
||||
* 分销 API 接口
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
public interface BrokerageApi {
|
||||
|
||||
/**
|
||||
* 获得分销用户
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @return 分销用户信息
|
||||
*/
|
||||
BrokerageUserDTO getBrokerageUser(Long userId);
|
||||
|
||||
/**
|
||||
* 【会员】绑定推广员
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param bindUserId 推广员编号
|
||||
* @param registerTime 用户注册时间
|
||||
* @return 是否绑定
|
||||
*/
|
||||
default boolean bindUser(@NotNull Long userId, @NotNull Long bindUserId, @NotNull LocalDateTime registerTime) {
|
||||
// 注册时间在30秒内的,都算新用户
|
||||
// TODO @疯狂:这个要不抽到 service 里哈?
|
||||
boolean isNewUser = LocalDateTimeUtils.afterNow(registerTime.minusSeconds(30));
|
||||
return bindUser(userId, bindUserId, isNewUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定推广员
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param bindUserId 推广员编号
|
||||
* @param isNewUser 是否为新用户
|
||||
* @return 是否绑定
|
||||
*/
|
||||
boolean bindUser(@NotNull(message = "用户编号不能为空") Long userId,
|
||||
@NotNull(message = "推广员编号不能为空") Long bindUserId,
|
||||
@NotNull Boolean isNewUser);
|
||||
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
package cn.iocoder.yudao.module.trade.api.brokerage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 分销用户 DTO
|
||||
*
|
||||
* @author owen
|
||||
*/
|
||||
@Data
|
||||
public class BrokerageUserDTO {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
* <p>
|
||||
* 对应 MemberUserDO 的 id 字段
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 推广员编号
|
||||
* <p>
|
||||
* 关联 MemberUserDO 的 id 字段
|
||||
*/
|
||||
private Long bindUserId;
|
||||
/**
|
||||
* 推广员绑定时间
|
||||
*/
|
||||
private LocalDateTime bindUserTime;
|
||||
|
||||
/**
|
||||
* 推广资格
|
||||
*/
|
||||
private Boolean brokerageEnabled;
|
||||
/**
|
||||
* 成为分销员时间
|
||||
*/
|
||||
private LocalDateTime brokerageTime;
|
||||
|
||||
/**
|
||||
* 可用佣金
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 冻结佣金
|
||||
*/
|
||||
private Integer frozenPrice;
|
||||
|
||||
}
|
Reference in New Issue
Block a user