咕咕日记 API 后端接口

这里仅显示目前开放的API,如有需要在你自己的应用或者VRC工具、插件中使用请联系我们
更多功能和接口将在后续版本中逐步开放,敬请期待!

API 说明

这是咕咕日记API的后端接口文档,为开发者提供认证、数据获取和数据提交等功能。以下是详细说明。

1. 活动日历

1.1 获取全部活动

URL: /api/calendar

方法: GET

请求头: Authorization: Bearer

响应:

[
    {
        "authorId": "usr_2e875c2a-3a3f-44a1-b454-a4e332b5b8c7",
        "createdAt": "2025-02-18T13:31:07.808Z",
        "groupId": "grp_25cca243-7966-4c2a-9b80-d0f2772717b1",
        "id": "not_5f9697e5-e4de-4256-822c-87fbb7cee085",
        "imageId": null,
        "imageUrl": null,
        "text": "Test #hd #2025․2․20",
        "title": "测试公告2",
        "startDate": "2025-02-20",
        "startTime": null,
        "visibility": "group",
        "restrict": "all",
        "groupId2": null
    },
]

1.2 获取当天活动

URL: /api/auth/register

方法: GET

请求头: Authorization: Bearer

响应:

[
    {
        "authorId": "usr_2e875c2a-3a3f-44a1-b454-a4e332b5b8c7",
        "createdAt": "2025-02-18T13:31:07.808Z",
        "groupId": "grp_25cca243-7966-4c2a-9b80-d0f2772717b1",
        "id": "not_5f9697e5-e4de-4256-822c-87fbb7cee085",
        "imageId": null,
        "imageUrl": null,
        "text": "Test #hd #2025․2․20",
        "title": "测试公告2",
        "startDate": "2025-02-20",
        "startTime": null,
        "visibility": "group",
        "restrict": "all",
        "groupId2": null
    },
]

1.3 按ID获取活动详细信息

URL: /api/calendar

方法: GET

请求头: Authorization: Bearer

响应:

[
    {
        "authorId": "usr_2e875c2a-3a3f-44a1-b454-a4e332b5b8c7",
        "createdAt": "2025-02-18T13:31:07.808Z",
        "groupId": "grp_25cca243-7966-4c2a-9b80-d0f2772717b1",
        "id": "not_5f9697e5-e4de-4256-822c-87fbb7cee085",
        "imageId": null,
        "imageUrl": null,
        "text": "Test #hd #2025․2․20",
        "title": "测试公告2",
        "startDate": "2025-02-20",
        "startTime": null,
        "visibility": "group",
        "restrict": "all",
        "groupId2": null
    },
]

2. 数据获取

2.1 获取用户列表

URL: /api/users

方法: GET

请求头: Authorization: Bearer

响应:

[
    {
        "id": "string",
        "username": "string",
        "email": "string"
    },
    ...
]

3. 数据提交

3.1 提交日记

URL: /api/diary

方法: POST

请求头: Authorization: Bearer

请求体:

{
    "title": "string",
    "content": "string",
    "date": "YYYY-MM-DD"
}

响应:

{
    "message": "日记提交成功",
    "diaryId": "string"
}