Conversation
全5ドメイン(モンスター・武器・防具・スキル・アイテム)に検索パラメータを追加 ## 変更内容 - モンスター: TribeName/FieldName/ProductName による絞り込み追加 - 武器: Rarity/ElementAttack による絞り込み追加 - 防具: Name/SkillName/Slot + ページネーション追加(GetAll → Find に変更) - スキル: Name/Description + ページネーション追加(FindAll → Find に変更) - アイテム: Name/MonsterID + ページネーション追加(FindAll → Find に変更) 各ドメインの domain/repository/mysql/controller を全レイヤー対応。 moq によるモック再生成・テスト・ゴールデンファイル更新を含む。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull request overview
各リソースの「全件取得のみ」だった検索APIに対して、部分一致/絞り込み条件と Limit/Offset を追加し、柔軟なフィルタリングを可能にする変更です(Issue #218 対応)。
Changes:
- モンスターに種族名/フィールド名/作品名の部分一致検索条件を追加
- 武器にレアリティ/属性攻撃の絞り込み条件を追加
- 防具/スキル/アイテムに検索条件+Limit/Offset ページネーション+総件数返却を追加
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/domain/weapons/weapon.go | 武器検索条件に rarity/element_attack を追加 |
| internal/domain/skills/skill.go | スキルの SearchParams/SearchResult を追加 |
| internal/domain/skills/repository.go | skills.Repository に Find を追加 |
| internal/domain/skills/repository_mock.go | skills.RepositoryMock の Find 対応を追加 |
| internal/domain/monsters/repository.go | モンスター検索条件に tribe/field/product 名を追加 |
| internal/domain/items/repository.go | items.Repository に Find を追加 |
| internal/domain/items/repository_mock.go | items.RepositoryMock の Find 対応を追加 |
| internal/domain/items/item.go | アイテムの SearchParams/SearchResult を追加 |
| internal/domain/armors/repository.go | armors.Repository に Find を追加 |
| internal/domain/armors/repository_mock.go | armors.RepositoryMock の Find 対応を追加 |
| internal/domain/armors/armor.go | 防具の SearchParams/SearchResult を追加 |
| internal/database/mysql/weaponQueryService.go | 武器検索に rarity/element_attack 条件を追加 |
| internal/database/mysql/skillQueryService.go | スキル検索(条件+Limit/Offset+総件数)を実装 |
| internal/database/mysql/monsters.go | モンスター検索に EXISTS 条件(tribe/field/product)を追加 |
| internal/database/mysql/itemQueryService.go | アイテム検索(条件+Limit/Offset+総件数)を実装 |
| internal/database/mysql/armorQueryService.go | 防具検索(条件+Limit/Offset+総件数)を実装 |
| internal/controller/weapon/request.go | weapon 検索クエリに rarity/element_attack を追加 |
| internal/controller/weapon/handler.go | weapon 検索条件を Repository に渡すよう更新 |
| internal/controller/skill/testdata/skills/get_skills_success.json.golden | スキル一覧レスポンスに total を追加したゴールデン更新 |
| internal/controller/skill/response.go | スキルレスポンスに total、検索用変換関数を追加 |
| internal/controller/skill/request.go | スキル検索用リクエスト構造体を追加 |
| internal/controller/skill/handler.go | /skills を検索+ページネーション対応に変更 |
| internal/controller/skill/handler_test.go | /skills のテストを Find ベースに更新 |
| internal/controller/monster/request.go | モンスター検索クエリに tribe/field/product を追加 |
| internal/controller/monster/handler.go | モンスター検索条件のマッピングを追加 |
| internal/controller/item/response.go | アイテム検索レスポンス(total/limit/offset)変換を追加 |
| internal/controller/item/request.go | アイテム検索用リクエスト構造体を追加 |
| internal/controller/item/handler.go | /items を検索+ページネーション対応に変更 |
| internal/controller/item/handler_test.go | /items のテストを Find ベースに更新 |
| internal/controller/armor/testdata/armor/armor_get_all_empty.json.golden | 防具一覧レスポンスに total を追加したゴールデン更新 |
| internal/controller/armor/testdata/armor/armor_get_all_200.json.golden | 防具一覧レスポンスに total を追加したゴールデン更新 |
| internal/controller/armor/response.go | 防具一覧レスポンスに total を追加 |
| internal/controller/armor/request.go | 防具検索用リクエスト構造体を追加 |
| internal/controller/armor/handler.go | /armors を検索+ページネーション対応に変更 |
| internal/controller/armor/handler_test.go | /armors のテストを Find ベースに更新 |
golangci-lint の unused エラーを解消。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Code Metrics Report
Code coverage of files in pull request scope (54.3%)Reported by octocov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
変更内容
変更の背景・目的
Issue #218 に対応。各エンドポイントで全件取得のみだったものに柔軟なフィルタリング能力を付与する。
アーキテクチャ対応範囲
テスト結果
make test全通過)Closes #218