-
Notifications
You must be signed in to change notification settings - Fork 0
GetEditionPlayStatsを実装する #1408
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
GetEditionPlayStatsを実装する #1408
Conversation
|
Migrate lint ✅ Lint output |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Migrate lint ✅ Lint output |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1408 +/- ##
==========================================
+ Coverage 50.95% 52.64% +1.68%
==========================================
Files 136 136
Lines 12090 9908 -2182
==========================================
- Hits 6161 5216 -945
+ Misses 5619 4380 -1239
- Partials 310 312 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ikura-hamu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとう、1個だけコメントをしたので確認をお願いします。
あと、startとendのバリデーションを入れてもいいかなと思いました。具体的には、endがstartより早いとか、期間が長すぎるとかです。期間が長すぎると、期間の長さに応じてスライスの長さをとってたりするので、悪意あるユーザーがめっちゃ長い期間を入れてメモリを使い切らせるとかが考えられます。上限10年とかでいいと思います。バリデーションはserviceの方でやるといいと思います。
src/handler/v2/game_play_log_test.go
Outdated
| gomock.Any(), | ||
| testCase.editionID, | ||
| gomock.Cond(func(start time.Time) bool { | ||
| return start.Sub(testCase.expectedStart).Abs() < time.Hour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここHourの幅はいらない気がするんですが、付けた意図は何ですか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
意図していたのは秒の幅でしたのでその様に修正しました:pray:
|
ad85373に入れるべき内容が一部次のコミットに入ってしまいました:pray: |
ikura-hamu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとう、okです。マージしちゃってください
User description
closes #1387
endのみを指定しなかった場合の仕様を定義し忘れていた(と思う)ので,それの追記を合わせて行いました
PR Type
Enhancement, Tests, Documentation
Description
エディション統計ハンドラを実装
期間指定のデフォルト挙動を定義
サービスエラーのHTTP変換を実装
単体テストとOpenAPI更新
Diagram Walkthrough
flowchart LR H["HTTP GET /editions/{editionID}/play-stats"] -- "parse params (start/end)" --> D["determine start/end defaults"] D -- "call service" --> S["GamePlayLogService.GetEditionPlayStats"] S -- "success" --> M["map domain -> OpenAPI model"] M -- "200 OK JSON" --> R["Response"] S -- "ErrInvalidEdition" --> N["404 Not Found"] S -- "other error" --> E["500 Internal Server Error"]File Walkthrough
game_play_log.go
エディション統計取得ハンドラの本実装src/handler/v2/game_play_log.go
game_play_log_test.go
エディション統計ハンドラの包括的テストsrc/handler/v2/game_play_log_test.go
v2.yaml
期間指定仕様のOpenAPIドキュメント更新docs/openapi/v2.yaml