Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ルーム入室エンドポイント実装 #29

Merged
merged 9 commits into from
Dec 18, 2023
Merged

ルーム入室エンドポイント実装 #29

merged 9 commits into from
Dec 18, 2023

Conversation

GoRuGoo
Copy link
Member

@GoRuGoo GoRuGoo commented Dec 17, 2023

close #18

@GoRuGoo
Copy link
Member Author

GoRuGoo commented Dec 17, 2023

QAエビデンス

Swaggerに指定された形式でリクエストを送る
スクリーンショット 2023-12-18 3 45 14

正常なレスポンスが返ってくる
スクリーンショット 2023-12-18 3 45 23

DBにも適切に値を書き込むことができている

{
  "user_id": {
    "S": "01bc0364-86e4-43f6-9eb5-7ca03e2f990f"
  },
  "answers": {
    "L": [
      {
        "M": {
          "answer": {
            "BOOL": true
          },
          "question_id": {
            "S": "1"
          }
        }
      },
      {
        "M": {
          "answer": {
            "BOOL": true
          },
          "question_id": {
            "S": "2"
          }
        }
      },
      {
        "M": {
          "answer": {
            "BOOL": false
          },
          "question_id": {
            "S": "3"
          }
        }
      },
      {
        "M": {
          "answer": {
            "BOOL": false
          },
          "question_id": {
            "S": "4"
          }
        }
      },
      {
        "M": {
          "answer": {
            "BOOL": true
          },
          "question_id": {
            "S": "5"
          }
        }
      }
    ]
  },
  "nickname": {
    "S": "gorugo"
  },
  "room_name": {
    "S": "youngeek"
  }
}

@GoRuGoo GoRuGoo requested review from fuu38 and is-hoku December 17, 2023 18:48
svc := dynamodb.NewFromConfig(cfg)

tableName := "CandleBackendUserTable"
if t, exists := os.LookupEnv("USER_ABLE_NAME"); exists {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

"user_id": &types.AttributeValueMemberS{Value: userData.UserId},
"nickname": &types.AttributeValueMemberS{Value: userData.NickName},
"room_name": &types.AttributeValueMemberS{Value: userData.RoomName},
"answers": &types.AttributeValueMemberL{Value: answers},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全体で用語の統一したい。room_idかな

Copy link
Member

@is-hoku is-hoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type Response struct {
Body string `json:"body"`
type Answer struct {
QuestionId string `json:"question_id" dynamodbav:"question_id"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule also applies to “ID” when it is short for “identifier” (which is pretty much all cases when it’s not the “id” as in “ego”, “superego”), so write “appID” instead of “appId”.
https://go.dev/wiki/CodeReviewComments

QuestionId より QuestionID の方がよさそう

@GoRuGoo GoRuGoo merged commit 0c797ab into master Dec 18, 2023
2 checks passed
@GoRuGoo GoRuGoo deleted the feat/18 branch December 18, 2023 04:07
@GoRuGoo GoRuGoo restored the feat/18 branch December 19, 2023 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ルーム入室エンドポイントの実装
3 participants