mirror of
https://github.com/ctwj/urldb.git
synced 2025-11-25 03:15:04 +08:00
247 lines
6.0 KiB
YAML
247 lines
6.0 KiB
YAML
basePath: /api/public
|
|
definitions:
|
|
dto.BatchReadyResourceRequest:
|
|
properties:
|
|
resources:
|
|
items:
|
|
$ref: '#/definitions/dto.ReadyResourceRequest'
|
|
type: array
|
|
required:
|
|
- resources
|
|
type: object
|
|
dto.ReadyResourceRequest:
|
|
properties:
|
|
category:
|
|
example: 示例分类
|
|
type: string
|
|
description:
|
|
example: 这是一个示例资源描述
|
|
type: string
|
|
extra:
|
|
example: 额外信息
|
|
type: string
|
|
img:
|
|
example: https://example.com/image.jpg
|
|
type: string
|
|
source:
|
|
example: 数据来源
|
|
type: string
|
|
tags:
|
|
example: 标签1,标签2
|
|
type: string
|
|
title:
|
|
example: 示例资源标题
|
|
type: string
|
|
url:
|
|
example: https://example.com/resource
|
|
type: string
|
|
required:
|
|
- title
|
|
- url
|
|
type: object
|
|
host: localhost:8080
|
|
info:
|
|
contact:
|
|
email: support@swagger.io
|
|
name: API Support
|
|
url: http://www.swagger.io/support
|
|
description: 网盘资源管理系统的公开API接口文档
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
termsOfService: http://swagger.io/terms/
|
|
title: 网盘资源管理系统公开API
|
|
version: "1.0"
|
|
paths:
|
|
/api/public/hot-dramas:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 获取热门剧列表,支持分页
|
|
parameters:
|
|
- description: API访问令牌
|
|
in: header
|
|
name: X-API-Token
|
|
required: true
|
|
type: string
|
|
- default: 1
|
|
description: 页码
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 20
|
|
description: 每页数量
|
|
in: query
|
|
maximum: 100
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 获取成功
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"401":
|
|
description: 认证失败
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"500":
|
|
description: 服务器内部错误
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
summary: 获取热门剧列表
|
|
tags:
|
|
- PublicAPI
|
|
/api/public/resources/add:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 通过公开API添加单个资源到待处理列表
|
|
parameters:
|
|
- description: API访问令牌
|
|
in: header
|
|
name: X-API-Token
|
|
required: true
|
|
type: string
|
|
- description: 资源信息
|
|
in: body
|
|
name: data
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/dto.ReadyResourceRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 添加成功
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"400":
|
|
description: 请求参数错误
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"401":
|
|
description: 认证失败
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"500":
|
|
description: 服务器内部错误
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
summary: 单个添加资源
|
|
tags:
|
|
- PublicAPI
|
|
/api/public/resources/batch-add:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: 通过公开API批量添加多个资源到待处理列表
|
|
parameters:
|
|
- description: API访问令牌
|
|
in: header
|
|
name: X-API-Token
|
|
required: true
|
|
type: string
|
|
- description: 批量资源信息
|
|
in: body
|
|
name: data
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/dto.BatchReadyResourceRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 批量添加成功
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"400":
|
|
description: 请求参数错误
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"401":
|
|
description: 认证失败
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"500":
|
|
description: 服务器内部错误
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
summary: 批量添加资源
|
|
tags:
|
|
- PublicAPI
|
|
/api/public/resources/search:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: 搜索资源,支持关键词、标签、分类过滤
|
|
parameters:
|
|
- description: API访问令牌
|
|
in: header
|
|
name: X-API-Token
|
|
required: true
|
|
type: string
|
|
- description: 搜索关键词
|
|
in: query
|
|
name: keyword
|
|
type: string
|
|
- description: 标签过滤
|
|
in: query
|
|
name: tag
|
|
type: string
|
|
- description: 分类过滤
|
|
in: query
|
|
name: category
|
|
type: string
|
|
- default: 1
|
|
description: 页码
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 20
|
|
description: 每页数量
|
|
in: query
|
|
maximum: 100
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: 搜索成功
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"401":
|
|
description: 认证失败
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
"500":
|
|
description: 服务器内部错误
|
|
schema:
|
|
additionalProperties: true
|
|
type: object
|
|
summary: 资源搜索
|
|
tags:
|
|
- PublicAPI
|
|
securityDefinitions:
|
|
ApiTokenAuth:
|
|
description: API Token认证
|
|
in: header
|
|
name: X-API-Token
|
|
type: apiKey
|
|
swagger: "2.0"
|