- 迁移 0022:problem_tag 加 category(knowledge / theme)和 category_confirmed; 存量 25 个题材、题集类标签归主题,其余归知识点,全部记为已确认 - 前台题目列表按两组显示标签,组内按题目数从多到少 - 后台标签管理:每行切换分类;出题时新建的标签默认知识点、标「待归类」并排在最前, 页头提示待归类数量,可点「确认」保留默认;加分类筛选 - 新接口 PUT /admin/problem-tags/:id/category,设置分类即视为确认 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1b6a9e9fa
commit
d07459928d
12 files changed
+4226
-30
No files matched your search
@@ -193,6 +193,7 @@ problemRoutes.get("/problem-tags", async (c) => {
|
||||
.select({
|
||||
id: schema.problemTag.id,
|
||||
name: schema.problemTag.name,
|
||||
category: schema.problemTag.category,
|
||||
problemCount: countDistinct(schema.problemTags.problemId),
|
||||
})
|
||||
.from(schema.problemTag)
|
||||
@@ -206,7 +207,7 @@ problemRoutes.get("/problem-tags", async (c) => {
|
||||
),
|
||||
)
|
||||
.where(keyword ? ilike(schema.problemTag.name, `%${keyword}%`) : undefined)
|
||||
.groupBy(schema.problemTag.id, schema.problemTag.name)
|
||||
.groupBy(schema.problemTag.id, schema.problemTag.name, schema.problemTag.category)
|
||||
.having(sql`count(${schema.problemTags.problemId}) > 0`)
|
||||
.orderBy(asc(schema.problemTag.name))
|
||||
return success(c, rows satisfies Tag[])
|
||||
|
||||
Reference in new issue
Block a user