mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、充值活动serviceimpl单元测试完善;2、充值活动id改为自增、无用字段移除;
This commit is contained in:
-2
@@ -61,6 +61,4 @@ public class GiftMoneyDetailsDO extends BaseDO {
|
|||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
private Boolean deleted;
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-25
@@ -1,8 +1,6 @@
|
|||||||
package com.cf.imes.module.system.service.funds.recharge;
|
package com.cf.imes.module.system.service.funds.recharge;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import com.cf.imes.framework.common.pojo.PageParam;
|
|
||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||||
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||||
@@ -12,7 +10,6 @@ import com.cf.imes.module.system.controller.admin.funds.recharge.vo.RechargePage
|
|||||||
import com.cf.imes.module.system.controller.admin.funds.recharge.vo.RechargeSaveReqVO;
|
import com.cf.imes.module.system.controller.admin.funds.recharge.vo.RechargeSaveReqVO;
|
||||||
import com.cf.imes.module.system.dal.dataobject.funds.recharge.GiftMoneyDetailsDO;
|
import com.cf.imes.module.system.dal.dataobject.funds.recharge.GiftMoneyDetailsDO;
|
||||||
import com.cf.imes.module.system.dal.mysql.funds.recharge.GiftMoneyDetailsMapper;
|
import com.cf.imes.module.system.dal.mysql.funds.recharge.GiftMoneyDetailsMapper;
|
||||||
import com.cf.imes.module.system.framework.snowflake.config.MybatisIdProperties;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@@ -34,26 +31,20 @@ import static com.cf.imes.module.system.enums.ErrorCodeConstants.RECHARGE_ACTIVE
|
|||||||
@Validated
|
@Validated
|
||||||
public class RechargeActiveServiceImpl implements RechargeActiveService{
|
public class RechargeActiveServiceImpl implements RechargeActiveService{
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MybatisIdProperties mybatisIdProperties;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private GiftMoneyDetailsMapper giftMoneyDetailsMapper;
|
private GiftMoneyDetailsMapper giftMoneyDetailsMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long create(RechargeSaveReqVO createReqVO) {
|
public Long create(RechargeSaveReqVO createReqVO) {
|
||||||
|
|
||||||
long id = IdUtil.getSnowflake(mybatisIdProperties.getWorkerId(), mybatisIdProperties.getDatacenterId()).nextId();
|
|
||||||
|
|
||||||
GiftMoneyDetailsDO giftMoneyDetailsDO = giftMoneyDetailsMapper.selectOne(new LambdaQueryWrapperX<GiftMoneyDetailsDO>()
|
GiftMoneyDetailsDO giftMoneyDetailsDO = giftMoneyDetailsMapper.selectOne(new LambdaQueryWrapperX<GiftMoneyDetailsDO>()
|
||||||
.eq(GiftMoneyDetailsDO::getDeleted, false)
|
.eq(GiftMoneyDetailsDO::getDeleted, false)
|
||||||
.eq(GiftMoneyDetailsDO::getActivityName,createReqVO.getActivityName()));
|
.eq(GiftMoneyDetailsDO::getActivityName,createReqVO.getActivityName()));
|
||||||
|
|
||||||
AssertUtils.empty(giftMoneyDetailsDO,RECHARGE_ACTIVE_NAME_IS_EXIST);
|
AssertUtils.empty(giftMoneyDetailsDO,RECHARGE_ACTIVE_NAME_IS_EXIST);
|
||||||
|
|
||||||
GiftMoneyDetailsDO giftMoneyDetailsDOn = BeanUtils.toBean(createReqVO, GiftMoneyDetailsDO.class).setId(id);
|
GiftMoneyDetailsDO giftMoneyDetailsDOn = BeanUtils.toBean(createReqVO, GiftMoneyDetailsDO.class);
|
||||||
giftMoneyDetailsMapper.insert(giftMoneyDetailsDOn);
|
giftMoneyDetailsMapper.insert(giftMoneyDetailsDOn);
|
||||||
return id;
|
return giftMoneyDetailsDOn.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -101,19 +92,13 @@ public class RechargeActiveServiceImpl implements RechargeActiveService{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GiftMoneyDetailsDO> getAvailableRechargeActiveList() {
|
public List<GiftMoneyDetailsDO> getAvailableRechargeActiveList() {
|
||||||
RechargePageReqVO rechargePageReqVO = new RechargePageReqVO();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
// 查询全部
|
// 筛选掉投放时间还没到和过期的
|
||||||
rechargePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
return giftMoneyDetailsMapper.selectList(new LambdaQueryWrapper<GiftMoneyDetailsDO>()
|
||||||
// 查询条件
|
.eq(GiftMoneyDetailsDO::getDeleted, false)
|
||||||
rechargePageReqVO.setDeleted(false);
|
.le(GiftMoneyDetailsDO::getStartTime, now)
|
||||||
PageResult<GiftMoneyDetailsDO> giftMoneyDetailsDOPageResult = giftMoneyDetailsMapper.selectPage(rechargePageReqVO);
|
.ge(GiftMoneyDetailsDO::getEndTime, now)
|
||||||
List<GiftMoneyDetailsDO> resultList = giftMoneyDetailsDOPageResult.getList();
|
);
|
||||||
if (CollUtil.isNotEmpty(resultList)) {
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
// 筛选掉投放时间还没到和过期的
|
|
||||||
resultList = resultList.stream().filter(item -> item.getStartTime().isBefore(now) && item.getEndTime().isAfter(now)).toList();
|
|
||||||
}
|
|
||||||
return resultList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 校验是否存在
|
// 校验是否存在
|
||||||
|
|||||||
+252
@@ -0,0 +1,252 @@
|
|||||||
|
package com.cf.imes.module.system.service.funds.recharge;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
|
import com.cf.imes.framework.test.core.ut.BaseDbAndRedisUnitTest;
|
||||||
|
import com.cf.imes.module.system.controller.admin.funds.recharge.vo.RechargePageReqVO;
|
||||||
|
import com.cf.imes.module.system.controller.admin.funds.recharge.vo.RechargeSaveReqVO;
|
||||||
|
import com.cf.imes.module.system.dal.dataobject.funds.recharge.GiftMoneyDetailsDO;
|
||||||
|
import com.cf.imes.module.system.dal.mysql.funds.recharge.GiftMoneyDetailsMapper;
|
||||||
|
import com.cf.imes.module.system.enums.recharge.RechargeGiftTypeEnum;
|
||||||
|
import com.cf.imes.module.system.enums.recharge.RechargeTypeEnum;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.junit.jupiter.api.MethodOrderer;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.cf.imes.framework.common.util.object.ObjectUtils.cloneIgnoreId;
|
||||||
|
import static com.cf.imes.framework.test.core.util.AssertUtils.assertPojoEquals;
|
||||||
|
import static com.cf.imes.framework.test.core.util.AssertUtils.assertServiceException;
|
||||||
|
import static com.cf.imes.framework.test.core.util.RandomUtils.randomPojo;
|
||||||
|
import static com.cf.imes.module.system.enums.ErrorCodeConstants.RECHARGE_ACTIVE_NAME_IS_EXIST;
|
||||||
|
import static com.cf.imes.module.system.enums.ErrorCodeConstants.RECHARGE_ACTIVE_NO_EXIST;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Gqr
|
||||||
|
* @since 2025/10/24 11:20
|
||||||
|
*/
|
||||||
|
@Import(RechargeActiveServiceImpl.class)
|
||||||
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||||
|
class RechargeActiveServiceImplTest extends BaseDbAndRedisUnitTest {
|
||||||
|
@Resource
|
||||||
|
private RechargeActiveService rechargeActiveService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private GiftMoneyDetailsMapper giftMoneyDetailsMapper;
|
||||||
|
|
||||||
|
private static GiftMoneyDetailsDO createDO;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(1)
|
||||||
|
void testCreate() {
|
||||||
|
RechargeSaveReqVO reqVO = randomPojo(RechargeSaveReqVO.class, o -> {
|
||||||
|
o.setId(null);
|
||||||
|
o.setActivityName("充值送活动");
|
||||||
|
o.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
o.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
o.setRechargeAmount(BigDecimal.valueOf(100));
|
||||||
|
o.setGiftAmount(BigDecimal.valueOf(20));
|
||||||
|
});
|
||||||
|
|
||||||
|
Long id = rechargeActiveService.create(reqVO);
|
||||||
|
|
||||||
|
// 校验数据库插入结果
|
||||||
|
createDO = giftMoneyDetailsMapper.selectById(id);
|
||||||
|
assertNotNull(createDO);
|
||||||
|
assertEquals("充值送活动", createDO.getActivityName());
|
||||||
|
assertEquals(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus(), createDO.getRechargeType());
|
||||||
|
assertEquals(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus(), createDO.getRechargeGiftType());
|
||||||
|
assertEquals(new BigDecimal("100.000"), createDO.getRechargeAmount());
|
||||||
|
assertEquals(new BigDecimal("20.000"), createDO.getGiftAmount());
|
||||||
|
|
||||||
|
// 再次插入相同活动名称,断言异常
|
||||||
|
assertServiceException(() -> rechargeActiveService.create(reqVO),
|
||||||
|
RECHARGE_ACTIVE_NAME_IS_EXIST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(2)
|
||||||
|
void testUpdate_not_exist() {
|
||||||
|
RechargeSaveReqVO reqVO = new RechargeSaveReqVO();
|
||||||
|
reqVO.setId(321L);
|
||||||
|
|
||||||
|
assertServiceException(() -> rechargeActiveService.update(reqVO),
|
||||||
|
RECHARGE_ACTIVE_NO_EXIST);
|
||||||
|
|
||||||
|
reqVO.setId(null);
|
||||||
|
|
||||||
|
assertServiceException(() -> rechargeActiveService.update(reqVO),
|
||||||
|
RECHARGE_ACTIVE_NO_EXIST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(2)
|
||||||
|
void testUpdate() {
|
||||||
|
|
||||||
|
// 插入
|
||||||
|
createDO.setId(null);
|
||||||
|
createDO.setActivityName("充值送活动新");
|
||||||
|
createDO.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
createDO.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
createDO.setRechargeAmount(BigDecimal.valueOf(100));
|
||||||
|
createDO.setGiftAmount(BigDecimal.valueOf(20));
|
||||||
|
giftMoneyDetailsMapper.insert(createDO);
|
||||||
|
|
||||||
|
RechargeSaveReqVO reqVO = new RechargeSaveReqVO();
|
||||||
|
reqVO.setId(createDO.getId());
|
||||||
|
reqVO.setActivityName("充值送活动");
|
||||||
|
assertServiceException(() -> rechargeActiveService.update(reqVO),
|
||||||
|
RECHARGE_ACTIVE_NAME_IS_EXIST);
|
||||||
|
|
||||||
|
// 更新成功
|
||||||
|
RechargeSaveReqVO update = BeanUtil.copyProperties(createDO, RechargeSaveReqVO.class);
|
||||||
|
assertDoesNotThrow(() -> rechargeActiveService.update(update));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(3)
|
||||||
|
void testGet_not_exist() {
|
||||||
|
assertServiceException(() -> rechargeActiveService.get(null), RECHARGE_ACTIVE_NO_EXIST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(4)
|
||||||
|
void testGet() {
|
||||||
|
assertNotNull(rechargeActiveService.getDefaultNull(createDO.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(5)
|
||||||
|
void testGetPage_success() {
|
||||||
|
GiftMoneyDetailsDO detail = randomPojo(GiftMoneyDetailsDO.class, o -> {
|
||||||
|
o.setId(null);
|
||||||
|
o.setActivityName("晨丰分页活动");
|
||||||
|
o.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
o.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
o.setRechargeAmount(BigDecimal.valueOf(100).setScale(3));
|
||||||
|
o.setGiftAmount(BigDecimal.valueOf(20).setScale(3));
|
||||||
|
});
|
||||||
|
|
||||||
|
giftMoneyDetailsMapper.insert(detail);
|
||||||
|
|
||||||
|
// 不匹配 ActivityName
|
||||||
|
giftMoneyDetailsMapper.insert(cloneIgnoreId(detail, o -> o.setActivityName("新分页活动")));
|
||||||
|
|
||||||
|
// 不匹配 RechargeGiftType
|
||||||
|
giftMoneyDetailsMapper.insert(cloneIgnoreId(detail, o -> o.setRechargeGiftType(RechargeGiftTypeEnum.FULL_X_GIVE_X.getStatus())));
|
||||||
|
|
||||||
|
// 不匹配 GiftAmount
|
||||||
|
giftMoneyDetailsMapper.insert(cloneIgnoreId(detail, o -> o.setGiftAmount(BigDecimal.valueOf(99))));
|
||||||
|
|
||||||
|
// 不匹配 RechargeAmount
|
||||||
|
giftMoneyDetailsMapper.insert(cloneIgnoreId(detail, o -> o.setRechargeAmount(BigDecimal.valueOf(99))));
|
||||||
|
|
||||||
|
// 被逻辑删除
|
||||||
|
giftMoneyDetailsMapper.insert(cloneIgnoreId(detail, o -> o.setDeleted(true)));
|
||||||
|
|
||||||
|
// ============ 构造查询参数 ============
|
||||||
|
RechargePageReqVO reqVO = new RechargePageReqVO();
|
||||||
|
reqVO.setActivityName("晨丰");
|
||||||
|
reqVO.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
reqVO.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
reqVO.setRechargeAmount(BigDecimal.valueOf(100));
|
||||||
|
reqVO.setGiftAmount(BigDecimal.valueOf(20));
|
||||||
|
reqVO.setPageNo(1);
|
||||||
|
reqVO.setPageSize(10);
|
||||||
|
|
||||||
|
// ============ 调用方法 ============
|
||||||
|
PageResult<GiftMoneyDetailsDO> pageResult = rechargeActiveService.getPage(reqVO);
|
||||||
|
|
||||||
|
// ============ 断言结果 ============
|
||||||
|
assertEquals(1, pageResult.getTotal(), "分页结果数量应为1");
|
||||||
|
assertEquals(1, pageResult.getList().size(), "分页列表长度应为1");
|
||||||
|
assertPojoEquals(detail, pageResult.getList().get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(6)
|
||||||
|
void testDelete() {
|
||||||
|
assertDoesNotThrow(() -> rechargeActiveService.delete(createDO.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(7)
|
||||||
|
void testDelete_not_exist() {
|
||||||
|
assertServiceException(() -> rechargeActiveService.delete(null), RECHARGE_ACTIVE_NO_EXIST);
|
||||||
|
assertServiceException(() -> rechargeActiveService.delete(321L), RECHARGE_ACTIVE_NO_EXIST);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Order(8)
|
||||||
|
void testGetAvailableRechargeActiveList() {
|
||||||
|
// 当前时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
|
// 1️⃣ 有效活动(时间区间内)
|
||||||
|
GiftMoneyDetailsDO valid = new GiftMoneyDetailsDO();
|
||||||
|
valid.setActivityName("有效活动");
|
||||||
|
valid.setRechargeAmount(new java.math.BigDecimal("100.000"));
|
||||||
|
valid.setGiftAmount(new java.math.BigDecimal("10.000"));
|
||||||
|
valid.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
valid.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
valid.setStartTime(now.minusDays(1));
|
||||||
|
valid.setEndTime(now.plusDays(1));
|
||||||
|
valid.setDeleted(false);
|
||||||
|
giftMoneyDetailsMapper.insert(valid);
|
||||||
|
|
||||||
|
// 2️⃣ 未开始活动
|
||||||
|
GiftMoneyDetailsDO notStarted = new GiftMoneyDetailsDO();
|
||||||
|
notStarted.setActivityName("未开始活动");
|
||||||
|
notStarted.setRechargeAmount(new java.math.BigDecimal("100.000"));
|
||||||
|
notStarted.setGiftAmount(new java.math.BigDecimal("10.000"));
|
||||||
|
notStarted.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
notStarted.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
notStarted.setStartTime(now.plusDays(1));
|
||||||
|
notStarted.setEndTime(now.plusDays(2));
|
||||||
|
notStarted.setDeleted(false);
|
||||||
|
giftMoneyDetailsMapper.insert(notStarted);
|
||||||
|
|
||||||
|
// 3️⃣ 已过期活动
|
||||||
|
GiftMoneyDetailsDO expired = new GiftMoneyDetailsDO();
|
||||||
|
expired.setActivityName("已过期活动");
|
||||||
|
expired.setRechargeAmount(new java.math.BigDecimal("100.000"));
|
||||||
|
expired.setGiftAmount(new java.math.BigDecimal("10.000"));
|
||||||
|
expired.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
expired.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
expired.setStartTime(now.minusDays(5));
|
||||||
|
expired.setEndTime(now.minusDays(1));
|
||||||
|
expired.setDeleted(false);
|
||||||
|
giftMoneyDetailsMapper.insert(expired);
|
||||||
|
|
||||||
|
// 4️⃣ 被逻辑删除的活动
|
||||||
|
GiftMoneyDetailsDO deleted = new GiftMoneyDetailsDO();
|
||||||
|
deleted.setActivityName("被删除活动");
|
||||||
|
deleted.setRechargeAmount(new java.math.BigDecimal("100.000"));
|
||||||
|
deleted.setGiftAmount(new java.math.BigDecimal("10.000"));
|
||||||
|
deleted.setRechargeGiftType(RechargeGiftTypeEnum.EVERY_X_GIVE_X.getStatus());
|
||||||
|
deleted.setRechargeType(RechargeTypeEnum.WECHAT_AND_ALIPAY.getStatus());
|
||||||
|
deleted.setStartTime(now.minusDays(1));
|
||||||
|
deleted.setEndTime(now.plusDays(1));
|
||||||
|
deleted.setDeleted(true);
|
||||||
|
giftMoneyDetailsMapper.insert(deleted);
|
||||||
|
|
||||||
|
// 执行被测方法
|
||||||
|
List<GiftMoneyDetailsDO> result = rechargeActiveService.getAvailableRechargeActiveList();
|
||||||
|
|
||||||
|
// 验证结果
|
||||||
|
assertEquals(1, result.size(), "只应返回一个有效活动");
|
||||||
|
assertEquals("有效活动", result.get(0).getActivityName());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -713,3 +713,21 @@ CREATE TABLE IF NOT EXISTS "products_details" (
|
|||||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||||
PRIMARY KEY ("id")
|
PRIMARY KEY ("id")
|
||||||
) COMMENT '产品购买信息表 products_details';
|
) COMMENT '产品购买信息表 products_details';
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS "gift_money_details" (
|
||||||
|
"id" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY COMMENT '主键,自增ID',
|
||||||
|
"activity_name" VARCHAR(32) NOT NULL COMMENT '活动名称',
|
||||||
|
"recharge_gift_type" TINYINT NOT NULL COMMENT '赠送类型:0满X送X;1每满X送X',
|
||||||
|
"recharge_type" TINYINT NOT NULL COMMENT '充值类型:0微信、支付宝;1微信;2支付宝',
|
||||||
|
"recharge_amount" DECIMAL(10, 3) NOT NULL COMMENT '充值金额',
|
||||||
|
"gift_amount" DECIMAL(10, 3) NOT NULL COMMENT '赠送金额',
|
||||||
|
"start_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
|
||||||
|
"end_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '结束时间',
|
||||||
|
"remark" VARCHAR(1024) DEFAULT NULL COMMENT '备注',
|
||||||
|
"creator" VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
"create_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
"updater" VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
"update_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
"deleted" BIT NOT NULL DEFAULT FALSE COMMENT '是否删除:0否 1是',
|
||||||
|
PRIMARY KEY ("id")
|
||||||
|
) COMMENT '赠送金规则明细表(base表)';
|
||||||
|
|||||||
Reference in New Issue
Block a user