[关闭]
@bergus 2016-03-17T16:42:54.000000Z 字数 8234 阅读 5305

活动报名 APIs v1

API 活动


  1. 美容项目对应表: body_parts
  2. 1-眼部,2-鼻部,3-胸部,4-吸脂,5-破尿酸,6-瘦脸除皱,7-激光美容
  3. 活动状态: status -- 原则是不激活不显示,时间不到不让注册
  4. -1:过期活动
  5. -2:未激活的活动(未来的新活动),默认,添加一个新活动默认为未激活状态,需要人为激活,未激活的活动不会在app段显示,过期的活动会显示。
  6. 1:在线活动(当前的活动)
  7. 是否注册报名过:is_enrolled
  8. 1:注册报名过;
  9. 2:没有注册报名过
  10. 报名管理状态:status
  11. 0:所有咨询;
  12. 1:添加咨询;
  13. 2:未添加咨询
  14. 数据字典解析:
  15. page: 代表第几页,默认为1
  16. size: 代表每页有多少条数据,默认为20
  17. sort: 代表排序方式,默认为create_at

获得活动列表

URL

POST /activity/list

TOKEN

required

Scope

INPUT

  1. {
  2. "page": 34,
  3. "size": 21,
  4. "sort": "the name that sorted by"
  5. }

OUTPUT

  1. # 全部信息
  2. {
  3. "code" :"00000"
  4. "total":13,
  5. "data" :[
  6. {
  7. "id":"ertyuhfg6", // 活动ID
  8. "status": -1, // 活动状态
  9. "num": 1, // 活动季数
  10. "update_at": , // 活动更新时间
  11. "title":"第一季", // 活动标题
  12. "start_at":45678933, // 整型时间戳
  13. "end_at":3221426, // 整形时间戳
  14. },
  15. ]
  16. }
  17. {
  18. "code": "10002",
  19. "message":"数据参数转化错误"
  20. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -d '{"page":1,"size":10,"sort":"create_at"}'\
  4. -i http://localhost:3001/v1/activity/list

获得活动详情

URL

POST /activity/get

TOKEN

required

Scope

INPUT

  1. {
  2. "ids": ["activity_id1", "activity_id2"]
  3. }

OUTPUT

  1. {
  2. "code":"00000"
  3. "data": [
  4. {
  5. "id":"ertyuhfg6", // 活动ID
  6. "status": -1, // 活动状态,-1:未激活的活动(未来的新活动);1:在线活动(当前的活动);
  7. "num": 1, // 活动季数
  8. "name":"美白", // 活动名字
  9. "title":"第一季", // 活动标题
  10. "cites":["北京","上海"],// 多个城市
  11. "start_at":45678933, // 整形时间戳
  12. "end_at":3221426, // 整形时间戳
  13. "update_at": 123456 , // 活动更新时间
  14. "body_parts": [{"id":1,"name":"脸部"},{"id":2,"name":"胸部"},{"id":3,"name":""}], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
  15. "content":"超文本" // 活动信息
  16. }
  17. ]
  18. }
  19. {
  20. "code":"10002",
  21. "message":"数据参数转化错误"
  22. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -d '{"ids":["id1","id2"]}'
  4. -i http://localhost:3001/v1/activity/get

活动报名

URL

POST /activity/enroll

TOKEN

required

Scope

INPUT

  1. {
  2. "activity_id": "4eb3a4ff-ad0c-4a03-963c-1a9e4290863e", //string:required, 活动Id
  3. "attrs":{ //基本属性
  4. "nickname": "irons", //string:required, 昵称
  5. "mobile": "86-18621936702", //string:required, 电话号码
  6. "gender": "female", //string:required, 性别
  7. "birthday": "2015-12-24", //string:required, 生日
  8. "occupation": "学生", //string:required, 职业[学生, 上班族, 自由职业者, 全职主妇, 网红, 其他 ]
  9. "body_parts": [1,2], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
  10. },
  11. "extras":{ //可扩展属性
  12. "front_photos": ["http://qiniu.com/1dasdf/asdf.jpg","http://qiniu.com/1dasdf/asdf.jpg"],//[]:required,正面照
  13. "profile_photos": ["http://qiniu.com/1dasdf/asdf.jpg","http://qiniu.com/1dasdf/asdf.jpg"]//[]:required,侧面照
  14. }
  15. }

OUTPUT

  1. # 只有返回成功的状态码时才会有data这个返回结果,否则返回message结果
  2. {
  3. "code":"00000"
  4. }
  5. {
  6. "code":"10002",
  7. "message":"传入参数错误"
  8. }
  9. {
  10. "code":"11201",
  11. "message":"用户已经注册该活动"
  12. }

ERROR

CURL

  1. curl\
  2. -X POST\
  3. -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":"申请理由"}'\
  4. -i http://localhost:3001/v1/activity/enroll\
  5. -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzM0MjkwNjgsImlhdCI6MTQzMzE2OTg2OCwic3ViIjoiNTU2YzY0OTNkZjhlNTY2NDViM2NmYjdlIn0.WA3UlkU2gDH5UCZ_q4abUSBTMEuY21ytAWgyUfPInEaYlJaI1Iav23yHoSHLggloV4emHf6f2hJuV-3LQuGMQfO60yC4zkgeBvBjjXm6808K_ZsuWMtzco8sTjV-2y6VbHb-EnUItVNE-YJuRiP_i0A0H3gJb7IfsSubOz63G3bXvCFUFxPy9Y7DPmpocLXexltf_-EKbyMNHHob5Nll0XOnb3dMZnXU9QhXnx1kT-2uexzdDVsWEZC6UexmRS9b86_oZ4tfGCcNG-Tg9Bl1ole_Yp_9fUBvqA9o-5gsEzFcc0atdEyM1ytFXAaO5SVCqbOnvRKKOdCrduGLth2w"

用户是否在该次活动报过名过

URL

POST /activity/is_enrolled

TOKEN

required

Scope

INPUT

  1. {
  2. "activity_id":"4eb3a4ff-ad0c-4a03-963c-1a9e4290863e"
  3. }

OUTPUT

  1. {
  2. "code":"00000",
  3. "data":{
  4. "is_enrolled":1 //1:true,2:false
  5. },
  6. }
  7. {
  8. "code":"11203",
  9. "message":"活动不存在!"
  10. }

ERROR

CURL

  1. curl -i http://localhost:3001/v1/activity/is_enrolled\
  2. -d '{"activity_id":"bhbdhbvdvfhfvbdfhd"}'\
  3. -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzM0MjkwNjgsImlhdCI6MTQzMzE2OTg2OCwic3ViIjoiNTU2YzY0OTNkZjhlNTY2NDViM2NmYjdlIn0.WA3UlkU2gDH5UCZ_q4abUSBTMEuY21ytAWgyUfPInEaYlJaI1Iav23yHoSHLggloV4emHf6f2hJuV-3LQuGMQfO60yC4zkgeBvBjjXm6808K_ZsuWMtzco8sTjV-2y6VbHb-EnUItVNE-YJuRiP_i0A0H3gJb7IfsSubOz63G3bXvCFUFxPy9Y7DPmpocLXexltf_-EKbyMNHHob5Nll0XOnb3dMZnXU9QhXnx1kT-2uexzdDVsWEZC6UexmRS9b86_oZ4tfGCcNG-Tg9Bl1ole_Yp_9fUBvqA9o-5gsEzFcc0atdEyM1ytFXAaO5SVCqbOnvRKKOdCrduGLth2w"

获得报名信息

URL

POST /activity/get_enrolls

TOKEN

required

Scope

INPUT

  1. {
  2. "activity_id": "活动ID", // 根据活动ID获得活动相关的注册报名
  3. "page":"enroll_id",
  4. "size":12,
  5. "sort":"",
  6. "status":2
  7. }

OUTPUT

  1. {
  2. "code":"00000"
  3. "total":23,
  4. "data":[
  5. {
  6. "id":"enroll_id",
  7. "user_id":"",
  8. "activity_id":"",
  9. "status":2,
  10. "share_count":2,
  11. "create_at": 12334444 //时间戳
  12. "attrs":{ //基本属性
  13. "nickname": "irons", //string:required, 昵称
  14. "mobile": "86-18621936702", //string:required, 电话号码
  15. "gender": "female", //string:required, 性别
  16. "birthday": "2015-12-24", //string:required, 生日
  17. "occupation": "学生", //string:required, 职业[学生, 上班族, 自由职业者, 全职主妇, 网红, 其他 ]
  18. "body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
  19. },
  20. "extras":{ //可扩展属性
  21. "front_photos": ["http://qiniu.com/1dasdf/asdf.jpg"],//[]:required,正面照
  22. "profile_photos": ["http://qiniu.com/1dasdf/asdf.jpg"],//[]:required,侧面照
  23. }
  24. }
  25. ]
  26. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3001/v1/activity/get_enrolls\
  4. -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzM0MjkwNjgsImlhdCI6MTQzMzE2OTg2OCwic3ViIjoiNTU2YzY0OTNkZjhlNTY2NDViM2NmYjdlIn0.WA3UlkU2gDH5UCZ_q4abUSBTMEuY21ytAWgyUfPInEaYlJaI1Iav23yHoSHLggloV4emHf6f2hJuV-3LQuGMQfO60yC4zkgeBvBjjXm6808K_ZsuWMtzco8sTjV-2y6VbHb-EnUItVNE-YJuRiP_i0A0H3gJb7IfsSubOz63G3bXvCFUFxPy9Y7DPmpocLXexltf_-EKbyMNHHob5Nll0XOnb3dMZnXU9QhXnx1kT-2uexzdDVsWEZC6UexmRS9b86_oZ4tfGCcNG-Tg9Bl1ole_Yp_9fUBvqA9o-5gsEzFcc0atdEyM1ytFXAaO5SVCqbOnvRKKOdCrduGLth2w"

创建活动

URL

POST /activity/add

TOKEN

required

Scope

INPUT

  1. {
  2. "name":"美白", // 活动名字
  3. "title":"第一季", // 活动标题
  4. "cites":["北京","上海"], // 多个城市
  5. "start_at":45678933, // 时间戳
  6. "end_at":3221426, // 时间戳
  7. "body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
  8. "content":"the html5 text" // 活动信息
  9. }

OUTPUT

  1. {
  2. "code":"00000",
  3. }
  4. {
  5. "code":"10002",
  6. "message":"传入信息转化错误!"
  7. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3001/v1/activity/add\
  4. -d '{
  5. "name":"美白",
  6. "title":"第一季",
  7. "cites":["上海", "北京"],
  8. "start_at":45678933,
  9. "end_at":3221426,
  10. "body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
  11. "content":""
  12. }'

活动编辑

URL

POST /activity/update

TOKEN

required

Scope

INPUT

  1. {
  2. "id":"ehjbfwew", // 活动ID
  3. "name":"美白", // 活动名字
  4. "title":"第一季", // 活动标题
  5. "cites":["北京","上海"], // 多个城市
  6. "start_at":45678933, // 整型时间戳
  7. "end_at":3221426, // 整型时间戳
  8. "body_parts": [1,2,3], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
  9. "content":"the html5 text" // 活动信息
  10. }

OUTPUT

  1. {
  2. "code":"00000"
  3. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3001/v1/activity/update

删除活动

URL

POST /activity/delete

TOKEN

required

Scope

INTER

INPUT

  1. {
  2. "ids":["ehjbfwew","fghbj"],// 可以让管理员一次删除多个
  3. }

OUTPUT

  1. {
  2. "code":"00000"
  3. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3001/v1/activity/delete

获得活动列表(web端)

URL

POST /activity/list

TOKEN

required

Scope

INPUT

  1. {
  2. "page":34,
  3. "size":21,
  4. "sort":""
  5. }

OUTPUT

  1. # 全部信息
  2. {
  3. "code":"00000"
  4. "total":12,
  5. "data":[
  6. {
  7. "id":"ertyuhfg6", // 活动ID
  8. "status": -1, // 活动状态,-1:未激活的活动(未来的新活动);1:在线活动(当前的活动);2:下线活动(过期的或者人为下线的活动)
  9. "num": 1, // 活动季数
  10. "name":"美白", // 活动名字
  11. "title":"第一季", // 活动标题
  12. "cites":["北京","上海"],// 多个城市
  13. "start_at":45678933, // 时间戳
  14. "end_at":3221426, // 时间戳
  15. "update_at": 123456 , // 活动更新时间
  16. "body_parts": [{"id":1,"name":"脸部"},{"id":2,"name":"胸部"},{"id":3,"name":""}], //[]:required,每个数字对应一个身体部位,对应表从活动中获取
  17. "enroll_num":"本次活动分享的次数",
  18. "share_num":"本次活动注册的人数"
  19. },
  20. ]
  21. }
  22. {
  23. "code":"10002",
  24. "message":"数据参数转化错误"
  25. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3002/v1/activity/list

获取html5内容(web端)

URL

POST /activity/get_content

TOKEN

required

Scope

INPUT

  1. {
  2. "id":"activity_id"
  3. }

OUTPUT

  1. # 全部信息
  2. {
  3. "code":"00000"
  4. "data":{
  5. "content":"html5 text"
  6. }
  7. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3002/v1/activity/get_content

获得身体部位对应列表(web端)

URL

POST /activity/get_body_parts

TOKEN

required

Scope

INPUT

  1. {
  2. "ids":["body_part_id1","body_part_id2"]
  3. }

OUTPUT

  1. # 全部信息
  2. {
  3. "code":"00000",
  4. "data":[
  5. {
  6. "id":1,
  7. "name":"鼻子"
  8. },
  9. {
  10. "id":2,
  11. "name":"脸部"
  12. }
  13. ]
  14. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3002/v1/activity/get_body_parts

修改活动状态

URL

POST /activity/update_status

TOKEN

required

Scope

INPUT

  1. {
  2. "id":"activity id",
  3. "status": 2
  4. }

OUTPUT

  1. # 全部信息
  2. {
  3. "code":"00000"
  4. }

ERROR

none

CURL

  1. curl\
  2. -X POST\
  3. -i http://localhost:3002/v1/activity/update_status
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注