From 857accfb2e4b5372836362dc614be5289a81e0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=88=90=E9=94=B4?= Date: Wed, 22 Nov 2023 10:36:40 +0800 Subject: [PATCH] feat: add invite process --- gen/openapi/team/v1/team_service.swagger.json | 44 ++++ gen/proto/team/v1/team_service.pb.go | 249 +++++++++++++----- gen/proto/team/v1/team_service.pb.gw.go | 85 ++++++ gen/proto/team/v1/team_service.pb.ts | 10 + gen/proto/team/v1/team_service_grpc.pb.go | 39 +++ proto/team/v1/team_service.proto | 12 + 6 files changed, 377 insertions(+), 62 deletions(-) diff --git a/gen/openapi/team/v1/team_service.swagger.json b/gen/openapi/team/v1/team_service.swagger.json index bf87f4f..edec4e7 100644 --- a/gen/openapi/team/v1/team_service.swagger.json +++ b/gen/openapi/team/v1/team_service.swagger.json @@ -109,6 +109,39 @@ ] } }, + "/gapi/team/v1/team/member/accept": { + "post": { + "summary": "接受邀请加入团队", + "operationId": "TeamService_AcceptInvite", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1AcceptInviteResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1AcceptInviteRequest" + } + } + ], + "tags": [ + "TeamService" + ] + } + }, "/gapi/team/v1/team/member/invite": { "post": { "summary": "邀请成员加入团队", @@ -238,6 +271,17 @@ } } }, + "v1AcceptInviteRequest": { + "type": "object", + "properties": { + "inviteId": { + "type": "string" + } + } + }, + "v1AcceptInviteResponse": { + "type": "object" + }, "v1CreateTeamRequest": { "type": "object", "properties": { diff --git a/gen/proto/team/v1/team_service.pb.go b/gen/proto/team/v1/team_service.pb.go index c83b8cc..f5140ae 100644 --- a/gen/proto/team/v1/team_service.pb.go +++ b/gen/proto/team/v1/team_service.pb.go @@ -582,6 +582,91 @@ func (*RemoveMemberResponse) Descriptor() ([]byte, []int) { return file_team_v1_team_service_proto_rawDescGZIP(), []int{11} } +type AcceptInviteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InviteId string `protobuf:"bytes,1,opt,name=inviteId,proto3" json:"inviteId,omitempty"` +} + +func (x *AcceptInviteRequest) Reset() { + *x = AcceptInviteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_team_v1_team_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcceptInviteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptInviteRequest) ProtoMessage() {} + +func (x *AcceptInviteRequest) ProtoReflect() protoreflect.Message { + mi := &file_team_v1_team_service_proto_msgTypes[12] + 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 AcceptInviteRequest.ProtoReflect.Descriptor instead. +func (*AcceptInviteRequest) Descriptor() ([]byte, []int) { + return file_team_v1_team_service_proto_rawDescGZIP(), []int{12} +} + +func (x *AcceptInviteRequest) GetInviteId() string { + if x != nil { + return x.InviteId + } + return "" +} + +type AcceptInviteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AcceptInviteResponse) Reset() { + *x = AcceptInviteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_team_v1_team_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AcceptInviteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AcceptInviteResponse) ProtoMessage() {} + +func (x *AcceptInviteResponse) ProtoReflect() protoreflect.Message { + mi := &file_team_v1_team_service_proto_msgTypes[13] + 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 AcceptInviteResponse.ProtoReflect.Descriptor instead. +func (*AcceptInviteResponse) Descriptor() ([]byte, []int) { + return file_team_v1_team_service_proto_rawDescGZIP(), []int{13} +} + var File_team_v1_team_service_proto protoreflect.FileDescriptor var file_team_v1_team_service_proto_rawDesc = []byte{ @@ -629,53 +714,65 @@ var file_team_v1_team_service_proto_rawDesc = []byte{ 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x94, 0x05, 0x0a, 0x0b, 0x54, 0x65, 0x61, 0x6d, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x65, - 0x61, 0x6d, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x74, 0x65, - 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x0a, 0x13, 0x41, 0x63, 0x63, 0x65, 0x70, + 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x41, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0x8e, 0x06, 0x0a, 0x0b, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x58, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x17, 0x2e, + 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, + 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x64, 0x0a, 0x0a, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x61, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, + 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, + 0x61, 0x6d, 0x12, 0x64, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, + 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, + 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x17, 0x3a, 0x01, 0x2a, 0x1a, 0x12, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, + 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x6b, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x67, 0x61, 0x70, + 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x78, 0x0a, 0x0c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, - 0x6d, 0x12, 0x64, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, - 0x1a, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, - 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x64, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x1a, 0x12, 0x2f, 0x67, 0x61, 0x70, 0x69, - 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x6b, 0x0a, - 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1a, 0x2e, 0x74, 0x65, - 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, - 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, - 0x19, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, - 0x65, 0x61, 0x6d, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x78, 0x0a, 0x0c, 0x49, 0x6e, - 0x76, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x74, 0x65, 0x61, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, - 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, - 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2f, 0x69, 0x6e, - 0x76, 0x69, 0x74, 0x65, 0x12, 0x78, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x67, - 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, - 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x3c, - 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x75, 0x61, - 0x6e, 0x6a, 0x69, 0x54, 0x65, 0x63, 0x68, 0x2f, 0x6a, 0x54, 0x65, 0x72, 0x6d, 0x2d, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, - 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x65, 0x61, 0x6d, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, + 0x78, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x1c, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, + 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x78, 0x0a, 0x0c, 0x41, 0x63, 0x63, + 0x65, 0x70, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x74, 0x65, 0x61, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x74, 0x65, 0x61, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, + 0x2a, 0x22, 0x20, 0x2f, 0x67, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2f, 0x61, 0x63, 0x63, + 0x65, 0x70, 0x74, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x6a, 0x75, 0x61, 0x6e, 0x6a, 0x69, 0x54, 0x65, 0x63, 0x68, 0x2f, 0x6a, 0x54, 0x65, + 0x72, 0x6d, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x65, 0x61, 0x6d, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -690,7 +787,7 @@ func file_team_v1_team_service_proto_rawDescGZIP() []byte { return file_team_v1_team_service_proto_rawDescData } -var file_team_v1_team_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_team_v1_team_service_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_team_v1_team_service_proto_goTypes = []interface{}{ (*GetTeamRequest)(nil), // 0: team.v1.GetTeamRequest (*GetTeamResponse)(nil), // 1: team.v1.GetTeamResponse @@ -704,28 +801,32 @@ var file_team_v1_team_service_proto_goTypes = []interface{}{ (*InviteMemberResponse)(nil), // 9: team.v1.InviteMemberResponse (*RemoveMemberRequest)(nil), // 10: team.v1.RemoveMemberRequest (*RemoveMemberResponse)(nil), // 11: team.v1.RemoveMemberResponse - (*Team)(nil), // 12: team.v1.Team + (*AcceptInviteRequest)(nil), // 12: team.v1.AcceptInviteRequest + (*AcceptInviteResponse)(nil), // 13: team.v1.AcceptInviteResponse + (*Team)(nil), // 14: team.v1.Team } var file_team_v1_team_service_proto_depIdxs = []int32{ - 12, // 0: team.v1.GetTeamResponse.team:type_name -> team.v1.Team - 12, // 1: team.v1.CreateTeamRequest.team:type_name -> team.v1.Team - 12, // 2: team.v1.CreateTeamResponse.team:type_name -> team.v1.Team - 12, // 3: team.v1.UpdateTeamRequest.team:type_name -> team.v1.Team - 12, // 4: team.v1.UpdateTeamResponse.team:type_name -> team.v1.Team + 14, // 0: team.v1.GetTeamResponse.team:type_name -> team.v1.Team + 14, // 1: team.v1.CreateTeamRequest.team:type_name -> team.v1.Team + 14, // 2: team.v1.CreateTeamResponse.team:type_name -> team.v1.Team + 14, // 3: team.v1.UpdateTeamRequest.team:type_name -> team.v1.Team + 14, // 4: team.v1.UpdateTeamResponse.team:type_name -> team.v1.Team 0, // 5: team.v1.TeamService.GetTeam:input_type -> team.v1.GetTeamRequest 2, // 6: team.v1.TeamService.CreateTeam:input_type -> team.v1.CreateTeamRequest 4, // 7: team.v1.TeamService.UpdateTeam:input_type -> team.v1.UpdateTeamRequest 6, // 8: team.v1.TeamService.DeleteTeam:input_type -> team.v1.DeleteTeamRequest 8, // 9: team.v1.TeamService.InviteMember:input_type -> team.v1.InviteMemberRequest 10, // 10: team.v1.TeamService.RemoveMember:input_type -> team.v1.RemoveMemberRequest - 1, // 11: team.v1.TeamService.GetTeam:output_type -> team.v1.GetTeamResponse - 3, // 12: team.v1.TeamService.CreateTeam:output_type -> team.v1.CreateTeamResponse - 5, // 13: team.v1.TeamService.UpdateTeam:output_type -> team.v1.UpdateTeamResponse - 7, // 14: team.v1.TeamService.DeleteTeam:output_type -> team.v1.DeleteTeamResponse - 9, // 15: team.v1.TeamService.InviteMember:output_type -> team.v1.InviteMemberResponse - 11, // 16: team.v1.TeamService.RemoveMember:output_type -> team.v1.RemoveMemberResponse - 11, // [11:17] is the sub-list for method output_type - 5, // [5:11] is the sub-list for method input_type + 12, // 11: team.v1.TeamService.AcceptInvite:input_type -> team.v1.AcceptInviteRequest + 1, // 12: team.v1.TeamService.GetTeam:output_type -> team.v1.GetTeamResponse + 3, // 13: team.v1.TeamService.CreateTeam:output_type -> team.v1.CreateTeamResponse + 5, // 14: team.v1.TeamService.UpdateTeam:output_type -> team.v1.UpdateTeamResponse + 7, // 15: team.v1.TeamService.DeleteTeam:output_type -> team.v1.DeleteTeamResponse + 9, // 16: team.v1.TeamService.InviteMember:output_type -> team.v1.InviteMemberResponse + 11, // 17: team.v1.TeamService.RemoveMember:output_type -> team.v1.RemoveMemberResponse + 13, // 18: team.v1.TeamService.AcceptInvite:output_type -> team.v1.AcceptInviteResponse + 12, // [12:19] is the sub-list for method output_type + 5, // [5:12] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name 5, // [5:5] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name @@ -882,6 +983,30 @@ func file_team_v1_team_service_proto_init() { return nil } } + file_team_v1_team_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcceptInviteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_team_v1_team_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AcceptInviteResponse); 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{ @@ -889,7 +1014,7 @@ func file_team_v1_team_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_team_v1_team_service_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/proto/team/v1/team_service.pb.gw.go b/gen/proto/team/v1/team_service.pb.gw.go index a43e18d..2afb2b6 100644 --- a/gen/proto/team/v1/team_service.pb.gw.go +++ b/gen/proto/team/v1/team_service.pb.gw.go @@ -237,6 +237,40 @@ func local_request_TeamService_RemoveMember_0(ctx context.Context, marshaler run } +func request_TeamService_AcceptInvite_0(ctx context.Context, marshaler runtime.Marshaler, client TeamServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AcceptInviteRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AcceptInvite(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TeamService_AcceptInvite_0(ctx context.Context, marshaler runtime.Marshaler, server TeamServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AcceptInviteRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AcceptInvite(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterTeamServiceHandlerServer registers the http handlers for service TeamService to "mux". // UnaryRPC :call TeamServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -393,6 +427,31 @@ func RegisterTeamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_TeamService_AcceptInvite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/team.v1.TeamService/AcceptInvite", runtime.WithHTTPPathPattern("/gapi/team/v1/team/member/accept")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TeamService_AcceptInvite_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TeamService_AcceptInvite_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -566,6 +625,28 @@ func RegisterTeamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_TeamService_AcceptInvite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/team.v1.TeamService/AcceptInvite", runtime.WithHTTPPathPattern("/gapi/team/v1/team/member/accept")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TeamService_AcceptInvite_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_TeamService_AcceptInvite_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -581,6 +662,8 @@ var ( pattern_TeamService_InviteMember_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 2, 3, 2, 4}, []string{"gapi", "team", "v1", "member", "invite"}, "")) pattern_TeamService_RemoveMember_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 2, 3, 2, 4}, []string{"gapi", "team", "v1", "member", "remove"}, "")) + + pattern_TeamService_AcceptInvite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 2, 3, 2, 4}, []string{"gapi", "team", "v1", "member", "accept"}, "")) ) var ( @@ -595,4 +678,6 @@ var ( forward_TeamService_InviteMember_0 = runtime.ForwardResponseMessage forward_TeamService_RemoveMember_0 = runtime.ForwardResponseMessage + + forward_TeamService_AcceptInvite_0 = runtime.ForwardResponseMessage ) diff --git a/gen/proto/team/v1/team_service.pb.ts b/gen/proto/team/v1/team_service.pb.ts index ff9e88f..f0d2b78 100644 --- a/gen/proto/team/v1/team_service.pb.ts +++ b/gen/proto/team/v1/team_service.pb.ts @@ -54,6 +54,13 @@ export type RemoveMemberRequest = { export type RemoveMemberResponse = { } +export type AcceptInviteRequest = { + inviteId?: string +} + +export type AcceptInviteResponse = { +} + export class TeamService { static GetTeam(req: GetTeamRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/gapi/team/v1/team?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"}) @@ -73,4 +80,7 @@ export class TeamService { static RemoveMember(req: RemoveMemberRequest, initReq?: fm.InitReq): Promise { return fm.fetchReq(`/gapi/team/v1/team/member/remove`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)}) } + static AcceptInvite(req: AcceptInviteRequest, initReq?: fm.InitReq): Promise { + return fm.fetchReq(`/gapi/team/v1/team/member/accept`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)}) + } } \ No newline at end of file diff --git a/gen/proto/team/v1/team_service_grpc.pb.go b/gen/proto/team/v1/team_service_grpc.pb.go index d88f6a6..ddecb2d 100644 --- a/gen/proto/team/v1/team_service_grpc.pb.go +++ b/gen/proto/team/v1/team_service_grpc.pb.go @@ -25,6 +25,7 @@ const ( TeamService_DeleteTeam_FullMethodName = "/team.v1.TeamService/DeleteTeam" TeamService_InviteMember_FullMethodName = "/team.v1.TeamService/InviteMember" TeamService_RemoveMember_FullMethodName = "/team.v1.TeamService/RemoveMember" + TeamService_AcceptInvite_FullMethodName = "/team.v1.TeamService/AcceptInvite" ) // TeamServiceClient is the client API for TeamService service. @@ -43,6 +44,8 @@ type TeamServiceClient interface { InviteMember(ctx context.Context, in *InviteMemberRequest, opts ...grpc.CallOption) (*InviteMemberResponse, error) // 从团队中移除成员 RemoveMember(ctx context.Context, in *RemoveMemberRequest, opts ...grpc.CallOption) (*RemoveMemberResponse, error) + // 接受邀请加入团队 + AcceptInvite(ctx context.Context, in *AcceptInviteRequest, opts ...grpc.CallOption) (*AcceptInviteResponse, error) } type teamServiceClient struct { @@ -107,6 +110,15 @@ func (c *teamServiceClient) RemoveMember(ctx context.Context, in *RemoveMemberRe return out, nil } +func (c *teamServiceClient) AcceptInvite(ctx context.Context, in *AcceptInviteRequest, opts ...grpc.CallOption) (*AcceptInviteResponse, error) { + out := new(AcceptInviteResponse) + err := c.cc.Invoke(ctx, TeamService_AcceptInvite_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // TeamServiceServer is the server API for TeamService service. // All implementations must embed UnimplementedTeamServiceServer // for forward compatibility @@ -123,6 +135,8 @@ type TeamServiceServer interface { InviteMember(context.Context, *InviteMemberRequest) (*InviteMemberResponse, error) // 从团队中移除成员 RemoveMember(context.Context, *RemoveMemberRequest) (*RemoveMemberResponse, error) + // 接受邀请加入团队 + AcceptInvite(context.Context, *AcceptInviteRequest) (*AcceptInviteResponse, error) mustEmbedUnimplementedTeamServiceServer() } @@ -148,6 +162,9 @@ func (UnimplementedTeamServiceServer) InviteMember(context.Context, *InviteMembe func (UnimplementedTeamServiceServer) RemoveMember(context.Context, *RemoveMemberRequest) (*RemoveMemberResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveMember not implemented") } +func (UnimplementedTeamServiceServer) AcceptInvite(context.Context, *AcceptInviteRequest) (*AcceptInviteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AcceptInvite not implemented") +} func (UnimplementedTeamServiceServer) mustEmbedUnimplementedTeamServiceServer() {} // UnsafeTeamServiceServer may be embedded to opt out of forward compatibility for this service. @@ -269,6 +286,24 @@ func _TeamService_RemoveMember_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _TeamService_AcceptInvite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AcceptInviteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamServiceServer).AcceptInvite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TeamService_AcceptInvite_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamServiceServer).AcceptInvite(ctx, req.(*AcceptInviteRequest)) + } + return interceptor(ctx, in, info, handler) +} + // TeamService_ServiceDesc is the grpc.ServiceDesc for TeamService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -300,6 +335,10 @@ var TeamService_ServiceDesc = grpc.ServiceDesc{ MethodName: "RemoveMember", Handler: _TeamService_RemoveMember_Handler, }, + { + MethodName: "AcceptInvite", + Handler: _TeamService_AcceptInvite_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "team/v1/team_service.proto", diff --git a/proto/team/v1/team_service.proto b/proto/team/v1/team_service.proto index 8e9f640..7973884 100644 --- a/proto/team/v1/team_service.proto +++ b/proto/team/v1/team_service.proto @@ -48,6 +48,13 @@ service TeamService { body: "*" }; } + // 接受邀请加入团队 + rpc AcceptInvite(AcceptInviteRequest) returns (AcceptInviteResponse) { + option (google.api.http) = { + post: "/gapi/team/v1/team/member/accept" + body: "*" + }; + } } message GetTeamRequest { @@ -95,3 +102,8 @@ message RemoveMemberRequest { message RemoveMemberResponse {} +message AcceptInviteRequest { + string inviteId = 1; +} + +message AcceptInviteResponse {}