package com.jeequan.jeepay.thirdparty.channel;

import com.jeequan.jeepay.core.exception.BizException;
import com.jeequan.jeepay.core.interfaces.paychannel.IMchApiService;
import com.jeequan.jeepay.core.model.params.IsvParams;
import com.jeequan.jeepay.core.model.rqrs.settle.ChannelSettleRq;

/**
 * TODO
 *
 * @author crystal
 * @date 2023/12/4 10:46
 */
public abstract class AbstractMchApiService<T extends IsvParams> implements IMchApiService<T> {

    /**
     * 通用结算参数校验
     * @param settleRq
     */
    protected void preSettleCheck(ChannelSettleRq settleRq){
        if(settleRq.getPage() == null){
            throw new BizException("当前页不能为空");
        }
        if(settleRq.getSize() == null){
            throw new BizException("每页显示的条数不能为空");
        }
    }
}
