mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-15 02:40: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:
37
tools/goctl/rpc/test/proto/06_wellknown/events.proto
Normal file
37
tools/goctl/rpc/test/proto/06_wellknown/events.proto
Normal file
@@ -0,0 +1,37 @@
|
||||
syntax = "proto3";
|
||||
|
||||
// 场景06:import google/protobuf/timestamp.proto (well-known type)
|
||||
// 预期:goctl 正常运行,well-known type 的 pb.go 不会被重复生成(跳过)
|
||||
package eventsvc;
|
||||
|
||||
option go_package = "example.com/demo/eventsvc";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
message Event {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
google.protobuf.Timestamp created_at = 3;
|
||||
}
|
||||
|
||||
message CreateEventReq {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CreateEventReply {
|
||||
Event event = 1;
|
||||
}
|
||||
|
||||
message ListEventsReq {
|
||||
int32 page = 1;
|
||||
int32 size = 2;
|
||||
}
|
||||
|
||||
message ListEventsReply {
|
||||
repeated Event events = 1;
|
||||
}
|
||||
|
||||
service EventService {
|
||||
rpc CreateEvent(CreateEventReq) returns (CreateEventReply);
|
||||
rpc ListEvents(ListEventsReq) returns (ListEventsReply);
|
||||
}
|
||||
Reference in New Issue
Block a user