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

import com.seer.teach.pay.api.ApiConstants;
import com.seer.teach.pay.api.refund.dto.RefundOrderRequestDTO;
import com.seer.teach.pay.api.refund.dto.RefundResponseDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

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

    /**
     * 提交退款
     * @param refundRequest 退款请求参数
     * @return 退款响应结果
     */
    @PostMapping(value = "/internal/refund/submit", consumes = "application/json", produces = "application/json")
    RefundResponseDTO submitRefund(@RequestBody RefundOrderRequestDTO refundRequest);

    /**
     * 查询退款状态
     * @param refundSn 退款单号
     * @return 退款响应结果
     */
    @GetMapping(value = "/internal/refund/order/query/{refundSn}", produces = "application/json")
    RefundResponseDTO queryRefundStatus(@PathVariable("refundSn") String refundSn);
}