package com.bonus.canteen.core.device.manage.vo;

import cn.hutool.core.bean.BeanUtil;
import com.bonus.canteen.core.common.utils.SysUtil;
import com.bonus.canteen.core.device.manage.model.DeviceDishes;
import com.bonus.canteen.core.menu.entity.MenuDishes;
import io.swagger.annotations.ApiModelProperty;

public class DeviceDishesVO {
   @ApiModelProperty("id主键")
   private Long id;
   @ApiModelProperty("设备id")
   private Long deviceId;
   @ApiModelProperty("菜品id")
   private Long dishesId;
   @ApiModelProperty("菜品名称")
   private String dishesName;
   @ApiModelProperty("菜品名称")
   private String dishesImageUrl;

   public static DeviceDishesVO of(DeviceDishes deviceDishes, MenuDishes menuDishes) {
      DeviceDishesVO vo = new DeviceDishesVO();
      BeanUtil.copyProperties(deviceDishes, vo, new String[0]);
      vo.setDishesName(menuDishes != null ? menuDishes.getDishesName() : "");
      vo.setDishesImageUrl(menuDishes != null ? menuDishes.getImageUrl() : "");
      return vo;
   }

   public String getDishesImageUrl() {
      return SysUtil.getCutFileUrl(this.dishesImageUrl);
   }

   public Long getId() {
      return this.id;
   }

   public Long getDeviceId() {
      return this.deviceId;
   }

   public Long getDishesId() {
      return this.dishesId;
   }

   public String getDishesName() {
      return this.dishesName;
   }

   public void setId(final Long id) {
      this.id = id;
   }

   public void setDeviceId(final Long deviceId) {
      this.deviceId = deviceId;
   }

   public void setDishesId(final Long dishesId) {
      this.dishesId = dishesId;
   }

   public void setDishesName(final String dishesName) {
      this.dishesName = dishesName;
   }

   public void setDishesImageUrl(final String dishesImageUrl) {
      this.dishesImageUrl = dishesImageUrl;
   }
}
