package com.baichuanxin.openrestapi.dtos;


import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.util.Map;

@Data
public class AddressDto {
    //省
    private Map<String,Object> province;
    //市
    private Map<String,Object> city;
    //区
    private Map<String,Object> region;
    //街道
    private Map<String,Object> town;
    //社区
    private Map<String,Object> country;
    //详细地址
    private String detail;

    public String convert(){
        String address = StrUtil.join("", this.province.get("name"), this.city.get("name")
                , this.region.get("name"), this.town.get("name"), this.country.get("name"), this.detail).replace("null","");
        return address ;
    }

}
