package shop.alien.lawyer.feign;

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;
import shop.alien.entity.result.R;

import java.util.Map;

/**
 * @author ssk
 * @version 1.0
 * @date 2025/11/10 14:08
 */
@FeignClient(name = "alienStoreFeign", url = "${feign.alienStore.url}")
public interface AlienStoreFeign {

    /**
     * 处理退款
     * @param outTradeNo 订单编号
     * @param refundAmount 退款金额
     * @param refundReason 退款原因
     * @param partialRefundCode 部分退款编码
     * @return 退款结果
     */
    @GetMapping("ali/processRefund")
    String processRefund(@RequestParam(value = "outTradeNo") String outTradeNo,
                         @RequestParam(value = "refundAmount") String refundAmount,
                         @RequestParam(value = "refundReason") String refundReason,
                         @RequestParam(value = "partialRefundCode") String partialRefundCode);

    /**
     * 微信/支付宝退款
     */
    @PostMapping("payment/refunds")
    R paymentRefunds(@RequestBody Map<String, String> params);
}
