package com.izouma.dingdong.domain.backstage;

import com.izouma.dingdong.domain.BaseEntity;
import com.izouma.dingdong.enums.BannerType;
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.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.time.LocalDateTime;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Where(clause = "enabled = 1")
public class Banner extends BaseEntity {
    @ApiModelProperty(value = "图片", name = "pic")
    private String pic;

    @ApiModelProperty(value = "描述", name = "remark")
    private String remark;

    @ApiModelProperty(value = "地址", name = "url")
    private String url;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "类型", name = "type")
    private BannerType type;

    @ApiModelProperty(value = "推广开始时间", name = "startDateTime")
    private LocalDateTime startDateTime;

    @ApiModelProperty(value = "推广结束时间", name = "startEndTime")
    private LocalDateTime endDateTime;

    @ApiModelProperty(value = "分类下的banner", name = "categoryId")
    private Long categoryId;

    @Column(nullable = false)
    private Boolean enabled = true;

//    private String address;

/*    @ApiModelProperty(value = "经度", name = "longitude")
    private BigDecimal longitude;

    @ApiModelProperty(value = "纬度", name = "latitude")
    private BigDecimal latitude;*/

    @ApiModelProperty(value = "商家Id", name = "merchantId")
    private Long merchantId;


}
