-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add internal kernel API /api/riff/getRiffCardsByBlockIDs
#10535
Comments
“批量”指的是传入参数需要传入块 ID 列表? |
@88250 对,一次给多个块id。这样也能自己封装单个接口。 |
/api/riff/getRiffCardsByBlockIDs
参数: {
"blockIDs": ["20231226210349-s9iqv9m", "20231226222829-yre8r9z"],
"page": 1,
"pageSize": 20
} 返回: {
"code": 0,
"msg": "",
"data": {
"blocks": [
{
"box": "20220407175815-lceq17w",
"path": "/20231225220807-sj8uajj.sy",
"hPath": "/闪卡测试",
"id": "20231226210349-s9iqv9m",
"rootID": "20231225220807-sj8uajj",
"parentID": "20231225220807-sj8uajj",
"name": "",
"alias": "",
"memo": "",
"tag": "",
"content": "1 20231226210349-s9iqv9m",
"fcontent": "",
"markdown": "1 20231226210349-s9iqv9m",
"folded": false,
"type": "NodeParagraph",
"subType": "",
"refText": "",
"refs": null,
"defID": "",
"defPath": "",
"ial": {
"custom-riff-decks": "20230218211946-2kw8jgx",
"id": "20231226210349-s9iqv9m",
"updated": "20240307202715"
},
"children": null,
"depth": 0,
"count": 0,
"sort": 10,
"created": "",
"updated": "",
"riffCardID": "20240118200836-c9iub5q",
"riffCard": {
"due": "2024-03-05T00:12:09.8522284+08:00",
"reps": 1,
"lapses": 1,
"state": 1,
"lastReview": "2024-03-05T00:11:09.8522284+08:00"
}
},
{
"box": "20220407175815-lceq17w",
"path": "/20231225220807-sj8uajj.sy",
"hPath": "/闪卡测试",
"id": "20231226222829-yre8r9z",
"rootID": "20231225220807-sj8uajj",
"parentID": "20231225220807-sj8uajj",
"name": "",
"alias": "",
"memo": "",
"tag": "",
"content": "2 20231226222829-yre8r9z",
"fcontent": "",
"markdown": "2 20231226222829-yre8r9z",
"folded": false,
"type": "NodeParagraph",
"subType": "",
"refText": "",
"refs": null,
"defID": "",
"defPath": "",
"ial": {
"custom-riff-decks": "20230218211946-2kw8jgx",
"id": "20231226222829-yre8r9z",
"updated": "20240307202719"
},
"children": null,
"depth": 0,
"count": 0,
"sort": 10,
"created": "",
"updated": "",
"riffCardID": "20240118200836-qtt6zgc",
"riffCard": {
"due": "2024-03-07T10:18:39.3465395+08:00",
"reps": 2,
"lapses": 1,
"state": 1,
"lastReview": "2024-03-07T10:13:39.3465395+08:00"
}
}
],
"pageCount": 1,
"total": 2
}
} |
有可能一个块对多个卡吧? @88250 |
不会的,目前的结构只可能一个块对应一张卡。 |
我就喜欢这样。 为什么有: 不是给几个返回几个吗? |
有道理……稍后删了。 |
如果不存在的card,也返回一个 {"id": "20231226222829-yre8r9z"} 占位吧 @88250 |
好的,修改以后: 参数: {
"blockIDs": ["20231226210349-s9iqv9m", "20231226222829-yre8r9z1"]
} 返回: {
"code": 0,
"msg": "",
"data": {
"blocks": [
{
"box": "20220407175815-lceq17w",
"path": "/20231225220807-sj8uajj.sy",
"hPath": "/闪卡测试",
"id": "20231226210349-s9iqv9m",
"rootID": "20231225220807-sj8uajj",
"parentID": "20231225220807-sj8uajj",
"name": "",
"alias": "",
"memo": "",
"tag": "",
"content": "1 20231226210349-s9iqv9m",
"fcontent": "",
"markdown": "1 20231226210349-s9iqv9m",
"folded": false,
"type": "NodeParagraph",
"subType": "",
"refText": "",
"refs": null,
"defID": "",
"defPath": "",
"ial": {
"custom-riff-decks": "20230218211946-2kw8jgx",
"id": "20231226210349-s9iqv9m",
"updated": "20240307202715"
},
"children": null,
"depth": 0,
"count": 0,
"sort": 10,
"created": "",
"updated": "",
"riffCardID": "20240118200836-c9iub5q",
"riffCard": {
"due": "2024-03-05T00:12:09.8522284+08:00",
"reps": 1,
"lapses": 1,
"state": 1,
"lastReview": "2024-03-05T00:11:09.8522284+08:00"
}
},
{
"box": "",
"path": "",
"hPath": "",
"id": "20231226222829-1111111",
"rootID": "",
"parentID": "",
"name": "",
"alias": "",
"memo": "",
"tag": "",
"content": "不存在符合条件的内容块",
"fcontent": "",
"markdown": "",
"folded": false,
"type": "",
"subType": "",
"refText": "",
"refs": null,
"defID": "",
"defPath": "",
"ial": null,
"children": null,
"depth": 0,
"count": 0,
"sort": 0,
"created": "",
"updated": "",
"riffCardID": "",
"riffCard": null
},
{
"box": "20220407175815-lceq17w",
"path": "/20231225220807-sj8uajj.sy",
"hPath": "/闪卡测试",
"id": "20231226222829-yre8r9z",
"rootID": "20231225220807-sj8uajj",
"parentID": "20231225220807-sj8uajj",
"name": "",
"alias": "",
"memo": "",
"tag": "",
"content": "2 20231226222829-yre8r9z",
"fcontent": "",
"markdown": "2 20231226222829-yre8r9z",
"folded": false,
"type": "NodeParagraph",
"subType": "",
"refText": "",
"refs": null,
"defID": "",
"defPath": "",
"ial": {
"custom-riff-decks": "20230218211946-2kw8jgx",
"id": "20231226222829-yre8r9z",
"updated": "20240307202719"
},
"children": null,
"depth": 0,
"count": 0,
"sort": 10,
"created": "",
"updated": "",
"riffCardID": "20240118200836-qtt6zgc",
"riffCard": {
"due": "2024-03-07T10:18:39.3465395+08:00",
"reps": 2,
"lapses": 1,
"state": 1,
"lastReview": "2024-03-07T10:13:39.3465395+08:00"
}
}
]
}
} |
这个api可能是不稳定的,之后改进闪卡结构后,一个块对应多张闪卡和一张闪卡含有多个块都可能存在。 |
我也担心这个,实在不行就放入 "blocks" 里面,目前的结构不改。
或者再多做一层。
不过一个块对多个卡,操作起来就麻烦了。 |
我觉得直接加到 blocks 就好了。另外, #10471 近期不会有时间做。 |
/api/riff/getRiffCardsByBlockIDs
/api/riff/getRiffCardsByBlockIDs
请求添加通过块id查找闪卡id的批量接口。
In what scenarios do you need this feature?
目前一些闪卡接口都是要求cardID。编辑器上操作的都是块。
目前的转换只能是,全量闪卡查出做缓存。
希望能有用块查card的接口,返回的实体类似 "/api/riff/getTreeRiffCards" 接口的。
The text was updated successfully, but these errors were encountered: