跳到主要内容

运营公告

基址 https://admin.auroran.io。公开读无鉴权;管理写要 Bearer。

一条公告(id)可有多语言版本,各语言独立发布,互不 fallback。 客户端必须显式传 locale(省略默认 zh)。

locale语言
zh中文
enEnglish
ja日本語
ko한국어
viTiếng Việt
thไทย
category含义列表别名
listing上币listings
delisting下架delistings
update更新updates

statusdraft · published · archived

公开接口只返回该 locale 已发布且已到点published_at_ms 为空或 ≤ now)且 title 非空的版本。 排序:sort_weight 降序 → 该 locale published_at_ms 降序 → 公告 created_at_ms 降序。

cover_image_url 可能是 https://… 外链,或相对路径 /api/public/assets/announcements/{filename}(拼基址后使用)。

交易站浏览器前缀:/announcements-api/*/api/public/*

公开只读

GET /api/public/announcements

Query默认说明
localezh语言
category全部all / 省略不筛;或上表值 / 别名
offset0分页
limit见下最大 100

无 query string 时 limit=20;有 query 但未传 limitlimit=50

200:

{
"announcements": [{
"id": "a1b2c3d4e5f6789012345678abcdef01",
"category": "listing",
"locale": "en",
"title": "New listing: BTC-USDC perps",
"summary": "…",
"body": "Markdown…",
"cover_image_url": "/api/public/assets/announcements/a1b2c3d4.jpg",
"published_at_ms": 1719000000000,
"sort_weight": 0
}],
"offset": 0,
"limit": 20,
"total": 1,
"locale": "en"
}

公开响应不含 status / created_by 等管理字段。非法 locale / category400;无库 → 503

GET /api/public/announcements/{id}

Query:locale(默认 zh)。返回单个公开对象(含完整 body)。 该语言未发布 / 未到点 / id 不存在 → 404

GET /api/public/announcements/{id}/locales

{ "id": "…", "locales": ["en", "ko", "zh"] }

id 存在但尚无已发布语言时 locales 为空数组(仍 200)。

GET /api/public/assets/announcements/{filename}

上传图。filename 仅允许字母数字、.-_Content-Type 为 jpeg/png/webp/gif;Cache-Control: public, max-age=86400。 非法或不存在 → 404

管理(Bearer)

GET /api/announcements

含草稿 / 归档。Query:categorystatuslocale(默认 zh,决定列表行展示哪一语言)、offsetlimit(默认 50)。

200: { "announcements": [AnnouncementListItem], "offset", "limit", "total", "locale" }

列表行含元数据 + 该 locale 的 title/summary/status,以及 locale_summaries[]

GET /api/announcements/{id}

详情:元数据 + locales[](全部语言,含草稿)。不存在 → 404

POST /api/announcements

Body: { "category": "listing", "primary_locale"?: "zh", "sort_weight"?: 0 }

201: { "ok": true, "announcement": <详情> }

PUT /api/announcements/{id}

更新元数据(不含正文)。Body: { "category"?, "primary_locale"?, "sort_weight"? }

PUT /api/announcements/{id}/locales/{locale}

按语言 upsert。非法 locale → 400

Body:

{
"title": "…",
"summary": "…",
"body": "Markdown…",
"cover_image_url": "/api/public/assets/announcements/….jpg",
"status": "published",
"published_at_ms": 1719000000000
}

published_at_ms 为空表示立即(或保持未定时)。

DELETE /api/announcements/{id}/locales/{locale}

删除某一语言版本。

DELETE /api/announcements/{id}

删除整条公告及全部语言。

POST /api/announcements/upload

Content-Type: multipart/form-data,字段名 file。优先传到已配置的 S3;失败则落到本地 /api/public/assets/announcements/…

200: { "url", "filename", "content_type", "size_bytes", "storage": "s3" | "local" }