package com.zbkj.service.huifu.v2;

import java.util.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.huifu.bspay.sdk.opps.core.request.V2TradeBatchtranslogQueryRequest;
import com.zbkj.service.huifu.core.Identify;

/**
 * 批量出金交易查询 - 示例
 *
 * @author sdk-generator
 * @Description
 */
@Identify(requestClass = V2TradeBatchtranslogQueryRequest.class)
public class V2TradeBatchtranslogQuery {

    public static V2TradeBatchtranslogQueryRequest method(Map<String, Object> map) {

        // 2.组装请求参数
        V2TradeBatchtranslogQueryRequest request = JSONObject.parseObject(JSON.toJSONString(map),V2TradeBatchtranslogQueryRequest.class);
// 商户号
//        request.setHuifuId("6666000000041651");
        // 开始日期
//        request.setBeginDate("20230315");
        // 结束日期
//        request.setEndDate("20230316");

        // 设置非必填字段
        Map<String, Object> extendInfoMap = getExtendInfos(map);
        request.setExtendInfo(extendInfoMap);
        return request;
    }

    /**
     * 非必填字段
     * @return
     */
    private static Map<String, Object> getExtendInfos(Map<String, Object> map) {
        // 设置非必填字段
        Map<String, Object> extendInfoMap = new HashMap<>();
        // 交易类型
        extendInfoMap.put("batch_trans_type", "");
        // 每页条数
        extendInfoMap.put("page_size", map.get("pageSize"));
        // 分页页码
        extendInfoMap.put("page_num", map.get("pageNum"));
        return extendInfoMap;
    }

}
