package com.izouma.nineth.dto.collection;

import com.alibaba.excel.annotation.ExcelProperty;
import com.izouma.nineth.dto.CollectionDTO;
import com.izouma.nineth.enums.AssetStatus;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * excel 导出视图
 */
@Data
@ApiModel("二手藏品")
public class SecondCollectionExcelDTO {

    @ExcelProperty("ID")
    private Long id;

    @ExcelProperty("藏品名称")
    private String name;

    @ExcelProperty("图片")
    private String pic;

    @ExcelProperty("价格")
    private BigDecimal price;


    @ExcelProperty("产品编号")
    private Integer number;


    @ExcelProperty("资产状态")
    private AssetStatus assetStatus;



    @ExcelProperty("资产ID")
    private Long assetId;

    /**
     * 关联的用户
     */
    @ExcelProperty("发布用户ID")
    private Long userId;
    @ExcelProperty("用户手机号")
    private String phone;
    @ExcelProperty("用户昵称")
    private String nickname;


    @ExcelProperty("官方藏品ID")
    private Long officialCollectionId;

    @ExcelProperty("寄售时间")
    private LocalDateTime createdAt;


    /**
     * 构建对象
     * @param collectionDTO
     */
    public SecondCollectionExcelDTO(CollectionDTO collectionDTO){
        BeanUtils.copyProperties(collectionDTO, this);
    }

}
