syntax = "proto2";
package Qot_GetEconomicCalendar;
option java_package = "com.futu.openapi.pb";
option go_package = "github.com/futuopen/ftapi4go/pb/qotgeteconomiccalendar";

// 事件重要性(星级)
enum Importance {
    Importance_All = 0;       //全部(默认)
    Importance_Low = 1;       //一星(低)
    Importance_Medium = 2;    //二星(中)
    Importance_High = 3;      //三星(高)
}

// 经济数据事件
message EconomicCalendarItem {
    optional string title = 1;          // 标题(如"非农就业人数")
    optional double timestamp = 2;      // 发布时间戳(秒)
    optional string country = 3;        // 国家名称
    optional int32 star = 4;            // 星级(重要性 1-3)
    optional string previous = 5;       // 前值
    optional string consensus = 6;      // 预测值
    optional string actual = 7;         // 实际值(公布值)
}

message C2S {
    required string beginDate = 1;      // 开始日期，格式"yyyy-MM-dd"，按本机系统时区解释
    optional string endDate = 2;        // 结束日期，格式"yyyy-MM-dd"，不传则仅查beginDate当天
    repeated int32 marketList = 3;      // Qot_Common.QotMarket，市场筛选(多选，支持HK/US/CNSH/SG/JP/AU/MY/CA)
    optional int32 importance = 4;      // Importance，事件重要性筛选，默认All
    optional int32 count = 5;           // 每页数量，默认50，最大100
    optional string nextPage = 6;       // 翻页标记，首次不传，后续带上S2C返回的nextPage
}

message S2C {
    repeated EconomicCalendarItem itemList = 1; // 经济数据事件列表
    optional string nextPage = 2;               // 下一页翻页标记
    optional bool hasMore = 3;                  // 是否还有更多数据
}

message Request {
    required C2S c2s = 1;
}

message Response {
    required int32 retType = 1 [default = -400]; //RetType，返回结果
    optional string retMsg = 2;
    optional int32 errCode = 3;
    optional S2C s2c = 4;
}
