package com.izouma.nineth.domain;

import com.izouma.nineth.converter.BuildingPosListConverter;
import com.izouma.nineth.dto.BuildingDTO;
import com.izouma.nineth.dto.BuildingPosDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Transient;
import java.util.List;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("空间物品信息")
public class SpaceObjectsInfo extends BaseEntity{

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("空间id")
    private Long spaceId;

    @Column(columnDefinition = "TEXT")
    @Convert(converter = BuildingPosListConverter.class)
    @ApiModelProperty("空间中已编辑物品信息")
    private List<BuildingPosDTO> buildingPosList;

    @ApiModelProperty("空间中剩余物品信息统计")
    @Transient
    private List<BuildingDTO> buildingList;

    @ApiModelProperty("是否个人空间")
    @Transient
    private boolean personal;
}
