From 480551a7382ffb912d290c3ae57c2267a2c4db45 Mon Sep 17 00:00:00 2001 From: daiyb <570956418@qq.com> Date: Thu, 19 Jun 2025 11:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=87=8D=E6=96=B0=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/cast/cast.pb.go | 510 +++++++++++++++++++++++++-------- api/cast/cast.pb.validate.go | 539 +++++++++++++++++++++++++++++++---- api/cast/cast_triple.pb.go | 116 +++++++- pkg/router/media.go | 7 +- pkg/service/cast/media.go | 37 +++ pkg/service/cast/oauth.go | 36 --- pkg/service/cast/work.go | 32 ++- 7 files changed, 1044 insertions(+), 233 deletions(-) diff --git a/api/cast/cast.pb.go b/api/cast/cast.pb.go index 09de8fa..cc47160 100644 --- a/api/cast/cast.pb.go +++ b/api/cast/cast.pb.go @@ -1908,29 +1908,30 @@ func (x *MediaWorksResp) GetData() []*MediaWorksResp_Info { return nil } -// youtube -type OAuthYoutubeReq struct { +type RePublishReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code"` + WorkUuid string `protobuf:"bytes,1,opt,name=workUuid,proto3" json:"workUuid"` + MediaAccountUuids []string `protobuf:"bytes,2,rep,name=mediaAccountUuids,proto3" json:"mediaAccountUuids"` + MediaAccountNames []string `protobuf:"bytes,3,rep,name=mediaAccountNames,proto3" json:"mediaAccountNames"` } -func (x *OAuthYoutubeReq) Reset() { - *x = OAuthYoutubeReq{} +func (x *RePublishReq) Reset() { + *x = RePublishReq{} mi := &file_pb_fiee_cast_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *OAuthYoutubeReq) String() string { +func (x *RePublishReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*OAuthYoutubeReq) ProtoMessage() {} +func (*RePublishReq) ProtoMessage() {} -func (x *OAuthYoutubeReq) ProtoReflect() protoreflect.Message { +func (x *RePublishReq) ProtoReflect() protoreflect.Message { mi := &file_pb_fiee_cast_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1942,19 +1943,124 @@ func (x *OAuthYoutubeReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use OAuthYoutubeReq.ProtoReflect.Descriptor instead. -func (*OAuthYoutubeReq) Descriptor() ([]byte, []int) { +// Deprecated: Use RePublishReq.ProtoReflect.Descriptor instead. +func (*RePublishReq) Descriptor() ([]byte, []int) { return file_pb_fiee_cast_proto_rawDescGZIP(), []int{22} } -func (x *OAuthYoutubeReq) GetCode() string { +func (x *RePublishReq) GetWorkUuid() string { if x != nil { - return x.Code + return x.WorkUuid } return "" } -type OAuthYoutubeResp struct { +func (x *RePublishReq) GetMediaAccountUuids() []string { + if x != nil { + return x.MediaAccountUuids + } + return nil +} + +func (x *RePublishReq) GetMediaAccountNames() []string { + if x != nil { + return x.MediaAccountNames + } + return nil +} + +type RePublishResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ArtistUuid string `protobuf:"bytes,1,opt,name=artistUuid,proto3" json:"artistUuid"` +} + +func (x *RePublishResp) Reset() { + *x = RePublishResp{} + mi := &file_pb_fiee_cast_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RePublishResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RePublishResp) ProtoMessage() {} + +func (x *RePublishResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_fiee_cast_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RePublishResp.ProtoReflect.Descriptor instead. +func (*RePublishResp) Descriptor() ([]byte, []int) { + return file_pb_fiee_cast_proto_rawDescGZIP(), []int{23} +} + +func (x *RePublishResp) GetArtistUuid() string { + if x != nil { + return x.ArtistUuid + } + return "" +} + +// youtube +type OAuthYoutubeUrlReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MediaAccountUuid string `protobuf:"bytes,1,opt,name=mediaAccountUuid,proto3" json:"mediaAccountUuid"` +} + +func (x *OAuthYoutubeUrlReq) Reset() { + *x = OAuthYoutubeUrlReq{} + mi := &file_pb_fiee_cast_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OAuthYoutubeUrlReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OAuthYoutubeUrlReq) ProtoMessage() {} + +func (x *OAuthYoutubeUrlReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_fiee_cast_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OAuthYoutubeUrlReq.ProtoReflect.Descriptor instead. +func (*OAuthYoutubeUrlReq) Descriptor() ([]byte, []int) { + return file_pb_fiee_cast_proto_rawDescGZIP(), []int{24} +} + +func (x *OAuthYoutubeUrlReq) GetMediaAccountUuid() string { + if x != nil { + return x.MediaAccountUuid + } + return "" +} + +type OAuthYoutubeUrlResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1962,21 +2068,21 @@ type OAuthYoutubeResp struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url"` } -func (x *OAuthYoutubeResp) Reset() { - *x = OAuthYoutubeResp{} - mi := &file_pb_fiee_cast_proto_msgTypes[23] +func (x *OAuthYoutubeUrlResp) Reset() { + *x = OAuthYoutubeUrlResp{} + mi := &file_pb_fiee_cast_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *OAuthYoutubeResp) String() string { +func (x *OAuthYoutubeUrlResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*OAuthYoutubeResp) ProtoMessage() {} +func (*OAuthYoutubeUrlResp) ProtoMessage() {} -func (x *OAuthYoutubeResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_fiee_cast_proto_msgTypes[23] +func (x *OAuthYoutubeUrlResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_fiee_cast_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1987,18 +2093,132 @@ func (x *OAuthYoutubeResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use OAuthYoutubeResp.ProtoReflect.Descriptor instead. -func (*OAuthYoutubeResp) Descriptor() ([]byte, []int) { - return file_pb_fiee_cast_proto_rawDescGZIP(), []int{23} +// Deprecated: Use OAuthYoutubeUrlResp.ProtoReflect.Descriptor instead. +func (*OAuthYoutubeUrlResp) Descriptor() ([]byte, []int) { + return file_pb_fiee_cast_proto_rawDescGZIP(), []int{25} } -func (x *OAuthYoutubeResp) GetUrl() string { +func (x *OAuthYoutubeUrlResp) GetUrl() string { if x != nil { return x.Url } return "" } +type OAuthYoutubeTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MediaAccountUuid string `protobuf:"bytes,1,opt,name=mediaAccountUuid,proto3" json:"mediaAccountUuid"` + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code"` +} + +func (x *OAuthYoutubeTokenReq) Reset() { + *x = OAuthYoutubeTokenReq{} + mi := &file_pb_fiee_cast_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OAuthYoutubeTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OAuthYoutubeTokenReq) ProtoMessage() {} + +func (x *OAuthYoutubeTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_fiee_cast_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OAuthYoutubeTokenReq.ProtoReflect.Descriptor instead. +func (*OAuthYoutubeTokenReq) Descriptor() ([]byte, []int) { + return file_pb_fiee_cast_proto_rawDescGZIP(), []int{26} +} + +func (x *OAuthYoutubeTokenReq) GetMediaAccountUuid() string { + if x != nil { + return x.MediaAccountUuid + } + return "" +} + +func (x *OAuthYoutubeTokenReq) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type OAuthYoutubeTokenResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccessToken string `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken"` + RefreshToken string `protobuf:"bytes,2,opt,name=refreshToken,proto3" json:"refreshToken"` + ExpireTime int64 `protobuf:"varint,3,opt,name=expireTime,proto3" json:"expireTime"` +} + +func (x *OAuthYoutubeTokenResp) Reset() { + *x = OAuthYoutubeTokenResp{} + mi := &file_pb_fiee_cast_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OAuthYoutubeTokenResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OAuthYoutubeTokenResp) ProtoMessage() {} + +func (x *OAuthYoutubeTokenResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_fiee_cast_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OAuthYoutubeTokenResp.ProtoReflect.Descriptor instead. +func (*OAuthYoutubeTokenResp) Descriptor() ([]byte, []int) { + return file_pb_fiee_cast_proto_rawDescGZIP(), []int{27} +} + +func (x *OAuthYoutubeTokenResp) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *OAuthYoutubeTokenResp) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *OAuthYoutubeTokenResp) GetExpireTime() int64 { + if x != nil { + return x.ExpireTime + } + return 0 +} + type WorkListResp_Info struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2020,7 +2240,7 @@ type WorkListResp_Info struct { func (x *WorkListResp_Info) Reset() { *x = WorkListResp_Info{} - mi := &file_pb_fiee_cast_proto_msgTypes[24] + mi := &file_pb_fiee_cast_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2032,7 +2252,7 @@ func (x *WorkListResp_Info) String() string { func (*WorkListResp_Info) ProtoMessage() {} func (x *WorkListResp_Info) ProtoReflect() protoreflect.Message { - mi := &file_pb_fiee_cast_proto_msgTypes[24] + mi := &file_pb_fiee_cast_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2147,7 +2367,7 @@ type MediaAccountsResp_Info struct { func (x *MediaAccountsResp_Info) Reset() { *x = MediaAccountsResp_Info{} - mi := &file_pb_fiee_cast_proto_msgTypes[26] + mi := &file_pb_fiee_cast_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2159,7 +2379,7 @@ func (x *MediaAccountsResp_Info) String() string { func (*MediaAccountsResp_Info) ProtoMessage() {} func (x *MediaAccountsResp_Info) ProtoReflect() protoreflect.Message { - mi := &file_pb_fiee_cast_proto_msgTypes[26] + mi := &file_pb_fiee_cast_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2236,7 +2456,7 @@ type MediaWorksResp_Info struct { func (x *MediaWorksResp_Info) Reset() { *x = MediaWorksResp_Info{} - mi := &file_pb_fiee_cast_proto_msgTypes[27] + mi := &file_pb_fiee_cast_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2248,7 +2468,7 @@ func (x *MediaWorksResp_Info) String() string { func (*MediaWorksResp_Info) ProtoMessage() {} func (x *MediaWorksResp_Info) ProtoReflect() protoreflect.Message { - mi := &file_pb_fiee_cast_proto_msgTypes[27] + mi := &file_pb_fiee_cast_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2715,72 +2935,108 @@ var file_pb_fiee_cast_proto_rawDesc = []byte{ 0x76, 0x69, 0x64, 0x65, 0x6f, 0x55, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x55, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x76, 0x65, - 0x72, 0x55, 0x72, 0x6c, 0x22, 0x25, 0x0a, 0x0f, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, - 0x74, 0x75, 0x62, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x4f, - 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, - 0x6c, 0x2a, 0x3f, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x45, - 0x4e, 0x55, 0x4d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x49, 0x4b, 0x54, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, - 0x59, 0x4f, 0x55, 0x54, 0x55, 0x42, 0x45, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x53, - 0x10, 0x03, 0x2a, 0x62, 0x0a, 0x0e, 0x57, 0x6f, 0x72, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x4e, 0x55, 0x4d, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, - 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x10, 0x01, - 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x11, - 0x0a, 0x0d, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x10, - 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x52, 0x45, - 0x4a, 0x45, 0x43, 0x54, 0x10, 0x04, 0x32, 0xa4, 0x06, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x74, 0x12, - 0x42, 0x0a, 0x0d, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x16, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x55, 0x73, 0x65, - 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, - 0x4d, 0x65, 0x64, 0x69, 0x61, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x64, - 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x43, 0x61, 0x73, 0x74, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0d, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, - 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0b, 0x42, 0x69, 0x6e, - 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, - 0x42, 0x69, 0x6e, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x16, + 0x72, 0x55, 0x72, 0x6c, 0x22, 0x86, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x75, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x75, 0x69, + 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x55, 0x75, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, 0x73, 0x12, + 0x2c, 0x0a, 0x11, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x2f, 0x0a, + 0x0d, 0x52, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, + 0x0a, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x75, 0x69, 0x64, 0x22, 0x40, + 0x0a, 0x12, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x55, 0x72, + 0x6c, 0x52, 0x65, 0x71, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, + 0x22, 0x27, 0x0a, 0x13, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, + 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x56, 0x0a, 0x14, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x55, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x65, 0x64, + 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x22, 0x7d, 0x0a, 0x15, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x22, 0x0a, 0x0c, + 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x2a, 0x3f, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x45, 0x4e, + 0x55, 0x4d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x54, 0x49, 0x4b, 0x54, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x59, + 0x4f, 0x55, 0x54, 0x55, 0x42, 0x45, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x53, 0x10, + 0x03, 0x2a, 0x62, 0x0a, 0x0e, 0x57, 0x6f, 0x72, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, + 0x4e, 0x55, 0x4d, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x10, 0x01, 0x12, + 0x0c, 0x0a, 0x08, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x11, 0x0a, + 0x0d, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x10, 0x03, + 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x52, 0x45, 0x4a, + 0x45, 0x43, 0x54, 0x10, 0x04, 0x32, 0xb5, 0x07, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x74, 0x12, 0x42, + 0x0a, 0x0d, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x16, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x55, 0x73, 0x65, 0x72, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, + 0x65, 0x64, 0x69, 0x61, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x51, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x64, 0x69, + 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0d, 0x55, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x6e, + 0x62, 0x69, 0x6e, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x2e, 0x43, 0x61, - 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, - 0x56, 0x69, 0x64, 0x65, 0x6f, 0x12, 0x18, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, 0x1a, - 0x19, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, - 0x6b, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x08, - 0x57, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, - 0x57, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x43, 0x61, - 0x73, 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, - 0x13, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x2e, 0x43, - 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, - 0x0d, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x16, - 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, - 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x39, 0x0a, 0x0a, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x12, - 0x13, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x57, 0x6f, 0x72, 0x6b, - 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, - 0x61, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0c, - 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x12, 0x15, 0x2e, 0x43, - 0x61, 0x73, 0x74, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, - 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, - 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0d, 0x5a, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0b, 0x42, 0x69, 0x6e, 0x64, + 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x42, + 0x69, 0x6e, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x2e, 0x43, 0x61, 0x73, + 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x48, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x56, + 0x69, 0x64, 0x65, 0x6f, 0x12, 0x18, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x19, + 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, + 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x08, 0x57, + 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x57, + 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x43, 0x61, 0x73, + 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, + 0x12, 0x39, 0x0a, 0x0a, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x13, + 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x2e, 0x43, 0x61, + 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0d, + 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x2e, + 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, + 0x69, 0x61, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, + 0x12, 0x39, 0x0a, 0x0a, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x12, 0x13, + 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x57, 0x6f, 0x72, 0x6b, 0x73, + 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x09, 0x52, + 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x12, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, + 0x52, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x43, + 0x61, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0f, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, + 0x75, 0x62, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x18, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4f, 0x41, + 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x71, + 0x1a, 0x19, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, + 0x74, 0x75, 0x62, 0x65, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x4e, 0x0a, + 0x11, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x1a, 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, + 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1b, + 0x2e, 0x43, 0x61, 0x73, 0x74, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x59, 0x6f, 0x75, 0x74, 0x75, + 0x62, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x63, 0x61, 0x73, 0x74, 0x3b, 0x63, 0x61, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } @@ -2798,7 +3054,7 @@ func file_pb_fiee_cast_proto_rawDescGZIP() []byte { } var file_pb_fiee_cast_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_pb_fiee_cast_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_pb_fiee_cast_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_pb_fiee_cast_proto_goTypes = []any{ (PlatformIDENUM)(0), // 0: Cast.PlatformIDENUM (WorkActionENUM)(0), // 1: Cast.WorkActionENUM @@ -2824,13 +3080,17 @@ var file_pb_fiee_cast_proto_goTypes = []any{ (*MediaAccountsResp)(nil), // 21: Cast.MediaAccountsResp (*MediaWorksReq)(nil), // 22: Cast.MediaWorksReq (*MediaWorksResp)(nil), // 23: Cast.MediaWorksResp - (*OAuthYoutubeReq)(nil), // 24: Cast.OAuthYoutubeReq - (*OAuthYoutubeResp)(nil), // 25: Cast.OAuthYoutubeResp - (*WorkListResp_Info)(nil), // 26: Cast.WorkListResp.Info - nil, // 27: Cast.WorkDetailResp.MediaAccDataEntry - (*MediaAccountsResp_Info)(nil), // 28: Cast.MediaAccountsResp.Info - (*MediaWorksResp_Info)(nil), // 29: Cast.MediaWorksResp.Info - (*emptypb.Empty)(nil), // 30: google.protobuf.Empty + (*RePublishReq)(nil), // 24: Cast.RePublishReq + (*RePublishResp)(nil), // 25: Cast.RePublishResp + (*OAuthYoutubeUrlReq)(nil), // 26: Cast.OAuthYoutubeUrlReq + (*OAuthYoutubeUrlResp)(nil), // 27: Cast.OAuthYoutubeUrlResp + (*OAuthYoutubeTokenReq)(nil), // 28: Cast.OAuthYoutubeTokenReq + (*OAuthYoutubeTokenResp)(nil), // 29: Cast.OAuthYoutubeTokenResp + (*WorkListResp_Info)(nil), // 30: Cast.WorkListResp.Info + nil, // 31: Cast.WorkDetailResp.MediaAccDataEntry + (*MediaAccountsResp_Info)(nil), // 32: Cast.MediaAccountsResp.Info + (*MediaWorksResp_Info)(nil), // 33: Cast.MediaWorksResp.Info + (*emptypb.Empty)(nil), // 34: google.protobuf.Empty } var file_pb_fiee_cast_proto_depIdxs = []int32{ 0, // 0: Cast.MediaUserListReq.platformID:type_name -> Cast.PlatformIDENUM @@ -2844,15 +3104,15 @@ var file_pb_fiee_cast_proto_depIdxs = []int32{ 11, // 8: Cast.UpdateWorkVideoReq.publishConfig1:type_name -> Cast.PublishConfig 11, // 9: Cast.UpdateWorkVideoReq.publishConfig2:type_name -> Cast.PublishConfig 11, // 10: Cast.UpdateWorkVideoReq.publishConfig3:type_name -> Cast.PublishConfig - 26, // 11: Cast.WorkListResp.data:type_name -> Cast.WorkListResp.Info + 30, // 11: Cast.WorkListResp.data:type_name -> Cast.WorkListResp.Info 11, // 12: Cast.WorkDetailResp.publishConfig1:type_name -> Cast.PublishConfig 11, // 13: Cast.WorkDetailResp.publishConfig2:type_name -> Cast.PublishConfig 11, // 14: Cast.WorkDetailResp.publishConfig3:type_name -> Cast.PublishConfig 17, // 15: Cast.WorkDetailResp.WorkLogData:type_name -> Cast.WorkLogInfo - 27, // 16: Cast.WorkDetailResp.mediaAccData:type_name -> Cast.WorkDetailResp.MediaAccDataEntry + 31, // 16: Cast.WorkDetailResp.mediaAccData:type_name -> Cast.WorkDetailResp.MediaAccDataEntry 1, // 17: Cast.UpdateStatusReq.workAction:type_name -> Cast.WorkActionENUM - 28, // 18: Cast.MediaAccountsResp.data:type_name -> Cast.MediaAccountsResp.Info - 29, // 19: Cast.MediaWorksResp.data:type_name -> Cast.MediaWorksResp.Info + 32, // 18: Cast.MediaAccountsResp.data:type_name -> Cast.MediaAccountsResp.Info + 33, // 19: Cast.MediaWorksResp.data:type_name -> Cast.MediaWorksResp.Info 3, // 20: Cast.WorkDetailResp.MediaAccDataEntry.value:type_name -> Cast.MediaUserInfo 2, // 21: Cast.Cast.MediaUserList:input_type -> Cast.MediaUserListReq 5, // 22: Cast.Cast.UpdateMediaAccount:input_type -> Cast.UpdateMediaAccountReq @@ -2865,21 +3125,25 @@ var file_pb_fiee_cast_proto_depIdxs = []int32{ 19, // 29: Cast.Cast.UpdateStatus:input_type -> Cast.UpdateStatusReq 20, // 30: Cast.Cast.MediaAccounts:input_type -> Cast.MediaAccountsReq 22, // 31: Cast.Cast.MediaWorks:input_type -> Cast.MediaWorksReq - 24, // 32: Cast.Cast.OAuthYoutube:input_type -> Cast.OAuthYoutubeReq - 4, // 33: Cast.Cast.MediaUserList:output_type -> Cast.MediaUserListResp - 6, // 34: Cast.Cast.UpdateMediaAccount:output_type -> Cast.UpdateMediaAccountResp - 30, // 35: Cast.Cast.UnbindManager:output_type -> google.protobuf.Empty - 30, // 36: Cast.Cast.BindManager:output_type -> google.protobuf.Empty - 10, // 37: Cast.Cast.UpdateWorkImage:output_type -> Cast.UpdateWorkImageResp - 13, // 38: Cast.Cast.UpdateWorkVideo:output_type -> Cast.UpdateWorkVideoResp - 15, // 39: Cast.Cast.WorkList:output_type -> Cast.WorkListResp - 18, // 40: Cast.Cast.WorkDetail:output_type -> Cast.WorkDetailResp - 30, // 41: Cast.Cast.UpdateStatus:output_type -> google.protobuf.Empty - 21, // 42: Cast.Cast.MediaAccounts:output_type -> Cast.MediaAccountsResp - 23, // 43: Cast.Cast.MediaWorks:output_type -> Cast.MediaWorksResp - 25, // 44: Cast.Cast.OAuthYoutube:output_type -> Cast.OAuthYoutubeResp - 33, // [33:45] is the sub-list for method output_type - 21, // [21:33] is the sub-list for method input_type + 24, // 32: Cast.Cast.RePublish:input_type -> Cast.RePublishReq + 26, // 33: Cast.Cast.OAuthYoutubeUrl:input_type -> Cast.OAuthYoutubeUrlReq + 28, // 34: Cast.Cast.OAuthYoutubeToken:input_type -> Cast.OAuthYoutubeTokenReq + 4, // 35: Cast.Cast.MediaUserList:output_type -> Cast.MediaUserListResp + 6, // 36: Cast.Cast.UpdateMediaAccount:output_type -> Cast.UpdateMediaAccountResp + 34, // 37: Cast.Cast.UnbindManager:output_type -> google.protobuf.Empty + 34, // 38: Cast.Cast.BindManager:output_type -> google.protobuf.Empty + 10, // 39: Cast.Cast.UpdateWorkImage:output_type -> Cast.UpdateWorkImageResp + 13, // 40: Cast.Cast.UpdateWorkVideo:output_type -> Cast.UpdateWorkVideoResp + 15, // 41: Cast.Cast.WorkList:output_type -> Cast.WorkListResp + 18, // 42: Cast.Cast.WorkDetail:output_type -> Cast.WorkDetailResp + 34, // 43: Cast.Cast.UpdateStatus:output_type -> google.protobuf.Empty + 21, // 44: Cast.Cast.MediaAccounts:output_type -> Cast.MediaAccountsResp + 23, // 45: Cast.Cast.MediaWorks:output_type -> Cast.MediaWorksResp + 25, // 46: Cast.Cast.RePublish:output_type -> Cast.RePublishResp + 27, // 47: Cast.Cast.OAuthYoutubeUrl:output_type -> Cast.OAuthYoutubeUrlResp + 29, // 48: Cast.Cast.OAuthYoutubeToken:output_type -> Cast.OAuthYoutubeTokenResp + 35, // [35:49] is the sub-list for method output_type + 21, // [21:35] is the sub-list for method input_type 21, // [21:21] is the sub-list for extension type_name 21, // [21:21] is the sub-list for extension extendee 0, // [0:21] is the sub-list for field type_name @@ -2896,7 +3160,7 @@ func file_pb_fiee_cast_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pb_fiee_cast_proto_rawDesc, NumEnums: 2, - NumMessages: 28, + NumMessages: 32, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cast/cast.pb.validate.go b/api/cast/cast.pb.validate.go index 2d9b7d7..2f47498 100644 --- a/api/cast/cast.pb.validate.go +++ b/api/cast/cast.pb.validate.go @@ -2913,44 +2913,43 @@ var _ interface { ErrorName() string } = MediaWorksRespValidationError{} -// Validate checks the field values on OAuthYoutubeReq with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *OAuthYoutubeReq) Validate() error { +// Validate checks the field values on RePublishReq with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *RePublishReq) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on OAuthYoutubeReq with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// OAuthYoutubeReqMultiError, or nil if none found. -func (m *OAuthYoutubeReq) ValidateAll() error { +// ValidateAll checks the field values on RePublishReq with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RePublishReqMultiError, or +// nil if none found. +func (m *RePublishReq) ValidateAll() error { return m.validate(true) } -func (m *OAuthYoutubeReq) validate(all bool) error { +func (m *RePublishReq) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for Code + // no validation rules for WorkUuid if len(errors) > 0 { - return OAuthYoutubeReqMultiError(errors) + return RePublishReqMultiError(errors) } return nil } -// OAuthYoutubeReqMultiError is an error wrapping multiple validation errors -// returned by OAuthYoutubeReq.ValidateAll() if the designated constraints -// aren't met. -type OAuthYoutubeReqMultiError []error +// RePublishReqMultiError is an error wrapping multiple validation errors +// returned by RePublishReq.ValidateAll() if the designated constraints aren't met. +type RePublishReqMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m OAuthYoutubeReqMultiError) Error() string { +func (m RePublishReqMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -2959,11 +2958,11 @@ func (m OAuthYoutubeReqMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m OAuthYoutubeReqMultiError) AllErrors() []error { return m } +func (m RePublishReqMultiError) AllErrors() []error { return m } -// OAuthYoutubeReqValidationError is the validation error returned by -// OAuthYoutubeReq.Validate if the designated constraints aren't met. -type OAuthYoutubeReqValidationError struct { +// RePublishReqValidationError is the validation error returned by +// RePublishReq.Validate if the designated constraints aren't met. +type RePublishReqValidationError struct { field string reason string cause error @@ -2971,22 +2970,22 @@ type OAuthYoutubeReqValidationError struct { } // Field function returns field value. -func (e OAuthYoutubeReqValidationError) Field() string { return e.field } +func (e RePublishReqValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e OAuthYoutubeReqValidationError) Reason() string { return e.reason } +func (e RePublishReqValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e OAuthYoutubeReqValidationError) Cause() error { return e.cause } +func (e RePublishReqValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e OAuthYoutubeReqValidationError) Key() bool { return e.key } +func (e RePublishReqValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e OAuthYoutubeReqValidationError) ErrorName() string { return "OAuthYoutubeReqValidationError" } +func (e RePublishReqValidationError) ErrorName() string { return "RePublishReqValidationError" } // Error satisfies the builtin error interface -func (e OAuthYoutubeReqValidationError) Error() string { +func (e RePublishReqValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2998,14 +2997,14 @@ func (e OAuthYoutubeReqValidationError) Error() string { } return fmt.Sprintf( - "invalid %sOAuthYoutubeReq.%s: %s%s", + "invalid %sRePublishReq.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = OAuthYoutubeReqValidationError{} +var _ error = RePublishReqValidationError{} var _ interface { Field() string @@ -3013,24 +3012,230 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = OAuthYoutubeReqValidationError{} +} = RePublishReqValidationError{} -// Validate checks the field values on OAuthYoutubeResp with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *OAuthYoutubeResp) Validate() error { +// Validate checks the field values on RePublishResp with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *RePublishResp) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on OAuthYoutubeResp with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// OAuthYoutubeRespMultiError, or nil if none found. -func (m *OAuthYoutubeResp) ValidateAll() error { +// ValidateAll checks the field values on RePublishResp with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in RePublishRespMultiError, or +// nil if none found. +func (m *RePublishResp) ValidateAll() error { return m.validate(true) } -func (m *OAuthYoutubeResp) validate(all bool) error { +func (m *RePublishResp) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for ArtistUuid + + if len(errors) > 0 { + return RePublishRespMultiError(errors) + } + + return nil +} + +// RePublishRespMultiError is an error wrapping multiple validation errors +// returned by RePublishResp.ValidateAll() if the designated constraints +// aren't met. +type RePublishRespMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RePublishRespMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RePublishRespMultiError) AllErrors() []error { return m } + +// RePublishRespValidationError is the validation error returned by +// RePublishResp.Validate if the designated constraints aren't met. +type RePublishRespValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RePublishRespValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RePublishRespValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RePublishRespValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RePublishRespValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RePublishRespValidationError) ErrorName() string { return "RePublishRespValidationError" } + +// Error satisfies the builtin error interface +func (e RePublishRespValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRePublishResp.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RePublishRespValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RePublishRespValidationError{} + +// Validate checks the field values on OAuthYoutubeUrlReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *OAuthYoutubeUrlReq) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OAuthYoutubeUrlReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// OAuthYoutubeUrlReqMultiError, or nil if none found. +func (m *OAuthYoutubeUrlReq) ValidateAll() error { + return m.validate(true) +} + +func (m *OAuthYoutubeUrlReq) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for MediaAccountUuid + + if len(errors) > 0 { + return OAuthYoutubeUrlReqMultiError(errors) + } + + return nil +} + +// OAuthYoutubeUrlReqMultiError is an error wrapping multiple validation errors +// returned by OAuthYoutubeUrlReq.ValidateAll() if the designated constraints +// aren't met. +type OAuthYoutubeUrlReqMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OAuthYoutubeUrlReqMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OAuthYoutubeUrlReqMultiError) AllErrors() []error { return m } + +// OAuthYoutubeUrlReqValidationError is the validation error returned by +// OAuthYoutubeUrlReq.Validate if the designated constraints aren't met. +type OAuthYoutubeUrlReqValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OAuthYoutubeUrlReqValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OAuthYoutubeUrlReqValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OAuthYoutubeUrlReqValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OAuthYoutubeUrlReqValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OAuthYoutubeUrlReqValidationError) ErrorName() string { + return "OAuthYoutubeUrlReqValidationError" +} + +// Error satisfies the builtin error interface +func (e OAuthYoutubeUrlReqValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOAuthYoutubeUrlReq.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OAuthYoutubeUrlReqValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OAuthYoutubeUrlReqValidationError{} + +// Validate checks the field values on OAuthYoutubeUrlResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *OAuthYoutubeUrlResp) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OAuthYoutubeUrlResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// OAuthYoutubeUrlRespMultiError, or nil if none found. +func (m *OAuthYoutubeUrlResp) ValidateAll() error { + return m.validate(true) +} + +func (m *OAuthYoutubeUrlResp) validate(all bool) error { if m == nil { return nil } @@ -3040,19 +3245,19 @@ func (m *OAuthYoutubeResp) validate(all bool) error { // no validation rules for Url if len(errors) > 0 { - return OAuthYoutubeRespMultiError(errors) + return OAuthYoutubeUrlRespMultiError(errors) } return nil } -// OAuthYoutubeRespMultiError is an error wrapping multiple validation errors -// returned by OAuthYoutubeResp.ValidateAll() if the designated constraints -// aren't met. -type OAuthYoutubeRespMultiError []error +// OAuthYoutubeUrlRespMultiError is an error wrapping multiple validation +// errors returned by OAuthYoutubeUrlResp.ValidateAll() if the designated +// constraints aren't met. +type OAuthYoutubeUrlRespMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m OAuthYoutubeRespMultiError) Error() string { +func (m OAuthYoutubeUrlRespMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -3061,11 +3266,11 @@ func (m OAuthYoutubeRespMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m OAuthYoutubeRespMultiError) AllErrors() []error { return m } +func (m OAuthYoutubeUrlRespMultiError) AllErrors() []error { return m } -// OAuthYoutubeRespValidationError is the validation error returned by -// OAuthYoutubeResp.Validate if the designated constraints aren't met. -type OAuthYoutubeRespValidationError struct { +// OAuthYoutubeUrlRespValidationError is the validation error returned by +// OAuthYoutubeUrlResp.Validate if the designated constraints aren't met. +type OAuthYoutubeUrlRespValidationError struct { field string reason string cause error @@ -3073,22 +3278,24 @@ type OAuthYoutubeRespValidationError struct { } // Field function returns field value. -func (e OAuthYoutubeRespValidationError) Field() string { return e.field } +func (e OAuthYoutubeUrlRespValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e OAuthYoutubeRespValidationError) Reason() string { return e.reason } +func (e OAuthYoutubeUrlRespValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e OAuthYoutubeRespValidationError) Cause() error { return e.cause } +func (e OAuthYoutubeUrlRespValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e OAuthYoutubeRespValidationError) Key() bool { return e.key } +func (e OAuthYoutubeUrlRespValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e OAuthYoutubeRespValidationError) ErrorName() string { return "OAuthYoutubeRespValidationError" } +func (e OAuthYoutubeUrlRespValidationError) ErrorName() string { + return "OAuthYoutubeUrlRespValidationError" +} // Error satisfies the builtin error interface -func (e OAuthYoutubeRespValidationError) Error() string { +func (e OAuthYoutubeUrlRespValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -3100,14 +3307,14 @@ func (e OAuthYoutubeRespValidationError) Error() string { } return fmt.Sprintf( - "invalid %sOAuthYoutubeResp.%s: %s%s", + "invalid %sOAuthYoutubeUrlResp.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = OAuthYoutubeRespValidationError{} +var _ error = OAuthYoutubeUrlRespValidationError{} var _ interface { Field() string @@ -3115,7 +3322,221 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = OAuthYoutubeRespValidationError{} +} = OAuthYoutubeUrlRespValidationError{} + +// Validate checks the field values on OAuthYoutubeTokenReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *OAuthYoutubeTokenReq) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OAuthYoutubeTokenReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// OAuthYoutubeTokenReqMultiError, or nil if none found. +func (m *OAuthYoutubeTokenReq) ValidateAll() error { + return m.validate(true) +} + +func (m *OAuthYoutubeTokenReq) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for MediaAccountUuid + + // no validation rules for Code + + if len(errors) > 0 { + return OAuthYoutubeTokenReqMultiError(errors) + } + + return nil +} + +// OAuthYoutubeTokenReqMultiError is an error wrapping multiple validation +// errors returned by OAuthYoutubeTokenReq.ValidateAll() if the designated +// constraints aren't met. +type OAuthYoutubeTokenReqMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OAuthYoutubeTokenReqMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OAuthYoutubeTokenReqMultiError) AllErrors() []error { return m } + +// OAuthYoutubeTokenReqValidationError is the validation error returned by +// OAuthYoutubeTokenReq.Validate if the designated constraints aren't met. +type OAuthYoutubeTokenReqValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OAuthYoutubeTokenReqValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OAuthYoutubeTokenReqValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OAuthYoutubeTokenReqValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OAuthYoutubeTokenReqValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OAuthYoutubeTokenReqValidationError) ErrorName() string { + return "OAuthYoutubeTokenReqValidationError" +} + +// Error satisfies the builtin error interface +func (e OAuthYoutubeTokenReqValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOAuthYoutubeTokenReq.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OAuthYoutubeTokenReqValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OAuthYoutubeTokenReqValidationError{} + +// Validate checks the field values on OAuthYoutubeTokenResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *OAuthYoutubeTokenResp) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on OAuthYoutubeTokenResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// OAuthYoutubeTokenRespMultiError, or nil if none found. +func (m *OAuthYoutubeTokenResp) ValidateAll() error { + return m.validate(true) +} + +func (m *OAuthYoutubeTokenResp) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for AccessToken + + // no validation rules for RefreshToken + + // no validation rules for ExpireTime + + if len(errors) > 0 { + return OAuthYoutubeTokenRespMultiError(errors) + } + + return nil +} + +// OAuthYoutubeTokenRespMultiError is an error wrapping multiple validation +// errors returned by OAuthYoutubeTokenResp.ValidateAll() if the designated +// constraints aren't met. +type OAuthYoutubeTokenRespMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m OAuthYoutubeTokenRespMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m OAuthYoutubeTokenRespMultiError) AllErrors() []error { return m } + +// OAuthYoutubeTokenRespValidationError is the validation error returned by +// OAuthYoutubeTokenResp.Validate if the designated constraints aren't met. +type OAuthYoutubeTokenRespValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e OAuthYoutubeTokenRespValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e OAuthYoutubeTokenRespValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e OAuthYoutubeTokenRespValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e OAuthYoutubeTokenRespValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e OAuthYoutubeTokenRespValidationError) ErrorName() string { + return "OAuthYoutubeTokenRespValidationError" +} + +// Error satisfies the builtin error interface +func (e OAuthYoutubeTokenRespValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sOAuthYoutubeTokenResp.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = OAuthYoutubeTokenRespValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = OAuthYoutubeTokenRespValidationError{} // Validate checks the field values on WorkListResp_Info with the rules defined // in the proto definition for this message. If any rules are violated, the diff --git a/api/cast/cast_triple.pb.go b/api/cast/cast_triple.pb.go index 4b9bbb1..a87eb6c 100644 --- a/api/cast/cast_triple.pb.go +++ b/api/cast/cast_triple.pb.go @@ -40,7 +40,9 @@ type CastClient interface { UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) MediaAccounts(ctx context.Context, in *MediaAccountsReq, opts ...grpc_go.CallOption) (*MediaAccountsResp, common.ErrorWithAttachment) MediaWorks(ctx context.Context, in *MediaWorksReq, opts ...grpc_go.CallOption) (*MediaWorksResp, common.ErrorWithAttachment) - OAuthYoutube(ctx context.Context, in *OAuthYoutubeReq, opts ...grpc_go.CallOption) (*OAuthYoutubeResp, common.ErrorWithAttachment) + RePublish(ctx context.Context, in *RePublishReq, opts ...grpc_go.CallOption) (*RePublishResp, common.ErrorWithAttachment) + OAuthYoutubeUrl(ctx context.Context, in *OAuthYoutubeUrlReq, opts ...grpc_go.CallOption) (*OAuthYoutubeUrlResp, common.ErrorWithAttachment) + OAuthYoutubeToken(ctx context.Context, in *OAuthYoutubeTokenReq, opts ...grpc_go.CallOption) (*OAuthYoutubeTokenResp, common.ErrorWithAttachment) } type castClient struct { @@ -59,7 +61,9 @@ type CastClientImpl struct { UpdateStatus func(ctx context.Context, in *UpdateStatusReq) (*emptypb.Empty, error) MediaAccounts func(ctx context.Context, in *MediaAccountsReq) (*MediaAccountsResp, error) MediaWorks func(ctx context.Context, in *MediaWorksReq) (*MediaWorksResp, error) - OAuthYoutube func(ctx context.Context, in *OAuthYoutubeReq) (*OAuthYoutubeResp, error) + RePublish func(ctx context.Context, in *RePublishReq) (*RePublishResp, error) + OAuthYoutubeUrl func(ctx context.Context, in *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error) + OAuthYoutubeToken func(ctx context.Context, in *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error) } func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient { @@ -140,10 +144,22 @@ func (c *castClient) MediaWorks(ctx context.Context, in *MediaWorksReq, opts ... return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaWorks", in, out) } -func (c *castClient) OAuthYoutube(ctx context.Context, in *OAuthYoutubeReq, opts ...grpc_go.CallOption) (*OAuthYoutubeResp, common.ErrorWithAttachment) { - out := new(OAuthYoutubeResp) +func (c *castClient) RePublish(ctx context.Context, in *RePublishReq, opts ...grpc_go.CallOption) (*RePublishResp, common.ErrorWithAttachment) { + out := new(RePublishResp) interfaceKey := ctx.Value(constant.InterfaceKey).(string) - return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthYoutube", in, out) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/RePublish", in, out) +} + +func (c *castClient) OAuthYoutubeUrl(ctx context.Context, in *OAuthYoutubeUrlReq, opts ...grpc_go.CallOption) (*OAuthYoutubeUrlResp, common.ErrorWithAttachment) { + out := new(OAuthYoutubeUrlResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthYoutubeUrl", in, out) +} + +func (c *castClient) OAuthYoutubeToken(ctx context.Context, in *OAuthYoutubeTokenReq, opts ...grpc_go.CallOption) (*OAuthYoutubeTokenResp, common.ErrorWithAttachment) { + out := new(OAuthYoutubeTokenResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthYoutubeToken", in, out) } // CastServer is the server API for Cast service. @@ -161,7 +177,9 @@ type CastServer interface { UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error) MediaAccounts(context.Context, *MediaAccountsReq) (*MediaAccountsResp, error) MediaWorks(context.Context, *MediaWorksReq) (*MediaWorksResp, error) - OAuthYoutube(context.Context, *OAuthYoutubeReq) (*OAuthYoutubeResp, error) + RePublish(context.Context, *RePublishReq) (*RePublishResp, error) + OAuthYoutubeUrl(context.Context, *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error) + OAuthYoutubeToken(context.Context, *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error) mustEmbedUnimplementedCastServer() } @@ -203,8 +221,14 @@ func (UnimplementedCastServer) MediaAccounts(context.Context, *MediaAccountsReq) func (UnimplementedCastServer) MediaWorks(context.Context, *MediaWorksReq) (*MediaWorksResp, error) { return nil, status.Errorf(codes.Unimplemented, "method MediaWorks not implemented") } -func (UnimplementedCastServer) OAuthYoutube(context.Context, *OAuthYoutubeReq) (*OAuthYoutubeResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method OAuthYoutube not implemented") +func (UnimplementedCastServer) RePublish(context.Context, *RePublishReq) (*RePublishResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RePublish not implemented") +} +func (UnimplementedCastServer) OAuthYoutubeUrl(context.Context, *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method OAuthYoutubeUrl not implemented") +} +func (UnimplementedCastServer) OAuthYoutubeToken(context.Context, *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method OAuthYoutubeToken not implemented") } func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) { s.proxyImpl = impl @@ -553,8 +577,8 @@ func _Cast_MediaWorks_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Cast_OAuthYoutube_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { - in := new(OAuthYoutubeReq) +func _Cast_RePublish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(RePublishReq) if err := dec(in); err != nil { return nil, err } @@ -566,7 +590,65 @@ func _Cast_OAuthYoutube_Handler(srv interface{}, ctx context.Context, dec func(i for k, v := range md { invAttachment[k] = v } - invo := invocation.NewRPCInvocation("OAuthYoutube", args, invAttachment) + invo := invocation.NewRPCInvocation("RePublish", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cast_OAuthYoutubeUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(OAuthYoutubeUrlReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("OAuthYoutubeUrl", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cast_OAuthYoutubeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(OAuthYoutubeTokenReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("OAuthYoutubeToken", args, invAttachment) if interceptor == nil { result := base.XXX_GetProxyImpl().Invoke(ctx, invo) return result, result.Error() @@ -634,8 +716,16 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{ Handler: _Cast_MediaWorks_Handler, }, { - MethodName: "OAuthYoutube", - Handler: _Cast_OAuthYoutube_Handler, + MethodName: "RePublish", + Handler: _Cast_RePublish_Handler, + }, + { + MethodName: "OAuthYoutubeUrl", + Handler: _Cast_OAuthYoutubeUrl_Handler, + }, + { + MethodName: "OAuthYoutubeToken", + Handler: _Cast_OAuthYoutubeToken_Handler, }, }, Streams: []grpc_go.StreamDesc{}, diff --git a/pkg/router/media.go b/pkg/router/media.go index 3c15bbc..3195b52 100644 --- a/pkg/router/media.go +++ b/pkg/router/media.go @@ -17,7 +17,11 @@ func MediaRouter(r *gin.RouterGroup) { media.POST("unbind-manager", serviceCast.UnbindManager) media.POST("bind-manager", serviceCast.BindManager) media.POST("update-account", serviceCast.UpdateMediaAccount) - media.POST("oauth-platform", serviceCast.OAuthPlatform) + media.POST("oauth-url", serviceCast.OAuthUrl) + } + mediaNoLogin := r.Group("media") + { + mediaNoLogin.GET("oauth2callback", serviceCast.OAuth2Callback) } work := auth.Group("work") @@ -27,5 +31,6 @@ func MediaRouter(r *gin.RouterGroup) { work.POST("update-approval", serviceCast.UpdateApproval) work.POST("list", serviceCast.WorkList) work.POST("detail", serviceCast.WorkDetail) + work.POST("republish", serviceCast.RePublish) } } diff --git a/pkg/service/cast/media.go b/pkg/service/cast/media.go index eb57569..9484f9a 100644 --- a/pkg/service/cast/media.go +++ b/pkg/service/cast/media.go @@ -116,3 +116,40 @@ func UpdateMediaAccount(ctx *gin.Context) { service.Success(ctx, resp) return } + +func OAuthUrl(ctx *gin.Context) { + var req *cast.OAuthYoutubeUrlReq + var resp *cast.OAuthYoutubeUrlResp + var err error + if err = ctx.ShouldBind(&req); err != nil { + service.Error(ctx, err) + return + } + if err = req.Validate(); err != nil { + service.Error(ctx, err) + return + } + if resp, err = service.CastProvider.OAuthYoutubeUrl(ctx, req); err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) + return +} + +func OAuth2Callback(ctx *gin.Context) { + code := ctx.Query("code") + state := ctx.Query("state") + //scope := ctx.Query("scope") + resp, err := service.CastProvider.OAuthYoutubeToken(ctx, &cast.OAuthYoutubeTokenReq{ + MediaAccountUuid: state, + Code: code, + //scope: scope, + }) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) + return +} diff --git a/pkg/service/cast/oauth.go b/pkg/service/cast/oauth.go index 5890181..4e6c8aa 100644 --- a/pkg/service/cast/oauth.go +++ b/pkg/service/cast/oauth.go @@ -1,37 +1 @@ package cast - -import ( - "fonchain-fiee/api/cast" - "fonchain-fiee/pkg/service" - modelCast "fonchain-fiee/pkg/model/cast" - "github.com/gin-gonic/gin" - "context" -) - -func OAuthPlatform(ctx *gin.Context) { - var ( - err error - req *modelCast.OAuthPlatformReq - resp *modelCast.OAuthPlatformResp - ) - if err = ctx.ShouldBind(&req); err != nil { - service.Error(ctx, err) - return - } - if req.PlatformID == int(cast.PlatformIDENUM_YOUTUBE) { - respOAuth, _err := service.CastProvider.OAuthYoutube(context.Background(), &cast.OAuthYoutubeReq{ - Code: "", - }) - if _err != nil { - service.Error(ctx, _err) - return - } - resp.Url = respOAuth.Url - } - //resp, err := service.CastProvider.OAuthPlatform(ctx, req) - //if err != nil { - // service.Error(ctx, err) - //} - service.Success(ctx, resp) - return -} diff --git a/pkg/service/cast/work.go b/pkg/service/cast/work.go index 1dfff66..d104ac9 100644 --- a/pkg/service/cast/work.go +++ b/pkg/service/cast/work.go @@ -175,7 +175,37 @@ func CheckUserBundleBalance(userID int32) (err error) { return } -//TODO 修改余量我还需要调用吗 +func RePublish(ctx *gin.Context) { + var ( + req *cast.RePublishReq + resp *cast.RePublishResp + ) + var err error + if err = ctx.ShouldBind(&req); err != nil { + service.Error(ctx, err) + return + } + newCtx := NewCtxWithUserInfo(ctx) + resp, err = service.CastProvider.RePublish(newCtx, req) + if err != nil { + service.Error(ctx, err) + return + } + artistID, _ := strconv.ParseUint(resp.ArtistUuid, 10, 64) + _, err = service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{ + UserId: int32(artistID), + AccountConsumptionNumber: -1, + }) + if err != nil { + service.Error(ctx, err) + //FIXME 进行回滚 + return + } + service.Success(ctx, nil) + return +} + +//修改余量我还需要调用吗 func UserBundleBalanceCost() { service.BundleProvider.AddBundleBalance(context.Background(), &bundle.AddBundleBalanceReq{}) }