Skip to content

教員・教員室の一覧にソート順を追加#51

Merged
kantacky merged 6 commits into
mainfrom
feat/sort-faculty-and-faculty-rooms
Apr 22, 2026
Merged

教員・教員室の一覧にソート順を追加#51
kantacky merged 6 commits into
mainfrom
feat/sort-faculty-and-faculty-rooms

Conversation

@kantacky
Copy link
Copy Markdown
Member

@kantacky kantacky commented Apr 22, 2026

やったこと

  • Close #
    • 教員一覧 (GET /v1/faculties) を email 昇順で返すようにした
    • 教員室一覧 (GET /v1/faculty-rooms) を yearrooms.floorrooms.name の昇順で返すようにした
      • faculty_roomsroomsJOIN し、DB 側の ORDER BY でソート
      • year の WHERE 句を faculty_rooms.year に明示して列名の曖昧参照を回避
    • 教室一覧 (GET /v1/rooms) を floorname の昇順で返すようにした

確認したこと

  • go build ./... が通ること

メモ

  • Floor は domain.Floor (Floor1Floor7) の列挙値であり、文字列昇順で想定通りの並びになる
  • dev環境のAdminで確認済み

kantacky and others added 3 commits April 22, 2026 17:43
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Floor/Nameはroomsテーブル側の列でPreloadによる別クエリ経由で
取得しているため、リポジトリ層でin-memoryソートする。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
in-memoryソートからDB側での並び替えに切り替え、
rooms テーブルと JOIN して year, floor, name の昇順で取得する。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kantacky kantacky self-assigned this Apr 22, 2026
@kantacky kantacky marked this pull request as ready for review April 22, 2026 09:08
@kantacky kantacky requested review from a team, Copilot, hikaru-0602 and masaya-osuga April 22, 2026 09:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

教員一覧・教員室一覧の返却順をAPI仕様として安定させるため、Repository のDBクエリにソート順(ORDER BY)を追加するPRです。

Changes:

  • GET /v1/faculties 相当の取得を email 昇順で返すように変更
  • GET /v1/faculty-rooms 相当の取得を yearrooms.floorrooms.name 昇順で返すように変更(rooms をJOINしてDB側でソート)
  • faculty-roomsyear フィルタ条件を faculty_rooms.year に修飾して曖昧参照を回避

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/repository/faculty.go 教員一覧クエリに ORDER BY email ASC を追加
internal/repository/faculty_room.go 教員室一覧クエリで rooms をJOINし、year/floor/name の複合ソート+WHERE句の列修飾を追加

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kantacky and others added 2 commits April 22, 2026 18:20
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 22, 2026 09:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/repository/faculty_room.go
Comment thread internal/repository/room.go
@kantacky kantacky merged commit a6da4e4 into main Apr 22, 2026
10 checks passed
@kantacky kantacky deleted the feat/sort-faculty-and-faculty-rooms branch April 22, 2026 09:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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