
package com.tmerclub.cloud.order.model;

import com.tmerclub.cloud.common.model.BaseModel;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;

/**
 * 用户订单配送地址
 *
 * @author tmerclub
 * @date 2020-12-05 14:13:50
 */
@Data
@ToString
public class OrderAddr extends BaseModel implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    private Long orderAddrId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 收货人
     */
    @NotBlank(message = "收货人名称不能为空")
    @Length(max = 50, message = "收货人名称字符长度不能超过50")
    private String consignee;

    /**
     * 省ID
     */
    private Long provinceId;

    /**
     * 省
     */
    private String province;

    /**
     * 城市ID
     */
    private Long cityId;

    /**
     * 城市
     */
    private String city;

    /**
     * 区域ID
     */
    private Long areaId;

    /**
     * 区
     */
    private String area;

    /**
     * 地址
     */
    @NotBlank(message = "地址不能为空")
    @Length(max = 255, message = "地址长度不能超过255")
    private String addr;

    /**
     * 邮编
     */
    private String postCode;

    /**
     * 手机
     */
    @NotBlank(message = "收货人手机不能为空")
    @Length(max = 11, message = "收货人手机长度不能超过11")
    private String mobile;

    @Schema(description = "经度")
    private Double lng;

    @Schema(description = "纬度")
    private Double lat;

}
