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

import com.bonus.canteen.core.allocation.canteen.model.AllocKind;
import com.bonus.canteen.core.common.utils.SysUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDateTime;

@ApiModel("品类VO")
public class AllocKindVO {
   @ApiModelProperty("品类名称")
   private String kindName;
   @ApiModelProperty("品类图片链接")
   private String imgUrl;
   @ApiModelProperty("创建时间")
   private LocalDateTime crtime;
   @ApiModelProperty("更新时间")
   private LocalDateTime uptime;

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

   public void setUrlAndTime(AllocKind allocKind) {
      this.imgUrl = SysUtil.getCutFileUrl(allocKind.getImgUrl());
      this.crtime = allocKind.getCrtime();
      this.uptime = allocKind.getUptime();
   }

   public String getKindName() {
      return this.kindName;
   }

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

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

   public void setKindName(final String kindName) {
      this.kindName = kindName;
   }

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

   public void setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
   }

   public void setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
   }

}
