From 76b1171c18d421372a3f6427a06fc58f4c2e0a9b Mon Sep 17 00:00:00 2001 From: Jason Yoo Date: Sun, 18 Feb 2024 18:08:25 +0900 Subject: [PATCH] =?UTF-8?q?[CHORE]=20protobuf=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EC=82=AC=ED=95=AD=20=EC=A0=81=EC=9A=A9=20(#23)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../all_namespaces_all_kinds.export_metadata | Bin 52 -> 52 bytes ...e => 22e1fd04-1df5-424d-b53e-7c1124ab87b7} | Bin ...e => a8385706-c2f9-4247-8df3-1b70b67e3c9f} | 0 ...0 => dad133c4-1c89-45b1-bab0-343b6c8e9d3a} | 0 ...22e1fd04-1df5-424d-b53e-7c1124ab87b7.json} | 0 ...a8385706-c2f9-4247-8df3-1b70b67e3c9f.json} | 0 ...dad133c4-1c89-45b1-bab0-343b6c8e9d3a.json} | 0 gen/proto/sentence.pb.go | 75 +++++++++--------- idl | 2 +- src/handler/scene.handler.go | 3 +- src/handler/sentence.handler.go | 5 +- src/handler/topic.handler.go | 6 +- 12 files changed, 48 insertions(+), 43 deletions(-) rename firebase-emulator/seed/storage_export/blobs/{47b174e8-74d5-4288-b9b0-88fceaf18d7e => 22e1fd04-1df5-424d-b53e-7c1124ab87b7} (100%) rename firebase-emulator/seed/storage_export/blobs/{577fd1ec-de86-41ae-8dfd-1c199072ff8e => a8385706-c2f9-4247-8df3-1b70b67e3c9f} (100%) rename firebase-emulator/seed/storage_export/blobs/{c8b5d512-9fee-416d-a0f6-c95513dd7e00 => dad133c4-1c89-45b1-bab0-343b6c8e9d3a} (100%) rename firebase-emulator/seed/storage_export/metadata/{47b174e8-74d5-4288-b9b0-88fceaf18d7e.json => 22e1fd04-1df5-424d-b53e-7c1124ab87b7.json} (100%) rename firebase-emulator/seed/storage_export/metadata/{c8b5d512-9fee-416d-a0f6-c95513dd7e00.json => a8385706-c2f9-4247-8df3-1b70b67e3c9f.json} (100%) rename firebase-emulator/seed/storage_export/metadata/{577fd1ec-de86-41ae-8dfd-1c199072ff8e.json => dad133c4-1c89-45b1-bab0-343b6c8e9d3a.json} (100%) diff --git a/firebase-emulator/seed/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata b/firebase-emulator/seed/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata index 3ce8a4354afd4af8e90c7c33b6e4f8d248f08e6d..089b385fa45962aa9fe9e0b668f18b2e6dc4a29e 100644 GIT binary patch delta 36 ncmXppnIJ0Pu;=l=!&_RIB|5G^7(zT;3_=|Fr6mQWCAtOxFQN|X delta 36 ncmXppnII~E?Zo#58@IGDOLRYgFobxx7=$?TOG^q$OLPqYEE*1^ diff --git a/firebase-emulator/seed/storage_export/blobs/47b174e8-74d5-4288-b9b0-88fceaf18d7e b/firebase-emulator/seed/storage_export/blobs/22e1fd04-1df5-424d-b53e-7c1124ab87b7 similarity index 100% rename from firebase-emulator/seed/storage_export/blobs/47b174e8-74d5-4288-b9b0-88fceaf18d7e rename to firebase-emulator/seed/storage_export/blobs/22e1fd04-1df5-424d-b53e-7c1124ab87b7 diff --git a/firebase-emulator/seed/storage_export/blobs/577fd1ec-de86-41ae-8dfd-1c199072ff8e b/firebase-emulator/seed/storage_export/blobs/a8385706-c2f9-4247-8df3-1b70b67e3c9f similarity index 100% rename from firebase-emulator/seed/storage_export/blobs/577fd1ec-de86-41ae-8dfd-1c199072ff8e rename to firebase-emulator/seed/storage_export/blobs/a8385706-c2f9-4247-8df3-1b70b67e3c9f diff --git a/firebase-emulator/seed/storage_export/blobs/c8b5d512-9fee-416d-a0f6-c95513dd7e00 b/firebase-emulator/seed/storage_export/blobs/dad133c4-1c89-45b1-bab0-343b6c8e9d3a similarity index 100% rename from firebase-emulator/seed/storage_export/blobs/c8b5d512-9fee-416d-a0f6-c95513dd7e00 rename to firebase-emulator/seed/storage_export/blobs/dad133c4-1c89-45b1-bab0-343b6c8e9d3a diff --git a/firebase-emulator/seed/storage_export/metadata/47b174e8-74d5-4288-b9b0-88fceaf18d7e.json b/firebase-emulator/seed/storage_export/metadata/22e1fd04-1df5-424d-b53e-7c1124ab87b7.json similarity index 100% rename from firebase-emulator/seed/storage_export/metadata/47b174e8-74d5-4288-b9b0-88fceaf18d7e.json rename to firebase-emulator/seed/storage_export/metadata/22e1fd04-1df5-424d-b53e-7c1124ab87b7.json diff --git a/firebase-emulator/seed/storage_export/metadata/c8b5d512-9fee-416d-a0f6-c95513dd7e00.json b/firebase-emulator/seed/storage_export/metadata/a8385706-c2f9-4247-8df3-1b70b67e3c9f.json similarity index 100% rename from firebase-emulator/seed/storage_export/metadata/c8b5d512-9fee-416d-a0f6-c95513dd7e00.json rename to firebase-emulator/seed/storage_export/metadata/a8385706-c2f9-4247-8df3-1b70b67e3c9f.json diff --git a/firebase-emulator/seed/storage_export/metadata/577fd1ec-de86-41ae-8dfd-1c199072ff8e.json b/firebase-emulator/seed/storage_export/metadata/dad133c4-1c89-45b1-bab0-343b6c8e9d3a.json similarity index 100% rename from firebase-emulator/seed/storage_export/metadata/577fd1ec-de86-41ae-8dfd-1c199072ff8e.json rename to firebase-emulator/seed/storage_export/metadata/dad133c4-1c89-45b1-bab0-343b6c8e9d3a.json diff --git a/gen/proto/sentence.pb.go b/gen/proto/sentence.pb.go index 8717c5c..1081cd5 100644 --- a/gen/proto/sentence.pb.go +++ b/gen/proto/sentence.pb.go @@ -76,7 +76,7 @@ func (x *SentenceDTO) GetText() string { return "" } -type GetSetenceRequest struct { +type GetSentenceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -84,8 +84,8 @@ type GetSetenceRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (x *GetSetenceRequest) Reset() { - *x = GetSetenceRequest{} +func (x *GetSentenceRequest) Reset() { + *x = GetSentenceRequest{} if protoimpl.UnsafeEnabled { mi := &file_sentence_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -93,13 +93,13 @@ func (x *GetSetenceRequest) Reset() { } } -func (x *GetSetenceRequest) String() string { +func (x *GetSentenceRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetSetenceRequest) ProtoMessage() {} +func (*GetSentenceRequest) ProtoMessage() {} -func (x *GetSetenceRequest) ProtoReflect() protoreflect.Message { +func (x *GetSentenceRequest) ProtoReflect() protoreflect.Message { mi := &file_sentence_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -111,19 +111,19 @@ func (x *GetSetenceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetSetenceRequest.ProtoReflect.Descriptor instead. -func (*GetSetenceRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetSentenceRequest.ProtoReflect.Descriptor instead. +func (*GetSentenceRequest) Descriptor() ([]byte, []int) { return file_sentence_proto_rawDescGZIP(), []int{1} } -func (x *GetSetenceRequest) GetId() string { +func (x *GetSentenceRequest) GetId() string { if x != nil { return x.Id } return "" } -type GetSetenceResponse struct { +type GetSentenceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -131,8 +131,8 @@ type GetSetenceResponse struct { Sentence *SentenceDTO `protobuf:"bytes,1,opt,name=sentence,proto3" json:"sentence,omitempty"` } -func (x *GetSetenceResponse) Reset() { - *x = GetSetenceResponse{} +func (x *GetSentenceResponse) Reset() { + *x = GetSentenceResponse{} if protoimpl.UnsafeEnabled { mi := &file_sentence_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -140,13 +140,13 @@ func (x *GetSetenceResponse) Reset() { } } -func (x *GetSetenceResponse) String() string { +func (x *GetSentenceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetSetenceResponse) ProtoMessage() {} +func (*GetSentenceResponse) ProtoMessage() {} -func (x *GetSetenceResponse) ProtoReflect() protoreflect.Message { +func (x *GetSentenceResponse) ProtoReflect() protoreflect.Message { mi := &file_sentence_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -158,12 +158,12 @@ func (x *GetSetenceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetSetenceResponse.ProtoReflect.Descriptor instead. -func (*GetSetenceResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetSentenceResponse.ProtoReflect.Descriptor instead. +func (*GetSentenceResponse) Descriptor() ([]byte, []int) { return file_sentence_proto_rawDescGZIP(), []int{2} } -func (x *GetSetenceResponse) GetSentence() *SentenceDTO { +func (x *GetSentenceResponse) GetSentence() *SentenceDTO { if x != nil { return x.Sentence } @@ -177,19 +177,20 @@ var file_sentence_proto_rawDesc = []byte{ 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x31, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x54, 0x4f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x23, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x53, 0x65, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x44, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x53, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x54, 0x4f, 0x52, 0x08, 0x73, 0x65, 0x6e, - 0x74, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x51, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x42, 0x0d, 0x53, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x01, 0x2e, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x05, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0xca, 0x02, 0x05, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xe2, 0x02, 0x11, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x05, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x45, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, + 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x44, 0x54, 0x4f, 0x52, 0x08, 0x73, + 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x51, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x0d, 0x53, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x01, 0x2e, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, + 0x05, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xca, 0x02, 0x05, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0xe2, 0x02, + 0x11, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x05, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -206,12 +207,12 @@ func file_sentence_proto_rawDescGZIP() []byte { var file_sentence_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_sentence_proto_goTypes = []interface{}{ - (*SentenceDTO)(nil), // 0: proto.SentenceDTO - (*GetSetenceRequest)(nil), // 1: proto.GetSetenceRequest - (*GetSetenceResponse)(nil), // 2: proto.GetSetenceResponse + (*SentenceDTO)(nil), // 0: proto.SentenceDTO + (*GetSentenceRequest)(nil), // 1: proto.GetSentenceRequest + (*GetSentenceResponse)(nil), // 2: proto.GetSentenceResponse } var file_sentence_proto_depIdxs = []int32{ - 0, // 0: proto.GetSetenceResponse.sentence:type_name -> proto.SentenceDTO + 0, // 0: proto.GetSentenceResponse.sentence:type_name -> proto.SentenceDTO 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -238,7 +239,7 @@ func file_sentence_proto_init() { } } file_sentence_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSetenceRequest); i { + switch v := v.(*GetSentenceRequest); i { case 0: return &v.state case 1: @@ -250,7 +251,7 @@ func file_sentence_proto_init() { } } file_sentence_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSetenceResponse); i { + switch v := v.(*GetSentenceResponse); i { case 0: return &v.state case 1: diff --git a/idl b/idl index e29a6d4..4853acd 160000 --- a/idl +++ b/idl @@ -1 +1 @@ -Subproject commit e29a6d45d50a64a3b85f51845973529036fc6f23 +Subproject commit 4853acd678e648eb0820f653a92e2edc1d5755bf diff --git a/src/handler/scene.handler.go b/src/handler/scene.handler.go index abd3541..88ad954 100644 --- a/src/handler/scene.handler.go +++ b/src/handler/scene.handler.go @@ -38,7 +38,8 @@ func (handler *SceneHandlerImpl) GetScene(c echo.Context) error { } scene.ImageUrl = thumbnailURL - return c.JSON(http.StatusOK, converter.ToSceneDTO(scene)) + response := &pb.GetSceneResponse{Scene: converter.ToSceneDTO(scene)} + return c.JSON(http.StatusOK, response) } func SceneHandlerInit(sceneService service.SceneService, storageService service.StorageService) *SceneHandlerImpl { diff --git a/src/handler/sentence.handler.go b/src/handler/sentence.handler.go index b7f5367..a4098be 100644 --- a/src/handler/sentence.handler.go +++ b/src/handler/sentence.handler.go @@ -18,7 +18,7 @@ type SentenceHandlerImpl struct { } func (handler *SentenceHandlerImpl) GetSentence(c echo.Context) error { - var request = pb.GetSetenceRequest{} + var request = pb.GetSentenceRequest{} if err := c.Bind(&request); err != nil { return model.NewCustomHTTPError(http.StatusBadRequest, err) } @@ -31,7 +31,8 @@ func (handler *SentenceHandlerImpl) GetSentence(c echo.Context) error { return model.NewCustomHTTPError(http.StatusInternalServerError, err) } - return c.JSON(http.StatusOK, converter.ToSentenceDTO(sentence)) + response := &pb.GetSentenceResponse{Sentence: converter.ToSentenceDTO(sentence)} + return c.JSON(http.StatusOK, response) } func SentenceHandlerInit(sentenceService service.SentenceService) *SentenceHandlerImpl { diff --git a/src/handler/topic.handler.go b/src/handler/topic.handler.go index caa5069..04c9773 100644 --- a/src/handler/topic.handler.go +++ b/src/handler/topic.handler.go @@ -45,7 +45,8 @@ func (handler *TopicHandlerImpl) ListTopics(c echo.Context) error { compactTopicDTOs[i] = converter.ToCompactTopicDTO(topic) } - return c.JSON(http.StatusOK, compactTopicDTOs) + response := &pb.ListTopicsResponse{Topics: compactTopicDTOs} + return c.JSON(http.StatusOK, response) } func (handler *TopicHandlerImpl) GetTopic(c echo.Context) error { @@ -68,7 +69,8 @@ func (handler *TopicHandlerImpl) GetTopic(c echo.Context) error { } topic.ThumbnailUrl = thumbnailURL - return c.JSON(http.StatusOK, converter.ToTopicDTO(topic)) + response := &pb.GetTopicResponse{Topic: converter.ToTopicDTO(topic)} + return c.JSON(http.StatusOK, response) } func TopicHandlerInit(topicService service.TopicService, storageService service.StorageService) *TopicHandlerImpl {