package com.miaxis.feign.service;

import com.miaxis.common.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/10/20 16:05
 */
@FeignClient(name="wxMpService",
        url = "https://mp.weixin.qq.com/cgi-bin",configuration = FeignConfig.class)
public interface IWxMpService {

    /**
     * 通过ticket换取二维码
     * HTTP头（示例）如下：
     *      Accept-Ranges:bytes
     *      Cache-control:max-age=604800
     *      Connection:keep-alive
     *      Content-Length:28026
     *      Content-Type:image/jpg
     *      Date:Wed, 16 Oct 2013 06:37:10 GMT
     *      Expires:Wed, 23 Oct 2013 14:37:10 +0800
     *      Server:nginx/1.4.1
     * @param ticket
     * @return
     */
    @GetMapping(value = "/showqrcode"
            ,headers = {"Accept-Ranges=bytes", "Cache-control='max-age=604800'", "Connection=keep-alive","Content-Length=28026","Content-Type=image/jpg"})
    String showQrcode(@RequestParam("ticket") String ticket);
}
