package com.bohuikeji.delivery.backstage.entity.discount;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.web.block.FileBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;


/**
 * <p>
 * 代金券样式设置
 * </p>
 *
 * @author zhouliwu
 * @since 2021-03-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TDiscountPattern对象", description="代金券样式设置")
@TableName("t_discount_pattern")
public class TDiscountPattern extends EntityBase<TDiscountPattern> {

    private static final long serialVersionUID = 1L;

    /**
     * 样式id
     */
    @ApiModelProperty(value="样式id")
    @TableId(value = "pattern_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false,required = false)
    private Integer patternId;

    /**
     * 样式设置(代金券详情页)
     */
    @ApiModelProperty(value = "模板名称")
    @TableQueryField()
    @TableShowField(value = "模板名称")
    @TableNewField()
    @TableField("pattern_name")
    private String patternName;

    /**
     * 样式设置(代金券详情页)
     */
    @ApiModelProperty(value = "样式类型")
    @TableQueryField()
    @TableShowField(value = "样式类型")
    @TableNewField(options = {"急送","快递","跨城","拉货","会员","弹框"})
    @TableField("pattern_type")
    private String patternType;

    /**
     * 样式设置(代金券详情页)
     */
    @ApiModelProperty(value = "优惠卷模板")
    @TableQueryField(show = false)
    @TableShowField(value = "优惠卷模板",type = ColumnTypeEnum.IMAGE)
    @TableNewField(block = FileBlock.class,required = false)
    @TableField("template_url")
    private String templateUrl;

    /**
     * 发放规则创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableShowField(value = "创建时间")
    @TableNewField()
    @TableField("create_time")
    private LocalDateTime createTime=LocalDateTime.now();

    /**
     * 发放方式
     */
    @ApiModelProperty(value = "领取方式（充值发放、免费赠送、后台方法）")
    @TableQueryField()
    @TableShowField(value = "发放方式")
    @TableNewField(options = {"充值发放","免费赠送","后台发放"},edit = false)
    @TableField("receive_method")
    private String receiveMethod;


    /**
     * 样式设置(代金券详情页)
     */
    @ApiModelProperty(value = "样式状态")
    @TableQueryField(show = false)
    @TableShowField(value = "样式状态")
    @TableNewField(required = false,edit = false,add = false,show = false)
    @TableField("pattern_state")
    private String patternState="正常";

    /**
     * 使用说明
     */
    @ApiModelProperty(value = "使用说明")
    @TableField("description")
    @TableQueryField(show = false)
    @TableShowField(value = "使用说明")
    @TableNewField
    private String description;


}
