Repository navigation
feat: ログインボーナスの時刻とポイント範囲を管理画面で設定 - #60
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -12271,6 +12271,15 @@
"enableLoginBonus": {
"type": "boolean"
},
+ "loginBonusResetTime": {
+ "type": "string"
+ },
+ "loginBonusMinPoints": {
+ "type": "integer"
+ },
+ "loginBonusMaxPoints": {
+ "type": "integer"
+ },
"cacheRemoteFiles": {
"type": "boolean"
},
@@ -12967,6 +12976,9 @@
"nowLocalUsers",
"maxLocalUsers",
"enableLoginBonus",
+ "loginBonusResetTime",
+ "loginBonusMinPoints",
+ "loginBonusMaxPoints",
"cacheRemoteFiles",
"cacheRemoteSensitiveFiles",
"emailRequiredForSignup",
@@ -22160,6 +22172,20 @@
"enableLoginBonus": {
"type": "boolean"
},
+ "loginBonusResetTime": {
+ "type": "string",
+ "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
+ },
+ "loginBonusMinPoints": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 2147483647
+ },
+ "loginBonusMaxPoints": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 2147483647
+ },
"disableRegistration": {
"type": [
"boolean",
@@ -22921,6 +22947,15 @@
"$ref": "#/components/schemas/Error"
},
"examples": {
+ "INVALID_LOGIN_BONUS_POINTS_RANGE": {
+ "value": {
+ "error": {
+ "message": "Minimum login bonus points must not exceed maximum points.",
+ "code": "INVALID_LOGIN_BONUS_POINTS_RANGE",
+ "id": "6e2ffe67-587e-41f9-887f-3355e95161e7"
+ }
+ }
+ },
"INVALID_PARAM": {
"value": {
"error": { |
🖥 Frontend Diagnostics Report(No significant changes) Requests by resource type
V8 heap snapshot statistics
📦 Bundle StatsChunk size diff (2 updated, 0 added, 0 removed)
Startup chunk size (0 updated, 0 added, 0 removed)
Startup chunks are the Vite entry for
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
⚙️ Backend Diagnostics ReportMemory: After GC(No significant changes) V8 Heap Snapshot Statistics
|
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.
What
コントロールパネルの「全般」にログインボーナス設定を表示し、有効・無効、付与日の切り替え時刻(日本時間)、付与ポイントの下限・上限を保存できるようにします。初期値は日本時間00:00、1〜5ポイントで、上下限を同じ値にすると固定ポイントになります。
時刻以降の最初のアクセスで1日1回付与します。ページを開いたままの場合は再読み込みが必要です。範囲の逆転は画面とAPIで拒否し、切り替え時刻の変更で最終付与日が過去に戻ることを防ぎます。
Why
ログインボーナスが無効でも管理画面に設定項目がなく、有効化や付与条件の変更ができませんでした。サーバーのタイムゾーンに依存していた日付判定も、指定した日本時間で切り替わるようにします。
Additional info (optional)
flowchart LR A["/api/i"] --> B{"有効・ロールで許可・未付与?"} B -->|いいえ| C["付与しない"] B -->|はい| D["付与日をDBで確保"] D -->|確保できた| E["設定範囲のポイントを加算"] D -->|確保できない| C E --> F["ログインボーナス通知"]erDiagram META { varchar id PK boolean enableLoginBonus varchar loginBonusResetTime "新規: HH:mm、日本時間" integer loginBonusMinPoints "新規: 下限" integer loginBonusMaxPoints "新規: 上限" } USER { varchar id PK integer points } USER_PROFILE { varchar userId PK, FK varchar lastLoginBonusDate } USER ||--|| USER_PROFILE : profile検証: backendの対象テスト20件、frontendの対象テスト2件、両パッケージの型検査、変更ファイルlint、SPDX・locale検査がPASS。
pnpm build-misskey-js-with-typesでAPI型を再生成し、pnpm --filter backend check-migrationsもpending DDLなしでPASS。実画面で設定保存、10ポイント固定の付与、再読み込み時の重複なし、逆転範囲の保存不可を確認しました。反映には新規migrationの適用、ビルド、再起動が必要です。既存の有効・無効の設定は引き継ぎます。本番への反映・全体ビルドは未実施です。
CHANGELOG候補: ログインボーナスの付与時刻とポイント範囲を管理画面から設定できるように。
実装・検証・PR作成にCodexを使用しました。
Checklist