Skip to content

Instantly share code, notes, and snippets.

@Mickey-
Created September 12, 2016 02:55
Show Gist options
  • Save Mickey-/4f27dc868fe2e0d3d6743bf8ab5888e3 to your computer and use it in GitHub Desktop.
Save Mickey-/4f27dc868fe2e0d3d6743bf8ab5888e3 to your computer and use it in GitHub Desktop.
###返回数据结构说明
````
{
status: int //请求的状态码,0:成功;非0:失败
msg: string //请求码简单描述(status=0时,msg=“success”, status!=0时为相应错误信息)
data: json|boolean|string //请求返回的数据
//常规情况下get请求data为json类型,post|update|delete请求 data为boolean类型
}
````
###图片上传(上传到我们自己服务器)
````
post /upload
````
####参数
````
{
file: file //上传的文件
}
````
####返回值
````
{
status:int,
msg: string,
data: {
tempUrl: string //临时图片地址
releaseUrl: string //生成的图片云存储地址
}
}
````
###检查是否存在相同的path海报
````
get /poster/check
````
####参数
````
{
id: string, //海报的ID(修改需要)
path: string //海报的发布地址
}
````
####返回值
````
{
status: init,
msg: string,
data: true|false
}
````
###保存海报信息
````
post /poster
````
####参数
````
{
'layout': '', //页面布局类型,其值为mobile或者pc
'title': '', //页面标题
'pathname': '', //页面路径名,需要确保唯一性
'background': '[{name: '', url: ''}]'
'backgroundColor': '#ffffff', //背景颜色
'shareImage': '', //分享图标地址
'shareTitle': '', //分享标题
'shareDesc': '', //分享描述
'statistics': '', //统计代码
'elements': '', //
'html': '', // 拼装好了的HTML数据
'tempFiles': [{tempUrl1: releaseUrl1}] //文件数组
}
````
####返回值
````
{
status: init,
msg: string,
data: true|false
}
````
###查询海报信息
````
get /poster
````
####参数
````
{
//过滤条件,可根据表中的任意字段组合过滤条件[非必须]
title: '',
pathname: '',
layout: '',
size: init, //分页信息
index: init //当前页(从0开始)
}
````
####返回值
````
{
status: init,
msg: string,
data: [
{
'id': '',//海报ID
'layout': '', //页面布局类型,其值为mobile或者pc
'title': '', //页面标题
'pathname': '', //页面路径名,需要确保唯一性
'backgroundImageName': '', //背景图名称
'backgroundImageData': '', //背景图base64数据
'backgroundColor': '#ffffff', //背景颜色
'shareImage': '', //分享图标地址
'shareTitle': '', //分享标题
'shareDesc': '', //分享描述
'statistics': '', //统计代码
'elements': '', //
'html': '', // 拼装好了的HTML数据
'createDate': '',//创建时间
'updateDate':''//修改时间(如为修改,该字段为null)
}
]
}
````
###查询我的海报信息
````
get /poster/me
````
####参数
````
{
page:{
size: init,
index: init
}
}
````
####返回值
````
{
status: init,
msg: string,
data: [
{
'id': '',//海报ID
'layout': '', //页面布局类型,其值为mobile或者pc
'title': '', //页面标题
'pathname': '', //页面路径名,需要确保唯一性
'backgroundImageName': '', //背景图名称
'backgroundImageData': '', //背景图base64数据
'backgroundColor': '#ffffff', //背景颜色
'shareImage': '', //分享图标地址
'shareTitle': '', //分享标题
'shareDesc': '', //分享描述
'statistics': '', //统计代码
'elements': '', //
'html': '' // 拼装好了的HTML数据
'createDate': '',//创建时间
'updateDate':''//修改时间(如为修改,该字段为null)
}
]
}
````
###获取海报详情
````
get /poster/detail
````
####参数
````
{
id: string //海报ID
}
````
####返回值
````
{
status: init,
msg: string,
data: {
'id': '',//海报ID
'layout': '', //页面布局类型,其值为mobile或者pc
'title': '', //页面标题
'pathname': '', //页面路径名,需要确保唯一性
'backgroundImageName': '', //背景图名称
'backgroundImageData': '', //背景图base64数据
'backgroundColor': '#ffffff', //背景颜色
'shareImage': '', //分享图标地址
'shareTitle': '', //分享标题
'shareDesc': '', //分享描述
'statistics': '', //统计代码
'elements': '', //
'html': '' // 拼装好了的HTML数据
'createDate': '',//创建时间
'updateDate':''//修改时间(如为修改,该字段为null)
}
}
````
###发布海报
````
post /poster/publish
````
####参数
````
{
id: string, //海报ID
params: {
'layout': '', //页面布局类型,其值为mobile或者pc
'title': '', //页面标题
'pathname': '', //页面路径名,需要确保唯一性
'backgroundImageName': '', //背景图名称
'backgroundImageData': '', //背景图base64数据
'backgroundColor': '#ffffff', //背景颜色
'shareImage': '', //分享图标地址
'shareTitle': '', //分享标题
'shareDesc': '', //分享描述
'statistics': '', //统计代码
'elements': '', //
'html': '' // 拼装好了的HTML数据
}
}
````
####返回值
````
{
status: init,
msg: string,
data: true|false
}
````
###更新海报信息
````
put /poster
````
####参数
````
{
id: string, //海报ID
params: {
'layout': '', //页面布局类型,其值为mobile或者pc
'title': '', //页面标题
'pathname': '', //页面路径名,需要确保唯一性
'backgroundImageName': '', //背景图名称
'backgroundImageData': '', //背景图base64数据
'backgroundColor': '#ffffff', //背景颜色
'shareImage': '', //分享图标地址
'shareTitle': '', //分享标题
'shareDesc': '', //分享描述
'statistics': '', //统计代码
'elements': '', //
'html': '' // 拼装好了的HTML数据
}
}
````
####返回值
````
{
status: init,
msg: string,
data: true|false
}
````
###删除海报信息
````
delete /poster
````
####参数
````
{
id: string, //海报ID
}
````
####返回值
````
{
status: init,
msg: string,
data: true|false
}
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment