mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 16:30:01 +08:00
feat(goctl/rpc): support external proto imports with cross-package ty… (#5472)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
35
tools/goctl/rpc/example/03-import-subdir/order.proto
Normal file
35
tools/goctl/rpc/example/03-import-subdir/order.proto
Normal file
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package ordersvc;
|
||||
|
||||
option go_package = "example.com/demo/pb";
|
||||
|
||||
import "common/types.proto";
|
||||
|
||||
message OrderItem {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
double price = 3;
|
||||
}
|
||||
|
||||
message ListOrdersReq {
|
||||
common.PageInfo page = 1;
|
||||
common.SortInfo sort = 2;
|
||||
}
|
||||
|
||||
message ListOrdersReply {
|
||||
repeated OrderItem orders = 1;
|
||||
}
|
||||
|
||||
message GetOrderReq {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetOrderReply {
|
||||
OrderItem order = 1;
|
||||
}
|
||||
|
||||
service OrderService {
|
||||
rpc ListOrders(ListOrdersReq) returns (ListOrdersReply);
|
||||
rpc GetOrder(GetOrderReq) returns (GetOrderReply);
|
||||
}
|
||||
Reference in New Issue
Block a user