feat: bff resp string to json
CI / changes (push) Successful in 1s
CI / docker-bff (push) Successful in 1s
CI / docker-product (push) Failing after 1s

This commit is contained in:
zzw
2026-08-07 11:57:43 +08:00
parent cf49ec56c7
commit 39fb09e7df
9 changed files with 192 additions and 188 deletions
+10 -11
View File
@@ -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;
}