|
@@ -0,0 +1,523 @@
|
|
|
+
|
|
|
+1.渠道加联系人,联系人电话
|
|
|
+2.课程加subtitle, breadcrumb
|
|
|
+
|
|
|
+1.token对path和公共参数做sign
|
|
|
+2.token过期,返回状态码,重新获取token
|
|
|
+3.登录时,token重新生成
|
|
|
+
|
|
|
+## 全局参数,参考资源平台全局参数
|
|
|
+
|
|
|
+> 每个请求都要带
|
|
|
+
|
|
|
+```
|
|
|
+{
|
|
|
+ 'uid':'xxxx',
|
|
|
+ 'eid':'xxxx',
|
|
|
+ 'sign':'xxxx',
|
|
|
+ 'requestId':'xxx'
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success',
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+>请求参数说明
|
|
|
+
|
|
|
+| field | type | null | value | desc |
|
|
|
+|----|:-----|:-------|:------|:------|
|
|
|
+| sign | string | no | /token-POST, 请求时值为'' | 用token对请求做的签名 |
|
|
|
+| uid | string | no | /token-POST, 请求时值为'' | 用户uid |
|
|
|
+| requestId | string | no | | 32位uuid, 客户端自己生成, 每次请求唯一, 表示请求的id |
|
|
|
+| terminal | string | no | | 表示客户端类型标识,比如‘tv’, 'mobile', 同一ip的一种客户端仅能登录一个账号 |
|
|
|
+
|
|
|
+
|
|
|
+### 学号登录
|
|
|
+
|
|
|
+```
|
|
|
+/token
|
|
|
+POST
|
|
|
+{
|
|
|
+ 'deviceCode':'xxx',
|
|
|
+ 'eid':'xxxx',
|
|
|
+ 'pwd':'xxxx',
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success',
|
|
|
+ 'data':{
|
|
|
+ 'uid':'xxx',
|
|
|
+ 'eid':'xxx',
|
|
|
+ 'name':'xxxx',
|
|
|
+ 'token':'xxxx',
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+---
|
|
|
+
|
|
|
+### deviceCode登录
|
|
|
+
|
|
|
+```
|
|
|
+/token
|
|
|
+PUT
|
|
|
+{
|
|
|
+ 'deviceCode':'xxx',
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'uid':'xxx',
|
|
|
+ 'eid':'xxx',
|
|
|
+ 'name':'xxxx',
|
|
|
+ 'token':'xxxx',
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+| field | type | null | value | desc |
|
|
|
+|----|:-----|:-------|:------|:------|
|
|
|
+
|
|
|
+
|
|
|
+### 退出登录
|
|
|
+>删除device_code和eid的绑定关系
|
|
|
+
|
|
|
+```
|
|
|
+/token
|
|
|
+DELETE
|
|
|
+{
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+### 首页推荐课程
|
|
|
+```
|
|
|
+/recommend/courses
|
|
|
+{}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'recs':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'title':'xxxx',
|
|
|
+ 'subtitle':'xxxx',
|
|
|
+ 'breadcrumb':'xxxx',
|
|
|
+ },
|
|
|
+ ...
|
|
|
+ ]
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+### 用户详情
|
|
|
+```
|
|
|
+/user
|
|
|
+GET
|
|
|
+{
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'id':'xxx',
|
|
|
+ 'eid':'xxx',
|
|
|
+ 'name':'xxxx',
|
|
|
+ 'merchantName':'xxx',
|
|
|
+ 'merchantContactName':'xxx',
|
|
|
+ 'merchantContactMobile':'xxxx',
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 根据课程获取课列表
|
|
|
+```
|
|
|
+/course/<courseId>/lessons/
|
|
|
+GET
|
|
|
+{
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'auth':1,
|
|
|
+ 'collected':1,
|
|
|
+ 'breadcrumb':'xxx',
|
|
|
+ 'recs':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'name':'xxx',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+>请求参数说明
|
|
|
+
|
|
|
+| field | type | null | value | desc |
|
|
|
+|----|:-----|:-------|:------|:------|
|
|
|
+| auth | int | no | | 取值{0,1}, 0表示无权限看此课,1表示有权限看此课 |
|
|
|
+
|
|
|
+| collected | int | no | | 取值{0,1}, 0表示未收藏,1已收藏 |
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 获取课程详情
|
|
|
+```
|
|
|
+/course/<courseId>/detail
|
|
|
+GET
|
|
|
+{
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'title':'xxx',
|
|
|
+ 'digest':'xxx',
|
|
|
+ 'detail':'xxxx',
|
|
|
+ 'auth':1,
|
|
|
+ 'collected':1,
|
|
|
+ 'beginTime':1243123,
|
|
|
+ 'endTime':12341234,
|
|
|
+ 'goods':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'chargeUnit':'xxx',
|
|
|
+ 'terminalPrice':'xxx',
|
|
|
+ 'isInCart':0,
|
|
|
+ },
|
|
|
+ ...
|
|
|
+ ],
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+### 获取课程相关配套列表
|
|
|
+
|
|
|
+```
|
|
|
+/course/<courseId>/supports
|
|
|
+GET
|
|
|
+{
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'recs':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'title':'xxx',
|
|
|
+ 'subTitle':'xxx',
|
|
|
+ 'goods':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'chargeUnit':'xxx',
|
|
|
+ 'terminalPrice':'xxx',
|
|
|
+ },
|
|
|
+ ...
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+### 配套详情
|
|
|
+```
|
|
|
+/support/<supportId>
|
|
|
+GET
|
|
|
+{}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'title':'xxx',
|
|
|
+ 'detail':'xxxx',
|
|
|
+ 'coverUrl':'http://xxx',
|
|
|
+ 'imgList':[
|
|
|
+ 'http://xxx',
|
|
|
+ ...
|
|
|
+ ]
|
|
|
+ 'goods':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'chargeUnit':'xxx',
|
|
|
+ 'terminalPrice':'xxx',
|
|
|
+ 'isInCart':0,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ 'relatedSupports':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'coverUrl':'http://xx',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ 'relatedCourses':[
|
|
|
+ {
|
|
|
+ 'id':'xxxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'title':'xxx',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 课详情
|
|
|
+```
|
|
|
+/lesson/<lessonId>
|
|
|
+GET
|
|
|
+{}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'title':'xxx',
|
|
|
+ 'recs':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'category':'xxx',
|
|
|
+ 'title':'xxx',
|
|
|
+ 'type':0,
|
|
|
+ 'resources':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'type':2,
|
|
|
+ 'url':'http://xxxx',
|
|
|
+ },
|
|
|
+ ...
|
|
|
+ ]
|
|
|
+
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ ...
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+| field | type | null | value | desc |
|
|
|
+|----|:-----|:-------|:------|:------|
|
|
|
+| recs.type | int | no | | 取值{0,1}, 分别表示{'图片', '视频'} |
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 获取标签组中标签列表
|
|
|
+
|
|
|
+```
|
|
|
+/tagGroup/<groupCode>
|
|
|
+{
|
|
|
+ 'showFirstPageSize':20,
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'name':'xxx',
|
|
|
+ 'showFirst':{
|
|
|
+ "tagId": "xxx",
|
|
|
+ "recs": [
|
|
|
+ {...},
|
|
|
+ ...
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ 'recs':[
|
|
|
+ {
|
|
|
+ 'id':'xxxx',
|
|
|
+ 'name':'xxx',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 获取特定标签下的产品列表
|
|
|
+
|
|
|
+```
|
|
|
+/tag/<tagId>
|
|
|
+GET
|
|
|
+{
|
|
|
+ 'pageNum':0,
|
|
|
+ 'pageSize':20,
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'totalNum':50,
|
|
|
+ 'pageNum':'xxx',
|
|
|
+ 'pageSize':20,
|
|
|
+ 'recs':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'type':'COURSE',
|
|
|
+ 'code':'xxx',
|
|
|
+ 'title':'xxx',
|
|
|
+ 'subTitle':'xxx',
|
|
|
+ 'coverUrl':'http://xxx',
|
|
|
+ 'goods':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'chargeUnit':'xxx',
|
|
|
+ 'terminalPrice':'xxx',
|
|
|
+ },
|
|
|
+ ...
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ...
|
|
|
+ ]
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 查询收藏列表
|
|
|
+
|
|
|
+```
|
|
|
+/user/collection
|
|
|
+{
|
|
|
+ 'tagId':'xxx',
|
|
|
+ 'pageNum':0,
|
|
|
+ 'pageSize':20,
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ /*参考/tag/<tagId>-GET请求*/
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+| field | type | null | value | desc |
|
|
|
+|----|:-----|:-------|:------|:------|
|
|
|
+| tagId | string | no | | 当tagId为空字符串时,返回所有收藏 |
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 购物车列表
|
|
|
+
|
|
|
+```
|
|
|
+/user/shopcart
|
|
|
+GET
|
|
|
+{
|
|
|
+ 'pageNum':0,
|
|
|
+ 'pageSize':10,
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+ 'data':{
|
|
|
+ 'totalNum':3,
|
|
|
+ 'pageNum':0,
|
|
|
+ 'pageSize':10,
|
|
|
+ 'goods':[
|
|
|
+ {
|
|
|
+ 'id':'xxx',
|
|
|
+ 'terminalPrice':22,0,
|
|
|
+ 'pid':'xxxx',
|
|
|
+ 'title':'xxxx',
|
|
|
+ 'subtitle':'xxx',
|
|
|
+ },
|
|
|
+ ...
|
|
|
+ ]
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+---
|
|
|
+
|
|
|
+### 添加商品到购物车
|
|
|
+```
|
|
|
+/user/shopcart
|
|
|
+PUT
|
|
|
+{
|
|
|
+ 'goodsId':'xxx',
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+### 从购物车删除商品
|
|
|
+```
|
|
|
+/user/shopcart
|
|
|
+DELETE
|
|
|
+{
|
|
|
+ 'goodsId':'xxx',
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 发送购买信息
|
|
|
+```
|
|
|
+/user/shopcart/buymsg
|
|
|
+POST
|
|
|
+{
|
|
|
+}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success'
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+### 获取购物车商品数量
|
|
|
+```
|
|
|
+/user/shopcart/totalNum
|
|
|
+GET
|
|
|
+{}
|
|
|
+返回
|
|
|
+{
|
|
|
+ 'code':200,
|
|
|
+ 'msg':'success',
|
|
|
+ 'data':{
|
|
|
+ 'totalNum':20,
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|