Skip to content

Comments

feat: 管理者用ユーザー一覧APIを追加#250

Closed
newt239 wants to merge 6 commits intomasterfrom
feat/admin-user-data
Closed

feat: 管理者用ユーザー一覧APIを追加#250
newt239 wants to merge 6 commits intomasterfrom
feat/admin-user-data

Conversation

@newt239
Copy link
Member

@newt239 newt239 commented Feb 3, 2026

Summary

  • 管理者向けのユーザー一覧取得エンドポイント /admin/user を追加
  • クエリパラメータによる検索・フィルタリング機能(名前検索、学年、管理者フラグ)を実装
  • 未使用の /user/{userId}/work エンドポイントを削除

変更内容

  • 新規APIエンドポイント: GET /admin/user
    • offset: ページネーションオフセット
    • limit: 取得件数制限
    • query: 名前検索(部分一致)
    • schoolGrade: 学年フィルタ
    • isAdmin: 管理者フラグフィルタ
  • レスポンスにはユーザー情報(プロフィール含む)と総件数を返却

Test plan

  • GET /admin/user が管理者ユーザーでアクセスできることを確認
  • 各クエリパラメータが正しく動作することを確認
  • 非管理者ユーザーでアクセスした場合に403が返ることを確認

🤖 Generated with Claude Code

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 3, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
spec-core 533aa42 Commit Preview URL

Branch Preview URL
Feb 03 2026, 05:40 AM

Copy link

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(GET /admin/user)を追加し、検索・フィルタ・ページネーションを提供するとともに、未使用の /user/{userId}/work エンドポイントを削除するPRです。

Changes:

  • GET /admin/user のハンドラ/モデル/サーバ実装と、ユーザー一覧(プロフィール+総件数)の取得処理を追加
  • 検索・フィルタ(query, schoolGrade, isAdmin)とページネーション(offset, limit)を追加
  • /user/{userId}/work の仕様・実装を削除し、Swagger/生成物を更新

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/work/get_user_user_id_work.go /user/{userId}/work の実装削除
pkg/utils/utils.go limit/offset 用の ClampInt を追加
pkg/user/get_admin_user.go 管理者ユーザー一覧取得のユースケース実装を追加
pkg/db/sql/user/select_admin_user_list.sql 管理者向けユーザー一覧の取得SQLを追加
pkg/db/sql/user/count_admin_user_list.sql 一覧の総件数取得SQLを追加
pkg/db/sql/admin/select_user_is_admin.sql 末尾の不要行削除(整形)
pkg/api/spec.gen.go Swagger生成物更新(エンドポイント追加・削除反映)
pkg/api/server/get_admin_user.go GET /admin/user のサーバ側ハンドラを追加
pkg/api/server.gen.go ルーティング/Wrapper生成物更新(追加・削除反映)
pkg/api/models.gen.go GetAdminUserParams / ResGetAdminUser 系モデル追加
pkg/api/authenticator/validate.go デバッグ出力削除
document/schemas/res_get_admin_user.yml レスポンススキーマ追加
document/schemas/res_get_admin_user.user.yml レスポンス(user要素)スキーマ追加
document/schemas/res_get_admin_user.profile.yml レスポンス(profile要素)スキーマ追加
document/schemas.yml 新スキーマ参照を追加
document/paths/user_user_id_work.yml /user/{userId}/work のパス定義削除
document/paths/admin_user.yml /admin/user のパス定義追加
document/paths.yml /admin/user 追加・/user/{userId}/work 削除
document/bundle.gen.yml バンドル生成物更新(追加・削除反映)

@newt239 newt239 closed this Feb 3, 2026
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.

1 participant