Skip to content

作品の削除機能と更新機能の作成#87

Merged
simesaba80 merged 28 commits into
developfrom
feature/31-work-delete-updaet
May 30, 2026
Merged

作品の削除機能と更新機能の作成#87
simesaba80 merged 28 commits into
developfrom
feature/31-work-delete-updaet

Conversation

@sharow2515

@sharow2515 sharow2515 commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator
  • 作品の削除機能を作成しました
  • 作品の編集機能を作成しました

@sharow2515 sharow2515 marked this pull request as ready for review December 12, 2025 09:47
}

func (r *AssetRepository) DeleteFile(ctx context.Context, url string) error {
key := util.ExtractS3KeyFromURL(url)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

多分S3のkey指定は統一にできないと思うからutil作るよりかはここで実装してほしいかなぁ

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

もしくはこのrepository.go内で実装してほしい
多分バイナリ系はasset.go以外でS3に行くことがないので

@simesaba80 simesaba80 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

レビュー途中


func (r *AssetRepository) DeleteFile(ctx context.Context, url string) error {
prefix := config.S3_BASE_URL + "/" + config.S3_BUCKET + "/"
key := ""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

多分URLのドメイン以下部分を抜き出してるってことなんだろうけど若干何やってるかわかりにくいのでコメントがほしいかな

@simesaba80 simesaba80 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

レビューの修正お願いします


// Work
e.POST("/works", r.WorkController.CreateWork)
e.PATCH("/works/:work_id", r.WorkController.UpdateWork)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

基本PUTでやってきたと思うんだけどPATCHにした意図はなにかあったりする?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ごめんなさい、これは私が何も考えずに部分更新で実装したからPATCHになっています。
Userの方のPUTは、リクエストに値渡さなかったら空で更新されるはずですが、Workの方はリクエストで値を渡さなかったら変更されないようになってます。

Comment thread internal/util/pointer.go Outdated
}

// StringPtr returns a pointer to the given string value.
func StringPtr(s string) *string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

この関数使われてなくない?
使ってないなら消してほしいな

Comment thread internal/util/pointer.go Outdated
@@ -4,3 +4,8 @@ package util
func IntPtr(i int) *int {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

この関数も現状テストでしか使ってないからテストファイルに関数だけ移行してこのディレクトリごと消してほしい

@simesaba80 simesaba80 merged commit e084f0e into develop May 30, 2026
3 checks passed
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