作品の削除機能と更新機能の作成#87
Merged
Merged
Conversation
simesaba80
requested changes
Dec 12, 2025
| } | ||
|
|
||
| func (r *AssetRepository) DeleteFile(ctx context.Context, url string) error { | ||
| key := util.ExtractS3KeyFromURL(url) |
Collaborator
There was a problem hiding this comment.
多分S3のkey指定は統一にできないと思うからutil作るよりかはここで実装してほしいかなぁ
Collaborator
There was a problem hiding this comment.
もしくはこのrepository.go内で実装してほしい
多分バイナリ系はasset.go以外でS3に行くことがないので
simesaba80
requested changes
Feb 2, 2026
|
|
||
| func (r *AssetRepository) DeleteFile(ctx context.Context, url string) error { | ||
| prefix := config.S3_BASE_URL + "/" + config.S3_BUCKET + "/" | ||
| key := "" |
Collaborator
There was a problem hiding this comment.
多分URLのドメイン以下部分を抜き出してるってことなんだろうけど若干何やってるかわかりにくいのでコメントがほしいかな
simesaba80
requested changes
Feb 5, 2026
|
|
||
| // Work | ||
| e.POST("/works", r.WorkController.CreateWork) | ||
| e.PATCH("/works/:work_id", r.WorkController.UpdateWork) |
Collaborator
There was a problem hiding this comment.
基本PUTでやってきたと思うんだけどPATCHにした意図はなにかあったりする?
Collaborator
Author
There was a problem hiding this comment.
ごめんなさい、これは私が何も考えずに部分更新で実装したからPATCHになっています。
Userの方のPUTは、リクエストに値渡さなかったら空で更新されるはずですが、Workの方はリクエストで値を渡さなかったら変更されないようになってます。
| } | ||
|
|
||
| // StringPtr returns a pointer to the given string value. | ||
| func StringPtr(s string) *string { |
Collaborator
There was a problem hiding this comment.
この関数使われてなくない?
使ってないなら消してほしいな
| @@ -4,3 +4,8 @@ package util | |||
| func IntPtr(i int) *int { | |||
Collaborator
There was a problem hiding this comment.
この関数も現状テストでしか使ってないからテストファイルに関数だけ移行してこのディレクトリごと消してほしい
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.
Uh oh!
There was an error while loading. Please reload this page.