package com.miaxis.feign.service;

import com.miaxis.common.config.FeignConfig;
import com.miaxis.feign.dto.WxGzhSend;
import com.miaxis.feign.dto.WxSend;
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.RequestParam;

/**
 *
 * 微信接口
 */
@FeignClient(name="wxSendService",
        url = "https://api.weixin.qq.com/cgi-bin",configuration = FeignConfig.class)
public interface IWxSendService {

    @PostMapping(value = "/message/subscribe/send")
    String sendMessage(@RequestParam("access_token") String accessToken, WxSend wxSend);

    @PostMapping(value = "/message/template/send")
    String sendGzhMessage(@RequestParam("access_token") String accessToken, WxGzhSend wxGzhSend);

    @GetMapping(value = "/token")
    String getAccessToken(@RequestParam("grant_type") String grant_type,
                          @RequestParam("appid") String appid,
                          @RequestParam("secret") String secret);

    @GetMapping(value = "/user/get")
    String getUser(@RequestParam("access_token") String access_token,
                   @RequestParam("next_openid") String next_openid);

    @GetMapping(value = "/user/info")
    String getUserInfo(@RequestParam("access_token") String access_token,
                       @RequestParam("openid") String openid,
                       @RequestParam("lang") String lang);


}
