2024-11-06 10:47:56 +00:00
|
|
|
definitions:
|
2024-11-07 10:09:13 +00:00
|
|
|
entity.Application:
|
2024-11-06 10:47:56 +00:00
|
|
|
properties:
|
2024-11-07 10:09:13 +00:00
|
|
|
created_at:
|
2024-11-06 10:47:56 +00:00
|
|
|
type: string
|
2024-11-07 10:09:13 +00:00
|
|
|
id:
|
|
|
|
type: integer
|
|
|
|
name:
|
2024-11-06 10:47:56 +00:00
|
|
|
type: string
|
2024-11-07 10:09:13 +00:00
|
|
|
updated_at:
|
2024-11-06 10:47:56 +00:00
|
|
|
type: string
|
2024-11-07 10:09:13 +00:00
|
|
|
user_id:
|
|
|
|
type: string
|
|
|
|
type: object
|
|
|
|
entity.ApplicationToken:
|
|
|
|
properties:
|
|
|
|
application:
|
|
|
|
$ref: '#/definitions/entity.Application'
|
|
|
|
application_id:
|
|
|
|
type: integer
|
|
|
|
created_at:
|
|
|
|
type: string
|
|
|
|
id:
|
|
|
|
type: integer
|
|
|
|
token:
|
|
|
|
type: string
|
|
|
|
updated_at:
|
|
|
|
type: string
|
|
|
|
type: object
|
|
|
|
schema.ApplicationCreateRequest:
|
|
|
|
properties:
|
|
|
|
name:
|
2024-11-06 10:47:56 +00:00
|
|
|
type: string
|
|
|
|
type: object
|
|
|
|
schema.ResponseBody:
|
|
|
|
properties:
|
|
|
|
data: {}
|
|
|
|
error:
|
|
|
|
type: string
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
success:
|
|
|
|
type: boolean
|
|
|
|
type: object
|
|
|
|
info:
|
|
|
|
contact: {}
|
2024-11-07 10:09:13 +00:00
|
|
|
title: Recommender API
|
2024-11-06 10:47:56 +00:00
|
|
|
version: "1.0"
|
|
|
|
paths:
|
2024-11-07 10:09:13 +00:00
|
|
|
/api/v1/application/{application_id}/tokens:
|
|
|
|
get:
|
|
|
|
consumes:
|
|
|
|
- application/json
|
|
|
|
description: 获取应用程序的 Token 列表
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: application_id
|
|
|
|
type: integer
|
|
|
|
produces:
|
|
|
|
- application/json
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: OK
|
|
|
|
schema:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/definitions/schema.ResponseBody'
|
|
|
|
- properties:
|
|
|
|
data:
|
|
|
|
items:
|
|
|
|
$ref: '#/definitions/entity.ApplicationToken'
|
|
|
|
type: array
|
|
|
|
type: object
|
|
|
|
"400":
|
|
|
|
description: Bad Request
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/schema.ResponseBody'
|
|
|
|
security:
|
|
|
|
- ApiKeyAuth: []
|
|
|
|
summary: 获取应用程序的 Token 列表
|
|
|
|
tags:
|
|
|
|
- applications
|
|
|
|
post:
|
|
|
|
consumes:
|
|
|
|
- application/json
|
|
|
|
description: 获取应用程序的 Token 列表
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: application_id
|
|
|
|
type: integer
|
|
|
|
- description: 创建应用程序的请求
|
|
|
|
in: body
|
|
|
|
name: ApplicationCreateRequest
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/schema.ApplicationCreateRequest'
|
|
|
|
produces:
|
|
|
|
- application/json
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: OK
|
|
|
|
schema:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/definitions/schema.ResponseBody'
|
|
|
|
- properties:
|
|
|
|
data:
|
|
|
|
$ref: '#/definitions/entity.ApplicationToken'
|
|
|
|
type: object
|
|
|
|
"400":
|
|
|
|
description: Bad Request
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/schema.ResponseBody'
|
|
|
|
security:
|
|
|
|
- ApiKeyAuth: []
|
|
|
|
summary: 获取应用程序的 Token 列表
|
|
|
|
tags:
|
|
|
|
- applications
|
|
|
|
/api/v1/applications:
|
2024-11-06 10:47:56 +00:00
|
|
|
get:
|
|
|
|
consumes:
|
|
|
|
- application/json
|
2024-11-07 10:09:13 +00:00
|
|
|
description: 列出当前用户下的应用程序列表
|
|
|
|
produces:
|
|
|
|
- application/json
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: OK
|
|
|
|
schema:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/definitions/schema.ResponseBody'
|
|
|
|
- properties:
|
|
|
|
data:
|
|
|
|
items:
|
|
|
|
$ref: '#/definitions/entity.Application'
|
|
|
|
type: array
|
|
|
|
type: object
|
|
|
|
"400":
|
|
|
|
description: Bad Request
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/schema.ResponseBody'
|
|
|
|
security:
|
|
|
|
- ApiKeyAuth: []
|
|
|
|
summary: List Applications
|
|
|
|
tags:
|
|
|
|
- applications
|
|
|
|
post:
|
|
|
|
consumes:
|
|
|
|
- application/json
|
|
|
|
description: 创建一个应用程序
|
|
|
|
parameters:
|
|
|
|
- description: 创建应用程序的请求
|
|
|
|
in: body
|
|
|
|
name: ApplicationCreateRequest
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/schema.ApplicationCreateRequest'
|
2024-11-06 10:47:56 +00:00
|
|
|
produces:
|
|
|
|
- application/json
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: OK
|
|
|
|
schema:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/definitions/schema.ResponseBody'
|
|
|
|
- properties:
|
|
|
|
data:
|
2024-11-07 10:09:13 +00:00
|
|
|
items:
|
|
|
|
$ref: '#/definitions/entity.Application'
|
|
|
|
type: array
|
2024-11-06 10:47:56 +00:00
|
|
|
type: object
|
|
|
|
"400":
|
|
|
|
description: Bad Request
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/schema.ResponseBody'
|
|
|
|
security:
|
|
|
|
- ApiKeyAuth: []
|
2024-11-07 10:09:13 +00:00
|
|
|
summary: 创建并保存一个应用程序
|
2024-11-06 10:47:56 +00:00
|
|
|
tags:
|
2024-11-07 10:09:13 +00:00
|
|
|
- applications
|
2024-11-07 12:00:06 +00:00
|
|
|
/applications/v1/info:
|
|
|
|
get:
|
|
|
|
consumes:
|
|
|
|
- application/json
|
|
|
|
description: 当前的应用程序信息
|
|
|
|
produces:
|
|
|
|
- application/json
|
|
|
|
responses:
|
|
|
|
"200":
|
|
|
|
description: OK
|
|
|
|
schema:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/definitions/schema.ResponseBody'
|
|
|
|
- properties:
|
|
|
|
data:
|
|
|
|
$ref: '#/definitions/entity.Application'
|
|
|
|
type: object
|
|
|
|
"400":
|
|
|
|
description: Bad Request
|
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/schema.ResponseBody'
|
|
|
|
security:
|
|
|
|
- ApiKeyAuth: []
|
|
|
|
summary: Current Application Info
|
|
|
|
tags:
|
|
|
|
- application_api
|
2024-11-06 10:47:56 +00:00
|
|
|
securityDefinitions:
|
|
|
|
ApiKeyAuth:
|
|
|
|
in: header
|
|
|
|
name: Authorization
|
|
|
|
type: apiKey
|
|
|
|
swagger: "2.0"
|