package cclotus.weixin.api.service

import cclotus.weixin.api.domain.GetApiDomainIp
import cclotus.weixin.api.feign.WxFeignConfiguration
import cclotus.weixin.util.WeixinError
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestParam

@FeignClient(name = "wx-demo", url = "\${wxapi.url}", configuration = [WxFeignConfiguration::class])
interface WxDemoService {
    @Throws(WeixinError::class)
    @GetMapping("/api.weixin.qq.com/cgi-bin/get_api_domain_ip")
    fun getApiDomainIp(@RequestParam("appid") appid: String): GetApiDomainIp
}