release- 新增是否内测用户字段,以及抽奖新增内测用户可参与抽奖类别

release-2024-04-25
huangyw 3 days ago
parent 66fc3d4184
commit 3fa10a10f3

@ -53,6 +53,7 @@ public class ErrorConstants {
public static final String NOT_PERMANENT_MEMBER = "非永久会员不能参与"; public static final String NOT_PERMANENT_MEMBER = "非永久会员不能参与";
public static final String NOT_CONTRIBUTOR = "非贡献者不能参与"; public static final String NOT_CONTRIBUTOR = "非贡献者不能参与";
public static final String NOT_ARTIST = "非音乐人不能参与"; public static final String NOT_ARTIST = "非音乐人不能参与";
public static final String NOT_INTERNAL_TEST = "非内测用户不能参与";
public static final String ALREADY_PARTICIPATED = "已参与抽奖"; public static final String ALREADY_PARTICIPATED = "已参与抽奖";
public static final String NOT_END_OF_SIGN_UP = "报名未结束,不允许抽奖"; public static final String NOT_END_OF_SIGN_UP = "报名未结束,不允许抽奖";
public static final String TICKET_CITY_IS_REQUIRED = "门票抽奖城市必填"; public static final String TICKET_CITY_IS_REQUIRED = "门票抽奖城市必填";

@ -23,6 +23,7 @@ public enum PointEnums {
LOTTERY_LIFE_MEMBER(3, "永久会员"), LOTTERY_LIFE_MEMBER(3, "永久会员"),
LOTTERY_CONTRIBUTORS(4, "贡献者"), LOTTERY_CONTRIBUTORS(4, "贡献者"),
LOTTERY_ARTIST(5, "音乐人"), LOTTERY_ARTIST(5, "音乐人"),
LOTTERY_INTERNAL_TEST(6, "内测用户"),
LOTTERY_STATUS_EDITING(0, "编辑中"), LOTTERY_STATUS_EDITING(0, "编辑中"),
LOTTERY_STATUS_SIGN(1, "报名中"), LOTTERY_STATUS_SIGN(1, "报名中"),

@ -0,0 +1,19 @@
package enums;
import lombok.Getter;
@Getter
public enum UserBetaEnum {
// 内测
INTERNAL_TEST(1, "内测用户"),
// 非内测
NOT_INTERNAL_TEST(0, "非内测用户");;
private Integer code;
private String desc;
UserBetaEnum(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
}

@ -65,7 +65,7 @@ public class Lottery implements Serializable {
private Integer num; private Integer num;
@Column(name = "participant") @Column(name = "participant")
@ApiModelProperty(value = "可参加人员 1-全部 2-全部会员 3-永久会员 4-贡献者") @ApiModelProperty(value = "可参加人员 1-全部 2-全部会员 3-永久会员 4-贡献者 5-音乐人 6-内测用户")
private Integer participant; private Integer participant;
@Column(name = "point") @Column(name = "point")

@ -232,5 +232,10 @@ public class UserInfo implements Serializable {
*/ */
private String invitationUserId; private String invitationUserId;
/**
* 10
*/
private Integer isBetaUser;
} }

@ -25,6 +25,7 @@ import constants.ErrorConstants;
import constants.TaskPointIdConstants; import constants.TaskPointIdConstants;
import dto.UserLoginDto; import dto.UserLoginDto;
import enums.PointEnums; import enums.PointEnums;
import enums.UserBetaEnum;
import enums.UserTypeEnum; import enums.UserTypeEnum;
import enums.UserVipStatusEnum; import enums.UserVipStatusEnum;
import exception.BizException; import exception.BizException;
@ -435,6 +436,11 @@ public class LotteryService {
) { ) {
throw new BizException(ErrorConstants.NOT_ARTIST); throw new BizException(ErrorConstants.NOT_ARTIST);
} }
} else if (Objects.equals(participant, PointEnums.LOTTERY_INTERNAL_TEST.getCode())) {
if (!Objects.equals(userInfo.getIsBetaUser(), UserBetaEnum.INTERNAL_TEST.getCode())) {
throw new BizException(ErrorConstants.NOT_INTERNAL_TEST);
}
} }
Integer point = lottery.getPoint(); Integer point = lottery.getPoint();

@ -6,7 +6,7 @@ create table tb_lottery
type tinyint null comment '抽奖类型 1-门票抽奖 2-实物抽奖', type tinyint null comment '抽奖类型 1-门票抽奖 2-实物抽奖',
num int null comment '奖品总数量', num int null comment '奖品总数量',
title varchar(255) null comment '抽奖标题', title varchar(255) null comment '抽奖标题',
participant int null comment '可参加人员 1-全部 2-全部会员 3-永久会员 4-贡献者 5-音乐人', participant int null comment '可参加人员 1-全部 2-全部会员 3-永久会员 4-贡献者 5-音乐人 6-内测用户',
point int null comment '消耗积分', point int null comment '消耗积分',
region_code varchar(255) null comment '抽奖城市code', region_code varchar(255) null comment '抽奖城市code',
region_name varchar(255) null comment '抽奖城市名称', region_name varchar(255) null comment '抽奖城市名称',

@ -0,0 +1,4 @@
ALTER TABLE tb_user_info
ADD COLUMN is_beta_user TINYINT DEFAULT 0 NOT NULL COMMENT '是否内测用户1表示是0表示不是';
UPDATE tb_user_info SET is_beta_user = IF(join_time < '2024-04-11', 1, 0);
Loading…
Cancel
Save