package com.bonus.canteen.core.allocation.canteen.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bonus.canteen.core.common.utils.SysUtil;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDateTime;

@TableName("alloc_meal_line")
@ApiModel("餐线信息表")
public class AllocMealLine {
   @TableId
   @ApiModelProperty("餐线id")
   private Long mealLineId;
   @ApiModelProperty("餐线编号")
   private String mealLineNum;
   @ApiModelProperty("餐线名称")
   private String mealLineName;
   @ApiModelProperty("档口id")
   private Long stallId;
   @ApiModelProperty("食堂id")
   private Long canteenId;
   @ApiModelProperty("区域id")
   private Long areaId;
   @ApiModelProperty("餐线类型")
   private Integer mealLineType;
   @ApiModelProperty("人员id")
   private Long custId;
   @ApiModelProperty("联系电话")
   private String contactTel;
   @ApiModelProperty("餐线图片链接")
   private String imgUrl;
   @ApiModelProperty("是否删除")
   private Integer ifDel;
   @ApiModelProperty("创建人")
   private String crby;
   @ApiModelProperty("创建时间")
   @JsonDeserialize(
      using = LocalDateTimeDeserializer.class
   )
   @JsonSerialize(
      using = LocalDateTimeSerializer.class
   )
   private LocalDateTime crtime;
   @ApiModelProperty("更新人")
   private String upby;
   @ApiModelProperty("更新时间")
   @JsonDeserialize(
      using = LocalDateTimeDeserializer.class
   )
   @JsonSerialize(
      using = LocalDateTimeSerializer.class
   )
   private LocalDateTime uptime;

   public void setImgUrl(String imgUrl) {
      this.imgUrl = SysUtil.getCutPath(imgUrl);
   }

   public String getImgUrl() {
      return SysUtil.getCutFileUrl(this.imgUrl);
   }

   public AllocMealLine(Long mealLineId) {
      this.mealLineId = mealLineId;
   }

   public Long getMealLineId() {
      return this.mealLineId;
   }

   public String getMealLineNum() {
      return this.mealLineNum;
   }

   public String getMealLineName() {
      return this.mealLineName;
   }

   public Long getStallId() {
      return this.stallId;
   }

   public Long getCanteenId() {
      return this.canteenId;
   }

   public Long getAreaId() {
      return this.areaId;
   }

   public Integer getMealLineType() {
      return this.mealLineType;
   }

   public Long getCustId() {
      return this.custId;
   }

   public String getContactTel() {
      return this.contactTel;
   }

   public Integer getIfDel() {
      return this.ifDel;
   }

   public String getCrby() {
      return this.crby;
   }

   public LocalDateTime getCrtime() {
      return this.crtime;
   }

   public String getUpby() {
      return this.upby;
   }

   public LocalDateTime getUptime() {
      return this.uptime;
   }

   public void setMealLineId(final Long mealLineId) {
      this.mealLineId = mealLineId;
   }

   public void setMealLineNum(final String mealLineNum) {
      this.mealLineNum = mealLineNum;
   }

   public void setMealLineName(final String mealLineName) {
      this.mealLineName = mealLineName;
   }

   public void setStallId(final Long stallId) {
      this.stallId = stallId;
   }

   public void setCanteenId(final Long canteenId) {
      this.canteenId = canteenId;
   }

   public void setAreaId(final Long areaId) {
      this.areaId = areaId;
   }

   public void setMealLineType(final Integer mealLineType) {
      this.mealLineType = mealLineType;
   }

   public void setCustId(final Long custId) {
      this.custId = custId;
   }

   public void setContactTel(final String contactTel) {
      this.contactTel = contactTel;
   }

   public void setIfDel(final Integer ifDel) {
      this.ifDel = ifDel;
   }

   public void setCrby(final String crby) {
      this.crby = crby;
   }

   @JsonDeserialize(
      using = LocalDateTimeDeserializer.class
   )
   public void setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
   }

   public void setUpby(final String upby) {
      this.upby = upby;
   }

   @JsonDeserialize(
      using = LocalDateTimeDeserializer.class
   )
   public void setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
   }


   public AllocMealLine() {
   }
}
