package com.sptg.pay.api.feigns;

import com.sptg.pay.api.entity.UserOrder;
import com.sptg.pay.api.feigns.fallback.WxPayFeignFallbackFactory;
import com.sptg.pay.api.vo.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @author zwx
 * @create 2020/6/20 18:35
 */
@FeignClient(value = "smart-house-pay", fallbackFactory = WxPayFeignFallbackFactory.class)
public interface WxPayFeign {

    /**
     * 微信APP支付
     */
    @PostMapping(value = "/wxPay/appPay")
    public AjaxResult appPay(@RequestBody Map<String, Object> map);

    /**
     * 查询订单
     */
    @PostMapping(value = "/wxPay/orderQuery")
    public AjaxResult orderQuery(@RequestBody UserOrder userOrder);

    /**
     * 退款申请
     * @param map
     * @return
     */
    @PostMapping(value = "/wxPay/refund")
    public Map<String, Object> refund(@RequestBody Map<String,String> map);
}
