2024-05-17 18:02:10 +08:00
|
|
|
include "config.thrift"
|
|
|
|
|
|
|
|
struct PushReq {
|
2024-11-29 21:53:59 +08:00
|
|
|
1: list<i64> ids (api.body="ids");
|
2024-05-20 17:57:25 +08:00
|
|
|
2: required string title (api.body="title");
|
|
|
|
3: required string content (api.body="content");
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
|
2024-05-20 17:57:25 +08:00
|
|
|
struct Resp {
|
|
|
|
1: required i64 code (api.body="code");
|
|
|
|
2: string msg (api.body="msg");
|
|
|
|
3: string msgId (api.body="msgId");
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
struct ListPusherRequest {
|
2024-05-20 17:57:25 +08:00
|
|
|
1: string keyword (api.query="keyword");
|
|
|
|
2: optional i64 page = 10 (api.query="page");
|
|
|
|
3: optional i16 size = 1 (api.query="size");
|
|
|
|
4: bool all (api.query="all");
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
struct ListPusherResponse {
|
2024-05-20 17:57:25 +08:00
|
|
|
1: i64 total (api.body="total");
|
|
|
|
2: list<config.PusherConfig> list (api.body="list");
|
|
|
|
}
|
|
|
|
|
|
|
|
struct GetPusherOptionsResponse {
|
2024-05-21 14:01:28 +08:00
|
|
|
1: list<config.PusherOption> options
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
service PushService{
|
2024-05-20 17:57:25 +08:00
|
|
|
Resp Push(1: PushReq req) (api.post="/api/v1/push");
|
|
|
|
Resp Add(1: config.PusherConfig req) (api.post="/api/v1/pushers");
|
|
|
|
ListPusherResponse List(1: ListPusherRequest req) (api.get="/api/v1/pushers");
|
|
|
|
GetPusherOptionsResponse GetPusherOptions() (api.get="/api/v1/pushers/options")
|
2024-05-17 18:02:10 +08:00
|
|
|
}
|