package com.izouma.nineth.dto;

import com.izouma.nineth.domain.Collection;
import com.izouma.nineth.domain.CollectionPrivilege;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CollectionInfoDTO extends Collection {
    private Long collectionId;

    @ApiModelProperty("展厅头部背景")
    private String headBg;

    @ApiModelProperty("展厅背景")
    private String showroomBg;

    @ApiModelProperty("最多可放藏品数量")
    private Integer maxCollection;

    @ApiModelProperty("vip特权藏品")
    private boolean vip;

    public CollectionInfoDTO(Collection c, CollectionPrivilege cp) {
        if (ObjectUtils.isNotEmpty(cp)){
            BeanUtils.copyProperties(cp, this);
        }
        BeanUtils.copyProperties(c, this);
    }

}
