Files
lone-services/product/proto/admin/product.proto
T
2026-08-07 15:41:18 +08:00

153 lines
3.3 KiB
Protocol Buffer

syntax = "proto3";
package product;
option go_package="./product";
import "google/api/annotations.proto";
service Product {
rpc Create(CreateReq) returns (Response) {
option (google.api.http) = {
post: "/admin/v3/product/create"
body: "*"
};
}
rpc Info(InfoReq) returns (Response) {
option (google.api.http) = {
get: "/admin/v3/product/info"
body: "*"
};
}
rpc Items(ItemsReq) returns (Response) {
option (google.api.http) = {
get: "/admin/v3/product"
body: "*"
};
}
rpc Names(NamesReq) returns (Response) {
option (google.api.http) = {
get: "/admin/v3/product/names"
body: "*"
};
}
rpc Status(StatusReq) returns (Response) {
option (google.api.http) = {
put: "/admin/v3/product/status"
body: "*"
};
}
rpc Sort(SortReq) returns (Response) {
option (google.api.http) = {
put: "/admin/v3/product/sort"
body: "*"
};
}
}
message Response {
int32 code = 1;
string msg = 2;
string data = 3;
}
message CreateReq {
string name = 1;
string subhead = 2;
string content = 3;
uint32 sales_model = 4;
string model_code = 5;
double price = 6;
double store_price = 7;
double sale_price = 8;
double share_price = 9;
double agent_price = 10;
string sale_reward = 11;
string images = 12;
double weight = 13;
string cubage = 14;
string waybill = 15;
int32 period_validity = 16;
uint32 norms_number = 17;
double box_number = 18;
uint32 type = 19;
uint32 number = 20;
uint32 try_number = 21;
string publish_time = 22;
string label = 23;
uint32 is_buy = 24;
uint32 is_index = 25;
string index_image = 26;
}
message InfoReq {
int64 id = 1;
}
message ItemsReq {
string name = 1;
uint32 page = 2;
uint32 page_size = 3;
}
message NamesReq {}
message StatusReq {
int64 id = 1;
uint32 status = 2;
string reason = 3;
}
message SortReq {
int64 id = 1;
uint32 sort = 2;
}
message ItemsData {
int64 count = 1;
repeated Item items = 2;
}
message NameItem {
int64 id = 1;
string name = 2;
}
message Item {
int64 id = 1;
string name = 2;
string subhead = 3;
string content = 4;
string model_code = 5;
double price = 6;
double store_price = 7;
double sale_price = 8;
double share_price = 9;
double agent_price = 10;
string sale_reward = 11;
uint32 sales_model = 12;
string waybill = 13;
uint32 status = 14;
double weight = 15;
uint32 is_index = 16;
string index_image = 17;
string cubage = 18;
string label = 19;
string images = 20;
uint32 is_buy = 21;
int32 period_validity = 22;
string publish_time = 23;
uint32 type = 24;
uint32 norms_number = 25;
double box_number = 26;
uint32 sort = 27;
uint32 number = 28;
uint32 verify_status = 29;
int64 verify_id = 30;
string verify_name = 31;
int64 verify_second_id = 32;
string verify_second_name = 33;
string reason = 34;
string admin_name = 35;
uint32 edit = 36;
}