Skip to content

Commit

Permalink
feat: 相关文章最多十篇,按点赞量逆序排列
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneJiang committed Feb 14, 2023
1 parent b661869 commit f25a7d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ interface IArticleItem {
| --- | --- |
| 参数(GET)| tags(传入格式化的array,例如 [{"tag":"frontend","alias":"前端"}] )authorId 作者id |
| 示例 | http://localhost:3000/api/articles/tags?tags=[{%22tag%22:%22frontend%22,%22alias%22:%22%E5%89%8D%E7%AB%AF%22}]&authorId=6 |
| 介绍 | 获取相关tag的文章,支持多个tag |
| 介绍 | 获取相关tag的文章,支持多个tag,最多十篇文章,按点赞量逆序排列 |
| 备注 | ArticleList是array类型 |
#### 使用方式
```
Expand Down
2 changes: 2 additions & 0 deletions frontend/server/api/articles/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export default defineEventHandler(async (event): Promise<ITagItem[] | IArticleIt
or: [${tagQuery}]
authorId: {id:{eq:"${authorId}"}}
}
pagination: { pageSize: 10 }
sort: "liked:desc"
){
data{
id
Expand Down

0 comments on commit f25a7d6

Please sign in to comment.