mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-14 18:30:02 +08:00
38 lines
812 B
Protocol Buffer
38 lines
812 B
Protocol Buffer
|
|
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);
|
|||
|
|
}
|