Skip to content
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

getMeでDBを叩くように変更 #763

Merged
merged 11 commits into from
Nov 20, 2024
Merged

getMeでDBを叩くように変更 #763

merged 11 commits into from
Nov 20, 2024

Conversation

comavius
Copy link
Member

@comavius comavius commented Jun 7, 2024

#725

  • getMeでセッションからユーザーを取ってくる実装からDBからに変更
  • DBにユーザーが存在しない場合にセッションのユーザーをDBに追加

@comavius comavius requested a review from H1rono June 7, 2024 14:10
router/user.go Outdated Show resolved Hide resolved
router/user.go Outdated Show resolved Hide resolved
@H1rono
Copy link
Member

H1rono commented Jun 8, 2024

とりあえずこれ
あとテストの方を直す必要があります

@comavius comavius requested a review from H1rono July 9, 2024 07:04
Copy link
Member

@H1rono H1rono left a comment

Choose a reason for hiding this comment

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

まずは変数名をcamelCaseにしてください

@Hueter57 Hueter57 requested a review from H1rono November 8, 2024 14:47
Copy link
Member

@H1rono H1rono left a comment

Choose a reason for hiding this comment

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

if err != nilreturn nil, errとするのは忘れずにお願いします 🙏

router/user.go Outdated Show resolved Hide resolved
@Hueter57 Hueter57 requested a review from H1rono November 8, 2024 16:06
router/user.go Outdated Show resolved Hide resolved
@Hueter57 Hueter57 requested a review from H1rono November 8, 2024 16:29
Copy link
Member

@H1rono H1rono left a comment

Choose a reason for hiding this comment

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

テスト頑張ってください

--- FAIL: TestHandlers_GetMe (0.00s)
    --- FAIL: TestHandlers_GetMe/Success (0.00s)
        user.go:95: Unexpected call to *mock_model.MockUserRepository.GetUserByID([context.Background.WithValue(sessions.contextKey, *sessions.Registry) c[76](https://github.com/traPtitech/Jomon/actions/runs/11745765123/job/32723973343?pr=763#step:8:77)069f6-ae57-40ee-be7d-b7674589867a]) at /home/runner/work/Jomon/Jomon/router/user.go:95 because: there are no expected calls of the method "GetUserByID" for that receiver

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 25.26%. Comparing base (6b2f353) to head (a95baa4).
Report is 22 commits behind head on v2.

Files with missing lines Patch % Lines
router/user.go 65.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v2     #763      +/-   ##
==========================================
+ Coverage   25.23%   25.26%   +0.03%     
==========================================
  Files         148      147       -1     
  Lines       30578    30583       +5     
==========================================
+ Hits         7716     7728      +12     
+ Misses      21986    21978       -8     
- Partials      876      877       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@Hueter57 Hueter57 requested a review from H1rono November 14, 2024 15:09
model/user.go Outdated Show resolved Hide resolved
@Hueter57 Hueter57 requested a review from H1rono November 15, 2024 07:04
Copy link
Member

@H1rono H1rono left a comment

Choose a reason for hiding this comment

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

LGTM
マージしておいてください

@Hueter57 Hueter57 merged commit 3e819c2 into v2 Nov 20, 2024
7 checks passed
@Hueter57 Hueter57 deleted the getme-returns-data-in-db branch November 20, 2024 17:04
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.

4 participants