package com.xunwang.education.feign;

import com.xunwang.commonutils.R;
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.RequestParam;

import java.io.IOException;

@FeignClient(name = "SERVICE-PAYMENT")
public interface PayFeign {

    @PostMapping("payment/wx-pay/jsapi/{inviteId}")
    R jsapiPay(@PathVariable String inviteId);

    @GetMapping("payment/order-info/generate/order/{inviteId}")
    R generateOrder(@PathVariable String inviteId);

    @GetMapping("payment/order-info/updateIsRefund/{orderId}")
    boolean updateIsRefund(@PathVariable String orderId);

    @GetMapping("/payment/wechat/publicAccount/order")
    void sendTemplateMsgOrder(@RequestParam("unionid") String unionid , @RequestParam("name") String name , @RequestParam("phone") String phone ,
                              @RequestParam("course") String course , @RequestParam("remark") String remark , @RequestParam("isTeacher") boolean isTeacher);

    @GetMapping("/payment/wechat/publicAccount/pay")
    void sendTemplateMsgPay(@RequestParam("unionid") String unionid , @RequestParam("grade") String grade , @RequestParam("subject") String subject ,
                                   @RequestParam("address") String address , @RequestParam("reward") String reward , @RequestParam("phone") String phone,
                                   @RequestParam("remark") String remark);
}
