Files
quyun-v2/backend/docs/swagger.yaml

2798 lines
79 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
basePath: /
definitions:
consts.ContentAccessStatus:
enum:
- active
- revoked
- expired
type: string
x-enum-varnames:
- ContentAccessStatusActive
- ContentAccessStatusRevoked
- ContentAccessStatusExpired
consts.ContentAssetRole:
enum:
- main
- cover
- preview
type: string
x-enum-varnames:
- ContentAssetRoleMain
- ContentAssetRoleCover
- ContentAssetRolePreview
consts.ContentStatus:
enum:
- draft
- reviewing
- published
- unpublished
- blocked
type: string
x-enum-varnames:
- ContentStatusDraft
- ContentStatusReviewing
- ContentStatusPublished
- ContentStatusUnpublished
- ContentStatusBlocked
consts.ContentVisibility:
enum:
- public
- tenant_only
- private
type: string
x-enum-varnames:
- ContentVisibilityPublic
- ContentVisibilityTenantOnly
- ContentVisibilityPrivate
consts.Currency:
enum:
- CNY
type: string
x-enum-varnames:
- CurrencyCNY
consts.DiscountType:
enum:
- none
- percent
- amount
type: string
x-enum-varnames:
- DiscountTypeNone
- DiscountTypePercent
- DiscountTypeAmount
consts.MediaAssetStatus:
enum:
- uploaded
- processing
- ready
- failed
- deleted
type: string
x-enum-varnames:
- MediaAssetStatusUploaded
- MediaAssetStatusProcessing
- MediaAssetStatusReady
- MediaAssetStatusFailed
- MediaAssetStatusDeleted
consts.MediaAssetType:
enum:
- video
- audio
- image
type: string
x-enum-varnames:
- MediaAssetTypeVideo
- MediaAssetTypeAudio
- MediaAssetTypeImage
consts.OrderStatus:
enum:
- created
- paid
- refunding
- refunded
- canceled
- failed
type: string
x-enum-varnames:
- OrderStatusCreated
- OrderStatusPaid
- OrderStatusRefunding
- OrderStatusRefunded
- OrderStatusCanceled
- OrderStatusFailed
consts.OrderType:
enum:
- content_purchase
- topup
type: string
x-enum-varnames:
- OrderTypeContentPurchase
- OrderTypeTopup
consts.Role:
enum:
- user
- super_admin
type: string
x-enum-varnames:
- RoleUser
- RoleSuperAdmin
consts.TenantInviteStatus:
enum:
- active
- disabled
- expired
type: string
x-enum-varnames:
- TenantInviteStatusActive
- TenantInviteStatusDisabled
- TenantInviteStatusExpired
consts.TenantJoinRequestStatus:
enum:
- pending
- approved
- rejected
type: string
x-enum-varnames:
- TenantJoinRequestStatusPending
- TenantJoinRequestStatusApproved
- TenantJoinRequestStatusRejected
consts.TenantLedgerType:
enum:
- credit_topup
- debit_purchase
- credit_refund
- freeze
- unfreeze
- adjustment
type: string
x-enum-varnames:
- TenantLedgerTypeCreditTopup
- TenantLedgerTypeDebitPurchase
- TenantLedgerTypeCreditRefund
- TenantLedgerTypeFreeze
- TenantLedgerTypeUnfreeze
- TenantLedgerTypeAdjustment
consts.TenantStatus:
enum:
- pending_verify
- verified
- banned
type: string
x-enum-varnames:
- TenantStatusPendingVerify
- TenantStatusVerified
- TenantStatusBanned
consts.TenantUserRole:
enum:
- member
- tenant_admin
type: string
x-enum-varnames:
- TenantUserRoleMember
- TenantUserRoleTenantAdmin
consts.UserStatus:
enum:
- pending_verify
- verified
- banned
type: string
x-enum-varnames:
- UserStatusPendingVerify
- UserStatusVerified
- UserStatusBanned
dto.AdminBatchTopupForm:
properties:
batch_idempotency_key:
description: BatchIdempotencyKey 批次幂等键:必须填写;用于重试同一批次时保证不会重复入账。
type: string
items:
description: Items 充值明细列表:至少 1 条;单批次条数在业务侧限制(避免拖垮系统)。
items:
$ref: '#/definitions/dto.AdminBatchTopupItem'
type: array
type: object
dto.AdminBatchTopupItem:
properties:
amount:
description: Amount 充值金额:单位分;必须 > 0。
type: integer
idempotency_key:
description: |-
IdempotencyKey 幂等键(可选):为空时后端会用 batch_idempotency_key 派生生成;
建议前端/调用方提供稳定值,便于重试时保持结果一致。
type: string
reason:
description: Reason 充值原因(可选):用于审计与追溯。
type: string
user_id:
description: UserID 目标用户ID必须属于当前租户否则该条充值失败。
type: integer
type: object
dto.AdminBatchTopupResponse:
properties:
failed:
description: Failed 失败条数。
type: integer
items:
description: Items 明细结果列表:与请求 items 顺序一致,便于前端逐条展示。
items:
$ref: '#/definitions/dto.AdminBatchTopupResultItem'
type: array
success:
description: Success 成功条数。
type: integer
total:
description: Total 总条数:等于 items 长度。
type: integer
type: object
dto.AdminBatchTopupResultItem:
properties:
amount:
description: Amount 充值金额(单位分)。
type: integer
error_code:
description: ErrorCode 错误码:失败时返回;成功时为 0。
type: integer
error_message:
description: ErrorMessage 错误信息:失败时返回;成功时为空。
type: string
idempotency_key:
description: IdempotencyKey 实际使用的幂等键:可能为客户端传入,也可能为后端派生生成。
type: string
ok:
description: OK 是否成功true 表示该条充值已成功入账或命中幂等成功结果。
type: boolean
order_id:
description: OrderID 生成的订单ID成功时返回失败时为 0。
type: integer
user_id:
description: UserID 目标用户ID。
type: integer
type: object
dto.AdminOrderDetail:
properties:
order:
allOf:
- $ref: '#/definitions/models.Order'
description: Order is the order with items preloaded.
type: object
dto.AdminOrderExportResponse:
properties:
content_type:
description: ContentType 内容类型:当前固定为 text/csv。
type: string
csv:
description: CSV CSV 文本内容UTF-8 编码,包含表头与数据行;前端可直接下载为文件。
type: string
filename:
description: Filename 建议文件名:前端可用于下载时的默认文件名。
type: string
type: object
dto.AdminOrderRefundForm:
properties:
force:
description: |-
Force indicates bypassing the default refund window check (paid_at + 24h).
强制退款true 表示绕过默认退款时间窗限制(需审计)。
type: boolean
idempotency_key:
description: |-
IdempotencyKey ensures refund request is processed at most once.
幂等键:同一笔退款重复请求时返回一致结果,避免重复退款/重复回滚。
type: string
reason:
description: |-
Reason is the human-readable refund reason used for audit.
退款原因:建议必填(由业务侧校验);用于审计与追责。
type: string
type: object
dto.AdminTenantInviteCreateForm:
properties:
code:
description: Code 邀请码(可选):为空时由后端生成;建议只包含数字/字母,便于人工输入。
type: string
expires_at:
description: ExpiresAt 过期时间(可选):为空表示不过期;到期后不可再使用。
type: string
max_uses:
description: MaxUses 最大可使用次数可选0 表示不限次数;大于 0 时用尽后自动失效。
type: integer
remark:
description: Remark 备注(可选):用于审计记录生成目的/投放渠道等。
type: string
type: object
dto.AdminTenantInviteDisableForm:
properties:
reason:
description: Reason 禁用原因(可选):用于审计与追溯。
type: string
type: object
dto.AdminTenantJoinRequestDecideForm:
properties:
reason:
description: Reason 审核说明(可选):用于审计记录通过/拒绝原因。
type: string
type: object
dto.AdminTenantUserItem:
properties:
tenant_user:
allOf:
- $ref: '#/definitions/models.TenantUser'
description: TenantUser 租户成员关系记录。
user:
allOf:
- $ref: '#/definitions/models.User'
description: User 用户基础信息(用于展示 username 等)。
type: object
dto.AdminTenantUserJoinResponse:
properties:
tenant_user:
allOf:
- $ref: '#/definitions/models.TenantUser'
description: TenantUser 租户成员关系记录。
type: object
dto.AdminTenantUserRoleUpdateForm:
properties:
role:
description: Role 角色member/tenant_admin。
type: string
type: object
dto.AdminTopupForm:
properties:
amount:
description: Amount is the topup amount in cents (CNY 分); must be > 0.
type: integer
idempotency_key:
description: IdempotencyKey ensures the topup request is processed at most
once.
type: string
reason:
description: Reason is the human-readable topup reason used for audit.
type: string
type: object
dto.ContentAssetAttachForm:
properties:
asset_id:
description: AssetID is the media asset id to attach.
type: integer
role:
allOf:
- $ref: '#/definitions/consts.ContentAssetRole'
description: Role indicates how this asset is used (main/cover/preview).
sort:
description: Sort controls ordering under the same role.
type: integer
type: object
dto.ContentAssetsResponse:
properties:
assets:
description: Assets is the list of media assets for the requested role (preview/main).
items:
$ref: '#/definitions/models.MediaAsset'
type: array
content:
allOf:
- $ref: '#/definitions/models.Content'
description: Content is the content entity.
preview_seconds:
description: PreviewSeconds indicates the max preview duration (only meaningful
for preview response).
type: integer
type: object
dto.ContentCreateForm:
properties:
description:
description: Description is the content description.
type: string
preview_seconds:
description: PreviewSeconds controls preview duration (defaults to 60 when
omitted).
type: integer
title:
description: Title is the content title.
type: string
visibility:
allOf:
- $ref: '#/definitions/consts.ContentVisibility'
description: Visibility controls who can view the content detail (main assets
still require free/purchase).
type: object
dto.ContentDetail:
properties:
content:
allOf:
- $ref: '#/definitions/models.Content'
description: Content is the content entity.
has_access:
description: HasAccess indicates whether current user can access main assets
(free/owner/purchased).
type: boolean
price:
allOf:
- $ref: '#/definitions/models.ContentPrice'
description: Price is the current price settings for the content (may be nil
if not set).
type: object
dto.ContentItem:
properties:
content:
allOf:
- $ref: '#/definitions/models.Content'
description: Content is the content entity.
has_access:
description: HasAccess indicates whether current user can access main assets
(free/owner/purchased).
type: boolean
price:
allOf:
- $ref: '#/definitions/models.ContentPrice'
description: Price is the current price settings for the content (may be nil
if not set).
type: object
dto.ContentPriceUpsertForm:
properties:
currency:
allOf:
- $ref: '#/definitions/consts.Currency'
description: Currency is fixed to CNY for now.
discount_end_at:
description: DiscountEndAt disables discount after this time (optional).
type: string
discount_start_at:
description: DiscountStartAt enables discount from this time (optional).
type: string
discount_type:
allOf:
- $ref: '#/definitions/consts.DiscountType'
description: DiscountType defines the discount algorithm (none/percent/amount).
discount_value:
description: DiscountValue is interpreted based on DiscountType.
type: integer
price_amount:
description: PriceAmount is the base price in cents (CNY 分).
type: integer
type: object
dto.ContentUpdateForm:
properties:
description:
description: Description updates the description when provided.
type: string
preview_seconds:
description: PreviewSeconds updates preview duration when provided (must be
> 0).
type: integer
status:
allOf:
- $ref: '#/definitions/consts.ContentStatus'
description: Status updates the content status when provided (e.g. publish/unpublish).
title:
description: Title updates the title when provided.
type: string
visibility:
allOf:
- $ref: '#/definitions/consts.ContentVisibility'
description: Visibility updates the visibility when provided.
type: object
dto.JoinByInviteForm:
properties:
invite_code:
description: InviteCode 邀请码:由租户管理员生成;用户提交后加入对应租户。
type: string
type: object
dto.JoinRequestCreateForm:
properties:
reason:
description: Reason 申请原因(可选):用于向租户管理员说明申请加入的目的。
type: string
type: object
dto.LoginForm:
properties:
password:
type: string
username:
type: string
type: object
dto.LoginResponse:
properties:
token:
type: string
type: object
dto.MeBalanceResponse:
properties:
balance:
description: Balance 可用余额:可用于购买/消费。
type: integer
balance_frozen:
description: BalanceFrozen 冻结余额:用于下单冻结/争议期等。
type: integer
currency:
allOf:
- $ref: '#/definitions/consts.Currency'
description: Currency 币种:当前固定 CNY金额单位为分
updated_at:
description: UpdatedAt 更新时间:余额变更时更新。
type: string
type: object
dto.MeResponse:
properties:
tenant:
allOf:
- $ref: '#/definitions/models.Tenant'
description: Tenant is the resolved tenant by `tenantCode`.
tenant_user:
allOf:
- $ref: '#/definitions/models.TenantUser'
description: TenantUser is the membership record of the authenticated user
within the tenant.
user:
allOf:
- $ref: '#/definitions/models.User'
description: User is the authenticated user derived from JWT `user_id`.
type: object
dto.MyLedgerItem:
properties:
ledger:
allOf:
- $ref: '#/definitions/models.TenantLedger'
description: Ledger 流水记录(租户内隔离)。
type_description:
description: TypeDescription 流水类型中文说明(用于前端展示)。
type: string
type: object
dto.PurchaseContentForm:
properties:
idempotency_key:
description: |-
IdempotencyKey is used to ensure the purchase request is processed at most once.
建议由客户端生成并保持稳定:同一笔购买重复请求时返回相同结果,避免重复扣款/重复下单。
type: string
type: object
dto.PurchaseContentResponse:
properties:
access:
allOf:
- $ref: '#/definitions/models.ContentAccess'
description: Access is the content access record after purchase grant.
amount_paid:
description: AmountPaid is the final paid amount in cents (CNY 分).
type: integer
item:
allOf:
- $ref: '#/definitions/models.OrderItem'
description: Item is the single order item of this purchase (current implementation
is 1 order -> 1 content).
order:
allOf:
- $ref: '#/definitions/models.Order'
description: Order is the created or existing order record (may be nil for
owner/free-path without order).
type: object
dto.TenantExpireUpdateForm:
properties:
duration:
enum:
- 7
- 30
- 90
- 180
- 365
type: integer
required:
- duration
type: object
dto.TenantItem:
properties:
code:
type: string
config:
items:
type: integer
type: array
created_at:
type: string
expired_at:
type: string
id:
type: integer
name:
type: string
status:
$ref: '#/definitions/consts.TenantStatus'
status_description:
type: string
updated_at:
type: string
user_balance:
type: integer
user_count:
type: integer
user_id:
type: integer
users:
items:
$ref: '#/definitions/models.User'
type: array
uuid:
type: string
type: object
dto.TenantStatusUpdateForm:
properties:
status:
allOf:
- $ref: '#/definitions/consts.TenantStatus'
enum:
- normal
- disabled
required:
- status
type: object
dto.UserItem:
properties:
created_at:
type: string
deleted_at:
$ref: '#/definitions/gorm.DeletedAt'
id:
type: integer
metas:
items:
type: integer
type: array
owned:
$ref: '#/definitions/models.Tenant'
password:
type: string
roles:
items:
$ref: '#/definitions/consts.Role'
type: array
status:
$ref: '#/definitions/consts.UserStatus'
status_description:
type: string
tenants:
items:
$ref: '#/definitions/models.Tenant'
type: array
updated_at:
type: string
username:
type: string
verified_at:
type: string
type: object
dto.UserStatistics:
properties:
count:
type: integer
status:
$ref: '#/definitions/consts.UserStatus'
status_description:
type: string
type: object
dto.UserStatusUpdateForm:
properties:
status:
allOf:
- $ref: '#/definitions/consts.UserStatus'
enum:
- normal
- disabled
required:
- status
type: object
gorm.DeletedAt:
properties:
time:
type: string
valid:
description: Valid is true if Time is not NULL
type: boolean
type: object
models.Content:
properties:
created_at:
description: 创建时间:默认 now();用于审计与排序
type: string
deleted_at:
allOf:
- $ref: '#/definitions/gorm.DeletedAt'
description: 软删除时间:非空表示已删除;对外接口需过滤
description:
description: 描述:用于详情页展示;可为空字符串
type: string
id:
description: 主键ID自增用于内容引用
type: integer
preview_downloadable:
description: 试看是否允许下载:默认 false当前策略固定为不允许下载仅 streaming
type: boolean
preview_seconds:
description: 试看秒数:默认 60只对 preview 资源生效;必须为正整数
type: integer
published_at:
description: 发布时间:首次发布时写入;用于时间窗与排序
type: string
status:
allOf:
- $ref: '#/definitions/consts.ContentStatus'
description: 状态draft/reviewing/published/unpublished/blockedpublished 才对外展示
tenant_id:
description: 租户ID多租户隔离关键字段所有查询/写入必须限定 tenant_id
type: integer
title:
description: 标题:用于列表展示与搜索;建议限制长度(由业务校验)
type: string
updated_at:
description: 更新时间:默认 now();编辑内容时写入
type: string
user_id:
description: 用户ID内容创建者/发布者;用于权限与审计(例如私有内容仅作者可见)
type: integer
visibility:
allOf:
- $ref: '#/definitions/consts.ContentVisibility'
description: 可见性public/tenant_only/private仅控制详情可见正片资源仍需按价格/权益校验
type: object
models.ContentAccess:
properties:
content_id:
description: 内容ID权益对应内容唯一约束 (tenant_id, user_id, content_id)
type: integer
created_at:
description: 创建时间:默认 now();用于审计
type: string
id:
description: 主键ID自增
type: integer
order_id:
description: 订单ID产生该权益的订单可为空例如后台补发/迁移)
type: integer
revoked_at:
description: 撤销时间:当 status=revoked 时写入;用于审计与追责
type: string
status:
allOf:
- $ref: '#/definitions/consts.ContentAccessStatus'
description: 权益状态active/revoked/expiredrevoked 表示立即失效(例如退款/违规)
tenant_id:
description: 租户ID多租户隔离与内容、用户归属一致
type: integer
updated_at:
description: 更新时间:默认 now();更新 status 时写入
type: string
user_id:
description: 用户ID权益所属用户用于访问校验
type: integer
type: object
models.ContentAsset:
properties:
asset_id:
description: 资源ID关联 media_assets.id用于查询资源归属内容
type: integer
content_id:
description: 内容ID关联 contents.id用于查询内容下资源列表
type: integer
created_at:
description: 创建时间:默认 now();用于审计
type: string
id:
description: 主键ID自增
type: integer
role:
allOf:
- $ref: '#/definitions/consts.ContentAssetRole'
description: 资源角色main/cover/previewpreview 必须为独立资源以满足禁下载与防绕过
sort:
description: 排序:同一 role 下的展示顺序,数值越小越靠前
type: integer
tenant_id:
description: 租户ID多租户隔离必须与 content_id、asset_id 所属租户一致
type: integer
updated_at:
description: 更新时间:默认 now();更新 sort/role 时写入
type: string
user_id:
description: 用户ID操作人/绑定人;用于审计(通常为租户管理员或作者)
type: integer
type: object
models.ContentPrice:
properties:
content_id:
description: 内容ID唯一约束 (tenant_id, content_id);一个内容在一个租户内仅一份定价
type: integer
created_at:
description: 创建时间:默认 now();用于审计
type: string
currency:
allOf:
- $ref: '#/definitions/consts.Currency'
description: 币种:当前固定 CNY金额单位为分
discount_end_at:
description: 折扣结束时间:可为空;为空表示长期有效(由业务逻辑解释)
type: string
discount_start_at:
description: 折扣开始时间:可为空;为空表示立即生效(由业务逻辑解释)
type: string
discount_type:
allOf:
- $ref: '#/definitions/consts.DiscountType'
description: 折扣类型none/percent/amount仅影响下单时成交价需写入订单快照
discount_value:
description: 折扣值percent=0-100按业务校验amount=分none 时忽略
type: integer
id:
description: 主键ID自增
type: integer
price_amount:
description: 基础价格0 表示免费(可直接访问正片资源)
type: integer
tenant_id:
description: 租户ID多租户隔离与内容归属一致
type: integer
updated_at:
description: 更新时间:默认 now();更新价格/折扣时写入
type: string
user_id:
description: 用户ID设置/更新价格的操作人(通常为 tenant_admin用于审计
type: integer
type: object
models.MediaAsset:
properties:
bucket:
description: 存储桶:对象所在 bucket与 provider 组合确定存储定位
type: string
created_at:
description: 创建时间:默认 now();用于审计与排序
type: string
deleted_at:
allOf:
- $ref: '#/definitions/gorm.DeletedAt'
description: 软删除时间:非空表示已删除;对外接口需过滤
id:
description: 主键ID自增仅用于内部关联
type: integer
meta:
description: 元数据JSON包含 hash、duration、width、height、bitrate、codec 等;用于展示与计费/风控
items:
type: integer
type: array
object_key:
description: 对象键:对象在 bucket 内的 key不得暴露可长期复用的直链通过签名URL/token下发
type: string
provider:
description: 存储提供方:例如 s3/minio/oss便于多存储扩展
type: string
status:
allOf:
- $ref: '#/definitions/consts.MediaAssetStatus'
description: 处理状态uploaded/processing/ready/failed/deletedready 才可被内容引用对外提供
tenant_id:
description: 租户ID多租户隔离关键字段所有查询/写入必须限定 tenant_id
type: integer
type:
allOf:
- $ref: '#/definitions/consts.MediaAssetType'
description: 资源类型video/audio/image决定后续处理流程转码/缩略图/封面等)
updated_at:
description: 更新时间:默认 now();更新状态/元数据时写入
type: string
user_id:
description: 用户ID资源上传者用于审计与权限控制
type: integer
type: object
models.Order:
properties:
amount_discount:
description: 优惠金额amount_paid = amount_original - amount_discount下单时快照
type: integer
amount_original:
description: 原价金额:分;未折扣前金额(用于展示与对账)
type: integer
amount_paid:
description: 实付金额:分;从租户内余额扣款的金额(下单时快照)
type: integer
created_at:
description: 创建时间:默认 now();用于审计与排序
type: string
currency:
allOf:
- $ref: '#/definitions/consts.Currency'
description: 币种:当前固定 CNY金额单位为分
id:
description: 主键ID自增用于关联订单明细、账本流水、权益等
type: integer
idempotency_key:
description: 幂等键:同一租户同一用户同一业务请求可用;用于防重复下单/重复扣款(建议由客户端生成)
type: string
items:
items:
$ref: '#/definitions/models.OrderItem'
type: array
paid_at:
description: 支付/扣款完成时间:余额支付在 debit_purchase 成功后写入
type: string
refund_forced:
description: 是否强制退款true 表示租户管理侧绕过时间窗执行退款(需审计)
type: boolean
refund_operator_user_id:
description: 退款操作人用户ID租户管理员/系统;用于审计与追责
type: integer
refund_reason:
description: 退款原因:后台/用户发起退款的原因说明;用于审计
type: string
refunded_at:
description: 退款完成时间:退款落账成功后写入
type: string
snapshot:
description: 订单快照JSON建议包含 content 标题/定价/折扣、请求来源等,避免改价影响历史展示
items:
type: integer
type: array
status:
allOf:
- $ref: '#/definitions/consts.OrderStatus'
description: 订单状态created/paid/refunding/refunded/canceled/failed状态变更需与账本/权益保持一致
tenant_id:
description: 租户ID多租户隔离关键字段所有查询/写入必须限定 tenant_id
type: integer
type:
allOf:
- $ref: '#/definitions/consts.OrderType'
description: 订单类型content_purchase购买内容/topup充值当前默认 content_purchase
updated_at:
description: 更新时间:默认 now();状态变更/退款写入时更新
type: string
user_id:
description: 用户ID下单用户buyer余额扣款与权益归属以该 user_id 为准
type: integer
type: object
models.OrderItem:
properties:
amount_paid:
description: 该行实付金额:分;通常等于订单 amount_paid单内容场景
type: integer
content:
$ref: '#/definitions/models.Content'
content_id:
description: 内容ID关联 contents.id用于生成/撤销 content_access
type: integer
content_user_id:
description: 内容作者用户ID用于后续分成/对账扩展;当前可为 0 或写入内容创建者
type: integer
created_at:
description: 创建时间:默认 now()
type: string
id:
description: 主键ID自增
type: integer
order:
$ref: '#/definitions/models.Order'
order_id:
description: 订单ID关联 orders.id用于聚合订单明细
type: integer
snapshot:
description: 内容快照JSON建议包含 title/price/discount 等,用于历史展示与审计
items:
type: integer
type: array
tenant_id:
description: 租户ID多租户隔离关键字段必须与 orders.tenant_id 一致
type: integer
updated_at:
description: 更新时间:默认 now()
type: string
user_id:
description: 用户ID下单用户buyer冗余字段用于查询加速与审计
type: integer
type: object
models.Tenant:
properties:
code:
type: string
config:
items:
type: integer
type: array
created_at:
type: string
expired_at:
type: string
id:
type: integer
name:
type: string
status:
$ref: '#/definitions/consts.TenantStatus'
updated_at:
type: string
user_id:
type: integer
users:
items:
$ref: '#/definitions/models.User'
type: array
uuid:
type: string
type: object
models.TenantInvite:
properties:
code:
description: 邀请码:用户加入租户时提交;同一租户内唯一
type: string
created_at:
description: 创建时间:默认 now()
type: string
disabled_at:
description: 禁用时间租户管理员禁用该邀请的时间UTC
type: string
disabled_operator_user_id:
description: 禁用操作人用户ID租户管理员审计用
type: integer
expires_at:
description: 过期时间到期后不可再使用UTC为空表示不过期
type: string
id:
description: 主键ID自增
type: integer
max_uses:
description: 最大可使用次数0 表示不限制;>0 时 used_count 达到该值后视为失效
type: integer
remark:
description: 备注:生成/禁用原因等(审计用)
type: string
status:
allOf:
- $ref: '#/definitions/consts.TenantInviteStatus'
description: 邀请状态active/disabled/expiredexpired 也可由 expires_at 推导,业务侧需保持一致
tenant_id:
description: 租户ID多租户隔离关键字段所有查询/写入必须限定 tenant_id
type: integer
updated_at:
description: 更新时间:默认 now()
type: string
used_count:
description: 已使用次数:每次成功加入时 +1需事务保证并发下不超发
type: integer
user_id:
description: 创建人用户ID生成邀请码的租户管理员审计用
type: integer
type: object
models.TenantJoinRequest:
properties:
created_at:
description: 创建时间:默认 now()
type: string
decided_at:
description: 处理时间:审核通过/拒绝时记录UTC
type: string
decided_operator_user_id:
description: 处理人用户ID租户管理员审计用
type: integer
decided_reason:
description: 处理说明:管理员通过/拒绝的原因(可选,审计用)
type: string
id:
description: 主键ID自增
type: integer
reason:
description: 申请原因:用户填写的加入说明(可选)
type: string
status:
allOf:
- $ref: '#/definitions/consts.TenantJoinRequestStatus'
description: 申请状态pending/approved/rejected状态变更需记录 decided_at 与 decided_operator_user_id
tenant_id:
description: 租户ID多租户隔离关键字段所有查询/写入必须限定 tenant_id
type: integer
updated_at:
description: 更新时间:默认 now()
type: string
user_id:
description: 申请人用户ID发起加入申请的用户
type: integer
type: object
models.TenantLedger:
properties:
amount:
description: 流水金额:分/最小货币单位;通常为正数,方向由 type 决定(由业务层约束)
type: integer
balance_after:
description: 变更后可用余额:用于审计与对账回放
type: integer
balance_before:
description: 变更前可用余额:用于审计与对账回放
type: integer
created_at:
description: 创建时间:默认 now()
type: string
frozen_after:
description: 变更后冻结余额:用于审计与对账回放
type: integer
frozen_before:
description: 变更前冻结余额:用于审计与对账回放
type: integer
id:
description: 主键ID自增
type: integer
idempotency_key:
description: 幂等键:同一租户同一用户同一业务操作固定;用于防止重复落账(建议由业务层生成)
type: string
order:
$ref: '#/definitions/models.Order'
order_id:
description: 关联订单ID购买/退款类流水应关联 orders.id非订单类可为空
type: integer
remark:
description: 备注:业务说明/后台操作原因等;用于审计
type: string
tenant_id:
description: 租户ID多租户隔离关键字段必须与 tenant_users.tenant_id 一致
type: integer
type:
allOf:
- $ref: '#/definitions/consts.TenantLedgerType'
description: 流水类型credit_topup/debit_purchase/credit_refund/freeze/unfreeze/adjustment不同类型决定余额/冻结余额的变更方向
updated_at:
description: 更新时间:默认 now()
type: string
user_id:
description: 用户ID余额账户归属用户对应 tenant_users.user_id
type: integer
type: object
models.TenantUser:
properties:
balance:
type: integer
balance_frozen:
description: 冻结余额:分/最小货币单位;下单冻结时从可用余额转入,最终扣款或回滚时转出;默认 0
type: integer
created_at:
type: string
id:
type: integer
role:
items:
$ref: '#/definitions/consts.TenantUserRole'
type: array
status:
$ref: '#/definitions/consts.UserStatus'
tenant_id:
type: integer
updated_at:
type: string
user_id:
type: integer
type: object
models.User:
properties:
created_at:
type: string
deleted_at:
$ref: '#/definitions/gorm.DeletedAt'
id:
type: integer
metas:
items:
type: integer
type: array
owned:
$ref: '#/definitions/models.Tenant'
password:
type: string
roles:
items:
$ref: '#/definitions/consts.Role'
type: array
status:
$ref: '#/definitions/consts.UserStatus'
tenants:
items:
$ref: '#/definitions/models.Tenant'
type: array
updated_at:
type: string
username:
type: string
verified_at:
type: string
type: object
requests.KV:
properties:
key:
description: Key is a machine-readable value, usually an enum string.
type: string
value:
description: Value is the label payload, often a human-readable string.
type: object
requests.Pager:
properties:
items:
description: Items is the paged result list; concrete type depends on endpoint.
limit:
description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
type: integer
page:
description: Page is 1-based page index; values <= 0 are normalized to 1.
type: integer
total:
description: Total is the total number of items matching current filter (before
paging).
type: integer
type: object
externalDocs:
description: OpenAPI
url: https://swagger.io/resources/open-api/
host: localhost:8080
info:
contact:
email: support@swagger.io
name: UserName
url: http://www.swagger.io/support
description: Multi-tenant media platform backend API.
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: ApiDoc
version: "1.0"
paths:
/super/v1/auth/login:
post:
consumes:
- application/json
parameters:
- description: form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.LoginForm'
produces:
- application/json
responses:
"200":
description: 成功
schema:
$ref: '#/definitions/dto.LoginResponse'
tags:
- Super
/super/v1/auth/token:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: 成功
schema:
$ref: '#/definitions/dto.LoginResponse'
tags:
- Super
/super/v1/tenants:
get:
consumes:
- application/json
parameters:
- description: Asc specifies comma-separated field names to sort ascending by.
in: query
name: asc
type: string
- description: Desc specifies comma-separated field names to sort descending
by.
in: query
name: desc
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- in: query
name: name
type: string
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- enum:
- pending_verify
- verified
- banned
in: query
name: status
type: string
x-enum-varnames:
- TenantStatusPendingVerify
- TenantStatusVerified
- TenantStatusBanned
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/dto.TenantItem'
type: object
summary: 租户列表
tags:
- Super
/super/v1/tenants/{tenantID}:
patch:
consumes:
- application/json
parameters:
- description: TenantID
format: int64
in: path
name: tenantID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.TenantExpireUpdateForm'
produces:
- application/json
responses: {}
summary: 更新过期时间
tags:
- Super
/super/v1/tenants/{tenantID}/status:
patch:
consumes:
- application/json
parameters:
- description: TenantID
format: int64
in: path
name: tenantID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.TenantStatusUpdateForm'
produces:
- application/json
responses: {}
summary: 更新租户状态
tags:
- Super
/super/v1/tenants/statuses:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/requests.KV'
type: array
summary: 租户状态列表
tags:
- Super
/super/v1/users:
get:
consumes:
- application/json
parameters:
- description: Asc specifies comma-separated field names to sort ascending by.
in: query
name: asc
type: string
- description: Desc specifies comma-separated field names to sort descending
by.
in: query
name: desc
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- enum:
- pending_verify
- verified
- banned
in: query
name: status
type: string
x-enum-varnames:
- UserStatusPendingVerify
- UserStatusVerified
- UserStatusBanned
- in: query
name: tenantID
type: integer
- in: query
name: username
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/dto.UserItem'
type: object
summary: 租户列表
tags:
- Super
/super/v1/users/{userID}/status:
patch:
consumes:
- application/json
parameters:
- description: UserID
format: int64
in: path
name: userID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.UserStatusUpdateForm'
produces:
- application/json
responses: {}
summary: 更新用户状态
tags:
- Super
/super/v1/users/statistics:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/dto.UserStatistics'
type: array
summary: 用户统计信息
tags:
- Super
/super/v1/users/statuses:
get:
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/requests.KV'
type: array
summary: 用户状态列表
tags:
- Super
/t/{tenantCode}/v1/admin/contents:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.ContentCreateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Content'
summary: 创建内容(草稿)
tags:
- Tenant
/t/{tenantCode}/v1/admin/contents/{contentID}:
patch:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.ContentUpdateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Content'
summary: 更新内容(标题/描述/状态等)
tags:
- Tenant
/t/{tenantCode}/v1/admin/contents/{contentID}/assets:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.ContentAssetAttachForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.ContentAsset'
summary: 绑定媒体资源到内容main/cover/preview
tags:
- Tenant
/t/{tenantCode}/v1/admin/contents/{contentID}/price:
put:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.ContentPriceUpsertForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.ContentPrice'
summary: 设置内容价格与折扣
tags:
- Tenant
/t/{tenantCode}/v1/admin/invites:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Code 按邀请码模糊过滤可选支持部分匹配like
in: query
name: code
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- description: Status 按状态过滤可选active/disabled/expired。
enum:
- active
- disabled
- expired
in: query
name: status
type: string
x-enum-varnames:
- TenantInviteStatusActive
- TenantInviteStatusDisabled
- TenantInviteStatusExpired
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/models.TenantInvite'
type: object
summary: 邀请码列表(租户管理)
tags:
- Tenant
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminTenantInviteCreateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.TenantInvite'
summary: 创建邀请码(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/invites/{inviteID}/disable:
patch:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: InviteID
format: int64
in: path
name: inviteID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminTenantInviteDisableForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.TenantInvite'
summary: 禁用邀请码(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/join-requests:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- description: Status 按申请状态过滤可选pending/approved/rejected。
enum:
- pending
- approved
- rejected
in: query
name: status
type: string
x-enum-varnames:
- TenantJoinRequestStatusPending
- TenantJoinRequestStatusApproved
- TenantJoinRequestStatusRejected
- description: UserID 按申请人用户ID过滤可选
in: query
name: user_id
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/models.TenantJoinRequest'
type: object
summary: 加入申请列表(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/join-requests/{requestID}/approve:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: RequestID
format: int64
in: path
name: requestID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.TenantJoinRequest'
summary: 通过加入申请(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/join-requests/{requestID}/reject:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: RequestID
format: int64
in: path
name: requestID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.TenantJoinRequest'
summary: 拒绝加入申请(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/orders:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: AmountPaidMax 实付金额上限可选amount_paid <= 该值(单位分)。
in: query
name: amount_paid_max
type: integer
- description: AmountPaidMin 实付金额下限可选amount_paid >= 该值(单位分)。
in: query
name: amount_paid_min
type: integer
- description: Asc specifies comma-separated field names to sort ascending by.
in: query
name: asc
type: string
- description: ContentID 内容ID可选通过 order_items 关联过滤。
in: query
name: content_id
type: integer
- description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.titlelike
in: query
name: content_title
type: string
- description: CreatedAtFrom 创建时间起可选created_at >= 该时间(用于按创建时间筛选)。
in: query
name: created_at_from
type: string
- description: CreatedAtTo 创建时间止可选created_at <= 该时间(用于按创建时间筛选)。
in: query
name: created_at_to
type: string
- description: Desc specifies comma-separated field names to sort descending
by.
in: query
name: desc
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- description: PaidAtFrom 支付时间起可选paid_at >= 该时间(用于按支付时间筛选)。
in: query
name: paid_at_from
type: string
- description: PaidAtTo 支付时间止可选paid_at <= 该时间(用于按支付时间筛选)。
in: query
name: paid_at_to
type: string
- description: Status 订单状态可选created/paid/refunding/refunded/canceled/failed。
enum:
- created
- paid
- refunding
- refunded
- canceled
- failed
in: query
name: status
type: string
x-enum-varnames:
- OrderStatusCreated
- OrderStatusPaid
- OrderStatusRefunding
- OrderStatusRefunded
- OrderStatusCanceled
- OrderStatusFailed
- description: Type 订单类型可选content_purchase/topup 等。
enum:
- content_purchase
- topup
in: query
name: type
type: string
x-enum-varnames:
- OrderTypeContentPurchase
- OrderTypeTopup
- description: UserID 下单用户ID可选按买家用户ID精确过滤。
in: query
name: user_id
type: integer
- description: Username 下单用户用户名关键字(可选):模糊匹配 users.usernamelike
in: query
name: username
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/models.Order'
type: object
summary: 订单列表(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/orders/{orderID}:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: OrderID
format: int64
in: path
name: orderID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.AdminOrderDetail'
summary: 订单详情(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/orders/{orderID}/refund:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: OrderID
format: int64
in: path
name: orderID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminOrderRefundForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Order'
summary: 订单退款(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/orders/export:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: AmountPaidMax 实付金额上限可选amount_paid <= 该值(单位分)。
in: query
name: amount_paid_max
type: integer
- description: AmountPaidMin 实付金额下限可选amount_paid >= 该值(单位分)。
in: query
name: amount_paid_min
type: integer
- description: Asc specifies comma-separated field names to sort ascending by.
in: query
name: asc
type: string
- description: ContentID 内容ID可选通过 order_items 关联过滤。
in: query
name: content_id
type: integer
- description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.titlelike
in: query
name: content_title
type: string
- description: CreatedAtFrom 创建时间起可选created_at >= 该时间(用于按创建时间筛选)。
in: query
name: created_at_from
type: string
- description: CreatedAtTo 创建时间止可选created_at <= 该时间(用于按创建时间筛选)。
in: query
name: created_at_to
type: string
- description: Desc specifies comma-separated field names to sort descending
by.
in: query
name: desc
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- description: PaidAtFrom 支付时间起可选paid_at >= 该时间(用于按支付时间筛选)。
in: query
name: paid_at_from
type: string
- description: PaidAtTo 支付时间止可选paid_at <= 该时间(用于按支付时间筛选)。
in: query
name: paid_at_to
type: string
- description: Status 订单状态可选created/paid/refunding/refunded/canceled/failed。
enum:
- created
- paid
- refunding
- refunded
- canceled
- failed
in: query
name: status
type: string
x-enum-varnames:
- OrderStatusCreated
- OrderStatusPaid
- OrderStatusRefunding
- OrderStatusRefunded
- OrderStatusCanceled
- OrderStatusFailed
- description: Type 订单类型可选content_purchase/topup 等。
enum:
- content_purchase
- topup
in: query
name: type
type: string
x-enum-varnames:
- OrderTypeContentPurchase
- OrderTypeTopup
- description: UserID 下单用户ID可选按买家用户ID精确过滤。
in: query
name: user_id
type: integer
- description: Username 下单用户用户名关键字(可选):模糊匹配 users.usernamelike
in: query
name: username
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.AdminOrderExportResponse'
summary: 订单导出(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/users:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- description: Role 按角色过滤可选member/tenant_admin。
enum:
- member
- tenant_admin
in: query
name: role
type: string
x-enum-varnames:
- TenantUserRoleMember
- TenantUserRoleTenantAdmin
- description: Status 按成员状态过滤可选pending_verify/verified/banned。
enum:
- pending_verify
- verified
- banned
in: query
name: status
type: string
x-enum-varnames:
- UserStatusPendingVerify
- UserStatusVerified
- UserStatusBanned
- description: UserID 按用户ID过滤可选
in: query
name: user_id
type: integer
- description: Username 按用户名模糊查询(可选,支持包含匹配)。
in: query
name: username
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/dto.AdminTenantUserItem'
type: object
summary: 成员列表(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/users/{userID}:
delete:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: UserID
format: int64
in: path
name: userID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/requests.Pager'
summary: 移除租户成员(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/users/{userID}/join:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: UserID
format: int64
in: path
name: userID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.AdminTenantUserJoinResponse'
summary: 添加租户成员(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/users/{userID}/role:
patch:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: UserID
format: int64
in: path
name: userID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminTenantUserRoleUpdateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.AdminTenantUserJoinResponse'
summary: 设置成员角色(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/users/{userID}/topup:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: UserID
format: int64
in: path
name: userID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminTopupForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Order'
summary: 为租户成员充值(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/admin/users/topup/batch:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.AdminBatchTopupForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.AdminBatchTopupResponse'
summary: 批量为租户成员充值(租户管理)
tags:
- Tenant
/t/{tenantCode}/v1/contents:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Keyword filters by title keyword (LIKE).
in: query
name: keyword
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/dto.ContentItem'
type: object
summary: 内容列表(已发布)
tags:
- Tenant
/t/{tenantCode}/v1/contents/{contentID}:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.ContentDetail'
summary: 内容详情(可见性+权益校验)
tags:
- Tenant
/t/{tenantCode}/v1/contents/{contentID}/assets:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.ContentAssetsResponse'
summary: 获取正片资源main role需要已购或免费
tags:
- Tenant
/t/{tenantCode}/v1/contents/{contentID}/preview:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.ContentAssetsResponse'
summary: 获取试看资源preview role
tags:
- Tenant
/t/{tenantCode}/v1/contents/{contentID}/purchase:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.PurchaseContentForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.PurchaseContentResponse'
summary: 购买内容(余额支付)
tags:
- Tenant
/t/{tenantCode}/v1/join/invite:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.JoinByInviteForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.TenantUser'
summary: 通过邀请码加入租户
tags:
- TenantJoin
/t/{tenantCode}/v1/join/request:
post:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Form
in: body
name: form
required: true
schema:
$ref: '#/definitions/dto.JoinRequestCreateForm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.TenantJoinRequest'
summary: 提交加入租户申请
tags:
- TenantJoin
/t/{tenantCode}/v1/me:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.MeResponse'
summary: 当前租户上下文信息
tags:
- Tenant
/t/{tenantCode}/v1/me/balance:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.MeBalanceResponse'
summary: 当前租户余额信息
tags:
- Tenant
/t/{tenantCode}/v1/me/ledgers:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/dto.MyLedgerItem'
type: object
summary: 当前租户余额流水(分页)
tags:
- Tenant
/t/{tenantCode}/v1/orders:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID filters orders by purchased content id (via order_items
join).
in: query
name: content_id
type: integer
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
- description: PaidAtFrom filters orders by paid_at >= this time.
in: query
name: paid_at_from
type: string
- description: PaidAtTo filters orders by paid_at <= this time.
in: query
name: paid_at_to
type: string
- description: Status filters orders by order status.
enum:
- created
- paid
- refunding
- refunded
- canceled
- failed
in: query
name: status
type: string
x-enum-varnames:
- OrderStatusCreated
- OrderStatusPaid
- OrderStatusRefunding
- OrderStatusRefunded
- OrderStatusCanceled
- OrderStatusFailed
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/models.Order'
type: object
summary: 我的订单列表(当前租户)
tags:
- Tenant
/t/{tenantCode}/v1/orders/{orderID}:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: OrderID
format: int64
in: path
name: orderID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Order'
summary: 我的订单详情(当前租户)
tags:
- Tenant
/t/{tenantCode}/v1/public/contents:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: Keyword filters by title keyword (LIKE).
in: query
name: keyword
type: string
- description: Limit is page size; only values in {10,20,50,100} are accepted
(otherwise defaults to 10).
in: query
name: limit
type: integer
- description: Page is 1-based page index; values <= 0 are normalized to 1.
in: query
name: page
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/requests.Pager'
- properties:
items:
$ref: '#/definitions/dto.ContentItem'
type: object
summary: 公开内容列表(已发布 + public
tags:
- TenantPublic
/t/{tenantCode}/v1/public/contents/{contentID}:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.ContentDetail'
summary: 公开内容详情(已发布 + public
tags:
- TenantPublic
/t/{tenantCode}/v1/public/contents/{contentID}/assets:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.ContentAssetsResponse'
summary: 获取公开正片资源main role免费/作者/已购)
tags:
- TenantPublic
/t/{tenantCode}/v1/public/contents/{contentID}/preview:
get:
consumes:
- application/json
parameters:
- description: Tenant Code
in: path
name: tenantCode
required: true
type: string
- description: ContentID
format: int64
in: path
name: contentID
required: true
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/dto.ContentAssetsResponse'
summary: 获取公开试看资源preview role
tags:
- TenantPublic
securityDefinitions:
BasicAuth:
type: basic
swagger: "2.0"