POINTS_PRODUCT_API.md 2.9 KB

积分产品 API 文档

本文档专门描述积分产品管理相关的接口。

1. 基础信息

  • URL 前缀: /v2/points/product
  • 响应格式: 统一使用 GlobalResponseWrapper

2. 接口列表

2.1 获取产品列表

  • URL: /list
  • Method: GET
  • 描述: 查询积分产品列表,默认按 sort 字段升序排列。

请求参数

无

响应参数 (data 字段)

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

字段名 类型 说明
id integer 主键ID
points long 点数
price decimal 价格
originalPrice decimal 原始价格
isDiscounted integer 是否打折
applePayProductId string 苹果支付产品id
sort integer 排序值
color string 角标颜色值

示例响应

{
  "code": 200,
  "message": "success",
  "data": [
    {
      "id": 1,
      "points": 1000,
      "price": 9.99,
      "originalPrice": 12.99,
      "isDiscounted": 1,
      "applePayProductId": "com.aitori.points.1000",
      "sort": 1,
      "color": "#FF0000"
    }
  ]
}

2.2 新增产品

  • URL: /add
  • Method: POST
  • Content-Type: application/json
  • 描述: 新增一条积分产品。

请求参数 (Body)

字段名 类型 必填 说明
points long 是 点数
price decimal 是 价格
originalPrice decimal 否 原始价格
isDiscounted integer 否 是否打折
applePayProductId string 是 苹果支付产品id
sort integer 否 排序
color string 否 角标颜色值

响应参数

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

2.3 更新产品

  • URL: /update
  • Method: PUT
  • Content-Type: application/json
  • 描述: 更新已存在的积分产品。

请求参数 (Body)

字段名 类型 必填 说明
id integer 是 主键ID
points long 否 点数
price decimal 否 价格
originalPrice decimal 否 原始价格
isDiscounted integer 否 是否打折
applePayProductId string 否 苹果支付产品id
sort integer 否 排序
color string 否 角标颜色值

响应参数

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

2.4 删除产品

  • URL: /delete
  • Method: DELETE
  • Content-Type: application/json
  • 描述: 批量删除积分产品。

请求参数 (Body)

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

响应参数

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