Skip to content

announcement-apiを統合#13

Merged
masaya-osuga merged 57 commits into
mainfrom
feat/integrate-announcement-api
Jun 14, 2026
Merged

announcement-apiを統合#13
masaya-osuga merged 57 commits into
mainfrom
feat/integrate-announcement-api

Conversation

@masaya-osuga

Copy link
Copy Markdown
Member

No description provided.

masaya-osuga and others added 30 commits November 8, 2025 12:47
…pository

Revert 5 feature/announcement repository
…cement-repository

Revert 8 revert 5 feature/announcement repository
モックリポジトリで動くようにした
masaya-osuga and others added 16 commits November 29, 2025 15:01
* oapi-codegen/gin-middlewareをインストール

* Add middleware

* Dockerfileを編集し、openapi.yamlをコピーするようにした
* task install

* devを一番上にして試す

* Revert "devを一番上にして試す"

This reverts commit 9ac24f10b4086ff942fb8db8564d3ad0c969dc8a.

* Cloud SQLにつなぐ処理を実装した

* Update cd.yaml
* Update mock repository

* Update test

* Update internal/handler/announcement_test.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Copilot のレビューを反映

* 文言を統一

* vilidate関数を追加

* いらないテストケースを削除

* 500エラーのテストを修正

* 不必要なヘルパー関数を削除

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* contextを導入

* テストにも導入
* Update config

* Generate

* Update main.go

* strict-server対応とtestの修正
* Update schema

* Update test

* Update and refactor

* Fix compile errors
* Update DB model

* Update domain model

* Update convert function

* Impl CRUD

* Fix error handling

* Refactor

* Fix converter

* Add gorm not null
* Update OpenAPI YAML

* Generate

* v0エンドポイントの削除とOpenAPIスキーマ変更に伴うハンドラー修正

v0関連の型・ハンドラーを削除し、Createレスポンスを201に変更、
新規のDetailエンドポイントハンドラーを追加した。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update domain model

* Remove v0

* Refactor

* Update SQL query

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Update OpenAPI schema from dotto-typespec

* Regenerate API code with 404 responses for detail, update, and delete endpoints

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Return 404 responses instead of errors when resource is not found

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add tests for 404 responses on detail, update, and delete endpoints

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: kantacky <51151242+kantacky@users.noreply.github.com>
Co-authored-by: Kanta Oikawa <iam@kantacky.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fun-dotto/announcement-api のコミット履歴を git filter-repo で
モジュラーモノリスのレイアウトへ再配置した上でマージする。

- internal/handler|domain|repository|service → internal/modules/announcement/
- cmd/server → cmd/announcement-api
- openapi → api/openapi/announcement
- generated → gen/announcement

import パスや shared 化などの配線は後続コミットで対応する。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
履歴引き継ぎマージ後の announcement-api コードを server の規約に合わせて配線する。

- import パスを github.com/fun-dotto/server/... へ書き換え
- repository を shared/model.Announcement ベースへ変更し、
  domain(string ID) と model(uuid.UUID) の境界変換を repository/convert.go に集約
- 独自の internal/config・internal/database(接続/モデル/AutoMigrate)は廃止し、
  shared/db と Atlas マイグレーション(既存 announcements テーブル)を再利用
- cmd/announcement-api を academic と同じ構成へ
  (shared db 接続・OpenAPI 仕様の埋め込み・graceful shutdown、AutoMigrate 廃止)
- OpenAPI 仕様をバイナリ同梱するため internal/modules/announcement/openapispec を追加
- oapi-codegen の出力先を gen/announcement/api.gen.go へ変更
- テスト依存の testify を go.mod へ追加

go build ./... / go test ./... 通過済み。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@masaya-osuga masaya-osuga self-assigned this Jun 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

他のエントリーポイントと同じフォーマット?にちゃんとなってるのかな

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

なってない気がする
今回の統合で対応するのがいいのかな

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

後からでも全然

Comment on lines +28 to +37
sortDateDirection := func() string {
switch query.SortByDate {
case domain.SortDirectionAsc:
return "ASC"
case domain.SortDirectionDesc:
return "DESC"
default:
return "ASC"
}
}()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ソートってめっちゃビジネスロジックだよね

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

これ前も悩んだな
どうします?
まあ、このPRでは変えなくてもいいかも

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

このPRでは変えなくていいね
将来的に検討しましょう()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

細かいけど、cmd/announcement/main.goにした方が良さそう

@masaya-osuga masaya-osuga Jun 14, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

cmd/academic-api/main.goになってるけど、それも変える?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

まあ後からでも笑

@kantacky kantacky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

良さそう

@masaya-osuga masaya-osuga merged commit c275376 into main Jun 14, 2026
@masaya-osuga masaya-osuga deleted the feat/integrate-announcement-api branch June 14, 2026 04:33
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.

2 participants