feat: bff resp string to json
This commit is contained in:
@@ -7,25 +7,31 @@ import "buf/validate/validate.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
service Product {
|
||||
rpc Add(AddReq) returns (AddResp) {
|
||||
rpc Add(AddReq) returns (Response) {
|
||||
option (google.api.http) = {
|
||||
post: "/admin/v3/product"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc Edit(EditReq) returns (EditResp) {
|
||||
rpc Edit(EditReq) returns (Response) {
|
||||
option (google.api.http) = {
|
||||
put: "/admin/v3/product"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
rpc Items(ItemsReq) returns (ItemsResp) {
|
||||
rpc Items(ItemsReq) returns (Response) {
|
||||
option (google.api.http) = {
|
||||
get: "/admin/v3/product"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message Response {
|
||||
int32 code = 1;
|
||||
string msg = 2;
|
||||
string data = 3;
|
||||
}
|
||||
|
||||
message ItemsReq {
|
||||
string name = 1 [(buf.validate.field).string = {max_len: 256}];
|
||||
uint32 page = 2 [(buf.validate.field) = {
|
||||
@@ -38,7 +44,7 @@ message ItemsReq {
|
||||
}];
|
||||
}
|
||||
|
||||
message ItemsResp {
|
||||
message ItemsData {
|
||||
int64 count = 1;
|
||||
repeated Item items = 2;
|
||||
}
|
||||
@@ -132,9 +138,6 @@ message AddReq {
|
||||
// reserved 2;
|
||||
}
|
||||
|
||||
message AddResp {
|
||||
}
|
||||
|
||||
message EditReq {
|
||||
int64 id = 1 [(buf.validate.field).int64 = {gt: 0}];
|
||||
string name = 2 [(buf.validate.field).string = {min_len: 1, max_len: 256}];
|
||||
@@ -157,7 +160,3 @@ message EditReq {
|
||||
}];
|
||||
string index_image = 14 [(buf.validate.field).string = {max_len: 255}];
|
||||
}
|
||||
|
||||
message EditResp {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user