package com.izouma.jiashanxia.domain;

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.*;
import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Where(clause = "del = 0")
public class GoodsInfo {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String name;

    @ApiModelProperty(value = "价格", name = "price")
    private BigDecimal price;

    @ApiModelProperty(value = "单位", name = "unit")
    private String unit;

//    @ApiModelProperty(value = "是否下架", name = "isOffShelf")
//    private Boolean isOffShelf;

    @Builder.Default
    @Column(nullable = false)
    private Boolean del = false;

    private String img;
}
