diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 9375fcb..4466172 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -9,3 +9,5 @@ jobs: - uses: actions/checkout@v4 - uses: bufbuild/buf-setup-action@v1 - uses: bufbuild/buf-lint-action@v1 + with: + input: proto diff --git a/buf.yaml b/proto/buf.yaml similarity index 72% rename from buf.yaml rename to proto/buf.yaml index 84d9c3b..3246458 100644 --- a/buf.yaml +++ b/proto/buf.yaml @@ -4,3 +4,4 @@ lint: - DEFAULT except: - PACKAGE_VERSION_SUFFIX + - PACKAGE_DIRECTORY_MATCH diff --git a/proto/error.proto b/proto/error.proto new file mode 100644 index 0000000..ce89b05 --- /dev/null +++ b/proto/error.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; + +package proto; + +message ErrorDTO { + int32 code = 1; + string message = 2; +} diff --git a/proto/feedback.proto b/proto/feedback.proto new file mode 100644 index 0000000..2a55802 --- /dev/null +++ b/proto/feedback.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package proto; + +message PronunciationFeedbackDTO { + string sentence_id = 1; + repeated int32 incorrect_indexes = 2; + int32 pronunciation_score = 3; + int32 volume_score = 4; + int32 speed_score = 5; + string overall_feedback = 6; +} + +message GetPronunciationFeedbackRequest { + string sentence_id = 1; + string audio_file_url = 2; +} + +message GetPronunciationFeedbackResponse { + PronunciationFeedbackDTO pronunciation_feeback = 1; +} + +message CommunicationFeedbackDTO { + string scene_id = 1; + string overall_feedback = 2; +} + +message GetCommunicationFeedbackRequest { + string scene_id = 1; + string audio_file_url = 2; +} + +message GetCommunicationFeedbackResponse { + CommunicationFeedbackDTO communication_feedback = 1; +} diff --git a/proto/history.proto b/proto/history.proto new file mode 100644 index 0000000..fef4399 --- /dev/null +++ b/proto/history.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package proto; + +import "feedback.proto"; + +enum HistoryType { + HISTORY_TYPE_UNSPECIFIED = 0; + HISTORY_TYPE_PRONUNCIATION = 1; + HISTORY_TYPE_COMMUNICATION = 2; +} + +message FeebackHistoryDTO { + HistoryType type = 1; + oneof feeback { + PronunciationFeedbackDTO pronunciation = 2; + CommunicationFeedbackDTO communication = 3; + } +} + +message ListHistoriesRequest { + optional HistoryType type = 1; +} + +message ListHistoriesResponse { + repeated FeebackHistoryDTO histories = 1; +} diff --git a/proto/scene.proto b/proto/scene.proto new file mode 100644 index 0000000..9925ce1 --- /dev/null +++ b/proto/scene.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package proto; + +// information for sentence formation practice +message SceneDTO { + string id = 1; + string image_url = 2; + string question = 3; +} + +message GetSceneRequest { + string id = 1; +} + +message GetSceneResponse { + SceneDTO scene = 1; +} diff --git a/proto/sentence.proto b/proto/sentence.proto new file mode 100644 index 0000000..e18811d --- /dev/null +++ b/proto/sentence.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package proto; + +// sentence which user has to try to pronounce +message SentenceDTO { + string id = 1; + string text = 2; +} + +message GetSetenceRequest { + string id = 1; +} + +message GetSetenceResponse { + SentenceDTO sentence = 1; +} diff --git a/proto/topic.proto b/proto/topic.proto new file mode 100644 index 0000000..cc029ae --- /dev/null +++ b/proto/topic.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package proto; + +// topic used to select the theme of the session +message TopicDTO { + string id = 1; + string title = 2; + string thumbnail_url = 3; + repeated string sentence_ids = 4; + repeated string scene_ids = 5; +} + +message CompactTopicDTO { + string id = 1; + string title = 2; + string thumbnail_url = 3; +} + +message ListTopicsRequest { + // empty +} + +message ListTopicsResponse { + repeated CompactTopicDTO topics = 1; +} + +message GetTopicRequest { + string id = 1; +} + +message GetTopicResponse { + TopicDTO topic = 1; +} diff --git a/proto/user.proto b/proto/user.proto index 0bf0ce5..a5ef48f 100644 --- a/proto/user.proto +++ b/proto/user.proto @@ -6,11 +6,6 @@ message UserDTO { string id = 1; string name = 2; int32 age = 3; - DisorderType disorder_type = 4; -} - -enum DisorderType { - DISORDER_TYPE_UNSPECIFIED = 0; } message GetUserRequest { @@ -25,7 +20,6 @@ message UpdateUserRequest { string id = 1; optional string name = 2; optional int32 age = 3; - DisorderType disorder_type = 4; } message UpdateUserResponse {