Commit Graph

34 Commits

Author SHA1 Message Date
MingxuanGame
10caa82320 feat(user-preference): add user preference support (#55)
APIs:

- GET `/api/private/user/preferences`: Get current user's preferences.
- PATCH `/api/private/user/preferences`: Modify current user's preferences. (body: Preferences)
- PUT `/api/private/user/preferences`: Overwrite current user's preferences. (body: Preferences)
- DELETE `/api/private/user/preferences`: Reset current user's preferences. (body: list[str])
  - body specifies the content to be reset. If body is empty, reset all preferences.

User:

- `User.g0v0_playmode`: show the special ruleset like `OSURX`, and custom rulesets in the future.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-06 20:57:17 +08:00
MingxuanGame
dfd656f2fb style(project): remove from __future__ import annotations 2025-10-03 17:15:41 +00:00
MingxuanGame
d490239f46 chore(linter): update ruff rules 2025-10-03 15:46:53 +00:00
MingxuanGame
40670c094b feat(auth): support trusted device (#52)
New API to maintain sessions and devices:

- GET /api/private/admin/sessions
- DELETE /api/private/admin/sessions/{session_id}
- GET /api/private/admin/trusted-devices
- DELETE /api/private/admin/trusted-devices/{device_id}

Auth:

web clients request `/oauth/token` and `/api/v2/session/verify` with `X-UUID` header to save the client as trusted device.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-03 11:26:43 +08:00
MingxuanGame
7d79f3cee7 feat(storage): save MIME type into storage service 2025-08-30 12:36:43 +00:00
MingxuanGame
9b00dbda28 refactor(project): use unified utcnow 2025-08-22 11:27:45 +00:00
MingxuanGame
598fcc8b38 refactor(project): make pyright & ruff happy 2025-08-22 08:21:52 +00:00
咕谷酱
3b1d7a2234 Fix: Handle 'user_agent' data truncation error 2025-08-22 15:17:03 +08:00
咕谷酱
e293d7541b rollback code 2025-08-22 15:07:50 +08:00
咕谷酱
c8a68f97ed Merge branch 'main' of https://github.com/GooGuTeam/g0v0-server 2025-08-22 14:03:00 +08:00
咕谷酱
b300ce9b09 修复多人游戏排行榜问题 2025-08-22 13:52:28 +08:00
MingxuanGame
f63eb97486 feat(team): support team 2025-08-22 04:21:36 +00:00
MingxuanGame
9fb0d0c198 feat(notification): support notification 2025-08-21 07:22:44 +00:00
MingxuanGame
ef1b699547 feat(daily-challenge): show statistics in profile 2025-08-20 04:24:00 +00:00
MingxuanGame
0a80c5051c feat(multiplayer): support countdown 2025-08-05 17:21:45 +00:00
MingxuanGame
2600fa499f feat(multiplayer): support play
WIP
2025-08-03 12:53:22 +00:00
MingxuanGame
9f7ab81213 feat(signalr): support json & msgpack protocol for all hubs 2025-08-03 09:45:04 +00:00
MingxuanGame
9ce99398ab refactor(user): refactor user database
**Breaking Change**

用户表变为 lazer_users

建议删除与用户关联的表进行迁移
2025-07-30 16:17:09 +00:00
MingxuanGame
223fa99692 feat(score): support calculate pp 2025-07-29 02:56:21 +00:00
咕谷酱
ae6ef11350 add info api 2025-07-28 21:22:29 +08:00
MingxuanGame
3ee95b0e7c feat(spectator): support save replays 2025-07-27 09:03:23 +00:00
MingxuanGame
b359be3637 feat(solo-score): support submit solo scores 2025-07-27 02:33:42 +00:00
MingxuanGame
900a17f815 feat(beatmap): implement get beatmap arrtibutes 2025-07-26 17:31:23 +00:00
MingxuanGame
46c19dddc1 chore(pre-commit): add pre-commit 2025-07-25 20:46:52 +08:00
MingxuanGame
f347b680b2 refactor(database): use asyncio 2025-07-25 20:43:50 +08:00
MingxuanGame
c43ca883a5 refactor(database): migrate to sqlmodel 2025-07-24 20:49:07 +08:00
MingxuanGame
1655bb9f53 feat: 基础 SignalR 服务器支持 2025-07-24 18:45:08 +08:00
jimmy-sketch
6647e5cd04 fix: 将 app/ 下的所有代码中与sql相关的所有隐式类型转换替换为显式类型转换 2025-07-24 12:30:24 +08:00
MingxuanGame
4a16a9598f fxxk merge 2025-07-23 18:56:53 +08:00
MingxuanGame
7b5a50493a use uv & make lint happy 2025-07-23 18:03:30 +08:00
jimmy-sketch
91f15d572d feat(database): 新增用户资料相关数据模型和处理逻辑
- 新增 LazerUserProfileSections、LazerUserBanners、LazerUserBadge、LazerUserMonthlyPlaycounts、LazerUserPreviousUsername 和 LazerUserReplaysWatched 数据模型- 更新 User 数据模型,添加与新模型的关联关系
- 修改 convert_db_user_to_api_user 函数,支持新数据模型的处理- 完善 MockProfile 类,添加新模型的默认值和辅助方法
2025-07-19 20:43:36 +08:00
jimmy-sketch
757166b665 feat: 优化用户资料构建过程
- 添加 LazerUserProfileSections 模型,用于自定义用户资料顺序
- 在 User 模型中添加 lazer_profile_order 关系
- 优化 utils.py 中的 build_user_profile 函数,使用数据库中的计数信息
-修复默认计数信息中的 recent_scores_count 和 socres_first_count 属性
2025-07-19 16:09:57 +08:00
jimmy-sketch
d8fcbf02cf feat: 添加从数据库中读取部分lazer资料的功能 2025-07-19 14:45:15 +08:00
咕谷酱
c0246440f3 上传源码 2025-07-19 12:08:10 +08:00