package com.iformall.domain.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.Date;
import java.util.List;

@TableName(value = "wx_topic")
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxTopic extends BaseEntity {


    protected Long id;
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	@io.swagger.annotations.ApiModelProperty(value="名称",name="name")
	private String name;
	@io.swagger.annotations.ApiModelProperty(value="标题",name="title")
	private String title;
	@io.swagger.annotations.ApiModelProperty(value="内容",name="content")
	private String content;
	@io.swagger.annotations.ApiModelProperty(value="封面",name="cover")
	private String cover;
    @io.swagger.annotations.ApiModelProperty(value="多封面",name="coverPicture")
    private String coverPicture;
    @io.swagger.annotations.ApiModelProperty(value="详情多图",name="detailPicture")
    private String detailPicture;
	@io.swagger.annotations.ApiModelProperty(value="广告图",name="advert")
	private String advert;
	@io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime")
	private Date beginTime;
	@io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime")
	private Date endTime;
	@io.swagger.annotations.ApiModelProperty(value="状态1生效2失效3作废",name="status")
	private Integer status;
	@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime")
	private Date createtime;
	@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime")
	private Date updatetime;
	@io.swagger.annotations.ApiModelProperty(value="背景颜色",name="bgColor")
	private String bgColor;

	@TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="优惠券ids",name="couponIds")
	private String couponIds;

	@TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="商品列表",name="couponList")
	private List<WxCoupon> couponList;

	@TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="状态，一个或者多个",name="statusStr")
	private String statusStr;
	@TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="状态，一个或者多个",name="statusList")
	protected List<Integer> statusList;
	//
	@TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="查询下架状态",name="queryDownLineStatus")
	private boolean queryDownLineStatus;

	@TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="上架标志 1正在上架",name="isOnline")
	private Integer isOnline;
	@TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="couponChannelId渠道ID",name="couponChannelId")
	private Long couponChannelId;

    @TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="小程序路径",name="weappPath")
    private String weappPath;

    @TableField(exist = false)
    @io.swagger.annotations.ApiModelProperty(value="小程序二维码Scene",name="weappScene")
    private String weappScene;


    public String getWeappPath() {
        if(id == null)
            return "pages/index/index";
	    return "pages/index/index?type=td&id="+id;
    }

    public String getWeappScene() {
	    if(id == null)
	        return "";
        return "t:td:" + id;
    }
}
