@bergus
2016-03-18T00:42:54.000000Z
字数 8234
阅读 5351
API
活动
美容项目对应表: body_parts
1-眼部,2-鼻部,3-胸部,4-吸脂,5-破尿酸,6-瘦脸除皱,7-激光美容
活动状态: status -- 原则是不激活不显示,时间不到不让注册
-1:过期活动
-2:未激活的活动(未来的新活动),默认,添加一个新活动默认为未激活状态,需要人为激活,未激活的活动不会在app段显示,过期的活动会显示。
1:在线活动(当前的活动)
是否注册报名过:is_enrolled
1:注册报名过;
2:没有注册报名过
报名管理状态:status
0:所有咨询;
1:添加咨询;
2:未添加咨询
数据字典解析:
page: 代表第几页,默认为1
size: 代表每页有多少条数据,默认为20
sort: 代表排序方式,默认为create_at
POST /activity/list
required
{
"page": 34,
"size": 21,
"sort": "the name that sorted by"
}
# 全部信息
{
"code" :"00000"
"total":13,
"data" :[
{
"id":"ertyuhfg6", // 活动ID
"status": -1, // 活动状态
"num": 1, // 活动季数
"update_at": , // 活动更新时间
"title":"第一季", // 活动标题
"start_at":45678933, // 整型时间戳
"end_at":3221426, // 整形时间戳
},
]
}
{
"code": "10002",
"message":"数据参数转化错误"
}
none
curl\
-X POST\
-d '{"page":1,"size":10,"sort":"create_at"}'\
-i http://localhost:3001/v1/activity/list
POST /activity/get
required
{
"ids": ["activity_id1", "activity_id2"]
}
{
"code":"00000"
"data": [
{
"id":"ertyuhfg6", // 活动ID
"status": -1, // 活动状态,-1:未激活的活动(未来的新活动);1:在线活动(当前的活动);
"num": 1, // 活动季数
"name":"美白", // 活动名字
"title":"第一季", // 活动标题
"cites":["北京","上海"],// 多个城市
"start_at":45678933, // 整形时间戳
"end_at":3221426, // 整形时间戳
"update_at": 123456 , // 活动更新时间
"body_parts": [{"id":1,"name":"脸部"},{"id":2,"name":"胸部"},{"id":3,"name":""}], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
"content":"超文本" // 活动信息
}
]
}
{
"code":"10002",
"message":"数据参数转化错误"
}
none
curl\
-X POST\
-d '{"ids":["id1","id2"]}'
-i http://localhost:3001/v1/activity/get
POST /activity/enroll
required
{
"activity_id": "4eb3a4ff-ad0c-4a03-963c-1a9e4290863e", //string:required, 活动Id
"attrs":{ //基本属性
"nickname": "irons", //string:required, 昵称
"mobile": "86-18621936702", //string:required, 电话号码
"gender": "female", //string:required, 性别
"birthday": "2015-12-24", //string:required, 生日
"occupation": "学生", //string:required, 职业[学生, 上班族, 自由职业者, 全职主妇, 网红, 其他 ]
"body_parts": [1,2], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
},
"extras":{ //可扩展属性
"front_photos": ["http://qiniu.com/1dasdf/asdf.jpg","http://qiniu.com/1dasdf/asdf.jpg"],//[]:required,正面照
"profile_photos": ["http://qiniu.com/1dasdf/asdf.jpg","http://qiniu.com/1dasdf/asdf.jpg"]//[]:required,侧面照
}
}
# 只有返回成功的状态码时才会有data这个返回结果,否则返回message结果
{
"code":"00000"
}
{
"code":"10002",
"message":"传入参数错误"
}
{
"code":"11201",
"message":"用户已经注册该活动"
}
curl\
-X POST\
-d '{"activity_id":"wefddw","mobile":"86-18621936702","gender":"female","birthday":"2015-12-24","occupation":"学生","invitation_code":"221ss","front_photo":["http://qiniu.com/fefw/ddw.jpg","http://qiniu.com/dee/fefew.jpg"],"profile_photo": ["http://qiniu.com/fefw/ddw.jpg","http://qiniu.com/dee/fefew.jpg"],"activity_id":"dwfeww","apply_reason":"申请理由"}'\
-i http://localhost:3001/v1/activity/enroll\
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzM0MjkwNjgsImlhdCI6MTQzMzE2OTg2OCwic3ViIjoiNTU2YzY0OTNkZjhlNTY2NDViM2NmYjdlIn0.WA3UlkU2gDH5UCZ_q4abUSBTMEuY21ytAWgyUfPInEaYlJaI1Iav23yHoSHLggloV4emHf6f2hJuV-3LQuGMQfO60yC4zkgeBvBjjXm6808K_ZsuWMtzco8sTjV-2y6VbHb-EnUItVNE-YJuRiP_i0A0H3gJb7IfsSubOz63G3bXvCFUFxPy9Y7DPmpocLXexltf_-EKbyMNHHob5Nll0XOnb3dMZnXU9QhXnx1kT-2uexzdDVsWEZC6UexmRS9b86_oZ4tfGCcNG-Tg9Bl1ole_Yp_9fUBvqA9o-5gsEzFcc0atdEyM1ytFXAaO5SVCqbOnvRKKOdCrduGLth2w"
POST /activity/is_enrolled
required
{
"activity_id":"4eb3a4ff-ad0c-4a03-963c-1a9e4290863e"
}
{
"code":"00000",
"data":{
"is_enrolled":1 //1:true,2:false
},
}
{
"code":"11203",
"message":"活动不存在!"
}
curl -i http://localhost:3001/v1/activity/is_enrolled\
-d '{"activity_id":"bhbdhbvdvfhfvbdfhd"}'\
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzM0MjkwNjgsImlhdCI6MTQzMzE2OTg2OCwic3ViIjoiNTU2YzY0OTNkZjhlNTY2NDViM2NmYjdlIn0.WA3UlkU2gDH5UCZ_q4abUSBTMEuY21ytAWgyUfPInEaYlJaI1Iav23yHoSHLggloV4emHf6f2hJuV-3LQuGMQfO60yC4zkgeBvBjjXm6808K_ZsuWMtzco8sTjV-2y6VbHb-EnUItVNE-YJuRiP_i0A0H3gJb7IfsSubOz63G3bXvCFUFxPy9Y7DPmpocLXexltf_-EKbyMNHHob5Nll0XOnb3dMZnXU9QhXnx1kT-2uexzdDVsWEZC6UexmRS9b86_oZ4tfGCcNG-Tg9Bl1ole_Yp_9fUBvqA9o-5gsEzFcc0atdEyM1ytFXAaO5SVCqbOnvRKKOdCrduGLth2w"
POST /activity/get_enrolls
required
{
"activity_id": "活动ID", // 根据活动ID获得活动相关的注册报名
"page":"enroll_id",
"size":12,
"sort":"",
"status":2
}
{
"code":"00000"
"total":23,
"data":[
{
"id":"enroll_id",
"user_id":"",
"activity_id":"",
"status":2,
"share_count":2,
"create_at": 12334444 //时间戳
"attrs":{ //基本属性
"nickname": "irons", //string:required, 昵称
"mobile": "86-18621936702", //string:required, 电话号码
"gender": "female", //string:required, 性别
"birthday": "2015-12-24", //string:required, 生日
"occupation": "学生", //string:required, 职业[学生, 上班族, 自由职业者, 全职主妇, 网红, 其他 ]
"body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
},
"extras":{ //可扩展属性
"front_photos": ["http://qiniu.com/1dasdf/asdf.jpg"],//[]:required,正面照
"profile_photos": ["http://qiniu.com/1dasdf/asdf.jpg"],//[]:required,侧面照
}
}
]
}
none
curl\
-X POST\
-i http://localhost:3001/v1/activity/get_enrolls\
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzM0MjkwNjgsImlhdCI6MTQzMzE2OTg2OCwic3ViIjoiNTU2YzY0OTNkZjhlNTY2NDViM2NmYjdlIn0.WA3UlkU2gDH5UCZ_q4abUSBTMEuY21ytAWgyUfPInEaYlJaI1Iav23yHoSHLggloV4emHf6f2hJuV-3LQuGMQfO60yC4zkgeBvBjjXm6808K_ZsuWMtzco8sTjV-2y6VbHb-EnUItVNE-YJuRiP_i0A0H3gJb7IfsSubOz63G3bXvCFUFxPy9Y7DPmpocLXexltf_-EKbyMNHHob5Nll0XOnb3dMZnXU9QhXnx1kT-2uexzdDVsWEZC6UexmRS9b86_oZ4tfGCcNG-Tg9Bl1ole_Yp_9fUBvqA9o-5gsEzFcc0atdEyM1ytFXAaO5SVCqbOnvRKKOdCrduGLth2w"
POST /activity/add
required
{
"name":"美白", // 活动名字
"title":"第一季", // 活动标题
"cites":["北京","上海"], // 多个城市
"start_at":45678933, // 时间戳
"end_at":3221426, // 时间戳
"body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
"content":"the html5 text" // 活动信息
}
{
"code":"00000",
}
{
"code":"10002",
"message":"传入信息转化错误!"
}
none
curl\
-X POST\
-i http://localhost:3001/v1/activity/add\
-d '{
"name":"美白",
"title":"第一季",
"cites":["上海", "北京"],
"start_at":45678933,
"end_at":3221426,
"body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
"content":""
}'
POST /activity/update
required
{
"id":"ehjbfwew", // 活动ID
"name":"美白", // 活动名字
"title":"第一季", // 活动标题
"cites":["北京","上海"], // 多个城市
"start_at":45678933, // 整型时间戳
"end_at":3221426, // 整型时间戳
"body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
"content":"the html5 text" // 活动信息
}
{
"code":"00000"
}
none
curl\
-X POST\
-i http://localhost:3001/v1/activity/update
POST /activity/delete
required
INTER
{
"ids":["ehjbfwew","fghbj"],// 可以让管理员一次删除多个
}
{
"code":"00000"
}
none
curl\
-X POST\
-i http://localhost:3001/v1/activity/delete
POST /activity/list
required
{
"page":34,
"size":21,
"sort":""
}
# 全部信息
{
"code":"00000"
"total":12,
"data":[
{
"id":"ertyuhfg6", // 活动ID
"status": -1, // 活动状态,-1:未激活的活动(未来的新活动);1:在线活动(当前的活动);2:下线活动(过期的或者人为下线的活动)
"num": 1, // 活动季数
"name":"美白", // 活动名字
"title":"第一季", // 活动标题
"cites":["北京","上海"],// 多个城市
"start_at":45678933, // 时间戳
"end_at":3221426, // 时间戳
"update_at": 123456 , // 活动更新时间
"body_parts": [{"id":1,"name":"脸部"},{"id":2,"name":"胸部"},{"id":3,"name":""}], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
"enroll_num":"本次活动分享的次数",
"share_num":"本次活动注册的人数"
},
]
}
{
"code":"10002",
"message":"数据参数转化错误"
}
none
curl\
-X POST\
-i http://localhost:3002/v1/activity/list
POST /activity/get_content
required
{
"id":"activity_id"
}
# 全部信息
{
"code":"00000"
"data":{
"content":"html5 text"
}
}
none
curl\
-X POST\
-i http://localhost:3002/v1/activity/get_content
POST /activity/get_body_parts
required
{
"ids":["body_part_id1","body_part_id2"]
}
# 全部信息
{
"code":"00000",
"data":[
{
"id":1,
"name":"鼻子"
},
{
"id":2,
"name":"脸部"
}
]
}
none
curl\
-X POST\
-i http://localhost:3002/v1/activity/get_body_parts
POST /activity/update_status
required
{
"id":"activity id",
"status": 2
}
# 全部信息
{
"code":"00000"
}
none
curl\
-X POST\
-i http://localhost:3002/v1/activity/update_status