Commit Graph

52 Commits

Author SHA1 Message Date
MingxuanGame
e591280620 refactor(database): rename migrations to make them more clear 2025-09-14 05:56:01 +00:00
陈晋瑭
6c2e88c485 feat(beatmap): 添加谱面用户标签功能 (#25)
* feat(tags): 添加 beatmap tags 相关功能

- 新增 BeatmapTags 模型类,用于表示 beatmap 的标签信息
- 实现加载标签数据、根据 ID 获取标签、获取所有标签等功能

* feat(database): 新增 BeatmapTagVote 数据库模型和迁移脚本

* fix(database): 修改 BeatmapTagVote 模型并创建新表

- 将 BeatmapTagVote 模型的表名从 "beatmap_tag_votes" 改为 "beatmap_tags"
- 创建新的数据库迁移文件以替换错误的原迁移文件
- 删除错误的迁移文件 "4a827ddba235_add_table_beatmap_tags.py"

* feat(tags): 添加用户标签功能

- 在 BeatmapResp 类中添加了 top_tag_ids 和 current_user_tag_ids 字段
- 新增了 /tags 相关的路由,包括获取所有标签和投票/取消投票功能
- 实现了标签投票和取消投票的数据库操作

* fix(tags): 修复标签投票查询和返回过程中的逻辑问题

- 修复 BeatmapResp 类中 current_user_tag_ids 字段的查询逻辑
- 优化 vote_beatmap_tags 函数中的标签验证过程

* fix(tags): add suggested changes from reviews

- 在 BeatmapResp 中添加 top_tag_ids 和 current_user_tag_ids 字段
- 实现用户标签投票功能,包括检查用户是否有资格投票
- 优化标签数据的加载方式
- 调整标签相关路由,增加路径参数描述

* fix(tags): apply changes from review

* fix(tag): apply changes from review suggests

- 更新标签接口文档,统一参数描述
- 修改标签投票接口状态码为 204
- 优化标签投票接口的用户认证方式
- 改进标签相关错误处理,使用更友好的错误信息

* fix(tag): use client authorization

* chore(linter): auto fix by pre-commit hooks

---------

Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-30 16:23:59 +08:00
陈晋瑭
3c5336ed61 添加谱面用户打分(评分)相关接口 (#24)
* feat(database): 添加 beatmap_ratings 表用于用户评分

- 新增 BeatmapRating 模型类,用于表示 beatmap_ratings 表
- 该表包含 id、beatmapset_id、user_id 字段
- 建立与 Beatmapset 和 User 表的关联关系

* feat(beatmapset_ratings): 添加判断用户是否可以对谱面集进行评分的接口

- 新增 /beatmapsets/{beatmapset_id}/can_rate 接口
- 判断用户是否能对谱面集进行过评分,返回True/False

* feat(ratings): 添加为谱面评分的接口

- 新增 POST /beatmapsets/{beatmapset_id} 路由,用于用户给谱面集评分
- 实现谱面集评分的添加和更新逻辑
- 在 BeatmapRating 模型中添加 rating 字段 (漏了最重要的,我真tm丢脸)

* chore(database): 添加alembic数据库迁移脚本

* fix(ratings): 更改上传谱面打分的api路径,防止冲突

* fix(ratings): add changes from pr review

* refactor(ratings): remove swears from code

* feat(ratings): 从beatmapset中移除ratings字段,并改由从beatmap_ratings表中直接计算评分

* chore(deps): 添加 git 包并更新依赖项

- 在 builder 阶段添加了 git 包的安装

* chore(database): 更新数据库连接地址并删除意外的迁移脚本

- 将 Alembic 配置文件中的数据库连接地址从本地地址改为 Docker Compose 中的 mysql 服务地址
- 删除了 migrations/versions 目录下的 dba1f8d9992e_add_beatmap_ratings_table.py 文件

* chore(database): generate alembic script for beatmap ratings

* fix(ratings): apply changes suggested in review

- revert changes to alembic.ini
- add name to apis
- modify migration scripts

* chore: format server.py using ruff

- who forgot to do this?

* fix(migrate): fix remove achievement index

* perf(rating): optimize SQL query

* fix(rating): ensure user can rate beatmapset

* fix(rating): add boundary check

* chore(project): remove submodule

---------

Co-authored-by: MingxuanGame <MingxuanGame@outlook.com>
2025-08-28 20:55:00 +08:00
MingxuanGame
f8535fdce4 feat(user): support login with any case of username & email 2025-08-26 11:39:55 +00:00
MingxuanGame
81a07b5544 refactor(migration): remove empty migration 2025-08-26 13:18:11 +08:00
MingxuanGame
9d92fa0a68 fix(score): fix score process 2025-08-26 13:18:11 +08:00
pre-commit-ci[bot]
7625cd99f5 chore(deps): auto fix by pre-commit hooks 2025-08-26 13:18:11 +08:00
咕谷酱
fabc1e9e88 Refactor Playlist model and add timestamps migration
Simplifies the PlaylistBase id field to a non-optional int and updates database logic to use session.refresh for id assignment. Adds Alembic migration to include created_at and updated_at columns in room_playlists for timestamp tracking.
2025-08-26 13:18:11 +08:00
咕谷酱
ea575de250 Add updated_at and created_at to Playlist model
Introduces created_at and updated_at fields to the Playlist model for tracking creation and modification times. Refactors room user removal logic to handle owner transfer and participant count updates more robustly. Updates room query logic for more accurate filtering by category and status. Adds migration stubs for updated_at column in room playlists.
2025-08-26 13:18:11 +08:00
咕谷酱
e0aae80f4b Add password support to multiplayer rooms
Introduces a password field to the Room model and database schema, enabling password-protected multiplayer rooms. Adds LIO router endpoints for room creation, user join/leave, and updates related imports and router registrations.
2025-08-26 13:18:11 +08:00
MingxuanGame
2ac56ed3bf fix(daily-challenge): fix duplicated top 10%/50% placements 2025-08-22 13:38:52 +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
MingxuanGame
f63eb97486 feat(team): support team 2025-08-22 04:21:36 +00:00
咕谷酱
9293fe2eb0 Update d103d442dc24_add_password_reset_table.py 2025-08-22 09:34:39 +08:00
咕谷酱
0f9238c501 添加密码重置 2025-08-22 08:56:40 +08:00
咕谷酱
3bee2421fa 添加邮件验证 2025-08-22 08:19:12 +08:00
MingxuanGame
068697355f feat(achievement): support obtain achievements 2025-08-21 08:50:16 +00:00
MingxuanGame
9fb0d0c198 feat(notification): support notification 2025-08-21 07:22:44 +00:00
MingxuanGame
219f19d623 feat(beatmap,score): support failtime & more exact playtime 2025-08-18 08:48:13 +00:00
MingxuanGame
86bea5d4b5 chore(lint): make ruff happy 2025-08-17 16:59:05 +00:00
咕谷酱
6e496a1123 add ip log 2025-08-18 00:23:57 +08:00
MingxuanGame
e28d78b90e fix(database): fix duplicated index for silence_users.id 2025-08-16 17:14:33 +00:00
MingxuanGame
3de73f2420 feat(chat): support mp/playlist chat 2025-08-16 08:42:40 +00:00
MingxuanGame
f992e4cc71 feat(chat): support public channel chat 2025-08-16 05:29:16 +00:00
chenjintang-shrimp
7c7c68c163 feat(detector): 新增封禁谱面表并检查可疑谱面
- 在数据库中添加了封禁谱面表(banned_beatmaps)
- 实现了检查可疑谱面的功能,将不符合规范的谱面添加到封禁列表
- 更新了相关的模型和迁移文件
2025-08-15 08:05:02 +00:00
MingxuanGame
1251ba31a2 feat(score): support rx for taiko & catch 2025-08-15 05:59:21 +00:00
MingxuanGame
a8906b8194 feat(v1-api): support api v1 2025-08-14 09:11:53 +00:00
MingxuanGame
3f5b242c6f fix(beatmap): make max_combo nullable 2025-08-13 15:39:24 +00:00
MingxuanGame
858a7e8640 playlist_best_scores: remove foreign key to allow to remove items 2025-08-13 15:18:26 +00:00
MingxuanGame
7a6a548a65 fix(statistics): fix levels 2025-08-13 10:37:51 +00:00
MingxuanGame
4b5aefb946 feat(beatmapset): support search beatmapset 2025-08-13 07:55:48 +00:00
chenjintang-shrimp
1dde8a40da feat(database): 将 Event.event_payload 字段从 str 改为 dict/json
- 在 events.py 中,将 event_payload 字段的类型从 str 改为 dict,并使用 JSON 类型存储
- 添加新的迁移文件,将数据库中的 event_payload 列从 VARCHAR 类型改为 JSON 类型
- 更新 EventResp 类,移除 _payload 属性,直接使用 event_payload 字段
2025-08-13 06:21:22 +00:00
MingxuanGame
69e9927ea0 fix(score): fix incomplete statistics in leaderboard & wrong statistics in replay 2025-08-13 04:01:19 +00:00
MingxuanGame
f683f5c911 fix(user): change column to adapt to lazer_users.id, add migration 2025-08-12 15:14:11 +00:00
MingxuanGame
52df05648c feat(user): support global rank & country rank 2025-08-12 13:36:15 +00:00
MingxuanGame
b09960af4c feat(private-api): support OAuth client operations 2025-08-12 09:52:40 +00:00
MingxuanGame
6e71141146 feat(developer): support custom OAuth 2.0 client 2025-08-11 12:33:31 +00:00
MingxuanGame
b9babb8f24 feat(score): support download replay 2025-08-11 08:19:05 +00:00
MingxuanGame
32e2ac5704 feat(score): support pin score 2025-08-10 15:36:39 +00:00
MingxuanGame
314fbf827b deploy(docker): support deploy with docker 2025-08-10 08:28:01 +00:00
MingxuanGame
efc784d903 feat(score): support osu-rx & osu-ap & all beatmap leaderboard like osu.ppy.sb 2025-08-10 07:03:49 +00:00
MingxuanGame
cf45070c2c refactor(database): use alembic to maintain the whole database 2025-08-10 04:33:03 +00:00
MingxuanGame
87bb74d1ca feat(multiplayer): support leaderboard 2025-08-06 10:51:37 +00:00
MingxuanGame
74e4b1cb53 fix(relationship): fix unique relationship 2025-08-01 04:27:44 +00:00
MingxuanGame
d938998239 feat(beatmapset): support post favoutite to beatmapset 2025-08-01 04:22:17 +00:00
MingxuanGame
9ce99398ab refactor(user): refactor user database
**Breaking Change**

用户表变为 lazer_users

建议删除与用户关联的表进行迁移
2025-07-30 16:17:09 +00:00
MingxuanGame
a53c63a33a feat(score): add best_id in response 2025-07-29 07:58:15 +00:00
MingxuanGame
223fa99692 feat(score): support calculate pp 2025-07-29 02:56:21 +00:00
MingxuanGame
9b889bc602 feat(database): use alembic 2025-07-28 13:09:55 +00:00