[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
70
api/schemas/components/parameters.yaml
Normal file
70
api/schemas/components/parameters.yaml
Normal file
|
@ -0,0 +1,70 @@
|
|||
Page:
|
||||
in: query
|
||||
name: page
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: 1
|
||||
description: 页码
|
||||
required: false
|
||||
|
||||
PerPage:
|
||||
in: query
|
||||
name: per_page
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
default: 20
|
||||
description: 每页记录数
|
||||
required: false
|
||||
|
||||
Language:
|
||||
in: query
|
||||
name: lang
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- en
|
||||
- zh-Hans
|
||||
- zh-Hant
|
||||
description: 语言代码
|
||||
required: false
|
||||
|
||||
Sort:
|
||||
in: query
|
||||
name: sort
|
||||
schema:
|
||||
type: string
|
||||
pattern: '^[a-zA-Z_]+:(asc|desc)$'
|
||||
examples:
|
||||
- 'created_at:desc'
|
||||
description: '排序字段和方向,格式为 field:(asc|desc)'
|
||||
required: false
|
||||
|
||||
Status:
|
||||
in: query
|
||||
name: status
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- draft
|
||||
- published
|
||||
description: 内容状态过滤
|
||||
required: false
|
||||
|
||||
Id:
|
||||
in: path
|
||||
name: id
|
||||
schema:
|
||||
type: integer
|
||||
required: true
|
||||
description: 资源 ID
|
||||
|
||||
Slug:
|
||||
in: path
|
||||
name: slug
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
description: 资源 Slug
|
67
api/schemas/components/responses.yaml
Normal file
67
api/schemas/components/responses.yaml
Normal file
|
@ -0,0 +1,67 @@
|
|||
Unauthorized:
|
||||
description: 未授权访问
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: './schemas.yaml#/Error'
|
||||
example:
|
||||
error:
|
||||
code: UNAUTHORIZED
|
||||
message: 未授权访问,请先登录
|
||||
|
||||
Forbidden:
|
||||
description: 禁止访问
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: './schemas.yaml#/Error'
|
||||
example:
|
||||
error:
|
||||
code: FORBIDDEN
|
||||
message: 您没有权限执行此操作
|
||||
|
||||
NotFound:
|
||||
description: 资源未找到
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: './schemas.yaml#/Error'
|
||||
example:
|
||||
error:
|
||||
code: NOT_FOUND
|
||||
message: 请求的资源不存在
|
||||
|
||||
ValidationError:
|
||||
description: 参数验证失败
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: './schemas.yaml#/Error'
|
||||
example:
|
||||
error:
|
||||
code: VALIDATION_ERROR
|
||||
message: 参数验证失败
|
||||
details:
|
||||
field: 错误描述
|
||||
|
||||
TooManyRequests:
|
||||
description: 请求过多
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: './schemas.yaml#/Error'
|
||||
example:
|
||||
error:
|
||||
code: TOO_MANY_REQUESTS
|
||||
message: 请求过于频繁,请稍后再试
|
||||
|
||||
InternalError:
|
||||
description: 服务器内部错误
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: './schemas.yaml#/Error'
|
||||
example:
|
||||
error:
|
||||
code: INTERNAL_ERROR
|
||||
message: 服务器内部错误,请稍后再试
|
375
api/schemas/components/schemas.yaml
Normal file
375
api/schemas/components/schemas.yaml
Normal file
|
@ -0,0 +1,375 @@
|
|||
Response:
|
||||
type: object
|
||||
required:
|
||||
- data
|
||||
properties:
|
||||
data: {}
|
||||
meta:
|
||||
type: object
|
||||
properties:
|
||||
total:
|
||||
type: integer
|
||||
description: 总记录数
|
||||
page:
|
||||
type: integer
|
||||
description: 当前页码
|
||||
per_page:
|
||||
type: integer
|
||||
description: 每页记录数
|
||||
total_pages:
|
||||
type: integer
|
||||
description: 总页数
|
||||
links:
|
||||
type: object
|
||||
properties:
|
||||
self:
|
||||
type: string
|
||||
format: uri
|
||||
first:
|
||||
type: string
|
||||
format: uri
|
||||
last:
|
||||
type: string
|
||||
format: uri
|
||||
prev:
|
||||
type: string
|
||||
format: uri
|
||||
next:
|
||||
type: string
|
||||
format: uri
|
||||
|
||||
Error:
|
||||
type: object
|
||||
required:
|
||||
- error
|
||||
properties:
|
||||
error:
|
||||
type: object
|
||||
required:
|
||||
- code
|
||||
- message
|
||||
properties:
|
||||
code:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
details:
|
||||
type: object
|
||||
|
||||
User:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- email
|
||||
- role
|
||||
- status
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
role:
|
||||
type: string
|
||||
enum:
|
||||
- admin
|
||||
- editor
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- active
|
||||
- inactive
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
Post:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- slug
|
||||
- status
|
||||
- contents
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
slug:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
enum:
|
||||
- draft
|
||||
- published
|
||||
contents:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/PostContent'
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
PostContent:
|
||||
type: object
|
||||
required:
|
||||
- language_code
|
||||
- title
|
||||
- content_markdown
|
||||
properties:
|
||||
language_code:
|
||||
type: string
|
||||
enum:
|
||||
- en
|
||||
- zh-Hans
|
||||
- zh-Hant
|
||||
title:
|
||||
type: string
|
||||
content_markdown:
|
||||
type: string
|
||||
summary:
|
||||
type: string
|
||||
meta_keywords:
|
||||
type: string
|
||||
meta_description:
|
||||
type: string
|
||||
|
||||
Category:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- contents
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
contents:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/CategoryContent'
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
CategoryContent:
|
||||
type: object
|
||||
required:
|
||||
- language_code
|
||||
- name
|
||||
- slug
|
||||
properties:
|
||||
language_code:
|
||||
type: string
|
||||
enum:
|
||||
- en
|
||||
- zh-Hans
|
||||
- zh-Hant
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
|
||||
Contributor:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
name:
|
||||
type: string
|
||||
avatar_url:
|
||||
type: string
|
||||
format: uri
|
||||
bio:
|
||||
type: string
|
||||
social_links:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- type
|
||||
- value
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- WeChat
|
||||
- Bilibili
|
||||
- Douyin/TikTok
|
||||
- Kuaishou
|
||||
- NCM
|
||||
- Xiaohongshu
|
||||
- QQ_Personal
|
||||
- QQ_Group
|
||||
- QQ_Channel
|
||||
- Zhihu
|
||||
- SinaWeibo
|
||||
- Feishu/Lark
|
||||
- DingTalk
|
||||
- Douban
|
||||
- CoolAPK
|
||||
- Tieba
|
||||
- Keyoxide
|
||||
- GitHub
|
||||
- Codeberg
|
||||
- SourceHut
|
||||
- Forgejo
|
||||
- Gitea
|
||||
- Facebook
|
||||
- Instagram
|
||||
- Twitter/X
|
||||
- Snapchat
|
||||
- Telegram
|
||||
- WhatsApp
|
||||
- LinkedIn
|
||||
- Reddit
|
||||
- YouTube
|
||||
- Pinterest
|
||||
- Bluesky
|
||||
- Mastodon
|
||||
- Fediverse
|
||||
- Matrix
|
||||
- XMPP
|
||||
- IRC
|
||||
- HomePage
|
||||
- AFDian
|
||||
- Paypal
|
||||
- LiberPay
|
||||
- Patreon
|
||||
- Ko-Fi
|
||||
- Custom
|
||||
name:
|
||||
type: string
|
||||
description: 'Optional name for the social link, required only for Custom type'
|
||||
value:
|
||||
type: string
|
||||
description: The actual link or identifier value
|
||||
user_id:
|
||||
type: integer
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
Media:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- url
|
||||
- mime_type
|
||||
- original_name
|
||||
- storage_id
|
||||
- size
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
storage_id:
|
||||
type: string
|
||||
description: 存储系统中的唯一标识符
|
||||
original_name:
|
||||
type: string
|
||||
description: 原始文件名
|
||||
url:
|
||||
type: string
|
||||
format: uri
|
||||
description: 文件访问 URL
|
||||
mime_type:
|
||||
type: string
|
||||
description: 文件的 MIME 类型,图片将被转换为 image/webp
|
||||
size:
|
||||
type: integer
|
||||
format: int64
|
||||
description: 文件大小(字节)
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
created_by:
|
||||
type: string
|
||||
description: 创建者 ID
|
||||
|
||||
DailyCategory:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- contents
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
contents:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- language_code
|
||||
- name
|
||||
properties:
|
||||
language_code:
|
||||
type: string
|
||||
enum:
|
||||
- en
|
||||
- zh-Hans
|
||||
- zh-Hant
|
||||
name:
|
||||
type: string
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
Daily:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- category
|
||||
- image_url
|
||||
- contents
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
pattern: '^\d{6}$'
|
||||
examples:
|
||||
- '250206'
|
||||
category:
|
||||
$ref: '#/DailyCategory'
|
||||
image_url:
|
||||
type: string
|
||||
format: uri
|
||||
contents:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required:
|
||||
- language_code
|
||||
- quote
|
||||
properties:
|
||||
language_code:
|
||||
type: string
|
||||
enum:
|
||||
- en
|
||||
- zh-Hans
|
||||
- zh-Hant
|
||||
quote:
|
||||
type: string
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
updated_at:
|
||||
type: string
|
||||
format: date-time
|
Loading…
Add table
Add a link
Reference in a new issue