@lina
2017-11-27T06:39:19.000000Z
字数 13288
阅读 356
闪电
2.0
wechat
- 【线上url】待定
- 【测试url】http://alpha.api3.flash.tmallwo.com:8000/api/v1
- 【线上url】http://api2.flashdiet.cn/api/v1
token填811cc8f3184da78119c370a401c4e25b59b5ff321dfa5
token
: [string] 登录后获取的token
信息
- 待定
- 【线上url】待定
- 【测试url】http://alpha.api3.flash.tmallwo.com:8000/api/
- 【线上url】http://api2.flashdiet.cn/api/
通用图片上传文件服务
请求URL
POST
/imgupload
请求参数
file
: 文件
响应
{
error_code: 0,
data: {
url: 'http://xxx'
}
}
url
: [string] 文件的访问URL
注:请求图片时,需解析图片的cookie,不然无法认证
GET
/captcha/app
POST
/verifycode
请求参数
captcha_code
: [string] 图形验证码phone
: [string] 手机号
响应
{
error_code: 0,
data: {
}
}
POST
请求参数
captcha_code
: [string] 图形验证码
响应
{
error_code: 0,
data: {
}
}
error_code
: [int] 服务器状态码,0 为正常状态,异常状态待定。error_message
:[string] 错误信息,但error_code
不为 0 时返回
data
: [object] 数据字段,所有响应数据都在此字段中list
: [array],当返回数据为列表时会将数据放在该字段
page
: [object] 分页信息,当返回数组数据时会携带该字段
current_page
: [int] 当前页码,默认为1total_page
: [int] 总页数page_size
: [int] 每页数量:本项目常用pageSize==10
示例
{
error_code: 0,
data: {
key: value,
list: [{
key: value
}],
page {
}
}
}
jump_mode
: [int]1:不跳转
2:跳转频道
3:跳转专题
4:跳转详情
5:跳转到H5
[1 => '不跳转', 2 => '栏目', '3' => '专题', '4' => '详情'];
sex
:[int]0: 未知
1: 男
2: 女
is_vip
:[int]0: 未付费
1: 付费
type取值为4的时候,请根据文章数据中的url字段进行跳转
type
:[int]1: 图文
2: 音频
3: 视频
4: H5页面类型
index_display_type
:[int]1: ![400x480.jpg-180.9kB][1]
2: ![400x260.jpg-125.6kB][2]
3: ![270x380.jpg-105.1kB][3]
list_display_type
:[int]1: 缩略图列表
![image_1bcne79pc12af6b21eariqrtr41k.png-973.8kB][4]
2: 大图列表
![image_1bcne8qk5195d15lo15sof4i103o2e.png-1303.8kB][5]
3: 文字列表(注章节信息后台接口自动判断)
![image_1bcne9ajc1hr791o1uvporc1ec02r.png-636.3kB][6]
![image_1bcne9q9cqcd17ui1gm2q9vr3q38.png-677.2kB][7]
{
id: 123,
nickname: '小胖墩',
phone: '15500000000',
avatars: 'http://img1.imgtn.bdimg.com/it/u=3904886406,695848811&fm=11&gp=0.jpg',
sex:0,
brithday:'1999-10-10',
addr: '北京市海淀区',
school: '紫鹿学院',
vip_end_time:'2099-10-10 12:12:12',
is_vip:0,
school_avatars:'http://img1.imgtn.bdimg.com/it/u=3904886406,695848811&fm=11&gp=0.jpg',
token:'aaaaaaa'
}
id
: [int] 用户IDnickname
: [string] 用户名,为空时表示未设置phone
: [string] 用户手机avatars
: [url] 头像sex
: [int] 性别,含义参见2.1brithday
: [date] 用户生日school
: [string] 所在院校vip_end_time
: [string] 毕业时间is_vip
: [int] 是否认证, 含义参见2.1school_avatars
: [url] 学校图标, 仅在用户信息接口下发token
: [string] token,用户登录态,仅登陆接口下发
{
id: 1,
title: '院长公开课',
pic: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
jump_mode: 2
jump_id: 1,
jump_info: {},
}
id
: [int] IDtitle
: [string] 广告titleepic
: [string] 广告图片地址jump_mode
: [int] 跳转类型,详见2.1jump_id
: 跳转的指向id,根据jump_mode含义跳转jump_info
: [object] 根据jump_mode和jump_id取对应的频道、专题、文章的信息
{
id: 1,
channel_name: '大学百事通',
english_name: 'TEACHER',
channel_desc: '大学百事通,让你知晓大学里的任何事情',
type: 1,
content: '<body>大学百事通,让你知晓大学里的任何事情</body>',
index_thumbnail:'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
thumbnail: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
pic: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
index_display_type:1,
list_display_type:3
}
id
: [int] IDchannel_name
: [string] 频道(栏目)名称english_name
: [string] 频道(栏目)英文名称channel_desc
: [string] 频道(栏目)描述type
: [int] 频道(栏目)类型;1为普通频道,普通频道下只能是内容,2专题专题频道,专题频道下只能是专题content
: [string] 频道(栏目)的详细描述(html)index_thumbnail
: [url] 首页缩略图thumbnail
: [url] 缩略图pic
: [url] 封面图index_display_type
: [int] 首页模板,详见2.1list_display_type
: [int] 列表页目标,详见2.1
{
id: 1,
subject_name: '昭赢院长公开课',
subject_desc: '昭赢院长公开课,大学生活的必修课',
content: '<body>昭赢院长公开课,大学生活的必修课</body>',
index_thumbnail:'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
thumbnail: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
pic: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
index_display_type:1,
list_display_type:3
}
id
: [int] IDsubject_name
: [string] 频道(栏目)名称subject_desc
: [string] 频道(栏目)描述content
: [string] 频道(栏目)的详细描述(html)index_thumbnail
: [url] 首页缩略图thumbnail
: [url] 缩略图pic
: [url] 封面图index_display_type
: [int] 首页模板,详见2.1list_display_type
: [int] 列表页目标,详见2.1
注1:内容、音频和视频的链接请用详情接口的,列表页返回的值可能无法访问
注2:type取值为4的时候,请根据文章数据中的url字段进行跳转
{
id:1
title: '001昭赢院长 | 大学生微信社交攻略大全',
type:1,
index_thumbnail: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
thumbnail: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
pic: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
publish_time:'2016-03-03 13:13:13',
abstract:'<body>大学生在社交过程中应注意的细节</body>',
content:'<body>大学生在社交过程中应注意的细节</body>',
audio:'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/audio/2017-03-09/58c0d2880424f.mp3',
audio_size: 16047363,
audio_time_long: 111,
video:'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/video/2017-03-09/58c0e69ae3b79.mp4',
video_size: 111179700,
video_time_long: 111,
chapter_id: 7,
url:http://m.bjfu.edu.cn/
}
id
: [int] idtitle
: [string] 广告图type
: [int] 类型 参见2.1index_thumbnail
: [url] 首页缩略图thumbnail
: [url] 缩略图pic
: [url] 封面图,视频封面publish_time
: [datetime] 发布时间abstract
: [string] 摘要,任何type类型都会有content
: [string] 内容,任何type类型都会有audio
: [url] 音频地址audio_size
: [int] 音频大小,单位Baudio_time_long
: [int] 音频时长,单位秒, 仅详情接口下发video
: [url] 视频地址video_size
: [int] 视频大小,单位Bvideo_time_long
: [int] 视频时长,单位秒, 仅详情接口下发chapter_id
: [int] 章节idurl
: [string] 跳转链接
{
id:1
user_info: @用户信息,
main_info: @文章信息,
content:'这个课程真心不错',
type:0,
comment_time:'2017-03-04 14:19:45',
}
id
: [int] iduser_info
: [map] 用户信息main_info
: [int] 文章信息content
: [string] 评论内容type
: [int] 类型 0普通 1精选comment_time
: [datetime] 评论时间
{
id:1
user_info: @用户信息,
invite_user_info: @用户信息,
amount:3.55,
code:'wefggh',
use_time:'2017-03-04 14:19:45',
}
id
: [int] iduser_info
: [map] 邀请码所有人 @用户信息invite_user_info
: [map] 邀请码使用人 @用户信息amount
: [float] 购买金额code
: [string] 邀请码use_time
: [datetime] 使用时间
{
id:1
sign_time:'2017-03-03 11:11:11',
}
id
: [int] idsign_time
: [datetime] 签到时间
{
id:1
from_user:'管理员',
user_info:@用户信息,
type: 0,
content: '通知:****',
send_time:'2017-10-10 14:34:54',
jump_mode: 3,
jump_id: 33,
}
id
: [int] idfrom_user
: [string] 发送人,文本信息user_info
: [map] 用户信息type
: [int] 类型0私人消息,1全员消息content
: [string] 消息类容send_time
: [datetime] 发送时间jump_mode
: [int] 跳转方式jump_id
: [int] 跳转地
{
id:1
title:'第一章',
}
id
: [int] 章节idtitle
: [string] 章节title
{
id:1
question:'如何快速减肥',
answer:'减肥要坚持'
}
id
: [int] 章节idquestion
: [string] 问题answer
: [string] 答案请求URL
POST
/user/info
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
@用户信息
},
"error_message": ""
}
注:token为用户标识,请求需带上
【注】手机号的修改,请使用认证手机号接口。 只传需要修改的字段,如修改昵称,请只传nick_name字段。
请求URL
POST
/user/update
请求参数
nickname
: [string] 用户名 【非必填】avatars
: [url] 头像 【非必填】sex
: [int] 性别,含义参见2.1 【非必填】brithday
: [date] 用户生日 【非必填】school
: [string] 所在院校 【非必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
@用户信息
},
"error_message": ""
}
【注】需填短信验证码
请求URL
POST
/change/phone
请求参数
verify_code
: 短信验证码【必填】phone
: 手机号【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
@用户信息
},
"error_message": ""
}
【注】与修改手机号不同,绑定过程等同于注册,需传递第三方平台标示,需填短信验证码。【如果用户第一次访问,绑定手机号接口返回用户token,否则在进入页面返回token】
请求URL
POST
/bind/phone
请求参数
verify_code
: 短信验证码【必填】phone
: 手机号【必填】type
: 来源【必填】 微信公众号请填写wechatunique_key
: 第三方唯一标示【必填】
响应
{
"error_code": 0,
"data":{
@用户信息
},
"error_message": ""
}
请求URL
POST
/user/msg
请求参数
current_page
: 页码【必填】page_size
: 页长【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
"list":{
[
@消息信息
]
},
"page":{
@分页字段
}
},
"error_message": ""
}
请求URL
POST
/invite/list
请求参数
current_page
: 页码【必填】page_size
: 页长【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
"list":{
[
@邀请码信息
]
},
"page":{
@分页字段
}
},
"error_message": ""
}
请求URL
POST
/invite/use
请求参数
code
: 邀请码【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
},
"error_message": ""
}
请求URL
【注】需要对接支付功能,此接口参数格式
POST
/invite/buy
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
@邀请码信息
},
"error_message": ""
}
注:调用消息列表接口后,会将此接口数据清零
请求URL
POST
/user/msg/count
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
msg_count": 2
},
"error_message": ""
}
注:仅用于测试
请求URL
POST
/user/delete
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
},
"error_message": ""
}
请求URL
POST
/user/login
请求参数
phone
: 电话号码【必填】verify_code
: 短信验证码【必填】code
: 邀请码【非必填】
响应
{
"error_code": 0,
"data":{
@用户信息
},
"error_message": ""
}
error_message:
1、登录成功,您已成功入学
2、登录成功,邀请码错误
3、登录成功,此邀请码已被使用
4、登录成功,您已经入学了,请勿重复入学
5、登录失败,请重试
请求URL
POST
/channel/list
请求参数
type
: 1取普通频道 2取专题频道,不填取所有频道【非必填】token
: token【非必填】
响应
{
"error_code": 0,
"data":{
"list":{
[
@频道信息
]
},
},
"error_message": ""
}
请求URL
POST
/channel/article-list
请求参数
channel_id
: 频道号【必填】current_page
: 页码【必填】page_size
: 页长【必填】,不分页的时请填一个足够大的值token
: token【必填】
响应
{
"error_code": 0,
"data":{
"list":{
[
@文章(内容)信息
]
},
"page":{
@分页字段
}
},
"error_message": ""
}
请求URL
POST
/channel/subject-list
请求参数
channel_id
: 频道号【必填】current_page
: 页码【必填】page_size
: 页长【必填】,不分页的时请填一个足够大的值token
: token【必填】
响应
{
"error_code": 0,
"data":{
"list":{
[
@专题信息
]
},
"page":{
@分页字段
}
},
"error_message": ""
}
请求URL
POST
/subject/article-list
请求参数
subject_id
: 专题id 测试:subject_id:10006【必填】current_page
: 页码【必填】page_size
: 页长【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
"chapter":[
@章节信息
]
"list":{
[
@文章(内容)信息
]
},
"page":{
@分页字段
}
},
"error_message": ""
}
请求URL
POST
/main/info
请求参数
main_id
: 文章ID 35 37 39【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
@文章(内容)信息
},
"error_message": ""
}
请求URL
POST
/main/comment
请求参数
main_id
: 文章Id【必填】content
: 评论内容【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
},
"error_message": ""
}
请求URL
POST
/channel/info
请求参数
channel_id
: 频道ID【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
@频道(栏目)信息
},
"error_message": ""
}
请求URL
POST
/subject/info
请求参数
subject_id
: 专题ID【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
@专题信息
},
"error_message": ""
}
请求URL
POST
/index
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
banner:@广告信息,
user:@用户信息##
----------
##
channel:[@频道信息]
},
"error_message": ""
}
注:此接口结构较复杂,主要体现在channel的数据。如果channel为普通频道,则该channel结构中会出现articel_list的数据,该数据为频道下的内容列表;如果channel为专题频道,则该channel结构中会出现subject_list的数据,该数据位频道下的专题列表。 请根据index_display_type来适配首页的展示效果
请求URL
POST
/banner/list
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
"list":{
[
@广告信息
]
}
},
"error_message": ""
}
请求URL
POST
/feedback
请求参数
content
: 反馈内容【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
},
"error_message": ""
}
[注] 返回一张默认图,用于缓存
请求URL
POST
/sign/config
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
"url":"http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg",
"start":"2017-03-01",
"end":"2017-03-15",
},
"error_message": ""
}
请求URL
POST
/sign
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
},
"error_message": ""
}
【注】 此接口不分页,以便于日历展示
请求URL
POST
/sign/list
请求参数
token
: token【必填】
响应
{
"error_code": 0,
"data":{
"list":[
@签到信息
]
},
"error_message": ""
}
请求URL
POST
/weixin/place/order
请求参数
token
: token【必填】type
: 类型【必填】微信端请填"web"goods
: 商品【必填】请统一填写"会员"
响应
{
"error_code": 0,
"data":{
"jsConfig":{
"debug": true,
"beta": false,
"appId": "wxec9f72c6529c6cd6",
"nonceStr": "Fhglo9Vf12",
"timestamp": 1491621038,
"url": "http://local.api.project.com/api/v1/weixin/place/order",
"signature": "9b4ef2b2153590ca9d738b4a481c0bae677391b1",
"jsApiList":[
"onMenuShareQQ",
"onMenuShareWeibo",
"chooseWXPay"
]
},
"payConfig":{
"appId": "wxec9f72c6529c6cd6",
"nonceStr": "58e854aec0d8c",
"package": "prepay_id=wx2017040811100055b9f33d1c0980809479",
"signType": "MD5",
"paySign": "B84C9BEA96B3F60B800C45BC52ADE7A8",
"timestamp": "1491621038"
}
},
"error_message": ""
}
使用方式(仅供参考):
wx.config(result.data.jsConfig);
wx.ready(function(){
wx.chooseWXPay({
timestamp: result.data.payConfig.timestamp,
nonceStr: result.data.payConfig.nonceStr,
package: result.data.payConfig.package,
signType: result.data.payConfig.signType,
paySign: result.data.payConfig.paySign,
success: function (res) {
alert('成功');
},
fail:function(res)
{
alert('fail');
},
complete:function(res)
{
alert('complete');
}
});
});
微信JS-SDK: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1445241432&token=&lang=zh_CN
微信支付服务端接口: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=1_1
请求URL
POST
/qa/list
请求参数
key_word
: 搜索关键字【非必填】current_page
: 页码【非必填】page_size
: 页长【非必填】
响应
{
"error_code": 0,
"data":{
"list":{
[
@问答
]
},
"page":{
@分页字段
}
},
"error_message": ""
}
请求URL
POST
/qa/info
请求参数
id
: 问答id【必填】
响应
{
"error_code": 0,
"data":{
@问答
},
"error_message": ""
}
请求URL
get
/qa/hotword
请求参数
响应
{
"error_code": 0,
"data":{
list:[
'减肥',
'瘦身',
]
},
"error_message": ""
}
请求URL
POST
/bind
请求参数
bind
: [string] 手机号或邮箱 【必填】verify_code
: [string] 验证码 【必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
@用户信息
},
"error_message": ""
}
请求URL
POST
/use/card
请求参数
code
: 邀请码【必填】subject_id
: 专题id【必填】from
: 来源渠道【非必填】token
: token【必填】
响应
{
"error_code": 0,
"data":{
},
"error_message": ""
}
请求URL
POST
/weixin/order
请求参数
token
: token【必填】subject_id
: 专题idchannel
: 渠道号
响应
{
"error_code": 0,
"data":{
"jsConfig":{
"debug": true,
"beta": false,
"appId": "wxec9f72c6529c6cd6",
"nonceStr": "Fhglo9Vf12",
"timestamp": 1491621038,
"url": "http://local.api.project.com/api/v1/weixin/place/order",
"signature": "9b4ef2b2153590ca9d738b4a481c0bae677391b1",
"jsApiList":[
"onMenuShareQQ",
"onMenuShareWeibo",
"chooseWXPay"
]
},
"payConfig":{
"appId": "wxec9f72c6529c6cd6",
"nonceStr": "58e854aec0d8c",
"package": "prepay_id=wx2017040811100055b9f33d1c0980809479",
"signType": "MD5",
"paySign": "B84C9BEA96B3F60B800C45BC52ADE7A8",
"timestamp": "1491621038"
}
},
"error_message": ""
}