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.math.BigDecimal;
import java.util.List;

/**
 * @author xiaohei
 * @date 2024/2/4
 */
@Data
public class IntracityExpressStoreBalanceInfoResult extends IntracityExpressBaseResult{

    @JsonProperty("all_balance")
    @ApiModelProperty("总余额")
    private BigDecimal all_balance;

    @JsonProperty("balance_detail")
    @ApiModelProperty("余额详情")
    private List<BalanceDetail> balance_detail;

    @Data
    public static class BalanceDetail{

        @ApiModelProperty("余额")
        private BigDecimal balance;

        @JsonProperty("service_trans_id")
        @ApiModelProperty("运力ID")
        private String service_trans_id;

        @JsonProperty("service_trans_name")
        @ApiModelProperty("运力名称")
        private String service_trans_name;
    }

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