美容项目对应表: 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

[TOC]

获得活动列表

URL

POST /activity/list

TOKEN

required

Scope

  • APP

INPUT

{
   "page": 34,  
   "size": 21,
   "sort": "the name that sorted by"
}

OUTPUT

# 全部信息
{
    "code" :"00000"
    "total":13,
    "data" :[
        {
            "id":"ertyuhfg6",       // 活动ID
            "status": -1,           // 活动状态
            "num":     1,           // 活动季数
            "update_at": ,          // 活动更新时间
            "title":"第一季",       // 活动标题
            "start_at":45678933,    // 整型时间戳
            "end_at":3221426,       // 整形时间戳
        },  
    ]
}

{
    "code":   "10002",
    "message":"数据参数转化错误"
}

ERROR

none

CURL

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

获得活动详情

URL

POST /activity/get

TOKEN

required

Scope

  • APP

INPUT

{
    "ids": ["activity_id1", "activity_id2"]
}

OUTPUT

{
    "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":"数据参数转化错误"
}

ERROR

none

CURL

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

##活动报名

URL

POST /activity/enroll

TOKEN

required

Scope

  • APP

INPUT

{
    "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,侧面照
    }
}

OUTPUT

# 只有返回成功的状态码时才会有data这个返回结果,否则返回message结果
{
    "code":"00000"
}

{
    "code":"10002",
    "message":"传入参数错误"
}

{
    "code":"11201",
    "message":"用户已经注册该活动"
}

ERROR

  • ErrEnrollExists :“11201”
  • ErrRequestFormat :“10002”

CURL

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"

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

URL

POST /activity/is_enrolled

TOKEN

required

Scope

  • APP

INPUT

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

OUTPUT

{
    "code":"00000",
    "data":{
        "is_enrolled":1   //1:true,2:false
    },
}

{
    "code":"11203",
    "message":"活动不存在!"
}

ERROR

  • ErrActivityNotExists //11203

CURL

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"

获得报名信息

URL

POST /activity/get_enrolls

TOKEN

required

Scope

  • INTER

INPUT

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

OUTPUT

{
    "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,侧面照
                }
        }
    ]
}

ERROR

none

CURL

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"

创建活动

URL

POST /activity/add

TOKEN

required

Scope

  • INTER

INPUT

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

OUTPUT

{
    "code":"00000",
}

{
    "code":"10002",
    "message":"传入信息转化错误!"
}

ERROR

none

CURL

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":""
      }'

活动编辑

URL

POST /activity/update

TOKEN

required

Scope

  • INTER

INPUT

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

OUTPUT

{
    "code":"00000"
}

ERROR

none

CURL

curl\
  -X POST\
  -i http://localhost:3001/v1/activity/update

删除活动

URL

POST /activity/delete

TOKEN

required

Scope

INTER

INPUT

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

OUTPUT

{
    "code":"00000"
}

ERROR

none

CURL

curl\
  -X POST\
  -i http://localhost:3001/v1/activity/delete

获得活动列表(web端)

URL

POST /activity/list

TOKEN

required

Scope

  • INTER

INPUT

{
   "page":34,  
   "size":21,
   "sort":""
}

OUTPUT


# 全部信息
{
    "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":"数据参数转化错误"
}

ERROR

none

CURL

curl\
  -X POST\
  -i http://localhost:3002/v1/activity/list

获取html5内容(web端)

URL

POST /activity/get_content

TOKEN

required

Scope

  • INTER

INPUT

{
    "id":"activity_id"
}

OUTPUT


# 全部信息
{
    "code":"00000"
    "data":{
        "content":"html5 text"
    }
}

ERROR

none

CURL

curl\
  -X POST\
  -i http://localhost:3002/v1/activity/get_content

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

URL

POST /activity/get_body_parts

TOKEN

required

Scope

  • INTER

INPUT

{
    "ids":["body_part_id1","body_part_id2"]
}

OUTPUT


# 全部信息
{
    "code":"00000",
    "data":[
         {
            "id":1,
            "name":"鼻子"
        },
         {
            "id":2,
            "name":"脸部"
        }
    ]
}

ERROR

none

CURL

curl\
  -X POST\
  -i http://localhost:3002/v1/activity/get_body_parts

修改活动状态

URL

POST /activity/update_status

TOKEN

required

Scope

  • INTER

INPUT

{
    "id":"activity id",
    "status": 2
}

OUTPUT


# 全部信息
{
    "code":"00000"
}

ERROR

none

CURL

curl\
  -X POST\
  -i http://localhost:3002/v1/activity/update_status