package com.slodon.b2b2c.vo.goods;

import com.slodon.b2b2c.core.util.FileUrlUtil;
import com.slodon.b2b2c.seller.pojo.StoreCertificateList;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 封装店铺荣誉资质表VO
 */
@Data
public class SellerCertificateVo {

    @ApiModelProperty("店铺荣誉资质id")
    private Long id;

    @ApiModelProperty("站点")
    private String webSite;

    @ApiModelProperty("店铺id")
    private Long storeId;

    @ApiModelProperty("荣誉资质名称")
    private String name;

    @ApiModelProperty("荣誉资质图片path")
    private String path;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("创建人")
    private Long createId;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新人")
    private Long updateId;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("资质图片状态：normal正常；delete删除;disabled禁用")
    private String status;

    @ApiModelProperty("荣誉资质图片Url")
    private String url;

    public SellerCertificateVo(StoreCertificateList storeCertificateList){
        this.id = storeCertificateList.getId();
        this.storeId = storeCertificateList.getStoreId();
        this.name = storeCertificateList.getHonorName();
        this.path = storeCertificateList.getHonorPath();
        this.createId = storeCertificateList.getCreateId();
        this.createTime = storeCertificateList.getCreateTime();
        this.sort = storeCertificateList.getSort();
        this.status = storeCertificateList.getStatus();
        this.updateId = storeCertificateList.getUpdateId();
        this.updateTime = storeCertificateList.getUpdateTime();
        this.url = FileUrlUtil.getFileUrl(storeCertificateList.getHonorPath(), null);
    }
}
