WEQServer/idl/WeatherAndEarthquake.thrift

34 lines
1.2 KiB
Thrift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ./idl/WeatherAndEarthquake.thrift
namespace go weather_and_earthquake
struct QueryReq {
// 操作码
// 0: 查最新地震信息。
// 1: 默认情况通过ip地址查看天气。此时不需要其他参数。
// 2: 通过提供的 LocationKey 查看天气。需要提供 LocationKey。
// 3: 通过地名查看天气。需要提供 Addr。
1: i32 Op (api.query="op");
2: string LocationKey (api.query="key");
3: string Addr (api.query="addr");
}
struct QueryResp {
// 0: 成功。如果是地震信息就返回地震信息。如果是通过ip或者locationKey查询天气就返回当前情况和预报。
// 如果是通过地点查询表示查到地点并且只有一个且通过这个key查询到了天气情况。
// -1: 参数错误
// -2: 请求头参数错误
// -3: 签名校验失败
// 1: 查询天气失败
// 2: 查询地名失败
// 3: 根据地名查询到多个地址,需要确认。
1: i32 Code;
2: string LocationKey;
3: string Locations;
4: string CurrentConditions;
5: string DailyForecasts;
6: string EarthquakeInformations;
}
service WeatherAndEarthquakeService {
QueryResp QueryMethod(1: QueryReq request) (api.get="/query");
}