package com.izouma.nineth.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(indexes = {
        @Index(columnList = "userId"),
        @Index(columnList = "assetId"),
        @Index(columnList = "likes"),
        @Index(columnList = "share")
})
@Where(clause = "del = 0")
@ApiModel("展厅")
public class Showroom extends BaseEntity {
    private Long userId;

    private String nickname;

    private Long assetId;

    @ApiModelProperty("头像")
    private String pic;

    private String introduction;

    private int likes;

    private int share;

    private boolean publish;

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

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

    @Transient
    private List<ShowCollection> collections;

    @Transient
    private boolean liked;
}
