This repository has been archived on 2026-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
MoeCounter/docs/README.md
T
2022-11-11 18:47:47 +08:00

1.2 KiB

这里是API接口的开发文档

所有接口前缀都为/api/ 返回类型除了 export 都是RESTFul风格的api

接口

  • 部分数据可能不同

query

  • 参数: name
$ curl -X GET 'http://127.0.0.1/api/query/test'

返回数据

{
  "code": 200,
  "time": 1668163249.493199,
  "data": {
    "name": "test",
    "times": 26
  }
}

query-all

  • 参数: 无
$ curl -X GET 'http://127.0.0.1/api/query-all/'

返回数据

{
  "code": 200,
  "time": 1668163318.0312304,
  "data": [
    {
      "name": "dasd",
      "times": 26
    }
  ]
}

query-theme

  • 参数: name
$ curl -X GET 'http://127.0.0.1/api/query-theme/lewd'
  • 注:返回的base64文本开头没有添加data:image/gif;base64,清手动添加

返回数据

  • 省略了部分数据
{
  "code": 200,
  "time": 1668163380.9702282,
  "data": [
    {
      "index": 0,
      "image": "...",
      "width": 68,
      "height": 150
    },
    {
      "index": 1,
      "image": "...",
      "width": 68,
      "height": 150
    }
  ]
}

export

  • 参数: 无
$ curl -X GET 'http://127.0.0.1/api/export/'

此接口返回文件