社区首页相关接口.md 10.4 KB

1、获取首页的版块轮播信息

获取首页的版块轮播信息(method=app.social.getForumCarouselInfo)

公共请求参数

参数名称 参数类型 长度 可否为空 示例 默认值 备注
client_secret string 50 5ac68f20cb18efe154be 进入接口提供的参数加密信息
app_version float 10 1 APP版本
os_version string 20 Android4.4 系统版本+机器型号
client_type string 20 iphone/android/ipad 手机型号(不区分大小写)
screen_size string 20 800x900 (手机尺寸)

请求参数

参数名称 参数类型 可否为空 示例 默认值 备注
appType String 1 1:有货APP,2:YOHO!
clientType String H5 客户端类型

注意,通用的头部没有列出。
请求示例 http://192.168.102.205:8095/social?method=app.social.getForumCarouselInfo

响应

code为200即为成功,否则是失败。 响应JSON格式如下所示:

{
    "alg": "SALT_MD5",
    "code": 200,
    "data": {
        "forumInfo": [
            {
                "commentsNum": 4,
                "forumCode": 10004,
                "forumDesc": "",
                "forumName": "SHOW",
                "forumPic": "",
                "hotPost": {
                    "contentData": "啊啊啊啊啊啊SDDDDDDDD啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊哈哈哈",
                    "hasImgFlg": "Y",
                    "postId": 72,
                    "postsTitle": ""
                },
                "newPost": {
                    "contentData": "啊啊啊啊啊啊SDDDDDDDD啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊哈哈哈",
                    "hasImgFlg": "Y",
                    "postId": 78,
                    "postsTitle": ""
                },
                "oneDayAddNum": 0,
                "orderBy": 0,
                "postsNum": 5,
                "praiseNum": 0
            },
            {
                "commentsNum": 1,
                "forumCode": 10001,
                "forumDesc": "",
                "forumName": "复古市集会",
                "forumPic": "",
                "newPost": {
                    "contentData": "兔子窝",
                    "hasImgFlg": "N",
                    "postId": 84,
                    "postsTitle": "解决了",
                    "user": {
                        "headIcon": "http://img10.static.yhbimg.com/yhb-img01/2016/06/28/17/01b4ab5ad41e5b2d1106915828f41c4bc6.jpg",
                        "name": "叶子",
                        "uid": 8050826
                    }
                },
                "oneDayAddNum": 0,
                "orderBy": 1,
                "postsNum": 2,
                "praiseNum": 9
            },
            {
                "commentsNum": 6,
                "forumCode": 10002,
                "forumDesc": "",
                "forumName": "SNEAKER",
                "forumPic": "",
                "newPost": {
                    "contentData": "啊啊啊啊啊啊SDDDDDDDD啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊哈哈哈哈哈哈哈哈啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊",
                    "hasImgFlg": "N",
                    "postId": 62,
                    "postsTitle": "",
                    "user": {
                        "headIcon": "http://img10.static.yhbimg.com/yhb-img01/2016/06/28/17/01b4ab5ad41e5b2d1106915828f41c4bc6.jpg",
                        "name": "叶子",
                        "uid": 8050826
                    }
                },
                "oneDayAddNum": 0,
                "orderBy": 2,
                "postsNum": 3,
                "praiseNum": 8
            },
            {
                "commentsNum": 0,
                "forumCode": 10003,
                "forumDesc": "",
                "forumName": "YOHO",
                "forumPic": "",
                "oneDayAddNum": 0,
                "orderBy": 3,
                "postsNum": 0,
                "praiseNum": 1
            }
        ],
        "resourceList": {
            "advertList": {
                "list": [
                    {
                        "src": "http://img11.static.yhbimg.com/yhb-img01/2016/07/07/15/011a5c3f9c95ff519647356758f182727c.jpg?imageView2/{mode}/w/{width}/h/{height}",
                        "url": []
                    },
                    {
                        "src": "http://img11.static.yhbimg.com/yhb-img01/2016/07/07/15/015ad6f59bb314007cbbb237aa4e94ecf2.jpg?imageView2/{mode}/w/{width}/h/{height}",
                        "url": []
                    },
                    {
                        "src": "http://img10.static.yhbimg.com/yhb-img01/2016/07/07/15/01c4823176bf27244158462386ad708193.jpg?imageView2/{mode}/w/{width}/h/{height}",
                        "url": []
                    },
                    {
                        "src": "http://img10.static.yhbimg.com/yhb-img01/2016/07/07/15/0191dd4006137d9ff4d2cd5af3391d0ef5.jpg?imageView2/{mode}/w/{width}/h/{height}",
                        "url": []
                    }
                ],
                "speed": ""
            },
            "textNoticeList": {
                "time": "3",
                "list": [
                    {
                        "title": "这是社区首页的文字公告",
                        "url": "http://url.cn"
                    }
                ],
                "open": "Y"
            }
        }
    },
    "md5": "59ce751fcc45bca7c9c2da5b327a9d4d",
    "message": "社区首页版块成功."
}

2、社区首页最热帖子列表

社区首页最热帖子列表(method=app.social.getHomePagePostList)

公共请求参数

参数名称 参数类型 长度 可否为空 示例 默认值 备注
client_secret string 50 5ac68f20cb18efe154be 进入接口提供的参数加密信息
app_version float 10 1 APP版本
os_version string 20 Android4.4 系统版本+机器型号
client_type string 20 iphone/android/ipad 手机型号(不区分大小写)
screen_size string 20 800x900 (手机尺寸)

请求参数

参数名称 参数类型 可否为空 示例 默认值 备注
uid String 32423 0 作者id
lastedTime String 1467116660000 0 时间戳:前一次返回数据的中的lastedTime
limit String 5 10 每页多少条

注意,通用的头部没有列出。
请求示例 http://192.168.102.205:8095/social/?method=app.social.getHomePagePostList&uid=2222222&lastedTime=1467116660000&limit=2&debug=XYZ

响应

code为200即为成功,否则是失败。 响应JSON格式如下所示:

{
    "alg": "SALT_MD5",
    "code": 200,
    "data": {
        "lastedTime": 1467116660000,
        "list": [
            {
                "isIndexTop": 0,
                "blocks": [
                    {
                        "contentData": "啊啊啊啊啊啊SDDDDDDDD啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊哈哈哈",
                        "templateKey": "text",
                        "order": 1
                    },
                    {
                        "contentData": "http://img12.static.yhbimg.com/goodsimg/2016/06/06/05/02e8b4a63c0101b1a1a8f04b53d817b9d4.png",
                        "templateKey": "image",
                        "order": 2
                    },
                    {
                        "contentData": "http://img12.static.yhbimg.com/goodsimg/2016/06/06/05/02e8b4a63c0101b1a1a8f04b53d817b9d5.png",
                        "templateKey": "image",
                        "order": 3
                    }
                ],
                "updateTime": 0,
                "praise": 0,
                "revieweTime": 0,
                "isForumTop": 0,
                "forumName": "YOHO",
                "createTime": 1467116713000,
                "forumCode": 10004,
                "comment": 1,
                "id": 76,
                "revieweState": 0,
                "isHot": 1,
                "browse": 0,
                "status": 0
            },
            {
                "isIndexTop": 0,
                "blocks": [
                    {
                        "contentData": "啊啊啊啊啊啊SDDDDDDDD啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊哈哈哈",
                        "templateKey": "text",
                        "order": 1
                    },
                    {
                        "contentData": "http://img12.static.yhbimg.com/goodsimg/2016/06/06/05/02e8b4a63c0101b1a1a8f04b53d817b9d4.png",
                        "templateKey": "image",
                        "order": 2
                    },
                    {
                        "contentData": "http://img12.static.yhbimg.com/goodsimg/2016/06/06/05/02e8b4a63c0101b1a1a8f04b53d817b9d5.png",
                        "templateKey": "image",
                        "order": 3
                    }
                ],
                "updateTime": 0,
                "praise": 0,
                "revieweTime": 0,
                "isForumTop": 0,
                "forumName": "YOHO",
                "createTime": 1467116660000,
                "forumCode": 10004,
                "comment": 1,
                "id": 74,
                "revieweState": 0,
                "isHot": 1,
                "browse": 0,
                "status": 0
            }
        ],
        "pageSize": 2,
        "total": 10
    },
    "md5": "02ea425ddba4ba534b5fdca266f6c4a2",
    "message": "社区最热帖子列表"
}
{
    "message": "用户ID不能为空",
    "code": 401
}