AI_SUBSCRIBE_API.md 3.0 KB

AI会员订阅配置 API 文档

本文档专门描述 AI 会员订阅配置相关的接口。

1. 基础信息

  • URL 前缀: /v2/ai/subscribe
  • 响应格式: 统一使用 GlobalResponseWrapper (实际返回类型根据 Controller 定义可能是 IPage 或 boolean,但通常会被全局包装)

2. 接口列表

2.1 获取订阅配置列表

  • URL: /list
  • Method: GET
  • 描述: 查询 AI 会员订阅配置列表。

请求参数

无

响应参数 (data 字段)

返回 AiSubscribeVO 对象列表,元素结构如下:

字段名 类型 说明
id integer 主键ID
productId string Apple产品id
subscribeType integer 订阅等级(0:连续包月,1:连续包年)
tokens integer 发放积分数量
tokenExpirationTime integer 积分过期时间(天)
actionType integer 订阅action类型(0:默认,1:推荐)

示例响应

{
  "code": 200,
  "message": "success",
  "data": [
    {
      "id": 1,
      "productId": "com.aitori.monthly",
      "subscribeType": 0,
      "tokens": 100,
      "tokenExpirationTime": 30,
      "actionType": 0
    }
  ]
}

2.2 新增订阅配置

  • URL: /add
  • Method: POST
  • Content-Type: application/json
  • 描述: 新增一条订阅配置。

请求参数 (Body)

字段名 类型 必填 说明
productId string 是 Apple产品id
subscribeType integer 是 订阅等级(0:连续包月,1:连续包年)
tokens integer 是 发放积分数量
tokenExpirationTime integer 是 积分过期时间(天)
actionType integer 否 订阅action类型(0:默认,1:推荐),默认0

响应参数

类型 说明
boolean 操作结果 (true/false)

2.3 更新订阅配置

  • URL: /update
  • Method: PUT
  • Content-Type: application/json
  • 描述: 更新已存在的订阅配置。

请求参数 (Body)

字段名 类型 必填 说明
id integer 是 主键ID
productId string 否 Apple产品id
subscribeType integer 否 订阅等级(0:连续包月,1:连续包年)
tokens integer 否 发放积分数量
tokenExpirationTime integer 否 积分过期时间(天)
actionType integer 否 订阅action类型(0:默认,1:推荐)

响应参数

类型 说明
boolean 操作结果 (true/false)

2.4 删除订阅配置

  • URL: /delete
  • Method: DELETE
  • Content-Type: application/json
  • 描述: 批量删除订阅配置。

请求参数 (Body)

类型 必填 说明
integer[] 是 主键ID数组,例如 [1, 2, 3]

响应参数

类型 说明
boolean 操作结果 (true/false)