Skip to content

使用 API 创建笔记本时返回新建的笔记本的 ID #3934

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

Closed
Zuoqiu-Yingyi opened this issue Jan 26, 2022 · 0 comments
Closed

使用 API 创建笔记本时返回新建的笔记本的 ID #3934

Zuoqiu-Yingyi opened this issue Jan 26, 2022 · 0 comments
Assignees
Milestone

Comments

@Zuoqiu-Yingyi
Copy link
Contributor

在什么情况下你需要该特性? In what scenarios do you need this function?

目前使用 API /api/notebook/createNotebook 创建笔记本时没有任何关于新建的笔记本的信息返回, 导致获取新建笔记本的 ID 需要使用 API /api/notebook/lsNotebooks 查询并对 ID 排序才能获取刚刚新建的笔记本信息, 而其他的 API 操作大都需要依赖笔记本的 ID

描述可能的最优解决方案 Describe the optimal solution

响应体的 data 属性值为一个描述刚刚新建笔记本对象, 可以参照 /api/notebook/lsNotebooks 返回值中 notebooks 列表包含的对象, 如下例所示

{
    "code": 0,
    "msg": "",
    "data":  {
        "id": "20211206203839-qh4vymb",
        "name": "协作",
        "icon": "1f4da",
        "sort": 0,
        "closed": false
    }
}

注: API 文档/api/notebook/lsNotebooks 中的响应体已过时, 需要更新为下例所示

{
    "code": 0,
    "msg": "",
    "data": {
        "notebooks": [
            {
                "id": "20211206203839-qh4vymb",
                "name": "协作",
                "icon": "1f4da",
                "sort": 0,
                "closed": false
            },
            {
                "id": "20210808180117-czj9bvb",
                "name": "思源笔记用户指南",
                "icon": "1f4d4",
                "sort": 1,
                "closed": false
            }
        ]
    }
}
@88250 88250 self-assigned this Jan 26, 2022
@88250 88250 added this to the 1.7.9 milestone Jan 26, 2022
88250 added a commit that referenced this issue Jan 26, 2022

Unverified

This user has not yet uploaded their public signing key.
@88250 88250 closed this as completed Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants