101 lines
1.7 KiB
Protocol Buffer
101 lines
1.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package ad;
|
|
option go_package = "lone-services/rpc/ad";
|
|
import "google/api/annotations.proto";
|
|
|
|
service Ad {
|
|
rpc Create(CreateReq) returns (Response) {
|
|
option (google.api.http) = {
|
|
post: "/admin/v3/ad"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc Edit(EditReq) returns (Response) {
|
|
option (google.api.http) = {
|
|
put: "/admin/v3/ad"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc Items(ItemsReq) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/admin/v3/ad"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc Status(StatusReq) returns (Response) {
|
|
option (google.api.http) = {
|
|
put: "/admin/v3/ad/status"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc WebItems(WebItemsReq) returns (Response) {
|
|
option (google.api.http) = {
|
|
get: "/api/v3/ad"
|
|
body: "*"
|
|
};
|
|
}
|
|
}
|
|
|
|
message Response {
|
|
int32 code = 1;
|
|
string msg = 2;
|
|
string data = 3;
|
|
}
|
|
|
|
message CreateReq {
|
|
uint32 type = 1;
|
|
string image = 2;
|
|
string content = 3;
|
|
string url = 4;
|
|
}
|
|
|
|
message EditReq {
|
|
int64 id = 1;
|
|
uint32 type = 2;
|
|
string image = 3;
|
|
string content = 4;
|
|
string url = 5;
|
|
}
|
|
|
|
message ItemsReq {
|
|
uint32 page = 1;
|
|
uint32 page_size = 2;
|
|
}
|
|
|
|
// type: 逗号分隔,如 "1,2,3"
|
|
message WebItemsReq {
|
|
string type = 1;
|
|
}
|
|
|
|
message StatusReq {
|
|
int64 id = 1;
|
|
uint32 status = 2;
|
|
string reason = 3;
|
|
}
|
|
|
|
message ItemsData {
|
|
int64 count = 1;
|
|
repeated Item items = 2;
|
|
}
|
|
|
|
message Item {
|
|
int64 id = 1;
|
|
uint32 type = 2;
|
|
string image = 3;
|
|
string content = 4;
|
|
string reason = 5;
|
|
uint32 status = 6;
|
|
string url = 7;
|
|
string update_time = 8;
|
|
string create_time = 9;
|
|
}
|
|
|
|
message WebItem {
|
|
int64 id = 1;
|
|
uint32 type = 2;
|
|
string image = 3;
|
|
string content = 4;
|
|
string url = 5;
|
|
}
|