package quant.rich.emoney.tushare;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import feign.Headers;

/**
 * 对接 TushareDataService 的 Feign 客户端
 * <p>
 * 服务器上配置了 fail2ban 对默认 User-Agent
 * 拦截（Java/*），所以这里自定义 User-Agent
 */
@Headers("User-Agent: At17DataService/1.0")
@FeignClient(name="tushare-data-service-client", url="https://tushare.database.at17.link")
public interface TushareDataServiceClient {
    
    @GetMapping("/api/v1/common/stockInfo/list")
    public List<StockInfo> list(
            @RequestParam(name="listStatus", required=false) String listStatus,
            @RequestParam(name="stockMarket", required=false) String[] stockMarket,
            @RequestParam(name="ths", required=false, defaultValue="false") Boolean ths
    );

}
