Files
wts/back/doc/API/common/responses.md
2026-02-26 19:22:38 +08:00

29 lines
722 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 返回内容的格式
本项目的API通常返回JSON格式预览如下
```JSON
{
"success":true,
"msg":"API Execution OK"
}
```
```JSON
{
"success":false,
"msg":"API Execution met a problem",
"error_type":2,
"debug":"Can not bind your JSON Request body"
}
```
任何API都会返回`success``msg`字段,错误时还会返回`error_type`字段,如果打开`Debug.APIVerbose`会返回`debug`字段。
关于msg的内容可以看每个API在logic包中的开头注释具体信息位于`logic/errors.go`
另外在回应头里有字段`X-Request-Id`这是我们为每个HTTP请求生成的唯一ID可以用来在日志里查找相应的信息