只整理 api 相关的改动,用于和前端人员对接使用。
接口前缀: /api/admin_center
POST /service_request/cancel
id(service_request_id)status=pending 取消admin_canceledPOST /work_task/cancel
id(work_task_id)status in (pending, wait_pay) 取消admin_canceledPOST /service_request/list 的 status 筛选新增支持:admin_canceledPOST /api/admin_center/service_request/cancel
POST /api/admin_center/work_task/cancel
service_requests.status 新增枚举值:admin_canceledwork_tasks.status 新增枚举值:admin_canceledservice_request.status=admin_canceled 时,允许继续调用删除接口进行列表隐藏。POST /api/service_requests/deletePOST /api/artist_center/service_requests/delete接口前缀: /api/artist_center
products/save 支持 tag_ids、art_style_idsproducts/meta 返回 tags、art_stylesproducts/list / products/info 返回 tags、art_styles 以及 tag_ids、art_style_idsoptions 支持 right_template_id,并返回 rightTemplate接口前缀: /api/content
products/list / products/info 返回 tags、art_styles 以及 tag_ids、art_style_idsproducts/info 的 options 返回 rightTemplateGET /products/filters 返回 art_styles 与 product_categoriesproducts/list 支持 tag_ids、art_style_ids 筛选product_licenses(user/artist)中的 product / product_option 返回购买时快照,包含权利模板与 right_tree接口: GET /api/bookmark/saved_products
tags、art_styles 以及 tag_ids、art_style_idsproduct_art_style_pivotproduct_options 新增字段:right_template_id接口前缀: /api/artist_center
Service 新增 visibility_status 字段(enum):public | unlisted | draftvisibility_statusPOST /services/create
POST /services/update
接口前缀: /api/content
visibility_status=public 的服务unlisted 与 draft 不会出现在列表/搜索中POST /service/info
public:所有人可访问unlisted:仅通过 info 接口可访问(不会出现在列表/搜索)draft:仅作者本人可通过 info 接口访问接口前缀: /api/artist_center
right_templates 由单一 markup_percent 改为 markup_type + markup_value。markup_type 取值:percent | fixed。markup_value 为整数:当 percent 表示百分比;当 fixed 表示固定加价金额(与 services.price 同币种/同单位)。markup_percent 字段。POST /services/create
POST /services/update
GET /services/info
新增返回字段:
right_templates(数组)
idnamemarkup_type(percent/fixed)markup_value(整数)right_tree(权限树)接口前缀: /api/content
GET /service/info 返回 right_templates(数组),包含 markup_type + markup_value。serviceSnap.data.right_templates 快照中包含 markup_type + markup_value。markup_type=percent:加价 = services.price * markup_value / 100markup_type=fixed:加价 = markup_value接口前缀: /api/artist_center
Service 的 right_template_id 被移除,改为多选 right_templates。right_templates 为数组对象,包含 id 与 markup_percent(整数,百分比)。POST /services/create
POST /services/update
GET /services/info
新增返回字段:
right_templates(数组)
idnamemarkup_percent(整数百分比)right_tree(权限树)接口前缀: /api/content
GET /service/info 返回 right_templates(数组),不再返回 rightTemplate 单对象。接口前缀: /api
POST /service_requests/create
right_template_id(单个 ID,用户选择的模板 ID,必须属于该 service)serviceSnap)serviceSnap.data.right_templates 存储 请求创建时服务的全部 right_templates 快照right_template_id,前端需从 serviceSnap.data.right_templates 匹配对应模板详情Service Request 返回示例:
serviceSnap 为该 Service Request 的快照数据(请求创建时的服务数据)。right_template_id(可能为 null,表示未选择)。serviceSnap.data.right_templates。service 关联数据。字段对照(Service Request 返回):
| 目的 | 字段路径 | 说明 |
|---|---|---|
| 用户选择的模板 ID | right_template_id | 模板 ID |
| 服务全部模板 | serviceSnap.data.right_templates | 模板列表快照 |
markup_percent 为整数百分比。services.price(用于前端展示)。接口前缀: /api/artist_center
POST /products/create - 创建产品POST /products/list - 产品列表POST /products/info - 产品详情POST /products/update - 更新产品POST /products/delete - 删除产品POST /product_options/create - 创建规格POST /product_options/list - 规格列表POST /product_options/update - 更新规格POST /product_options/delete - 删除规格POST /product_showcases/create - 创建展示(复用 ServiceShowcase 结构)POST /product_showcases/delete - 删除展示POST /product_option_files/create - 上传文件POST /product_option_files/list - 文件列表POST /product_option_files/update - 更新文件(自动版本管理)POST /product_option_files/delete - 删除文件接口前缀: /api
POST /content/products/list - 产品列表(已更新,新增 options 关联)POST /content/products/info - 产品详情(已更新,新增 options 关联)POST /product_purchases/create - 创建购买订单POST /product_purchases/list - 购买订单列表POST /product_purchases/info - 购买订单详情POST /product_purchases/cancel - 取消购买订单POST /product_purchases/files - 获取可下载文件product_options - 产品规格表product_showcases - 产品展示表(复用 ServiceShowcase 结构)product_option_files - 产品规格文件表product_file_histories - 文件历史记录表product_purchases - 产品购买表products - 新增字段:
user_id - 用户IDcategory_id - 分类IDstatus - 产品状态created_at 时间戳的访问控制| 值 | 说明 |
|---|---|
| 0 | 草稿 |
| 1 | 上架 |
| 2 | 下架 |
| 值 | 说明 |
|---|---|
| unlimited | 无限库存 |
| fixed | 固定库存 |
| 值 | 说明 |
|---|---|
| created | 创建 |
| updated | 更新 |
| deleted | 删除 |
| 值 | 说明 |
|---|---|
| pending | 待支付 |
| paid | 已支付 |
| cancelled | 已取消 |
| refunded | 已退款 |
ErrorCode 枚举替代字符串错误码ValidationException、AuthorizationException、ResourceNotFoundException所有 API 错误响应现在遵循统一格式:
接口:
POST /withdraw_accounts/unbind: 用于执行提现账户的解绑操作。POST /withdraw_accounts/unbind_check: 新增接口,用于在解绑前预先检查是否满足条件。POST /withdraw_accounts/delete: 此路由已被移除。作用: 允许用户解绑已绑定的提现账户,并提供了预检查功能以提升用户体验。
请求参数 (unbind 和 unbind_check):
| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
id | integer | 是 | 要操作的提现账户 ID |
unbind 和 unbind_check):| 错误码 | 名称 | 说明 |
|---|---|---|
| 50001 | UserWithdrawAccountStripeBalanceNotZero | Stripe 账户余额不为零 |
| 50002 | UserWithdrawAccountWalletBalanceNotZero | 钱包余额不为零 |
| 50003 | UserWithdrawAccountHasWorkTaskNotDone | 尚有未完成的工作任务 |
| 50004 | UserWithdrawStripeBalanceNotEnough | Stripe 账户余额不足 |
| 50005 | UserWithdrawAccountNotFound | 提现账户未找到 |
| 50007 | UserWithdrawAccountNotBound | 提现账户未绑定 |
code 和 message 的 JSON 响应。POST /withdraw_accounts/list| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
currency_id | integer | 否 | 根据货币 ID 筛选 |
stripe_service_agreement | string | 否 | 根据 Stripe 服务协议类型筛选 (full, recipient) |
wallet 字段,包含了完整的关联钱包信息。POST /stripe/create_connect_account_link| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
callback | string | 是 | 用户完成 Stripe 流程后重定向的 URL。 |
country | string | 是 | 用户所在的国家代码 (例如: US)。 |
service_agreement | string | 是 | Stripe 服务协议类型,可选值为 full 或 recipient。 |
callback, country, 和 service_agreement 进行验证。country 和 service_agreement 创建不同能力的 Stripe 账户。GET /stripe/stripe_dashboard_link| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
withdraw_account_id | integer | 是 | 用户的提现账户 ID。 |
GET /stripe/create_connect_account_return| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
account_id | string | 是 | Stripe Connect 账户的 ID。 |
callback | string | 是 | 用户在发起 create_connect_account_link 时提供的回调 URL。 |
account_id 查找对应的用户提现账户,并将其 bind_status 从 Pending 更新为 Successed。currency_id 和 stripe_email 字段。wallet_id 字段。POST /wallets/listwithdrawAccount 字段,包含了已成功绑定的提现账户信息。POST /wallet_withdraws/create| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
amount | integer | 是 | 提现金额(最小单位,例如美分)。 |
withdraw_account_id | integer | 是 | 用户的提现账户 ID。 |
password | string | 是 | 用户密码,用于安全验证。 |
| 错误码 | 名称 | 说明 |
|---|---|---|
| 30003 | SystemUserPasswordError | 用户密码错误 |
| 50004 | UserWithdrawStripeBalanceNotEnough | 钱包余额不足 |
| 50005 | UserWithdrawAccountNotFound | 提现账户未找到 |
| 50009 | UserWithdrawWalletNotFound | 钱包未找到 |
| 50010 | UserWithdrawWalletNotOwned | 钱包不属于用户 |
stripe_connect_payoutPOST /wallet_withdraws/stripe_connect_payout| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
withdraw_account_id | integer | 是 | 用户的提现账户 ID。 |
amount | integer | 是 | 提现金额(最小单位,例如美分)。 |
password | string | 是 | 用户密码,用于安全验证。 |
UserWithdrawStripeBalanceNotEnough (50004) 错误。stripe_connect_transferPOST /wallet_withdraws/stripe_connect_transfer| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
withdraw_account_id | integer | 是 | 用户的提现账户 ID。 |
amount | integer | 是 | 转账金额(最小单位,例如美分)。 |
password | string | 是 | 用户密码,用于安全验证。 |
| 错误码 | 名称 | 说明 |
|---|---|---|
| 30003 | SystemUserPasswordError | 用户密码错误 |
| 50004 | UserWithdrawStripeBalanceNotEnough | 钱包余额不足 |
| 50005 | UserWithdrawAccountNotFound | 提现账户未找到 |
| 50006 | UserWithdrawAccountTypeInvalid | 提现账户类型必须为Stripe |
| 50007 | UserWithdrawAccountNotBound | 提现账户未绑定成功 |
| 50008 | UserWithdrawAccountServiceAgreementInvalid | Stripe服务协议必须为recipient |
| 50009 | UserWithdrawWalletNotFound | 钱包未找到 |
| 50010 | UserWithdrawWalletNotOwned | 钱包不属于用户 |
已废弃的独立接口:
POST /user/send_sign_up_code - 发送注册验证码 (已移除)POST /user/verify_sign_up_code - 验证注册验证码 (已移除)POST /user/send_forget_psw_code - 发送忘记密码验证码 (已移除)POST /user/verify_forget_psw_code - 验证忘记密码验证码 (已移除)POST /withdraw_accounts/send_email_code - 发送提现账户验证码 (已移除)POST /user/send_change_email_code - 发送修改邮箱验证码 (已移除)统一验证码接口:
POST /user/send_email_verify_code - 统一发送验证码接口POST /user/verify_email_verify_code - 统一验证验证码接口send_email_verify_code)POST /user/send_email_verify_code请求参数:
| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
email | string | 是 | 邮箱地址,需符合email格式 |
type | string | 是 | 验证码类型,根据登录状态不同有不同可选值 |
type字段可选值:
sign_up (注册), forget_psw (忘记密码)manage_withdraw_account (管理提现账户), change_email_org (原邮箱验证), change_email_new (新邮箱验证)成功响应:
verify_email_verify_code)POST /user/verify_email_verify_code请求参数:
| 字段名 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
email | string | 是 | 邮箱地址,需符合email格式 |
code | string | 是 | 6位数字验证码 |
type | string | 是 | 验证码类型(与发送时保持一致) |
type字段可选值:(与发送接口相同)
sign_up (注册), forget_psw (忘记密码)manage_withdraw_account (管理提现账户), change_email_org (原邮箱验证), change_email_new (新邮箱验证)成功响应:
注册流程:
POST /user/sign_up 中直接使用 EmailVerifyCodeService::use() 方法标记验证码为已使用密码重置流程:
POST /user/forget_psw_change 中直接使用 EmailVerifyCodeService::use() 方法标记验证码为已使用提现账户管理流程:
POST /withdraw_accounts/create 中先验证再使用:verify() → use()修改邮箱流程:
change_email_org)和新邮箱验证(change_email_new)POST /user/change_email 中直接验证和使用新邮箱验证码:verify() → use()发送验证码时的邮箱状态检查:
sign_up) 和 新邮箱验证码 (change_email_new): 检查邮箱是否已存在,存在则抛出 SystemEmailVerifyEmailExists 错误forget_psw): 检查邮箱是否存在,不存在则抛出 SystemEmailVerifyEmailNotFound 错误change_email_org) 和 提现账户验证码 (manage_withdraw_account): 无需邮箱状态检查修改邮箱接口优化 (POST /user/change_email):
EmailVerifyCodeServiceSENT → VERIFIED → USEDused_at 字段记录验证码使用时间| 错误码 | 名称 | 说明 |
|---|---|---|
| 30001 | SystemCaptchaError | 验证码错误 |
| 30004 | SystemEmailVerifyCodeNotFound | 验证码不存在 |
| 30005 | SystemEmailVerifyCodeExpired | 验证码已过期 |
| 30006 | SystemEmailSendError | 邮件发送失败 |
| 30007 | SystemEmailVerifyCodeAttemptsLimit | 验证尝试次数过多,请稍后再试 |
| 30008 | SystemEmailVerifyEmailExists | 邮箱已存在 |
| 30009 | SystemEmailVerifyEmailNotFound | 邮箱未找到 |
used_at 时间戳字段记录验证码使用时间idx_email_type_status: 复合索引用于查询特定状态的验证码idx_email_type_code: 复合索引用于验证码校验idx_expired_at: 单字段索引用于清理过期数据接口前缀: /api
POST /groups/request_admin_join 从“单一布尔标记”改为“申请记录”模式。pending 申请;重复申请会返回现有 pending 记录。POST /groups/cancel_request_admin_join,通过申请记录 id 取消申请(仅可取消本人 pending)。POST /groups/request_admin_join
POST /groups/cancel_request_admin_join
POST /api/groups/listPOST /api/groups/new_groupsPOST /api/groups/infoPOST /api/groups/openrequest_admin_join 在上述接口中默认返回 pending 申请数组(不再按布尔值使用)。request_admin_join 每项都包含申请记录信息及申请人 user。pending 状态;canceled / accepted 不会出现在该数组中。POST /api/admin_center/work_task/listPOST /api/admin_center/profile/job_countPOST /api/admin_center/group/joinwork_task/list 返回的 group.request_admin_join 改为 pending 申请数组(含申请人信息)。filter_request_admin_join=true 现在按“是否存在 pending 申请”筛选。profile/job_count 的 join_group 现在按“存在 pending 申请的群数量”统计。group/join 后,该群所有 pending 申请会被置为 accepted,该群不再有 pending 申请返回。group_admin_join_requests
id、group_id、user_id、status(pending/canceled/accepted)、时间戳UserWithdrawAccount (用户提现账户)user_withdraw_accountsid: integer, 主键user_id: integer, 用户 IDtype: enum (UserWithdrawAccountType), 提现账户类型 (例如: Alipay, Stripe)bind_status: enum (UserWithdrawAccountStatus), 绑定状态 (例如: Successed, Pending, Unbound)currency_id: integer, 关联的货币 IDalipay_account: string, 支付宝账号 (如果 type 是 Alipay)alipay_name: string, 支付宝姓名 (如果 type 是 Alipay)stripe_connect_account_id: string, Stripe Connect 账户 ID (如果 type 是 Stripe)stripe_service_agreement: enum (UserWithdrawStripeServiceAgreement), Stripe 服务协议类型 (例如: Full, Recipient)stripe_email: string, Stripe 账户邮箱unbound_at: datetime, 解绑时间 (软删除时记录)deleted_at: datetime, 软删除时间stripe_balance: object, Stripe 账户余额信息 (通过 UserWithdrawAccount 模型中的 stripe_balance 属性获取)user(): 属于 User 模型 (多对一)currency(): 属于 Currency 模型 (多对一)wallet(): 属于 Wallet 模型 (多对一)Wallet (钱包)walletsid: integer, 主键user_id: integer, 用户 IDcurrency_id: integer, 关联的货币 IDbalance: decimal, 余额usage: enum (WalletUsage), 钱包用途deposit_type: enum (WalletDepositType), 存款类型stripe_connect_account_id: string, Stripe Connect 账户 ID (如果关联 Stripe)deleted_at: datetime, 软删除时间user(): 属于 User 模型 (多对一)currency(): 属于 Currency 模型 (多对一)transactions(): 拥有多个 WalletTransaction (一对多)withdrawAccounts(): 拥有多个 UserWithdrawAccount (一对多)withdrawAccount(): 拥有一个 UserWithdrawAccount (一对一,且 bind_status 为 Successed)Currency (货币)currenciesid: integer, 主键code: string, 货币代码 (例如: USD, CNY)symbol: string, 货币符号name: string, 货币名称is_zero_decimal: boolean, 是否是零小数货币 (例如: 日元)is_can_withdraw: boolean, 是否可提现货币is_default_withdraw: boolean, 是否默认提现货币UserWithdrawAccountType (用户提现账户类型)stringalipay: 支付宝stripe: StripeUserWithdrawAccountStatus (用户提现账户状态)stringpending: 待处理successed: 成功failed: 失败unbound: 已解绑UserWithdrawStripeServiceAgreement (用户提现 Stripe 服务协议)stringfull: 完整服务协议recipient: 收款人服务协议WalletUsage (钱包用途)stringdeposit: 艺术家收款钱包,用于提现credit: 用户礼品卡,仅用于支付抵扣plat_fee: 艺术家平台手续费,仅用于抵扣平台手续费WalletDepositType (钱包存款类型)stringalipay: 支付宝stripe_full: Stripe 完整服务协议stripe_recipient: Stripe 收款人服务协议ErrorCode (错误码)int| 错误码 | 名称 | 中文描述 |
|---|---|---|
| 10001 | ChatMessageNeedReceiverReturnMessage | 聊天消息需要接收者回复消息 |
| 10002 | ChatMessageUndoTimeLimit | 聊天消息撤回时间限制 |
| 20001 | WorkTaskHasPayingOrder | 工作任务有正在支付的订单 |
| 20002 | WorkTaskNoUnpaidStage | 工作任务没有未支付的阶段 |
| 30001 | SystemCaptchaError | 验证码错误 |
| 30002 | SystemError | 系统错误 |
| 30003 | SystemUserPasswordError | 用户密码错误 |
| 30004 | SystemEmailVerifyCodeNotFound | 验证码不存在 |
| 30005 | SystemEmailVerifyCodeExpired | 验证码已过期 |
| 30006 | SystemEmailSendError | 邮件发送失败 |
| 30007 | SystemEmailVerifyCodeAttemptsLimit | 验证尝试次数过多,请稍后再试 |
| 30008 | SystemEmailVerifyEmailExists | 邮箱已存在 |
| 30009 | SystemEmailVerifyEmailNotFound | 邮箱未找到 |
| 35001 | BusinessLogicError | 业务逻辑错误 |
| 40002 | GroupMessageUndoTimeLimit | 群组消息撤回时间限制 |
| 40003 | GroupReminderLimit | 群组提醒限制 |
| 40004 | GroupReminderExistInvalidUser | 群组提醒存在无效用户 |
| 50001 | UserWithdrawAccountStripeBalanceNotZero | Stripe账户余额不为零 |
| 50002 | UserWithdrawAccountWalletBalanceNotZero | 钱包余额不为零 |
| 50003 | UserWithdrawAccountHasWorkTaskNotDone | 尚有未完成的工作任务 |
| 50004 | UserWithdrawStripeBalanceNotEnough | 余额不足 |
| 50005 | UserWithdrawAccountNotFound | 提现账户未找到 |
| 50006 | UserWithdrawAccountTypeInvalid | 提现账户类型无效 |
| 50007 | UserWithdrawAccountNotBound | 提现账户未绑定 |
| 50008 | UserWithdrawAccountServiceAgreementInvalid | Stripe服务协议无效 |
| 50009 | UserWithdrawWalletNotFound | 钱包未找到 |
| 50010 | UserWithdrawWalletNotOwned | 钱包不属于用户 |