Skip to content

Latest commit

 

History

History
436 lines (294 loc) · 6.3 KB

API.md

File metadata and controls

436 lines (294 loc) · 6.3 KB

API Documentation

msg

POST chat

POST /api/chat

Body Parameters

{
  "content": "12345",
  "receiver": "lglglglgy"
}

Params

Name Location Type Required Description
body body object no none
» content body string yes none
» receiver body string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline
404 [error] 失败 Inline

Responses Data Schema

POST check

POST /api/check

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline

Responses Data Schema

POST nfmgr

POST /api/nfmgr

Body Parameters

{
  "username": "lglglglgy",
  "info": "allow"
}

Params

Name Location Type Required Description
body body object no none
» username body string yes none
» info body string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline
404 [error] User not found Inline

Responses Data Schema

POST info

POST /api/info

Body Parameters

{
  "person": "lglglglgy"
}

Params

Name Location Type Required Description
body body object no none
» person body string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline
401 [error] Invalid token Inline

Responses Data Schema

POST newfriend

POST /api/newfriend

Params

Name Location Type Required Description
username query string no none
operation query string no none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK OK Inline
401 [error] Unauthorized Inline

Responses Data Schema

file

POST save

POST /api/file/save

Body Parameters

{
  "filename": "asdf",
  "content": "asdf"
}

Params

Name Location Type Required Description
body body object no none
» filename body string yes none
» content body string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline
500 [error] Error saving file Inline

Responses Data Schema

POST upload

POST /api/upload

Body Parameters

image: string

Params

Name Location Type Required Description
body body object no none
» image body string(binary) yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline

Responses Data Schema

GET get

GET /api/file/get

Params

Name Location Type Required Description
filename query string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline
404 [error] File not found Inline

Responses Data Schema

POST commands

POST /api/commands

Body Parameters

{
  "commands": "1",
  "params": [
    "",
    ""
  ]
}

Params

Name Location Type Required Description
body body object no none
» commands body string yes none
» params body [string] yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline

Responses Data Schema

POST lock

POST /api/file/lock

Params

Name Location Type Required Description
filename query string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline

Responses Data Schema

user

POST login

POST /api/login

Body Parameters

{
  "username": "lj",
  "password": "XC0Cqe&kieOwtF"
}

Params

Name Location Type Required Description
body body object no none
» username body string yes none
» password body string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline
401 [error] Invalid credentials Inline

Responses Data Schema

POST signup

POST /api/signup

Body Parameters

{
  "username": "b",
  "password": "b"
}

Params

Name Location Type Required Description
body body object no none
» username body string yes none
» password body string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline
409 [error] Username already exists Inline

Responses Data Schema

POST avatar

POST /api/avatar

Body Parameters

{
  "avatar": "3"
}

Params

Name Location Type Required Description
body body object no none
» avatar body string yes none

Response Examples

200 Response

{}

Responses

HTTP Status Code Meaning Description Data schema
200 OK 成功 Inline

Responses Data Schema

Data Schema