api接口说明文档

    测试环境前端:http://test.cheshen.cn
    正式环境前端:http://wx.cheshen.cn

    通用返回结构:
    {
        "status":200,       //200:成功,非200:失败
        "msg":"success",
        "data":{}
    }

    其它:
    测试环境管理后台:http://test.cheshen.cn:8001
    正式环境管理后台:http://admin.cheshen.cn

1. 通用

1.1 是否关注公众号

http://test.cheshen.cn/public/is_follow_gzh.htm
        参数:
            无
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": true           //true,已关注;false,未关注
        }
        

1.2 通用统计

http://test.cheshen.cn/public/statistic.htm
        参数:
        type_id: 操作类型
            1,//百科点击
            2,//百科分享    todo
            5,//广告点击
            10,//自媒体文章点击
            11,//自媒体文章分享    todo
            15,//自媒体点击
            16,//自媒体分享
            20,//页面分享
            30,//文章点赞
            40,//自媒体活动点击
            41,//自媒体活动分享
        ta_id:      被收藏/分享的对象id
        id:         点击/赞的对象id
        title:      分享-title
        link:       分享-link
        imgUrl:     分享-imgUrl
        source_url: 分享-source_url
        share_type: 分享类型:1.朋友圈;2.朋友;3.qq;4.微博;5.qq空间

        返回:
        {
            "status": 200,
            "msg": "success",
            "data": []
        }
        

2. 自媒体文章

2.1 文章详情

http://test.cheshen.cn/media/detail/30.htm
        参数:
            无
        返回:参考链接
            http://test.cheshen.cn/media/detail/30.htm?debug=1
        

2.2 获取文章评论

http://test.cheshen.cn/media/articleComment.htm
        参数:
            id: 文章id
            sort: 排序方式
                time:时间,默认方式
                likes:点赞数
            page_index:page_index
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": {
                "list": [
                    {
                        "id": "10",
                        "art_id": "42",
                        "uid": "1",
                        "nickname": "[啤酒]ifhaveif[闪电]呀",
                        "avatar": "",
                        "title": "这是一单图的文章,好看成吗?不要删除!!!a+b 'xxx'",
                        "content": "aaaabbbbxx'xx",
                        "reply_id": "5",
                        "reply_uid": "1",
                        "reply_nickname": "[啤酒]ifhaveif[闪电]呀",
                        "reply_content": "xx'xx",
                        "status": "3",
                        "likes": "0",                       //点赞数
                        "created": "1466412898",
                        "is_like": false                    //是否已点赞
                    }
                ],
                "hasNext": true,     //是否有下一页
                "pageSize": 2,
                "pageIndex": 1
            }
        }
        

2.3 文章评论

http://test.cheshen.cn/media/articleComment.htm
        参数:
            id: 文章id
            mod: comment
            content:内容,前端需要处理不能超过140字
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": []
        }
        

2.4 对文章评论进行回复/评论

http://test.cheshen.cn/media/articleComment.htm
        参数:
            comment_id: 评论id
            mod: reply
            content:内容,前端需要处理不能超过140字
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": []
        }
        

2.5 对文章评论点赞

http://test.cheshen.cn/media/articleComment.htm
        参数:
            comment_id: 评论id
            mod: like
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": []
        }
        

2.6 评论删除

http://test.cheshen.cn/my/comment.htm
        参数:
            id: 评论id
            mod: del
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": []
        }
        

3. 自媒体活动

3.1 详情

http://test.cheshen.cn/act/detail/30.htm
        参数:
            无
        返回:参考链接
            http://test.cheshen.cn/act/detail/30.htm?debug=1
        

3.2 获取评论

http://test.cheshen.cn/act/comment.htm
        参数:
            id: 文章id
            sort: 排序方式
                time:时间,默认方式
                likes:点赞数
            page_index:page_index
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": {
                "list": [
                    {
                        "id": "10",
                        "art_id": "42",
                        "uid": "1",
                        "nickname": "[啤酒]ifhaveif[闪电]呀",
                        "avatar": "",
                        "title": "这是一单图的文章,好看成吗?不要删除!!!a+b 'xxx'",
                        "content": "aaaabbbbxx'xx",
                        "reply_id": "5",
                        "reply_uid": "1",
                        "reply_nickname": "[啤酒]ifhaveif[闪电]呀",
                        "reply_content": "xx'xx",
                        "status": "3",
                        "likes": "0",                       //点赞数
                        "created": "1466412898",
                        "is_like": false                    //是否已点赞
                    }
                ],
                "hasNext": true,     //是否有下一页
                "pageSize": 2,
                "pageIndex": 1
            }
        }
        

添加评论/回复评论/点赞,请参考自媒体文章接口

http://test.cheshen.cn/act/comment.htm

9. 我

9.1 我的评论-自媒体文章

http://test.cheshen.cn/my/comment.htm
        参数:
            无
        返回:参考链接
            http://test.cheshen.cn/my/comment.htm?debug=1
        

9.1.1 我的评论-自媒体活动

http://test.cheshen.cn/my/comment_act.htm
        参数:
            无
        返回:参考链接
            http://test.cheshen.cn/my/comment_act.htm?debug=1
        

9.2 我的消息

http://test.cheshen.cn/my/message.htm
        参数:
            无
        返回:参考链接
            http://test.cheshen.cn/my/message.htm?debug=1
            "list": [
                {
                    "id": "4",
                    "uid": "1",
                    "ta_id": "42",          //文章/活动Id
                    "ta_id2": "5",          //评论id
                    "ta_uid": "1",
                    "ta_nickname": "[啤酒]ifhaveif[闪电]呀",
                    "ta_avatar": "",
                    "ta_content": "xx'xx",
                    "ta_reply_content": "xxxx",
                    "type": "2",                //类型:100.系统消息;1.文章评论;2.文章评论被回复;3.文章评论被点赞;4.活动评论;5.活动评论被回复;6.活动评论被点赞
                    "created": "1466412898"
                }
            ],
            "hasNext": true
        

9.2.1 系统消息详情

http://test.cheshen.cn/my/message_detail.htm
        参数:
            id:消息id
        返回:参考链接
            http://test.cheshen.cn/my/message_detail.htm?id=1&debug=1
        

10. 游戏

10.1 获取登录用户及游戏信息

http://test.cheshen.cn/event/game/index.htm
        参数:
            invite_code_from: 页面地址中的邀请码,可为空
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": {
                "is_first_play": false,             //是否第一次玩游戏
                "is_first_visit": false,             //是否第一次访问这个链接
                "my": {                             //登录者信息
                    "id": "4",
                    "uid": "1",
                    "invite_code_my": "zTq90K",     //邀请码
                    "coin_total": "310",            //金币数
                    "nickname": "13719100871",
                    "avatar": "http://pic.cheshen.cn/imgs/88818c2b257887b573637b095b0352d8.png"
                },
                "ta": {                             //邀请者信息,当invite_code_from不存在时,返回空数组
                    "id": "4",
                    "uid": "1",
                    "invite_code_my": "zTq90K",
                    "coin_total": "310",
                    "nickname": "13719100871",
                    "avatar": "http://pic.cheshen.cn/imgs/88818c2b257887b573637b095b0352d8.png"
                },
                "sign": {                           //微信分享需要的
                    "appId": "wxf57faee7db902aac",
                    "nonceStr": "3v3vfUgyZWyOKBrM",
                    "timestamp": 1460614087,
                    "url": "http://wx.cs.cn/event/game/index.htm?invite_code_from=bbbbbbbb",
                    "signature": "b43434284a71378d6cfbd39ac4078bf45bcebd5b",
                    "rawString": "jsapi_ticket=bxLdikRXVbTPdHSM05e5u7H3MWRimQrnJLZxae3JjnYOmhAK7tGEseqPIpRDFfs5x1G-yssMpFL8gnc85T47jA&noncestr=3v3vfUgyZWyOKBrM×tamp=1460614087&url=http://wx.cs.cn/event/game/index.htm?invite_code_from=bbbbbbbb"
                },
                "list": [                           //用户列表
                    {
                        "id": "4",
                        "uid": "1",
                        "coin_total": "310",
                        "nickname": "13719100871",
                        "avatar": "http://pic.cheshen.cn/imgs/88818c2b257887b573637b095b0352d8.png"
                    }
                ]
            }
        }
        

10.2 游戏完成提交

http://test.cheshen.cn/event/game/index.htm?m=game_completed
        参数:
            coin: 金币数
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": []
        }
        

10.3 排行榜

http://test.cheshen.cn/event/game/rank.htm
        参数:
            无
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": {
                "total": 4,     //总数
                "ranking": 4,   //我的排名
                "list": [       //列表
                    {
                        "id": "5",
                        "uid": "1",
                        "coin_total": "1",
                        "nickname": "13719100871",
                        "avatar": "http://pic.cheshen.cn/imgs/bc21b0c23a5ca48c1da187890d234af3.png"
                    }
                ]
            }
        }
        

11. 游戏0523

所有接口参考"10.游戏"

http://test.cheshen.cn/event/game05/index.htm
            注:请将链接替换为:
            xxx/event/game/xxx    ----->   xxx/event/game05/xxx
        

11.1 领取

http://test.cheshen.cn/event/game05/ticket.htm?realname=xxxx&mobile=13719100871
        需要先登录
        参数:
            realname: 姓名
            mobile: 手机号
        返回:
        {
            "status": 200,
            "msg": "success",
            "data": []
        }