Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/HNU-himematsu/HNU-TimeLetter/llms.txt

Use this file to discover all available pages before exploring further.

The announcement API controls the popup modal shown to visitors on the HNU-TimeLetter frontend. The popup renders a Feishu document (飞书文档) by URL, along with any feature extension configuration. Two endpoints serve this data: an admin endpoint for reading and writing the configuration, and a public endpoint that the frontend popup component calls at runtime.
Two-endpoint pattern: GET /api/admin/announcement is protected by the admin_auth cookie and is used for management. GET /api/announcement-config is publicly accessible and is called by the frontend popup component. Both return the same response shape. This separation keeps write access behind authentication while allowing the frontend to read the configuration without credentials.

GET /api/admin/announcement

Returns the current announcement configuration. Authentication: admin_auth cookie required. Returns 401 Unauthorized if absent or invalid.

Response fields

docUrl
string
required
The Feishu document URL rendered inside the announcement popup (e.g. "https://himematsu.feishu.cn/docx/EbsDdehuLo1801xBzb1cxzJLnHb").
featureConfig
object
required
Feature extension configuration for the announcement popup.

Example response

{
  "docUrl": "https://himematsu.feishu.cn/docx/EbsDdehuLo1801xBzb1cxzJLnHb",
  "featureConfig": {
    "extensions": {}
  }
}

curl example

curl -X GET https://himematsu.cn/api/admin/announcement \
  --cookie "admin_auth=<YOUR_SESSION_COOKIE>"

PATCH /api/admin/announcement

Updates the announcement configuration. All fields are optional — only include the fields you want to change. Returns the full updated configuration on success. Authentication: admin_auth cookie required.

Request body

docUrl
string
The new Feishu document URL for the announcement popup. Must be a non-empty string when provided — passing an empty string is rejected with 400 Bad Request.
featureConfig
object
Replacement feature extension configuration. Must be a JSON object when provided. The entire featureConfig value is replaced, not merged.

Responses

200 OK — Returns the full updated announcement configuration (same shape as GET /api/admin/announcement).
{
  "docUrl": "https://himematsu.feishu.cn/docx/EbsDdehuLo1801xBzb1cxzJLnHb",
  "featureConfig": {
    "extensions": {}
  }
}
400 Bad RequestdocUrl was provided as an empty string.
{ "message": "文档链接不能为空" }
401 Unauthorized — Missing or invalid admin_auth cookie.
{ "message": "Unauthorized" }

curl example

curl -X PATCH https://himematsu.cn/api/admin/announcement \
  --cookie "admin_auth=<YOUR_SESSION_COOKIE>" \
  -H "Content-Type: application/json" \
  -d '{
    "docUrl": "https://himematsu.feishu.cn/docx/EbsDdehuLo1801xBzb1cxzJLnHb",
    "featureConfig": {
      "extensions": {}
    }
  }'

GET /api/announcement-config

Public endpoint — no authentication required. Returns the same response shape as GET /api/admin/announcement. This is the endpoint the frontend popup component calls each time it opens.

Example response

{
  "docUrl": "https://himematsu.feishu.cn/docx/EbsDdehuLo1801xBzb1cxzJLnHb",
  "featureConfig": {
    "extensions": {}
  }
}

curl example

curl -X GET https://himematsu.cn/api/announcement-config

Build docs developers (and LLMs) love