add addTeams route

This commit is contained in:
2025-05-17 01:22:31 +07:00
parent b5f92e0d9b
commit f710207782
6 changed files with 525 additions and 20 deletions
+300 -18
View File
@@ -97,6 +97,210 @@ func (*PingRsp) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{1}
}
type AddTeamsReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Teams []*Team `protobuf:"bytes,1,rep,name=teams,proto3" json:"teams,omitempty"`
}
func (x *AddTeamsReq) Reset() {
*x = AddTeamsReq{}
if protoimpl.UnsafeEnabled {
mi := &file_main_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AddTeamsReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddTeamsReq) ProtoMessage() {}
func (x *AddTeamsReq) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddTeamsReq.ProtoReflect.Descriptor instead.
func (*AddTeamsReq) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{2}
}
func (x *AddTeamsReq) GetTeams() []*Team {
if x != nil {
return x.Teams
}
return nil
}
type Team struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
}
func (x *Team) Reset() {
*x = Team{}
if protoimpl.UnsafeEnabled {
mi := &file_main_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Team) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Team) ProtoMessage() {}
func (x *Team) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Team.ProtoReflect.Descriptor instead.
func (*Team) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{3}
}
func (x *Team) GetName() string {
if x != nil {
return x.Name
}
return ""
}
type AddTeamsRsp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Teams []*TeamFull `protobuf:"bytes,1,rep,name=teams,proto3" json:"teams,omitempty"`
}
func (x *AddTeamsRsp) Reset() {
*x = AddTeamsRsp{}
if protoimpl.UnsafeEnabled {
mi := &file_main_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AddTeamsRsp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddTeamsRsp) ProtoMessage() {}
func (x *AddTeamsRsp) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddTeamsRsp.ProtoReflect.Descriptor instead.
func (*AddTeamsRsp) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{4}
}
func (x *AddTeamsRsp) GetTeams() []*TeamFull {
if x != nil {
return x.Teams
}
return nil
}
type TeamFull struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
Password string `protobuf:"bytes,3,opt,name=Password,proto3" json:"Password,omitempty"`
}
func (x *TeamFull) Reset() {
*x = TeamFull{}
if protoimpl.UnsafeEnabled {
mi := &file_main_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TeamFull) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TeamFull) ProtoMessage() {}
func (x *TeamFull) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TeamFull.ProtoReflect.Descriptor instead.
func (*TeamFull) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{5}
}
func (x *TeamFull) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *TeamFull) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *TeamFull) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
var File_main_proto protoreflect.FileDescriptor
var file_main_proto_rawDesc = []byte{
@@ -105,14 +309,36 @@ var file_main_proto_rawDesc = []byte{
0x63, 0x74, 0x69, 0x76, 0x65, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0x09, 0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x22, 0x09,
0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x73, 0x70, 0x32, 0x6d, 0x0a, 0x10, 0x45, 0x76, 0x65,
0x6e, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x59, 0x0a,
0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x65, 0x76,
0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2e,
0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e,
0x0a, 0x07, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x73, 0x70, 0x22, 0x42, 0x0a, 0x0b, 0x41, 0x64, 0x64,
0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e,
0x65, 0x76, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x76,
0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x73, 0x70, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x07, 0x12, 0x05, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x0b, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f,
0x65, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x22, 0x1a, 0x0a,
0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x46, 0x0a, 0x0b, 0x41, 0x64, 0x64,
0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x05, 0x74, 0x65, 0x61, 0x6d,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e,
0x65, 0x76, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x76,
0x65, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x46, 0x75, 0x6c, 0x6c, 0x52, 0x05, 0x74, 0x65, 0x61, 0x6d,
0x73, 0x22, 0x4a, 0x0a, 0x08, 0x54, 0x65, 0x61, 0x6d, 0x46, 0x75, 0x6c, 0x6c, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0xd8, 0x01,
0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69,
0x76, 0x65, 0x12, 0x59, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x20, 0x2e, 0x63, 0x72, 0x61,
0x62, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63,
0x74, 0x69, 0x76, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x63,
0x72, 0x61, 0x62, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74,
0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x73, 0x70, 0x22, 0x0d,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, 0x05, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x69, 0x0a,
0x08, 0x41, 0x64, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x72, 0x61, 0x62,
0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74,
0x69, 0x76, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a,
0x24, 0x2e, 0x63, 0x72, 0x61, 0x62, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x69, 0x6e, 0x67, 0x5f,
0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x54, 0x65, 0x61,
0x6d, 0x73, 0x52, 0x73, 0x70, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x3a, 0x01, 0x2a,
0x22, 0x06, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x42, 0x0b, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
@@ -128,19 +354,27 @@ func file_main_proto_rawDescGZIP() []byte {
return file_main_proto_rawDescData
}
var file_main_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_main_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_main_proto_goTypes = []interface{}{
(*PingReq)(nil), // 0: crabs.evening_detective.PingReq
(*PingRsp)(nil), // 1: crabs.evening_detective.PingRsp
(*PingReq)(nil), // 0: crabs.evening_detective.PingReq
(*PingRsp)(nil), // 1: crabs.evening_detective.PingRsp
(*AddTeamsReq)(nil), // 2: crabs.evening_detective.AddTeamsReq
(*Team)(nil), // 3: crabs.evening_detective.Team
(*AddTeamsRsp)(nil), // 4: crabs.evening_detective.AddTeamsRsp
(*TeamFull)(nil), // 5: crabs.evening_detective.TeamFull
}
var file_main_proto_depIdxs = []int32{
0, // 0: crabs.evening_detective.EveningDetective.Ping:input_type -> crabs.evening_detective.PingReq
1, // 1: crabs.evening_detective.EveningDetective.Ping:output_type -> crabs.evening_detective.PingRsp
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
3, // 0: crabs.evening_detective.AddTeamsReq.teams:type_name -> crabs.evening_detective.Team
5, // 1: crabs.evening_detective.AddTeamsRsp.teams:type_name -> crabs.evening_detective.TeamFull
0, // 2: crabs.evening_detective.EveningDetective.Ping:input_type -> crabs.evening_detective.PingReq
2, // 3: crabs.evening_detective.EveningDetective.AddTeams:input_type -> crabs.evening_detective.AddTeamsReq
1, // 4: crabs.evening_detective.EveningDetective.Ping:output_type -> crabs.evening_detective.PingRsp
4, // 5: crabs.evening_detective.EveningDetective.AddTeams:output_type -> crabs.evening_detective.AddTeamsRsp
4, // [4:6] is the sub-list for method output_type
2, // [2:4] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_main_proto_init() }
@@ -173,6 +407,54 @@ func file_main_proto_init() {
return nil
}
}
file_main_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddTeamsReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_main_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Team); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_main_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddTeamsRsp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_main_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TeamFull); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -180,7 +462,7 @@ func file_main_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_main_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},