feat: 添加主定调过滤选项,优化内容列表查询功能

This commit is contained in:
2026-01-05 09:19:39 +08:00
parent 637ff7110d
commit a5cc9b13d6
3 changed files with 16 additions and 1 deletions

View File

@@ -88,6 +88,7 @@ type CreatorContentListFilter struct {
requests.Pagination
Status *string `query:"status"`
Genre *string `query:"genre"`
Key *string `query:"key"`
Keyword *string `query:"keyword"`
}

View File

@@ -128,6 +128,9 @@ func (s *creator) ListContents(
q = q.Where(tbl.Genre.Eq(val))
}
}
if filter.Key != nil && *filter.Key != "" {
q = q.Where(tbl.Key.Eq(*filter.Key))
}
if filter.Keyword != nil && *filter.Keyword != "" {
q = q.Where(tbl.Title.Like("%" + *filter.Keyword + "%"))
}