feat: 统一字段命名风格,使用下划线格式替代驼峰式命名

This commit is contained in:
2025-12-29 10:20:53 +08:00
parent d482905157
commit 60ff49d4c8
8 changed files with 106 additions and 105 deletions

View File

@@ -24,15 +24,18 @@ components:
message:
type: string
Pagination:
Pager:
type: object
properties:
page:
type: integer
pageSize:
limit:
type: integer
total:
type: integer
items:
type: array
items: {} # Generic placeholder
# --- User Models ---
User:
@@ -67,7 +70,7 @@ components:
points:
type: integer
readOnly: true
isRealNameVerified:
is_real_name_verified:
type: boolean
readOnly: true
@@ -111,17 +114,17 @@ components:
enum: [video, audio, article]
price:
type: number
authorId:
author_id:
type: string
authorName:
author_name:
type: string
authorAvatar:
author_avatar:
type: string
views:
type: integer
likes:
type: integer
isPurchased:
is_purchased:
type: boolean
description: User specific state
@@ -134,7 +137,7 @@ components:
type: string
body:
type: string # HTML/Markdown
mediaUrls:
media_urls:
type: array
items:
type: object
@@ -154,10 +157,10 @@ components:
type: string
beat:
type: string
isLiked:
is_liked:
type: boolean
description: User specific state
isFavorited:
is_favorited:
type: boolean
description: User specific state
@@ -168,19 +171,19 @@ components:
type: string
content:
type: string
userId:
user_id:
type: string
userNickname:
user_nickname:
type: string
userAvatar:
user_avatar:
type: string
createTime:
create_time:
type: string
likes:
type: integer
isLiked:
is_liked:
type: boolean
replyTo:
reply_to:
type: string # Comment ID
# --- Tenant/Creator Public Profile ---
@@ -199,7 +202,7 @@ components:
type: string
description:
type: string
certType:
cert_type:
type: string
enum: [personal, enterprise]
stats:
@@ -211,7 +214,7 @@ components:
type: integer
likes:
type: integer
isFollowing:
is_following:
type: boolean
# --- Order Models ---
@@ -220,10 +223,10 @@ components:
properties:
id:
type: string
createTime:
create_time:
type: string
format: date-time
payTime:
pay_time:
type: string
format: date-time
status:
@@ -237,18 +240,18 @@ components:
type: array
items:
$ref: '#/components/schemas/ContentItem'
tenantId:
tenant_id:
type: string
tenantName:
tenant_name:
type: string
isVirtual:
is_virtual:
type: boolean
# --- Creator Dashboard Models ---
CreatorStats:
type: object
properties:
totalFollowers:
total_followers:
type: object
properties:
value:
@@ -256,16 +259,16 @@ components:
trend:
type: number
description: Percentage change (e.g. 1.2 for +1.2%)
totalRevenue:
total_revenue:
type: object
properties:
value:
type: number
trend:
type: number
pendingRefunds:
pending_refunds:
type: integer
newMessages:
new_messages:
type: integer
PayoutAccount:
@@ -295,7 +298,7 @@ components:
type: string
size:
type: integer
mimeType:
mime_type:
type: string
security:
@@ -367,7 +370,7 @@ paths:
in: query
schema:
type: string
- name: tenantId
- name: tenant_id
in: query
schema:
type: string
@@ -387,14 +390,14 @@ paths:
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/ContentItem'
pagination:
$ref: '#/components/schemas/Pagination'
allOf:
- $ref: '#/components/schemas/Pager'
- type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/ContentItem'
/contents/{id}:
get:
@@ -433,14 +436,14 @@ paths:
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Comment'
pagination:
$ref: '#/components/schemas/Pagination'
allOf:
- $ref: '#/components/schemas/Pager'
- type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/Comment'
post:
summary: Post a comment
requestBody:
@@ -451,7 +454,7 @@ paths:
properties:
content:
type: string
replyTo:
reply_to:
type: string
responses:
'200':
@@ -573,7 +576,7 @@ paths:
properties:
realname:
type: string
idCard:
id_card:
type: string
responses:
'200':
@@ -630,9 +633,9 @@ paths:
schema:
type: object
properties:
payParams:
pay_params:
type: string # QR code or SDK params
orderId:
order_id:
type: string
/me/orders:
@@ -695,7 +698,7 @@ paths:
post:
summary: Add to favorites
parameters:
- name: contentId
- name: content_id
in: query
required: true
schema:
@@ -704,11 +707,11 @@ paths:
'200':
description: Added
/me/favorites/{contentId}:
/me/favorites/{content_id}:
delete:
summary: Remove from favorites
parameters:
- name: contentId
- name: content_id
in: path
required: true
schema:
@@ -731,7 +734,7 @@ paths:
post:
summary: Like content
parameters:
- name: contentId
- name: content_id
in: query
required: true
schema:
@@ -740,11 +743,11 @@ paths:
'200':
description: Liked
/me/likes/{contentId}:
/me/likes/{content_id}:
delete:
summary: Unlike content
parameters:
- name: contentId
- name: content_id
in: path
required: true
schema:
@@ -796,7 +799,7 @@ paths:
schema:
type: object
properties:
contentId:
content_id:
type: string
sku:
type: string
@@ -810,7 +813,7 @@ paths:
schema:
type: object
properties:
orderId:
order_id:
type: string
/orders/{id}/pay:
@@ -838,7 +841,7 @@ paths:
schema:
type: object
properties:
payParams:
pay_params:
type: string
/orders/{id}/status:
@@ -931,7 +934,7 @@ paths:
type: string
price:
type: number
mediaIds:
media_ids:
type: array
items:
type: string
@@ -1093,7 +1096,7 @@ paths:
method:
type: string
enum: [wallet, external]
accountId:
account_id:
type: string # Required if method is external
responses:
'200':
@@ -1122,4 +1125,4 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/UploadResult'
$ref: '#/components/schemas/UploadResult'