-
Notifications
You must be signed in to change notification settings - Fork 2
buy_report Get details & Put status APIの作成 #920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
動作良さげです
少しコメントしますた
| return nil, err | ||
| } | ||
|
|
||
| getDs := selectBuyReportDetailsQuery.Where(goqu.Ex{"buy_statuses.buy_report_id": buyReportId}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[imo]
これrepository内のメソッドとして定義して、usecaseから使って欲しいかも
1つの処置につき、1つのメソッドの方が綺麗な気がする
これに関しては意見欲しいかも
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1つの処置につき、1つのメソッドの方が綺麗な気がする
これ非常に同感です。
作成されたdetailを返すまでがupdateかなと思って一つにしてました。
けどrepository内で処理を完結させる必要もないですし、いい感じに分けました。
| if err != nil { | ||
| return detail, errors.Wrapf(err, "cannot connect SQL") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ask]
これのエラーはcannot connect SQLじゃないよね?
取得したrowをdetailに渡すときのエラーだよね
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そうですね。どっかのコピペして大本作ってたので修正抜けです。
| return BuyReportDetail{}, err | ||
| } | ||
|
|
||
| row, err := bru.bRep.AllByPeriod(c, buyReportId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このmethod使ったらダメな気がします!
idからBuyReportDetailで取得するAPIはない気がするので、新しく実装する必要有りかも
// 年度に紐づいたdetailsの取得
func (brr *buyReportRepository) AllByPeriod(c context.Context, year string) (*sql.Rows, error) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確かに、、、
AllByBuyReportIdのメソッド作成しました!
| return brr.crud.Read(c, query) | ||
| } | ||
|
|
||
| func (brr *buyReportRepository) AllByBuyReportId(c context.Context, buyReportId string) (*sql.Row, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
細かいですが、ByIDならGet~使って欲しいかもです!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kubosaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応Issue
resolve #0
概要
buy_reportのAPIを作成しました。

画面スクリーンショット等
URLスクリーンショット
テスト項目
備考
予算管理フロント作成から切ってます