package cn.ysk.cashier.mybatis.entity;

import java.util.Date;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import org.apache.commons.lang3.StringUtils;


/**
 * 店铺扩展信息(TbShopExtend)表实体类
 *
 * @author ww
 * @since 2024-07-18 11:10:16
 */
@SuppressWarnings("serial")
public class TbShopExtend extends Model<TbShopExtend> {
    //自增id
    private Integer id;
    //商户Id
    private Integer shopId;
    //img:图片；text:文本；
    private String name;
    private String type;
    //自定义key
    private String autokey;
    //值
    private String value;
    private String detail;
    //更新时间
    private Date updateTime;
    //创建时间
    private Date createTime;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getShopId() {
        return shopId;
    }

    public void setShopId(Integer shopId) {
        this.shopId = shopId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAutokey() {
        return autokey;
    }

    public void setAutokey(String autokey) {
        this.autokey = autokey;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    /**
     * index_bg：店铺首页背景图
     * my_bg：  我的页面背景图
     * member_bg：会员卡页面背景图
     * shopinfo_bg：商品列表顶部背景图
     * @param autokey
     */
    public void initAutoKey(String autokey,Integer shopId) {
        if (StringUtils.isBlank(name)) {
            switch (autokey) {
                case "index_bg":
                    this.name = "店铺首页背景图";
                    this.detail="建议尺寸: 375*600 ";
                    this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png";
                    break;
                case "my_bg":
                    this.name = "我的页面背景图";
                    this.detail="建议尺寸: 375*200";
                    this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/myTopBack.png";
                    break;
                case "member_bg":
                    this.name = "会员卡页面背景图";
                    this.detail="建议尺寸: 315*152";
                    this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_bg.png";
                    break;
                case "shopinfo_bg":
                    this.name = "商品列表顶部背景图";
                    this.detail="建议尺寸: 375*120";
                    this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png";
                    break;
            }
        }
        this.type="img";
        this.shopId=shopId;
        this.autokey = autokey;
    }
}

