package com.bonus.canteen.core.menu.domain;

import com.bonus.canteen.core.common.utils.FileUrlUtil;
import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;

import java.math.BigDecimal;

/**
 * 菜品收藏对象 menu_collection_dishes
 * 
 * @author xsheng
 * @date 2025-04-20
 */


@Data
@ToString
public class MenuCollectionDishes extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键自增 */
    private Long id;

    /** 人员id */
    @Excel(name = "人员id")
    @ApiModelProperty(value = "人员id")
    private Long userId;

    /** 店铺档口id */
    @Excel(name = "店铺档口id")
    @ApiModelProperty(value = "店铺档口id")
    private Long shopstallId;

    /** 菜品id */
    @Excel(name = "菜品id")
    @ApiModelProperty(value = "菜品id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long dishesId;

    @ApiModelProperty(value = "菜品名称")
    private String dishesName;

    @ApiModelProperty(value = "图片地址")
    private String imageUrl;

    /** 乐观锁 */
    @Excel(name = "乐观锁")
    @ApiModelProperty(value = "乐观锁")
    private Long revision;

    /** 删除标识(0:正常 2:删除) */
    private Long delFlag;

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

    @ApiModelProperty(value = "售出数量")
    private Integer saleNum;

    @ApiModelProperty("是否收藏(1-收藏,2-未收藏)")
    private Integer isFavorites;

    public String getImageUrl() {
        return FileUrlUtil.getFileUrl(this.imageUrl);
    }
}
