简要描述:

查询指定栏目文章列表

涉及到的数据表:

enet_cms_user_info // 用户信息(token来源)
enet_cms_article

请求URL:

  1. http://localhost:8081/service/api/cauthcms/category/article/getList
  2. http://localhost:8081/service/api/opencms/category/article/getList

请求方式:

  • POST
  • 参数

    • curl -POST
      http://localhost:8081/serviceapi/cauthcms/category/article/getList?accessKey=mini_profile__app6546d23ef636e_a449006c-a570-4ec5-9082-179660a795c3&userFlag=5d55e70ee071a533b06770291f388eb0_357
      http://localhost:8081/service/api/opencms/category/article/getList?accessKey=mini_profile__app6546d23ef636e_a449006c-a570-4ec5-9082-179660a795c3&userFlag=5d55e70ee071a533b06770291f388eb0_357
      

      表头:

      Content-Type:application/json
      

      URL参数:

      | 参数名 | 类型 | 说明 | | —- | —- | —- | | accessKey | String | 用户token | | userFlag | String | 用户唯一标识 |
  • 以上参数用作用户Token校验。

    请求参数:

    | 参数名 | 是否必须 | 类型 | 说明 | | —- | —- | —- | —- | | categoryId | false | Integer | 栏目ID(如果null则返回全部栏目) | | pageIndex | false | Integer | 当前页面, 从1开始 | | pageSize | false | Integer | 页面大小 |

输入实例:

// 查询所有栏目下的所有信息,默认从第一页,一页100条记录查询
{
    "categoryId": null,
    "pageIndex": null,
    "pageSize":null
}
// 查询栏目1下的所有信息。默认从第一页,一页100条记录查询
 {
    "categoryId": 1,
    "pageIndex": null,
    "pageSize":null
}

返回参数:

参数名 是否必须 类型 说明
msg true String 错误信息
data true 返回 栏目的文章列表数据
code true String 错误代码
-0正确
-1001 count zero

data数组中参数名 是否必须 类型 说明
count true integer 返回数据的条数。
list true Array 返回栏目对应的文章信息

返回示例:

{
    "data": {
        "count": 2,
        "list": [
            {
                "updateTime": 1615342404000,
                "url": "xxxxx",
                "subTitle": "world",
                "id": 2,
                "createTime": 1615342404000,
                "content": "xxxx",
                "img": "xxxxx",
                "title": "fuck2",
                "categoryId": 1
            },
            {
                "url": "xxxx",
                "title": "fuck1",
                "subTitle": "hello",
                "createTime": 1615342378000,
                "content": "xxx",
                "categoryId": 1,
                "updateTime": 1615342381000,
                "img": "xxxx",
                "id": 1
            }
        ]
    },
    "code": 0,
    "msg": "ok"
}