mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 00:15:06 +08:00
code review:会员积分
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.member.enums.point;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 会员积分的业务类型枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum MemberPointBizTypeEnum implements IntArrayValuable {
|
||||
|
||||
SIGN(1, "签到"),
|
||||
ORDER_BUY(10, "订单消费"),
|
||||
ORDER_CANCEL(11, "订单取消"); // 退回积分
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
}
|
@ -16,12 +16,9 @@ public class MemberPointRecordPageReqVO extends PageParam {
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "业务类型", example = "1")
|
||||
private String bizType;
|
||||
private Integer bizType;
|
||||
|
||||
@Schema(description = "积分标题", example = "呵呵")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "积分状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,10 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 用户积分记录 Response VO")
|
||||
@Data
|
||||
public class MemberPointRecordRespVO {
|
||||
@ -26,7 +22,7 @@ public class MemberPointRecordRespVO {
|
||||
private String bizId;
|
||||
|
||||
@Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private String bizType;
|
||||
private Integer bizType;
|
||||
|
||||
@Schema(description = "积分标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
|
||||
private String title;
|
||||
@ -40,17 +36,6 @@ public class MemberPointRecordRespVO {
|
||||
@Schema(description = "变动后的积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||
private Integer totalPoint;
|
||||
|
||||
@Schema(description = "积分状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "冻结时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime freezingTime;
|
||||
|
||||
@Schema(description = "解冻时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime thawingTime;
|
||||
|
||||
@Schema(description = "发生时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.point;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.member.enums.point.MemberPointBizTypeEnum;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户积分记录 DO
|
||||
*
|
||||
@ -42,10 +41,10 @@ public class MemberPointRecordDO extends BaseDO {
|
||||
/**
|
||||
* 业务类型
|
||||
*
|
||||
* 枚举 {@link TODO biz_type 对应枚举,然后改成 int 类型哈}
|
||||
* TODO @qingxia:这个改成 Integer,然后搞个枚举
|
||||
* 枚举 {@link MemberPointBizTypeEnum}
|
||||
*/
|
||||
private String bizType;
|
||||
private Integer bizType;
|
||||
|
||||
/**
|
||||
* 积分标题
|
||||
*/
|
||||
@ -54,29 +53,17 @@ public class MemberPointRecordDO extends BaseDO {
|
||||
* 积分描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 积分 正数表示获得积分 负数表示消耗积分
|
||||
* 变动积分
|
||||
*
|
||||
* 1、正数表示获得积分
|
||||
* 2、负数表示消耗积分
|
||||
*/
|
||||
private Integer point;
|
||||
/**
|
||||
* 变动后的积分
|
||||
*/
|
||||
private Integer totalPoint;
|
||||
/**
|
||||
* 状态:1-订单创建,2-冻结期,3-完成,4-失效(订单退款)
|
||||
*
|
||||
* 枚举 {@link point_status 对应的类}
|
||||
* TODO @qingxia:搞个枚举
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 冻结时间
|
||||
*/
|
||||
private LocalDateTime freezingTime;
|
||||
/**
|
||||
* 解冻时间
|
||||
*/
|
||||
private LocalDateTime thawingTime;
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO
|
||||
.inIfPresent(MemberPointRecordDO::getUserId, userIds)
|
||||
.eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType())
|
||||
.likeIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(MemberPointRecordDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(MemberPointRecordDO::getId));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user