Browse Source

add merchant api

huodongdong 7 years ago
parent
commit
fcbf0f5b0d

+ 55 - 0
api/cms/group/group_save.md

@@ -0,0 +1,55 @@
+### POST /group
+* method: POST
+* version: v1.0
+* describe: 创建标签组
+
+* method: PUT
+* version: v1.0
+* describe: 修改标签
+
+##### 参数说明
+| name | type | desc |
+|------|:-----|:----:|
+| id | string | id |
+| code | string | 代码 |
+| name | string | 名称 |
+| merchantId | string | 渠道id |
+| name| string | 标签组名称 |
+| status| string| 状态 |
+| tagList | array | 标签列表 |
+| gmtCreated|int | 创建时间 |
+| gmtModified|int|修改时间|
+
+##### 结果示例
+```
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": {
+        "id": "d513401461284feea555a3e0abc5974a",
+        "code": "K-test-311",
+        "name": "小学310",
+        "merchantId": "87",
+        "sort": 2,
+        "status": "NORMAL",
+        "tagList": [
+            {
+                "id": "1",
+                "name": "001",
+                "groupId": "d513401461284feea555a3e0abc5974a",
+                "sort": 1,
+                "type": "COURSE",
+                "status": "NORMAL",
+                "gmtCreated": 1512956695000,
+                "gmtModified": 1512971472000,
+                "merchantId": "87",
+                "groupName": "小学310",
+                "itemList": null
+            }
+        ],
+        "gmtCreated": 1512960192000,
+        "gmtModified": 1512960192000
+    }
+}
+```

+ 59 - 0
api/cms/merchant/merchant_list.md

@@ -0,0 +1,59 @@
+### GET /merchant/list
+* method: GET
+* version: v1.0
+* describe: 获取渠道商列表
+
+##### 参数说明
+
+|name |type| null | desc |
+|---- |:---|:---|:----:|
+| code | string | yes | 编码 |
+| name | string | yes | 名称 |
+| merchantId | string | yes | 渠道id |
+| status | string | yes | 类型 |
+| pageNo | int | yes | 页码 |
+| pageSize | int | yes | 页大小
+
+##### 返回字段说明
+| name | type | desc |
+|------|:-----|:----:|
+| id | string | id |
+| code | string | 代码 |
+| name | string | 名称 |
+| licenseId | string | 执照 |
+| taxNumber | string | 纳税人识别号 |
+| bankAccount | string | 银行账户 |
+| depositBank | string | 开户行 |
+| receiptType | string | 发票类型 |
+
+##### 示例
+```
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": {
+        "pageNo": 1,
+        "pageSize": 10,
+        "totalSize": 1,
+        "list": [
+            {
+                "id": "1",
+                "code": "2321",
+                "name": "huodong",
+                "licenseId": "23321",
+                "taxNumber": "000",
+                "bankAccount": "001",
+                "depositBank": "海淀支行",
+                "receiptType": "SPECIAL",
+                "status": "NORMAL",
+                "gmtCreated": 1513304166000,
+                "gmtModified": 1513304166000,
+                "adminList": null
+            }
+        ],
+        "start": 0,
+        "totalNo": 1
+    }
+}
+```

+ 32 - 0
api/cms/merchant/merchant_one.md

@@ -0,0 +1,32 @@
+### GET /merchant/{id}
+* method: GET
+* version: v1.0
+* describe: 获取渠道商
+
+##### 参数说明
+|name |type| null | desc |
+|---- |:---|:---|:----:
+| id | string | no | id |
+
+##### 示例
+```
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": {
+        "id": "1",
+        "code": "2321",
+        "name": "huodong",
+        "licenseId": "23321",
+        "taxNumber": "000",
+        "bankAccount": "001",
+        "depositBank": "海淀支行",
+        "receiptType": "SPECIAL",
+        "status": "NORMAL",
+        "gmtCreated": 1513304166000,
+        "gmtModified": 1513304166000,
+        "adminList": []
+    }
+}
+```

+ 44 - 0
api/cms/merchant/merchant_save.md

@@ -0,0 +1,44 @@
+### /merchant/list
+* method: POST
+* version: v1.0
+* describe: 新建
+
+* method: PUT
+* version: v1.0
+* describe: 修改
+
+##### 参数说明
+| name | type | desc |
+|------|:-----|:----:|
+| id | string | id |
+| code | string | 代码 |
+| name | string | 名称 |
+| licenseId | string | 执照 |
+| taxNumber | string | 纳税人识别号 |
+| bankAccount | string | 银行账户 |
+| depositBank | string | 开户行 |
+| receiptType | string | 发票类型 |
+| status | string | 状态 |
+
+##### 示例
+```
+{
+    "code": 200,
+    "success": true,
+    "message": null,
+    "data": {
+        "id": "82a914674b094e4f92986a9b88d28445",
+        "code": "0512",
+        "name": "贝尔安亲",
+        "licenseId": "test-license-id",
+        "taxNumber": "010ma",
+        "bankAccount": "666",
+        "depositBank": "华夏支行",
+        "receiptType": "NORMAL",
+        "status": "NORMAL",
+        "gmtCreated": null,
+        "gmtModified": null,
+        "adminList": null
+    }
+}
+```

+ 1 - 1
db/product/lj_course.md

@@ -14,7 +14,7 @@
 | cv_img_list | varchar(512) | yes | null | 封面图 | |
 | bg_img_list | varchar(512) | yes | null | 背景图 | |
 | status | smallint | no | | 状态 | |
-| gmt_created | smallint | no | now | 创建时间 | |
+| gmt_created | timestamp | no | now | 创建时间 | |
 | gmt_modified | timestamp | no | now | 更新时间 | | |
 
 ##### index

+ 1 - 1
db/product/lj_course_sub_relation.md

@@ -10,7 +10,7 @@
 | type | smallint | no | 0 | 类型, 0为课程与课对应关系, 1为课程与单元对应关系 | |
 | sort | int | no | | 顺序 | 排序字段 |
 | status | int | no | 0 | 是否删除 | |
-| gmt_created | smallint | no | now | 创建时间 | | |
+| gmt_created | timestamp | no | now | 创建时间 | | |
 
 ##### index
 > unique index on(course_id, sub_id)

+ 1 - 1
db/product/lj_course_support_relation.md

@@ -9,7 +9,7 @@
 | support_id | varchar(512) | no | | 周边id | |
 | sort | int | yes | 0 | 排序 | |
 | status | int | no | 0 | 是否删除 | |
-| gmt_created | smallint | no | now | 创建时间 | | |
+| gmt_created | timestamp | no | now | 创建时间 | | |
 
 ##### index
 > unique index on(course_id, support_id)

+ 1 - 1
db/product/lj_item.md

@@ -11,7 +11,7 @@
 | merchant_id | varchar(512) | no | | 渠道id | |
 | sort | int | no | 0 | 排序字段 | |
 | status | smallint | no | | 状态 | |
-| gmt_created | smallint | no | now | 创建时间 | |
+| gmt_created | timestamp | no | now | 创建时间 | |
 | gmt_modified | timestamp | no | now | 更新时间 | | |
 
 ##### index

+ 1 - 1
db/product/lj_item_price.md

@@ -12,7 +12,7 @@
 | merchant_price | double(16,2) | no | 0 | 给渠道价格 | |
 | terminal_price | double(16,2) | no | 0 | 终端显示价格 | |
 | status | smallint | no | | 状态 | |
-| gmt_created | smallint | no | now | 创建时间 | |
+| gmt_created | timestamp | no | now | 创建时间 | |
 | gmt_modified | timestamp | no | now | 更新时间 | | |
 
 ### index

+ 1 - 1
db/product/lj_lesson.md

@@ -10,7 +10,7 @@
 | digest | text | yes | null | 课摘要 | |
 | sort | int | no |  | tag排序 | |
 | status | smallint | no | | 状态 | |
-| gmt_created | smallint | no | now | 创建时间 | |
+| gmt_created | timestamp | no | now | 创建时间 | |
 | gmt_modified | timestamp | no | now | 更新时间 | |
 
 ##### index

+ 1 - 1
db/product/lj_support_self_relation.md

@@ -7,7 +7,7 @@
 | id | varchar(512) | no | | 主键 | pri |
 | fid | varchar(512) | no | | 课程id | |
 | tid | varchar(512) | no | | 课程id | |
-| gmt_created | smallint | no | now | 创建时间 | | |
+| gmt_created | timestamp | no | now | 创建时间 | | |
 
 ##### index
 > unique index on(fid, tid)

+ 1 - 1
db/resource/lj_resource.md

@@ -12,5 +12,5 @@
 | size | int | yes | | 资源大小 | |
 | path | varchar(1024) | no | | 地址 | |
 | status | smallint | no | | 状态 | |
-| gmt_created | smallint | no | now | 创建时间 | |
+| gmt_created | timestamp | no | now | 创建时间 | |
 | gmt_modified | timestamp | no | now | 更新时间 | | |

+ 19 - 0
db/user/merchant.md

@@ -0,0 +1,19 @@
+### merchant table structure
+> 此表为渠道商的数据结构
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | varchar(512) | no | | 主键 | pri |
+| code | varchar(512) | no | | 编码 | uni |
+| name | varchar(1024) | | | 渠道商名称 | |
+| license_id | varchar(1024) | | | 营业执照 | |
+| tax_number | varchar(1024) | | | 纳税人识别号 | |
+| bank_account | varchar(512) | | | 银行账号 | |
+| deposit_bank | varchar(2048) | | | 开户行 | |
+| receipt_type | smallint | no | | 发票类型 | |
+| status | int | no | 0 | 是否删除 | |
+| gmt_created | timestamp | no | now | 创建时间 | | |
+
+##### index
+> unique index on(code)

+ 25 - 0
db/user/user.md

@@ -0,0 +1,25 @@
+### user table structure
+> 此表为管理用户的数据结构
+
+
+| field | type | null | default | desc | extra |
+|----|:-----|:-------|:------|:-----|:-----|
+| id | varchar(512) | no | | 主键 | pri |
+| name | varchar(1024) | | | 名字 | |
+| password | varchar(512) | no | | 密码 | |
+| gender | smallint | no | | 性别 | |
+| avatar | varchar(1024) | yes |  |头像 | |
+| birthday | date | | |  生日 | |
+| mobile | varchar(512) | | | 手机号 | |
+| mail | varchar(256) | | | 邮箱 | |
+| we_chat | varchar(512) | | | 微信 | |
+| qq | varchar(512) | | | qq | |
+| merchant_id | varchar(512)| | | 渠道id | |
+| domain | int | no | | 平台类型 | |
+| admin | smallint | no | 0 | 是否是管理员 | |
+| status | int | no | 0 | 是否删除 | |
+| gmt_update | timestamp | no | now | 修改时间 | |
+| gmt_created | timestamp | no | now | 创建时间 | | |
+
+##### index
+> unique index on(name)