package com.yiqi.core.domain.vo.wx;

import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * @author xiaohei
 * @date 2024/2/1
 */
@Data
public class IntracityExpressGetCityResult extends IntracityExpressBaseResult{

    @JsonProperty("support_list")
    @ApiModelProperty("运力支持的城市信息")
    private List<TransCity> support_list;

    @Data
    public static class TransCity{
        @JsonProperty("service_trans_id")
        @ApiModelProperty("运力ID")
        private String service_trans_id;

        @JsonProperty("city_list")
        @ApiModelProperty("城市列表")
        private List<CityInfo> city_list;
    }

    @Data
    public static class CityInfo{

        @JsonProperty("city_code")
        @ApiModelProperty("城市行政区域编码")
        private String city_code;

        @JsonProperty("city_name")
        @ApiModelProperty("城市名称")
        private String city_name;
    }

    public static IntracityExpressGetCityResult fromJson(String json) {
        return WxMaGsonBuilder.create().fromJson(json, IntracityExpressGetCityResult.class);
    }
}
