huodongdong пре 7 година
родитељ
комит
dd690b9811
1 измењених фајлова са 134 додато и 1 уклоњено
  1. 134 1
      tob/tobApi.md

+ 134 - 1
tob/tobApi.md

@@ -121,7 +121,140 @@ POST
 
 ---
 
-#### 查询产品列表
+#### 产品列表
+>请求参数
+
+|name |type| null | desc |
+|---- |:---|:---|:----:|
+| code | string | yes | product的编号 |
+| name | string | yes | item名称 |
+| type | int | yes | item类型 |
+
+```
+/product
+GET
+{
+  "code": "xxx",
+  "name": "xxx",
+  "type": "xxx"
+}
+返回
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": {
+        "pageNo": 1,
+        "pageSize": 10,
+        "totalSize": 1,
+        "list": [
+            {
+                "id": "1",
+                "pid": "1",
+                "code": "C-01",
+                "name": "test",
+                "type": "COURSE",
+                "gmtCreated": 1516095977000,
+                "gmtModified": 1516095977000
+            }
+        ],
+        "start": 0,
+        "totalNo": 1
+    }
+}
+```
+
+---
+#### 一个产品
+```
+/product/{productId}
+GET
+{
+  "productId": "xxx"
+}
+返回
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": {
+        "id": "1",
+        "code": "C-01",
+        "name": "test",
+        "title": "test-title",
+        "digest": "test",
+        "detail": "",
+        "keyword": null,
+        "coverUrl": "http://xxx",
+        "bgUrl": "http://xxx",
+        "status": "NORMAL",
+        "gmtCreated": null,
+        "gmtModified": null,
+        "subItemList": [],
+        "supportList": []
+    }
+}
+```
+
+---
+#### 新建产品
+```
+/product?type=<COURSE>
+POST
+{
+  参见原对应类型的创建数据格式
+}
+返回
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": {
+        "id": "cb3c1fa66714486d9c0298ce87c4f336",
+        "code": "C-02",
+        "name": "test-02",
+        "title": "test-title-02",
+        "digest": "test",
+        "detail": "",
+        "keyword": null,
+        "coverUrl": "http://xxx",
+        "bgUrl": "http://xxx",
+        "status": "NORMAL",
+        "gmtCreated": null,
+        "gmtModified": null,
+        "subItemList": null,
+        "supportList": null
+    }
+}
+```
+
+---
+#### 修改产品
+```
+/product/{productId}
+PUT
+{
+  参见对应类型的数据结构
+}
+
+```
+
+---
+#### 下架产品
+>注意:下架产品将下架所有渠道的商品, 操作要谨慎
+```
+/product/{productId}
+DELETE
+返回
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": null
+}
+```
+---
+#### 查询渠道产品列表
 ```
 /merchant/products
 GET