
package com.tmerclub.cloud.common.order.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

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

/**
 * 省市区地区信息DTO
 *
 * @author YXF
 * @date 2020-11-25 15:16:14
 */
public class AreaDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    private Long areaId;

    @NotNull(message = "地址不能为空")
    @Schema(description = "地址")
    private String areaName;

    @NotNull(message = "上级地址不能为空")
    @Schema(description = "上级地址")
    private Long parentId;

    @NotNull(message = "等级不能为空")
    @Schema(description = "等级（从1开始）")
    private Integer level;

    public AreaDTO() {
    }

    public AreaDTO(Long areaId, String areaName, Long parentId, Integer level) {
        this.areaId = areaId;
        this.areaName = areaName;
        this.parentId = parentId;
        this.level = level;
    }

    public Long getAreaId() {
        return areaId;
    }

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

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Override
    public String toString() {
        return "AreaDTO{" +
                "areaId=" + areaId +
                ",areaName=" + areaName +
                ",parentId=" + parentId +
                ",level=" + level +
                '}';
    }
}
