/necore
- request
GET /slogan
- response
{
"slogan": "string"
}User group includes ["admin", "news_admin", "server_admin", "document_admin"]. If empty, the user doesn"t have permission to manage corresponding resources.
Auth uses JWT Token.
GET /auth/status
- response
{
"status": "alive" | "dead",
}- request
POST /auth/login
{
"username": "string",
"password": "string"
}- response
{
"token": "string",
"user": {
"username": "string",
"group": "string[]",
"tags": [{
"text": "string",
"color": "string",
"tagColor": "string",
}, ...]
},
"error": "string" // if error
}- auth
Only Admin can create accounts.
- request
POST /auth/register
{
"username": "string",
"password": "string",
}- response
{
"error": "string" // if error
}- auth
Any user
- request
GET /auth/avatar/:id
- response
{
"avatar": "string"
}- auth
Current user or Admin
- request
GET /auth/user/:id
- response
{
"user": {
"username": "string",
"group": "string[]",
"tags": [{
"text": "string",
"color": "string",
"tagColor": "string",
}, ...]
},
}- auth
Only Admin can see all users.
- request
GET /auth/userlist
- response
{
"users": [
{
"username": "string",
"group": "string[]",
"tags": [{
"text": "string",
"color": "string",
"tagColor": "string",
}, ...]
},
],
}- auth
Only Admin can delete accounts.
- request
DELETE /auth/user/:id
- response
{
"error": "string" // if error
}- auth
User can update their own password. Admin can change password of others.
- request
POST /auth/password
{
"id": "string",
"self_password": "string",
"new_password": "string",
}- auth
User can update their own avatar.
- request
POST /auth/avatar
{
"username": "string",
"avatar": "string"
}- response
{
"error": "string" // if error
}- response
{
"error": "string" // if error
}- auth
Admin can change group and tag of others.
- request
PATCH /auth/user
{
"username": "string",
"group": "string[]",
"tags": [{
"text": "string",
"color": "string",
"tagColor": "string",
}, ...]
}- response
{
"error": "string" // if error
}- request
GET /server
- response
{
"servers":
[
{
"name": "string",
"icon": "string",
"description": "string",
"onlineMapUrl": "string",
"realtime": "boolean",
"serverUrl": "string",
},
...
]
}- request
POST server/status
{
"serverUrl": "string",
}- response
{
"online": "boolean",
// If online is true, the following fields should be available
"icon": "string",
"playerCount": "number",
"capacity": "number",
"latency": "number",
"version": "string",
}- request
GET /server/create
- response
{
"id": "string"
}- request
PATCH /server
{
"id": "string",
"name": "string",
"icon": "string",
"description": "string",
"realtime": "boolean",
"onlineMapUrl": "string",
"serverUrl": "string",
}- response
{
"error": "string" // if error
}- auth
Admin or server_admin
- request
DELETE /server/:id
- response
{
"error": "string" // if error
}- request
GET /news/total/:target
target: "information" | "magazine" | "notice" | "activity",
- response
{
"total": "int"
}- request
POST /news/list
{
"target": "information" | "magazine" | "notice" | "activity",
"page": "int",
"page_size": "int",
"pin": "boolean", // whether to show pinned news
}- response
{
"list": [
{
"id": "string",
"pin": "boolean",
"title": "string",
"brief": "string",
"date": "string",
"image": "string",
},
...
]
}- request
GET /news/detail/:id
- response
{
"entity": {
"pin": "boolean",
"title": "string",
"brief": "string",
"date": "string",
"endDate": "string", // Optional
"image": "string",
},
"content": [
{
"type": "markdown" | "pdf_file",
"content": "string", // markdown content or file url
},
...
],
"author": "string:username",
"category": "information" | "magazine" | "notice" | "activity",
}- request
PATCH /news/:id
{
"entity": {
"pin": "boolean",
"title": "string",
"brief": "string",
"date": "string",
"endDate": "string", // Optional
"image": "string",
},
"content": [
{
"type": "markdown" | "pdf_file",
"content": "string", // markdown content or file url
},
...
],
"category": "information" | "magazine" | "notice" | "activity",
}- response
{
"error": "string" // if error
}- request
POST /news/upload/:id
with multipart/form-data file upload
- response
{
"url": "string" // will be combined with backend url base, should be undefined if error
}- request
DELETE /news/upload/:id
{
"url": "string" // backend url base should be removed
}- response
{
"error": "string" // if error
}- request
POST /news/create
创建一个空的新闻,返回其ID,编辑通过update来实现
- response
{
"id": "string",
"error": "string" // if error
}- request
DELETE /news/:id
- response
{
"error": "string" // if error
}- request
DELETE /documents/node/:id
- response
{
"error": "string" // if error
}- request
POST /documents/node/:id
{
"parentId": "string", // Should be "root" if there is no parent
}- response
{
"error": "string" // if error
}- request
PUT /documents/node/:id
{
"private": "boolean",
"content": [{
"type": "markdown" | "pdf_file",
"content": "string", // markdown content or file url
}, ...],
}- response
{
"error": "string" // if error
}- request
PATCH /documents/node/:id
{
"name": "string"
}- response
{
"error": "string" // if error
}- request
POST /documents/node
{
"parentId": "string", // Should be "root" if there is no parent
"isFolder": "boolean",
"private": "boolean",
"name": "string"
}- response
{
"id": "string", // if not error
"error": "string" // if error
}GET /documents/layer/private/:parentId // parentId should be "root" if there is no parent
- response
{
"children": [
{
"parentId": "string", // Should be "root" if there is no parent
"id": "string",
"isFolder": "boolean",
"private": "boolean",
"name": "string"
}
]
}- request
GET /documents/:id
- response
{
"parentId": "string", // Should be "root" if there is no parent
"id": "string",
"isFolder": "boolean",
"private": "boolean",
"name": "string",
"contributors": "string[]", // invalid if isFolder is true
"content": [{
"type": "markdown" | "pdf_file",
"content": "string", // markdown content or file url
}, ...], // invalid if isFolder is true
"updateTime": "string" // format: yyyy-MM-dd, invalid if isFolder is true
}- request
GET /documents/private/:id
- response
{
"parentId": "string", // Should be "root" if there is no parent
"id": "string",
"isFolder": "boolean",
"private": "boolean",
"name": "string",
"contributors": "string[]", // invalid if isFolder is true
"content": [{
"type": "markdown" | "pdf_file",
"content": "string", // markdown content or file url
}, ...], // invalid if isFolder is true
"updateTime": "string" // format: yyyy-MM-dd, invalid if isFolder is true
}GET /documents/layer/:parentId // parentId should be "root" if there is no parent
- response
{
"children": [
{
"parentId": "string", // Should be "root" if there is no parent
"id": "string",
"isFolder": "boolean",
"private": "boolean",
"name": "string",
}
]
}- request
POST /documents/upload/:id
with multipart/form-data file upload
- response
{
"url": "string" // will be combined with backend url base, should be undefined if error
}- request
DELETE /documents/upload/:id
{
"url": "string" // backend url base should be removed
}- response
{
"error": "string" // if error
}