package com.seer.teach.pay.api.wallet;

import com.seer.teach.pay.api.ApiConstants;
import com.seer.teach.pay.api.wallet.dto.CoinAccountRefundDTO;
import com.seer.teach.pay.api.wallet.dto.WechatRefundRespDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = ApiConstants.SERVER_NAME, contextId = "coinAccountRefundServiceApi", path = "/seer/pay")
public interface CoinAccountRefundServiceApi {

    /**
     * 提交退款请求到支付平台
     *
     * @param coinAccountRefundDTO 充值记录和退款实体，包含原始充值交易的详细信息
     * @return 返回一个退款响应对象，包含支付平台处理退款请求的结果信息
     */
    @PostMapping(value = "/wallet/refund-apply", consumes = "application/json", produces = "application/json")
    WechatRefundRespDTO submitRefundApply(@RequestBody CoinAccountRefundDTO coinAccountRefundDTO);

    /**
     * 查询支付平台处理退款请求的结果信息
     *
     * @param refundSn 支付平台返回的退款请求编码
     * @return 返回一个退款响应对象，包含付平台处理退款请求的结果信息
     */
    @GetMapping(value = "/wallet/refund-query", produces = "application/json")
    WechatRefundRespDTO queryRefund(@RequestParam("refundSn") String refundSn);
}