166 lines
4.2 KiB
YAML
166 lines
4.2 KiB
YAML
basePath: /api
|
|
definitions:
|
|
hfb_sys_backend_pkg_response.Body:
|
|
properties:
|
|
code:
|
|
type: string
|
|
data: {}
|
|
message:
|
|
type: string
|
|
type: object
|
|
internal_modules_auth.LoginRequest:
|
|
properties:
|
|
code:
|
|
type: string
|
|
phone:
|
|
type: string
|
|
required:
|
|
- code
|
|
- phone
|
|
type: object
|
|
internal_modules_auth.RefreshRequest:
|
|
properties:
|
|
refresh_token:
|
|
type: string
|
|
required:
|
|
- refresh_token
|
|
type: object
|
|
internal_modules_auth.SendSMSRequest:
|
|
properties:
|
|
phone:
|
|
type: string
|
|
required:
|
|
- phone
|
|
type: object
|
|
host: localhost:8080
|
|
info:
|
|
contact:
|
|
email: support@hfb.com
|
|
name: API Support
|
|
description: 哈夫币租号平台 API 文档
|
|
license:
|
|
name: MIT
|
|
url: https://opensource.org/licenses/MIT
|
|
termsOfService: http://swagger.io/terms/
|
|
title: HFB Sys API
|
|
version: "1.0"
|
|
paths:
|
|
/auth/logout:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 用户登出(客户端需清除本地 token)
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 登出成功
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
security:
|
|
- BearerAuth: []
|
|
summary: 登出
|
|
tags:
|
|
- 认证
|
|
/auth/refresh:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 使用 refresh_token 获取新的 access_token
|
|
parameters:
|
|
- description: 刷新令牌
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/internal_modules_auth.RefreshRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 刷新成功,返回新的 token
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
"400":
|
|
description: 请求参数错误
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
"401":
|
|
description: refresh_token 无效
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
summary: 刷新访问令牌
|
|
tags:
|
|
- 认证
|
|
/auth/sms/login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 使用手机号和验证码登录
|
|
parameters:
|
|
- description: 登录信息
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/internal_modules_auth.LoginRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 登录成功,返回用户信息和 token
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
"400":
|
|
description: 请求参数错误
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
"401":
|
|
description: 验证码错误
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
"500":
|
|
description: 服务器错误
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
summary: 短信验证码登录
|
|
tags:
|
|
- 认证
|
|
/auth/sms/send:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 发送登录验证码到指定手机号
|
|
parameters:
|
|
- description: 手机号
|
|
in: body
|
|
name: request
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/internal_modules_auth.SendSMSRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 发送成功
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
"400":
|
|
description: 请求参数错误
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
"500":
|
|
description: 服务器错误
|
|
schema:
|
|
$ref: '#/definitions/hfb_sys_backend_pkg_response.Body'
|
|
summary: 发送短信验证码
|
|
tags:
|
|
- 认证
|
|
securityDefinitions:
|
|
BearerAuth:
|
|
description: Type "Bearer" followed by a space and JWT token.
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|