Skip to content

Commit

Permalink
[CHORE] protobuf 변경사항 적용 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoo0515 authored Feb 18, 2024
1 parent c4bc962 commit 76b1171
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 43 deletions.
Binary file not shown.
75 changes: 38 additions & 37 deletions gen/proto/sentence.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion idl
Submodule idl updated from e29a6d to 4853ac
3 changes: 2 additions & 1 deletion src/handler/scene.handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions src/handler/sentence.handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions src/handler/topic.handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 76b1171

Please sign in to comment.