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 IntracityExpressQueryFlowResult extends IntracityExpressBaseResult{

    @JsonProperty("flow_list")
    @ApiModelProperty("流水数组")
    private List<FlowRecordInfo> flow_list;

    @Data
    public static class FlowRecordInfo{
        @JsonProperty("flow_type")
        @ApiModelProperty("流水类型;1:充值流水，2:消费流水，3:退款流水")
        private Integer flow_type;

        @JsonProperty("pay_amount")
        @ApiModelProperty("支付金额")
        private Integer pay_amount;

        @JsonProperty("pay_time")
        @ApiModelProperty("支付时间")
        private Integer pay_time;

        @JsonProperty("pay_status")
        @ApiModelProperty("支付状态,FAIL：支付失败,SUCCESS:支付成功")
        private String pay_status;
    }


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