package com.bonus.canteen.core.customer.dto;

import com.bonus.canteen.core.common.utils.SysUtil;

import javax.validation.constraints.NotBlank;

public class UploadPhotoGenCodeDTO {
   private String openid;
   private Integer sourceType;
   private @NotBlank(
   message = "照片地址不能为空"
) String photoUrl;
   private Integer expirDay;
   private Long custId;

   public void setPhotoUrl(String photoUrl) {
      this.photoUrl = SysUtil.getCutPath(photoUrl);
   }

   public String getOpenid() {
      return this.openid;
   }

   public Integer getSourceType() {
      return this.sourceType;
   }

   public String getPhotoUrl() {
      return this.photoUrl;
   }

   public Integer getExpirDay() {
      return this.expirDay;
   }

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

   public UploadPhotoGenCodeDTO setOpenid(final String openid) {
      this.openid = openid;
      return this;
   }

   public UploadPhotoGenCodeDTO setSourceType(final Integer sourceType) {
      this.sourceType = sourceType;
      return this;
   }

   public UploadPhotoGenCodeDTO setExpirDay(final Integer expirDay) {
      this.expirDay = expirDay;
      return this;
   }

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

}
