Authored by liqingzhong

增加错误码

新潮教室签到
------------
## 1. 获取当前用户亲密度,排名
`method=app.starClass.rankInfo`
#### 入参
| 参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
|:---------|---------:|----------:|-----:|-------:|-----:|
| uid | int | 否 | 213 | 0 |用户id|
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": {
// 如果没有签过到,会显示零
"userNum": 10,
// 如果没有签过到,会没有数据
"userRank": 2
},
"md5": "fcf7791bac08abb80ef3a2b27964386c",
"message": "获取用户亲密度成功"
}
```
## 2.签到
`method=app.starClass.sign`
#### 入参
| 参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
|:---------|---------:|----------:|-----:|-------:|-----:|
| uid | int | 否 | 213 | 0 |用户id|
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": {
// 本次增加的亲密度
"addNum": 10,
// 签到记录
"logs": [
{
"addNum": 10,
"createTime": 1460112775,
"id": 211,
"starId": 1,
"type": 1,
"uid": 3703860
}
],
// 前三名
"rankList": [
{
"num": 10,
"uid": 3566199,
"username": "136****8114@yohoinc.com"
},
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 10,
"uid": 3566423,
"username": "黄德才"
},
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 10,
"uid": 3703860,
"username": "曹苒"
}
]
},
"md5": "450edbd92076dfac74701cb6421f68ae",
"message": "获取用户签到信息成功"
}
```
## 3.转发
`method=app.starClass.forward`
#### 入参
| 参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
|:---------|---------:|----------:|-----:|-------:|-----:|
| uid | int | 否 | 213 | 0 |用户id|
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": 10, // 本次增加的分数
"md5": "9f6ed5823862ae9009fc8084516132da",
"message": "用户转发"
}
```
## 前 100
`method=app.starClass.top100`
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": [
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 20,
"uid": 3703860,
"username": "曹苒"
},
{
"num": 10,
"uid": 3566199,
"username": "136****8114@yohoinc.com"
},
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 10,
"uid": 3566423,
"username": "黄德才"
}
],
"md5": "fae5f8b593b1c505eb36db1d29a80eca",
"message": "top100"
}
```
## 4.获得星潮教室中星搭配的文章
星搭配文章取逛后台新增的标签分类‘星潮教室’,标签开启状态下的文章(/guang/api/*/article/getStarClassroomArticleList)(app接口)
| 接口说明 | 接口说明 |
|:------- | -----:|
|请求域名 | http://api.yoho.cn/ |
|接口名 | /guang/api/*/article/getStarClassroomArticleList |
|接口说明 | 获得星潮教室中星搭配的文章 |
|接口说明 | get |
#### 请求参数
| 参数名称 | 参数类型 | 长度 | 是否必须 | 示例值 | 默认值 | 描述 |
|:---------| --------:|-----:| ---------:| ------:| ------:| ----:|
|page|Integer|3|否|1|1|页码|
#### 正常返回结果
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": {
"datetime": "1460342224",
"list": {
"artList": [
{
"ads_img_size": "",
"article_type": "1",
"author": {
"author_id": "5105041",
"avatar": "http://img12.static.yhbimg.com/yhb-img02/2015/06/15/14/02e77877049e6949eb5e8b121b6f58204d.jpg?imageView/0/w/100/h/100",
"name": "雷恩雷恩",
"url": "http://guang.m.yohobuy.com/author/index?id=5105041&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"5105041\"},\"share\":\"\",\"id\":5105041,\"type\":0,\"islogin\":\"N\",\"url\":\"http://guang.m.yohobuy.com/author/index\"}}"
},
"author_id": "5105041",
"category_id": "1",
"category_name": "话题",
"conver_image_type": "2",
"id": 29630,
"intro": "Wuli凡凡前天回广州老家,小蛮腰可是为他亮起了欢迎语~这阵仗,简直了。看来《老炮儿》和wuli凡凡的人气,实在是高的不要不要。~",
"isFavor": "N",
"isPraise": "N",
"is_recommended": "0",
"praiseStatus": "true",
"praise_num": "46",
"publish_time": "12月25日 22:00",
"share": {
"url": "http://guang.m.yohobuy.com/info/index?id=29630&openby:yohobuy={\"action\":\"go.share\",\"params\":{\"pic\":\"http://img11.static.yhbimg.com/yhb-img01/2015/12/25/10/014df3a77aad110a75f4c63865461785da.jpg?imageView/2/w/640/h/640\",\"title\":\"《老炮儿》造型大吐槽!吴亦凡李易峰戏里戏外造型PK!\",\"url\":\"http://guang.m.yohobuy.com/info/index?id=29630\",\"content\":\"潮流资讯,新鲜贩售,YOHO!有货【逛】不停\"}}"
},
"src": "http://img11.static.yhbimg.com/yhb-img01/2015/12/25/10/014df3a77aad110a75f4c63865461785da.jpg?imageView/{mode}/w/{width}/h/{height}",
"title": "《老炮儿》造型大吐槽!吴亦凡李易峰戏里戏外造型PK!",
"url": "http://guang.m.yohobuy.com/info/index?id=29630&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"29630\"},\"update_flag\":\"a585b3d889ca39701f76149e194ae268\",\"shareparam\":{\"id\":29630},\"share\":\"/guang/api/v1/share/guang\",\"id\":29630,\"type\":1,\"url\":\"http://guang.m.yohobuy.com/info/index\",\"islogin\":\"N\"}}",
"views_num": "57133"
},
{
"article_type": "1",
"author": {
"author_id": "5514979",
"avatar": "http://img12.static.yhbimg.com/yhb-img02/2015/06/12/15/025ff50f6d72fd19abe00c1bc3f0576eaa.jpg?imageView/0/w/100/h/100",
"name": "XpecialSux",
"url": "http://guang.m.yohobuy.com/author/index?id=5514979&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"5514979\"},\"share\":\"\",\"id\":5514979,\"type\":0,\"islogin\":\"N\",\"url\":\"http://guang.m.yohobuy.com/author/index\"}}"
},
"author_id": "5514979",
"category_id": "2",
"category_name": "搭配",
"conver_image_type": "1",
"id": 589,
"intro": "印象里松糕鞋总是女生的专属,殊不知,男生穿上松糕鞋同样也可以萌萌哒,简单的白色短袖T恤搭配迷彩短裤,原创的松糕鞋编织鞋头细节承载麂皮绒的特殊质感,表达年轻人拒绝平庸主义的态度。",
"isFavor": "N",
"isPraise": "N",
"is_recommended": "0",
"praiseStatus": "true",
"praise_num": "25",
"publish_time": "06月05日 16:10",
"share": {
"url": "http://guang.m.yohobuy.com/info/index?id=589&openby:yohobuy={\"action\":\"go.share\",\"params\":{\"pic\":\"http://img11.static.yhbimg.com/yhb-img01/2015/06/01/13/01c00f0fe35939d71161f98f4996dbe703.jpg?imageView/2/w/640/h/640\",\"title\":\"男生穿松糕鞋也可以萌萌哒\",\"url\":\"http://guang.m.yohobuy.com/info/index?id=589\",\"content\":\"潮流资讯,新鲜贩售,YOHO!有货【逛】不停\"}}"
},
"src": "http://img11.static.yhbimg.com/yhb-img01/2015/06/01/13/01c00f0fe35939d71161f98f4996dbe703.jpg?imageView/{mode}/w/{width}/h/{height}",
"title": "男生穿松糕鞋也可以萌萌哒",
"url": "http://guang.m.yohobuy.com/info/index?id=589&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"589\"},\"update_flag\":\"5b9724501839dfbe5ffcc00201868dc0\",\"shareparam\":{\"id\":589},\"share\":\"/guang/api/v1/share/guang\",\"id\":589,\"type\":1,\"url\":\"http://guang.m.yohobuy.com/info/index\",\"islogin\":\"N\"}}",
"views_num": "25960"
}
]
},
"page": 1,
"total": 2,
"totalPage": 1
},
"md5": "6b2878c28018dbae9435cdc49a019e3e",
"message": "星潮教室文章列表"
}
```
#### 响应内容描述
| Param Name | Param Type | Desc |
|:---------| --------:|-----:|
|alg |String | |
|code |int |状态码 |
|md5 |String | |
|message |String |返回结果内容描述 |
|data |json |返回数据内容 |
|datetime |String |当前时间 |
|page |int |当前页 |
|total |int |总记录数 |
|totalPage |int |总页数 |
|list |json |文章集合对象 |
|artList |array |文章数组 |
|ads_img_size |String |广告图片尺寸 |
|article_type |String |文章类型 |
|author_id |String |作者ID |
|author |json |作者对象json |
|author_id |String |作者ID |
|avatar |String |产品的图片URL |
|name |String |名称 |
|url |String |链接的地址 |
|category_id |String |分类ID |
|category_name |String |分类名称 |
|conver_image_type |String |图片类型 1方图,2长图 |
|id |String | |
|intro |String |文章信息 |
|isFavor |String |是否收藏 |
|isPraise |String |是否点赞 |
|is_recommended |String |是否推荐 |
|praiseStatus |String |点赞状态 |
|praise_num |String |点赞数量 |
|publish_time |String |发布时间 |
|share |json |分享链接 |
|url |String |分享链接地址 |
|src |String |图片绝对路径 |
|title |String |文章标题 |
|url |String |URL |
|views_num |String |查看数量 |
#### 异常返回结果:
| 错误码code | 错误message | 说明 |
|:---------| --------:|-----:|
| 500| | 内部错误|
\ No newline at end of file
新潮教室签到
------------
## 1. 获取当前用户亲密度,排名
`method=app.starClass.rankInfo`
#### 入参
| 参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
|:---------|---------:|----------:|-----:|-------:|-----:|
| method | string | 否 | app.starClass.rankInfo |||
| uid | int | 否 | 213 | 0 |用户id|
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": {
// 如果没有签过到,会显示零
"userNum": 10,
// 如果没有签过到,会没有数据
"userRank": 2
},
"md5": "fcf7791bac08abb80ef3a2b27964386c",
"message": "获取用户亲密度成功"
}
```
### 错误码
| 错误码 code | message | 说明 |
|-------------|---------|------|
| 200 | success | |
| 400 | 输入参数错误 | 没传 uid |
| 500 | 获取个人排名失败 | uid 不存在或者查询 redis 失败 |
## 2.签到
`method=app.starClass.sign`
#### 入参
| 参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
|:---------|---------:|----------:|-----:|-------:|-----:|
| uid | int | 否 | 213 | 0 |用户id|
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": {
// 本次增加的亲密度
"addNum": 10,
// 签到记录
"logs": [
{
"addNum": 10,
"createTime": 1460112775,
"id": 211,
"starId": 1,
"type": 1,
"uid": 3703860
}
],
// 前三名
"rankList": [
{
"num": 10,
"uid": 3566199,
"username": "136****8114@yohoinc.com"
},
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 10,
"uid": 3566423,
"username": "黄德才"
},
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 10,
"uid": 3703860,
"username": "曹苒"
}
]
},
"md5": "450edbd92076dfac74701cb6421f68ae",
"message": "获取用户签到信息成功"
}
```
### 错误码
| 错误码 code | message | 说明 |
|-------------|---------|------|
| 200 | success | |
| 400 | 输入参数错误 | 没传 uid |
| 500 | 设置 redis 失败 | 比如 redis 挂了等情况 |
## 3.转发
`method=app.starClass.forward`
#### 入参
| 参数名称 | 参数类型 | 可否为空 | 示例 | 默认值 | 备注 |
|:---------|---------:|----------:|-----:|-------:|-----:|
| uid | int | 否 | 213 | 0 |用户id|
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": 10, // 本次增加的分数
"md5": "9f6ed5823862ae9009fc8084516132da",
"message": "用户转发"
}
```
### 错误码
| 错误码 code | message | 说明 |
|-------------|---------|------|
| 200 | success | |
| 400 | 输入参数错误 | 没传 uid |
| 500 | 设置 redis 失败 | 比如 redis 挂了等情况 |
## 前 100
`method=app.starClass.top100`
#### 出参
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": [
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 20,
"uid": 3703860,
"username": "曹苒"
},
{
"num": 10,
"uid": 3566199,
"username": "136****8114@yohoinc.com"
},
{
"avatar": "http://static.yoho.cn/images/default_userhead_boy_180_180.png?imageView/{mode}/w/{width}/h/{height}",
"num": 10,
"uid": 3566423,
"username": "黄德才"
}
],
"md5": "fae5f8b593b1c505eb36db1d29a80eca",
"message": "top100"
}
```
### 错误码
| 错误码 code | message | 说明 |
|-------------|---------|------|
| 200 | success | |
| 500 | 查询 redis 失败 | 比如 redis 挂了等情况 |
## 4.获得星潮教室中星搭配的文章
星搭配文章取逛后台新增的标签分类‘星潮教室’,标签开启状态下的文章(/guang/api/*/article/getStarClassroomArticleList)(app接口)
| 接口说明 | 接口说明 |
|:------- | -----:|
|请求域名 | http://api.yoho.cn/ |
|接口名 | /guang/api/*/article/getStarClassroomArticleList |
|接口说明 | 获得星潮教室中星搭配的文章 |
|接口说明 | get |
#### 请求参数
| 参数名称 | 参数类型 | 长度 | 是否必须 | 示例值 | 默认值 | 描述 |
|:---------| --------:|-----:| ---------:| ------:| ------:| ----:|
|page|Integer|3|否|1|1|页码|
#### 正常返回结果
```json
{
"alg": "SALT_MD5",
"code": 200,
"data": {
"datetime": "1460342224",
"list": {
"artList": [
{
"ads_img_size": "",
"article_type": "1",
"author": {
"author_id": "5105041",
"avatar": "http://img12.static.yhbimg.com/yhb-img02/2015/06/15/14/02e77877049e6949eb5e8b121b6f58204d.jpg?imageView/0/w/100/h/100",
"name": "雷恩雷恩",
"url": "http://guang.m.yohobuy.com/author/index?id=5105041&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"5105041\"},\"share\":\"\",\"id\":5105041,\"type\":0,\"islogin\":\"N\",\"url\":\"http://guang.m.yohobuy.com/author/index\"}}"
},
"author_id": "5105041",
"category_id": "1",
"category_name": "话题",
"conver_image_type": "2",
"id": 29630,
"intro": "Wuli凡凡前天回广州老家,小蛮腰可是为他亮起了欢迎语~这阵仗,简直了。看来《老炮儿》和wuli凡凡的人气,实在是高的不要不要。~",
"isFavor": "N",
"isPraise": "N",
"is_recommended": "0",
"praiseStatus": "true",
"praise_num": "46",
"publish_time": "12月25日 22:00",
"share": {
"url": "http://guang.m.yohobuy.com/info/index?id=29630&openby:yohobuy={\"action\":\"go.share\",\"params\":{\"pic\":\"http://img11.static.yhbimg.com/yhb-img01/2015/12/25/10/014df3a77aad110a75f4c63865461785da.jpg?imageView/2/w/640/h/640\",\"title\":\"《老炮儿》造型大吐槽!吴亦凡李易峰戏里戏外造型PK!\",\"url\":\"http://guang.m.yohobuy.com/info/index?id=29630\",\"content\":\"潮流资讯,新鲜贩售,YOHO!有货【逛】不停\"}}"
},
"src": "http://img11.static.yhbimg.com/yhb-img01/2015/12/25/10/014df3a77aad110a75f4c63865461785da.jpg?imageView/{mode}/w/{width}/h/{height}",
"title": "《老炮儿》造型大吐槽!吴亦凡李易峰戏里戏外造型PK!",
"url": "http://guang.m.yohobuy.com/info/index?id=29630&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"29630\"},\"update_flag\":\"a585b3d889ca39701f76149e194ae268\",\"shareparam\":{\"id\":29630},\"share\":\"/guang/api/v1/share/guang\",\"id\":29630,\"type\":1,\"url\":\"http://guang.m.yohobuy.com/info/index\",\"islogin\":\"N\"}}",
"views_num": "57133"
},
{
"article_type": "1",
"author": {
"author_id": "5514979",
"avatar": "http://img12.static.yhbimg.com/yhb-img02/2015/06/12/15/025ff50f6d72fd19abe00c1bc3f0576eaa.jpg?imageView/0/w/100/h/100",
"name": "XpecialSux",
"url": "http://guang.m.yohobuy.com/author/index?id=5514979&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"5514979\"},\"share\":\"\",\"id\":5514979,\"type\":0,\"islogin\":\"N\",\"url\":\"http://guang.m.yohobuy.com/author/index\"}}"
},
"author_id": "5514979",
"category_id": "2",
"category_name": "搭配",
"conver_image_type": "1",
"id": 589,
"intro": "印象里松糕鞋总是女生的专属,殊不知,男生穿上松糕鞋同样也可以萌萌哒,简单的白色短袖T恤搭配迷彩短裤,原创的松糕鞋编织鞋头细节承载麂皮绒的特殊质感,表达年轻人拒绝平庸主义的态度。",
"isFavor": "N",
"isPraise": "N",
"is_recommended": "0",
"praiseStatus": "true",
"praise_num": "25",
"publish_time": "06月05日 16:10",
"share": {
"url": "http://guang.m.yohobuy.com/info/index?id=589&openby:yohobuy={\"action\":\"go.share\",\"params\":{\"pic\":\"http://img11.static.yhbimg.com/yhb-img01/2015/06/01/13/01c00f0fe35939d71161f98f4996dbe703.jpg?imageView/2/w/640/h/640\",\"title\":\"男生穿松糕鞋也可以萌萌哒\",\"url\":\"http://guang.m.yohobuy.com/info/index?id=589\",\"content\":\"潮流资讯,新鲜贩售,YOHO!有货【逛】不停\"}}"
},
"src": "http://img11.static.yhbimg.com/yhb-img01/2015/06/01/13/01c00f0fe35939d71161f98f4996dbe703.jpg?imageView/{mode}/w/{width}/h/{height}",
"title": "男生穿松糕鞋也可以萌萌哒",
"url": "http://guang.m.yohobuy.com/info/index?id=589&openby:yohobuy={\"action\":\"go.h5\",\"params\":{\"param\":{\"id\":\"589\"},\"update_flag\":\"5b9724501839dfbe5ffcc00201868dc0\",\"shareparam\":{\"id\":589},\"share\":\"/guang/api/v1/share/guang\",\"id\":589,\"type\":1,\"url\":\"http://guang.m.yohobuy.com/info/index\",\"islogin\":\"N\"}}",
"views_num": "25960"
}
]
},
"page": 1,
"total": 2,
"totalPage": 1
},
"md5": "6b2878c28018dbae9435cdc49a019e3e",
"message": "星潮教室文章列表"
}
```
#### 响应内容描述
| Param Name | Param Type | Desc |
|:---------| --------:|-----:|
|alg |String | |
|code |int |状态码 |
|md5 |String | |
|message |String |返回结果内容描述 |
|data |json |返回数据内容 |
|datetime |String |当前时间 |
|page |int |当前页 |
|total |int |总记录数 |
|totalPage |int |总页数 |
|list |json |文章集合对象 |
|artList |array |文章数组 |
|ads_img_size |String |广告图片尺寸 |
|article_type |String |文章类型 |
|author_id |String |作者ID |
|author |json |作者对象json |
|author_id |String |作者ID |
|avatar |String |产品的图片URL |
|name |String |名称 |
|url |String |链接的地址 |
|category_id |String |分类ID |
|category_name |String |分类名称 |
|conver_image_type |String |图片类型 1方图,2长图 |
|id |String | |
|intro |String |文章信息 |
|isFavor |String |是否收藏 |
|isPraise |String |是否点赞 |
|is_recommended |String |是否推荐 |
|praiseStatus |String |点赞状态 |
|praise_num |String |点赞数量 |
|publish_time |String |发布时间 |
|share |json |分享链接 |
|url |String |分享链接地址 |
|src |String |图片绝对路径 |
|title |String |文章标题 |
|url |String |URL |
|views_num |String |查看数量 |
#### 异常返回结果:
| 错误码code | 错误message | 说明 |
|:---------| --------:|-----:|
| 500| | 内部错误|
... ...