-
Notifications
You must be signed in to change notification settings - Fork 0
プラン設定機能追加 #10
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
プラン設定機能追加 #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -594,3 +594,212 @@ func hasYearUnit(menus []pricingapi.PricingMenu) bool { | |||||||||
| } | ||||||||||
| return false | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // ────────────────────────────────────────────── | ||||||||||
| // プラン管理機能 | ||||||||||
| // ────────────────────────────────────────────── | ||||||||||
|
|
||||||||||
| // getPricingPlans is a function for /pricing_plans route. | ||||||||||
| func getPricingPlans(c echo.Context) error { | ||||||||||
| userInfo, ok := c.Get(string(ctxlib.UserInfoKey)).(*authapi.UserInfo) | ||||||||||
| if !ok { | ||||||||||
| c.Logger().Error("failed to get user info") | ||||||||||
| return c.String(http.StatusInternalServerError, "internal server error") | ||||||||||
| } | ||||||||||
|
|
||||||||||
| if len(userInfo.Tenants) == 0 { | ||||||||||
| c.Logger().Error("user does not belong to any tenant") | ||||||||||
|
||||||||||
| c.Logger().Error("user does not belong to any tenant") | |
| c.Logger().Errorf("user does not belong to any tenant") |
Copilot
AI
Oct 23, 2025
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.
[nitpick] Inconsistent logging practices: these Error() calls don't follow the Errorf() pattern used elsewhere in the same file (lines 618, 625, 628, etc.). For consistency with the rest of the codebase and proper structured logging, these should also use Errorf() even without format arguments.
| c.Logger().Error("failed to get user info") | |
| c.Logger().Errorf("failed to get user info") |
Copilot
AI
Oct 23, 2025
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.
[nitpick] Inconsistent logging practices: these Error() calls don't follow the Errorf() pattern used elsewhere in the same file (lines 618, 625, 628, etc.). For consistency with the rest of the codebase and proper structured logging, these should also use Errorf() even without format arguments.
| c.Logger().Error("user does not belong to any tenant") | |
| c.Logger().Errorf("user does not belong to any tenant") |
Copilot
AI
Oct 23, 2025
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.
[nitpick] Inconsistent logging practices: these Error() calls don't follow the Errorf() pattern used elsewhere in the same file (lines 618, 625, 628, etc.). For consistency with the rest of the codebase and proper structured logging, these should also use Errorf() even without format arguments.
| c.Logger().Error("failed to get user info") | |
| c.Logger().Errorf("failed to get user info") |
Copilot
AI
Oct 23, 2025
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.
Potential integer overflow when converting int64 to int. On 32-bit systems, this conversion could lose data if the value exceeds the int range. Consider adding validation or using int64 consistently throughout the API.
| usingNextPlanFromInt := int(*usingNextPlanFrom) | |
| updateTenantPlanParam.UsingNextPlanFrom = &usingNextPlanFromInt | |
| // Avoid unsafe conversion: assign int64 pointer directly | |
| updateTenantPlanParam.UsingNextPlanFrom = usingNextPlanFrom |
Copilot
AI
Oct 23, 2025
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.
[nitpick] Inconsistent logging practices: these Error() calls don't follow the Errorf() pattern used elsewhere in the same file (lines 618, 625, 628, etc.). For consistency with the rest of the codebase and proper structured logging, these should also use Errorf() even without format arguments.
| c.Logger().Error("failed to get user info") | |
| c.Logger().Errorf("failed to get user info") |
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.
[nitpick] Inconsistent logging practices: these Error() calls don't follow the Errorf() pattern used elsewhere in the same file (lines 618, 625, 628, etc.). For consistency with the rest of the codebase and proper structured logging, these should also use Errorf() even without format arguments.