package com.liquidnet.service.adam.dto.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.adam.entity.AdamAddresses;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@ApiModel(value = "AdamAddressesVo", description = "收获地址")
@JsonIgnoreProperties(value = {"uid", "town", "townId", "fullAddress", "deletedAt"})
@Data
public class AdamAddressesVo implements java.io.Serializable, Cloneable {
    private static final long serialVersionUID = -3096308044365829079L;
    @ApiModelProperty(position = 10, value = "收获地址ID[64]")
    private String addressesId;
    @ApiModelProperty(position = 11, value = "用户ID[64]")
    private String uid;
    @ApiModelProperty(position = 12, value = "姓名[30]")
    private String name;
    @ApiModelProperty(position = 13, value = "手机号[11]")
    private String phone;
    @ApiModelProperty(position = 14, value = "邮编[10]")
    private String zipcode;
    @ApiModelProperty(position = 15, value = "省份[30]")
    private String province;
    @ApiModelProperty(position = 16, value = "省份行政编码[20]")
    private String provinceId;
    @ApiModelProperty(position = 17, value = "城市[30]")
    private String city;
    @ApiModelProperty(position = 18, value = "城市行政编码[20]")
    private String cityId;
    @ApiModelProperty(position = 19, value = "区县[30]")
    private String county;
    @ApiModelProperty(position = 20, value = "区县行政编码[20]")
    private String countyId;
    @ApiModelProperty(position = 21, value = "街道/镇[30]")
    private String town;
    @ApiModelProperty(position = 22, value = "街道行政编码[20]")
    private String townId;
    @ApiModelProperty(position = 23, value = "详细地址[100]")
    private String address;
    @ApiModelProperty(position = 24, value = "详细地址[100]")
    private String fullAddress;
    @ApiModelProperty(position = 25, value = "是否为默认:0-否,1-是")
    private Boolean isDefault;
    @ApiModelProperty(position = 26, value = "状态:0-INIT,1-NORMAL,2-INVALID")
    private Integer state;
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR)
    private LocalDateTime createdAt;
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR)
    private LocalDateTime updatedAt;
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR)
    private LocalDateTime deletedAt;

    private static final AdamAddressesVo obj = new AdamAddressesVo();

    public static AdamAddressesVo getNew() {
        try {
            return (AdamAddressesVo) obj.clone();
        } catch (CloneNotSupportedException e) {
            return new AdamAddressesVo();
        }
    }

    public AdamAddressesVo copy(AdamAddresses source) {
        if (null == source) return this;
        this.setAddressesId(source.getAddressesId());
        this.setUid(source.getUid());
        this.setName(source.getName());
        this.setPhone(source.getPhone());
        this.setZipcode(source.getZipcode());
        this.setProvince(source.getProvince());
        this.setProvinceId(source.getProvinceId());
        this.setCity(source.getCity());
        this.setCityId(source.getCityId());
        this.setCounty(source.getCounty());
        this.setCountyId(source.getCountyId());
        this.setTown(source.getTown());
        this.setTownId(source.getTownId());
        this.setAddress(source.getAddress());
        this.setFullAddress(source.getFullAddress());
        this.setIsDefault(source.getIsDefault());
        this.setState(source.getState());
        this.setCreatedAt(source.getCreatedAt());
        this.setUpdatedAt(source.getUpdatedAt());
        this.setDeletedAt(source.getDeletedAt());
        return this;
    }
}
