四、飞鹅后端管理系统API接口文档

接口列表

1. 服务健康检查

  • 请求方法: GET
  • 请求 URL: /api/health

请求参数

无

返回结果

{
    "code": 1,
    "message": "success"
}

2. 用户登录

  • 请求方法: POST
  • 请求 URL: /api/admin/access/login

请求参数(form表单)

参数名称 类型 描述 是否必需
username string 账号 是
password string 密码 是

返回结果

{
    "code": 1,
    "data": {
        "token": "d0629855ca6095f8ca7ad85baec22cea"
    },
    "message": "登录成功"
}

3. 用户登出

  • 请求方法: POST
  • 请求 URL: /api/admin/access/logout

请求参数

无

返回结果

{
    "code": 1,
    "data": null,
    "message": "退出成功"
}

4. 创建博客

  • 请求方法: POST
  • 请求 URL: /api/admin/blog/createBlog

请求参数(form表单)

字段名 类型 描述 是否必须
title string 博客标题 是
intro string 博客简介 否
content string 博客内容 否
html string HTML 格式的博客内容 否
tags string 标签列表 否
thumbnail string 缩略图 URL 否
isHtml int 内容来源:0:md 编辑器产生的内容,1:富文本编辑器产生的内容 是
isTop int 是否置顶:0:不置顶,1:置顶 是
cateId int64 博客分类 枚举 是

返回结果

{
    "code": 1,
    "data": null,
    "message": "创建成功"
}

5. 更新博客

  • 请求方法: POST
  • 请求 URL: /api/admin/blog/updateBlog

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 博客ID 是
title string 博客标题 是
intro string 博客简介 否
content string 博客内容 否
html string HTML 格式的博客内容 否
tags string 标签列表 否
thumbnail string 缩略图 URL 否
isHtml int 内容来源:0:md 编辑器产生的内容,1:富文本编辑器产生的内容 是
isTop int 是否置顶:0:不置顶,1:置顶 是
cateId int64 博客分类 枚举 是

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

6. 博客状态变更

  • 请求方法: POST
  • 请求 URL: /api/admin/blog/updateBlogStatus

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 博客ID 是
status int 博客的状态值:10-已创建;20-已下架;30-已发布 是

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

7. 根据博客状态获取博客列表

  • 请求方法: POST
  • 请求 URL: /api/admin/blog/getBlogListByStatus

请求参数(form表单)

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
status int 博客的状态值:10-已创建;20-已下架;30-已发布 是

返回结果

{
    "code": 1,
    "data": {
        "count": 1122,
        "list": [
            {
                "id": 1, // 博客 ID
                "title": "Sample Blog Title", // 博客的标题
                "intro": "This is a brief introduction to the blog.", // 博客的简介
                "content": "This is the content written in Markdown format.", // md 编辑器产生的内容时,对应的 md 的内容
                "html": "<p>This is the HTML content generated from Markdown.</p>", // md 编辑器产生的内容时,对应的生成的 HTML
                "isHtml": 1, // 0:md 编辑器产生的内容,1:富文本编辑器产生的内容
                "isTop": 0, // 是否置顶:0:不置顶,1:置顶
                "readCount": 1024, // 阅读数
                "createTime": "2024-08-22T15:30:00Z", // 创建时间
                "updateTime": "2024-08-22T15:45:00Z", // 更新时间
                "publishTime": "2024-08-22T16:00:00Z", // 发布时间
                "thumbnail": "https://example.com/thumbnail.jpg", // 缩略图, 是一个 URL
                "status": "published", // 博客状态
                "cateId": 4, // 博客分类枚举值
                "tags": "golang,struct,example" // 标签,英文逗号分隔,如:"并发,线程,Java"
            }
        ]
    },
    "message": "获取数据成功"
}

8. 根据关键字搜索获取博客列表

  • 请求方法: POST
  • 请求 URL: /api/admin/blog/getBlogListByWord

请求参数(form表单)

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
word string 关键字 是

返回结果

{
    "code": 1,
    "data": {
        "count": 1122,
        "list": [
            {
                "id": 1, // 博客 ID
                "title": "Sample Blog Title", // 博客的标题
                "intro": "This is a brief introduction to the blog.", // 博客的简介
                "content": "This is the content written in Markdown format.", // md 编辑器产生的内容时,对应的 md 的内容
                "html": "<p>This is the HTML content generated from Markdown.</p>", // md 编辑器产生的内容时,对应的生成的 HTML
                "isHtml": 1, // 0:md 编辑器产生的内容,1:富文本编辑器产生的内容
                "isTop": 0, // 是否置顶:0:不置顶,1:置顶
                "readCount": 1024, // 阅读数
                "createTime": "2024-08-22T15:30:00Z", // 创建时间
                "updateTime": "2024-08-22T15:45:00Z", // 更新时间
                "publishTime": "2024-08-22T16:00:00Z", // 发布时间
                "thumbnail": "https://example.com/thumbnail.jpg", // 缩略图, 是一个 URL
                "status": "published", // 博客状态
                "cateId": 4, // 博客分类枚举值
                "tags": "golang,struct,example" // 标签,英文逗号分隔,如:"并发,线程,Java"
            }
        ]
    },
    "message": "获取数据成功"
}

9. 搜索博客

  • 请求方法: POST
  • 请求 URL: /api/admin/blog/searchBlog

请求参数(form表单)

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
word string 关键字 否
status int 博客的状态值:10-已创建;20-已下架;30-已发布 否

返回结果

{
    "code": 1,
    "data": {
        "count": 1122,
        "list": [
            {
                "id": 1, // 博客 ID
                "title": "Sample Blog Title", // 博客的标题
                "intro": "This is a brief introduction to the blog.", // 博客的简介
                "content": "This is the content written in Markdown format.", // md 编辑器产生的内容时,对应的 md 的内容
                "html": "<p>This is the HTML content generated from Markdown.</p>", // md 编辑器产生的内容时,对应的生成的 HTML
                "isHtml": 1, // 0:md 编辑器产生的内容,1:富文本编辑器产生的内容
                "isTop": 0, // 是否置顶:0:不置顶,1:置顶
                "readCount": 1024, // 阅读数
                "createTime": "2024-08-22T15:30:00Z", // 创建时间
                "updateTime": "2024-08-22T15:45:00Z", // 更新时间
                "publishTime": "2024-08-22T16:00:00Z", // 发布时间
                "thumbnail": "https://example.com/thumbnail.jpg", // 缩略图, 是一个 URL
                "status": "published", // 博客状态
                "cateId": 4, // 博客分类枚举值
                "tags": "golang,struct,example" // 标签,英文逗号分隔,如:"并发,线程,Java"
            }
        ]
    },
    "message": "获取数据成功"
}

10. 获取博客详情

  • 请求方法: POST
  • 请求 URL: /api/admin/blog/getBlogDetail

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 博客ID 是

返回结果

{
    "code": 1,
    "data": {
        "id": 1, // 博客 ID
        "title": "Sample Blog Title", // 博客的标题
        "intro": "This is a brief introduction to the blog.", // 博客的简介
        "content": "This is the content written in Markdown format.", // md 编辑器产生的内容时,对应的 md 的内容
        "html": "<p>This is the HTML content generated from Markdown.</p>", // md 编辑器产生的内容时,对应的生成的 HTML
        "isHtml": 1, // 0:md 编辑器产生的内容,1:富文本编辑器产生的内容
        "isTop": 0, // 是否置顶:0:不置顶,1:置顶
        "readCount": 1024, // 阅读数
        "createTime": "2024-08-22T15:30:00Z", // 创建时间
        "updateTime": "2024-08-22T15:45:00Z", // 更新时间
        "publishTime": "2024-08-22T16:00:00Z", // 发布时间
        "thumbnail": "https://example.com/thumbnail.jpg", // 缩略图, 是一个 URL
        "status": "published", // 博客状态
        "cateId": 4, // 博客分类枚举值
        "tags": "golang,struct,example" // 标签,英文逗号分隔,如:"并发,线程,Java"
    },
    "message": "获取博客成功"
}

11. 创建友链

  • 请求方法: POST
  • 请求 URL: /api/admin/link/create

请求参数(form表单)

字段名 类型 描述 是否必须
title string 名称 是
url string URL 是
seq int 序号 否
validTime int64 有效时间(UNIX 时间戳) 否
remark string 备注 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "添加成功"
}

12. 修改友链

  • 请求方法: POST
  • 请求 URL: /api/admin/link/update

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 友链ID 是
title string 名称 否
url string URL 否
seq int 序号 否
validTime int64 有效时间(UNIX 时间戳) 否
remark string 备注 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

13. 获取友链信息

  • 请求方法: POST
  • 请求 URL: /api/admin/link/getLinkInfo

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 友链ID 是

返回结果

{
    "code": 1,
    "data": {
        "id": 1, // id
        "title": "Sample Link Title", // 标题
        "url": "https://example.com", // 链接到的 URL
        "seq": 1, // 序号,从小到大排序
        "createTime": "2024-08-22T15:30:00Z", // 创建时间
        "updateTime": "2024-08-22T15:45:00Z", // 修改时间
        "validTime": "2024-12-31T23:59:59Z", // 有效时间
        "remark": "This is a sample remark.", // 备注
        "status": 1 // 状态: 0-已下架;1-正常
    },
    "message": "获取成功"
}

14. 获取友链

  • 请求方法: POST
  • 请求 URL: /api/admin/link/getLinkList

请求参数(form表单)

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
status int 友链状态:0-已下架;1-已上架;-1-全部 是

返回结果

{
    "code": 1,
    "data": {
        "count": 1122,
        "list": [
            {
                "id": 1, // id
                "title": "Sample Link Title", // 标题
                "url": "https://example.com", // 链接到的 URL
                "seq": 1, // 序号,从小到大排序
                "createTime": "2024-08-22T15:30:00Z", // 创建时间
                "updateTime": "2024-08-22T15:45:00Z", // 修改时间
                "validTime": "2024-12-31T23:59:59Z", // 有效时间
                "remark": "This is a sample remark.", // 备注
                "status": 1 // 状态: 0-已下架;1-正常
            }
        ]
    },
    "message": "获取成功"
}

15. 创建网站

  • 请求方法: POST
  • 请求 URL: /api/admin/site/createSite

请求参数(form表单)

字段名 类型 描述 是否必须
title string 网站名称 否
intro string 网站简介 否
slogan string 个性签名 否
cover string 网站背景图 否
copyright string 版权信息 否
icp string 备案号 否
extra string 额外的信息, json字符串,具体有哪些信息,暂未定 否
status int 网站信息状态: 0-未启用;1-已启用 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "创建成功"
}

16. 更新网站

  • 请求方法: POST
  • 请求 URL: /api/admin/site/updateSite

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 网站ID 是
title string 网站名称 否
intro string 网站简介 否
slogan string 个性签名 否
cover string 网站背景图 否
copyright string 版权信息 否
icp string 备案号 否
extra string 额外的信息, json字符串,具体有哪些信息,暂未定 否
status int 网站信息状态: 0-未启用;1-已启用 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

17. 获取网站信息

  • 请求方法: POST
  • 请求 URL: /api/admin/site/getSiteInfoList

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 网站ID 是
title string 网站名称 否
intro string 网站简介 否
slogan string 个性签名 否
cover string 网站背景图 否
copyright string 版权信息 否
icp string 备案号 否
extra string 额外的信息, json字符串,具体有哪些信息,暂未定 否
status int 网站信息状态: 0-未启用;1-已启用 否

返回结果

{
    "code": 1,
    "data": {
        "list": [
            {
                "id": 1, // id
                "title": "Example Site Name", // 网站名称
                "intro": "This is an example site description.", // 网站简介
                "slogan": "Your Tagline Here", // 个性签名
                "cover": "https://example.com/cover.jpg", // 网站背景图
                "copyright": "© 2024 Example Company", // 版权信息
                "icp": "ICP 12345678", // 备案号
                "updateTime": "2024-08-22T15:30:00Z", // 更新时间
                "extra": "{\"info\": \"Additional JSON data\"}", // 额外的信息, json字符串,具体有哪些信息,暂未定
                "status": "1" // 网站信息状态: 0-未启用;1-已启用 
            }
        ]
    },
    "message": "获取数据成功"
}

18. 获取在网站上展示的那一条

  • 请求方法: POST
  • 请求 URL: /api/admin/site/getUsedSiteInfo

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 网站ID 是
title string 网站名称 否
intro string 网站简介 否
slogan string 个性签名 否
cover string 网站背景图 否
copyright string 版权信息 否
icp string 备案号 否
extra string 额外的信息, json字符串,具体有哪些信息,暂未定 否
status int 网站信息状态: 0-未启用;1-已启用 否

返回结果

{
    "code": 1,
    "data": {
        "id": 1, // id
        "title": "Example Site Name", // 网站名称
        "intro": "This is an example site description.", // 网站简介
        "slogan": "Your Tagline Here", // 个性签名
        "cover": "https://example.com/cover.jpg", // 网站背景图
        "copyright": "© 2024 Example Company", // 版权信息
        "icp": "ICP 12345678", // 备案号
        "updateTime": "2024-08-22T15:30:00Z", // 更新时间
        "extra": "{\"info\": \"Additional JSON data\"}", // 额外的信息, json字符串,具体有哪些信息,暂未定
        "status": "1" // 网站信息状态: 0-未启用;1-已启用 
    },
    "message": "获取数据成功"
}

19. 创建站长信息

  • 请求方法: POST
  • 请求 URL: /api/admin/site/createWebmasterInfo

请求参数(form表单)

字段名 类型 描述 是否必须
intro string 站长简介 否
slogan string 站长个性签名 否
nicker string 站长昵称 否
avatar string 站长头像 否
job string 站长职业 否
email string 站长邮箱 否
qq string 站长QQ号 否
wechat string 站长微信二维码 否
rewardCode string 站长打赏二维码 否
status int 状态: 0-未启用;1-已启用 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "创建成功"
}

20. 更新站长信息

  • 请求方法: POST
  • 请求 URL: /api/admin/site/updateWebmasterInfo

请求参数(form表单)

字段名 类型 描述 是否必须
id int64 站长ID 是
intro string 站长简介 否
slogan string 站长个性签名 否
nicker string 站长昵称 否
avatar string 站长头像 否
job string 站长职业 否
email string 站长邮箱 否
qq string 站长QQ号 否
wechat string 站长微信二维码 否
rewardCode string 站长打赏二维码 否
status int 状态: 0-未启用;1-已启用 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

21. 获取站长信息

  • 请求方法: POST
  • 请求 URL: /api/admin/site/getWebmasterInfo

请求参数

无

返回结果

{
    "code": 1,
    "data": {
        "id": 1234567890123456789, // id
        "intro": "This is the webmaster's introduction.", // 站长简介
        "slogan": "Webmaster's tagline", // 站长个性签名
        "nicker": "webmaster_nickname", // 站长昵称
        "avatar": "https://example.com/avatar.jpg", // 站长头像
        "job": "Chief Web Officer", // 站长职业
        "email": "webmaster@example.com", // 站长邮箱
        "qq": "123456789", // 站长QQ号
        "wechat": "https://example.com/wechat-qrcode.png", // 站长微信二维码
        "rewardCode": "https://example.com/reward-qrcode.png", // 站长打赏二维码
        "status": 1, // 状态 0-未启用;1-已启用
        "updateTime": "2024-08-22T15:30:00Z" // 更新时间
    },
    "message": "获取数据成功"
}

22. 获取站长信息

  • 请求方法: POST
  • 请求 URL: /api/admin/site/getWebmasterInfoList

请求参数

无

返回结果

{
    "code": 1,
    "data": {
        "list": [
            {
                "id": 1234567890123456789, // id
                "intro": "This is the webmaster's introduction.", // 站长简介
                "slogan": "Webmaster's tagline", // 站长个性签名
                "nicker": "webmaster_nickname", // 站长昵称
                "avatar": "https://example.com/avatar.jpg", // 站长头像
                "job": "Chief Web Officer", // 站长职业
                "email": "webmaster@example.com", // 站长邮箱
                "qq": "123456789", // 站长QQ号
                "wechat": "https://example.com/wechat-qrcode.png", // 站长微信二维码
                "rewardCode": "https://example.com/reward-qrcode.png", // 站长打赏二维码
                "status": 1, // 状态 0-未启用;1-已启用
                "updateTime": "2024-08-22T15:30:00Z" // 更新时间
            }
        ]
    },
    "message": "获取数据成功"
}

23. 创建博客分类

  • 请求方法: POST
  • 请求 URL: /api/admin/category/create

请求参数

字段名 类型 描述 是否必须
name string 名称 否
seq int 序号,从小到大排序 否
icon string 分类图标 icon 的 URL 否
font string 字体,iconfont 上的矢量字体 否
color string 分类颜色,iconfont 上的颜色,如:#aa33ff 否
status int 状态 0-下架;1-正常 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "创建分类成功"
}

24. 修改博客分类

  • 请求方法: POST
  • 请求 URL: /api/admin/category/update

请求参数

字段名 类型 描述 是否必须
id int64 分类ID 是
name string 名称 否
seq int 序号,从小到大排序 否
icon string 分类图标 icon 的 URL 否
font string 字体,iconfont 上的矢量字体 否
color string 分类颜色,iconfont 上的颜色,如:#aa33ff 否
status int 状态 0-下架;1-正常 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

25. 获取分类列表

  • 请求方法: POST
  • 请求 URL: /api/admin/category/getCategoryList

请求参数

字段名 类型 描述 是否必须
status int 状态 0-下架;1-正常;-1-全部 是

返回结果

{
    "code": 1,
    "data": {
        "list": [
            {
                "id": 1, // 分类 ID
                "name": "Sample Category", // 名称
                "seq": 1, // 序号,从小到大排序
                "icon": "https://example.com/icon.png", // 分类图标 icon 的 URL
                "font": "iconfont-class", // 字体,iconfont 上的矢量字体
                "color": "#aa33ff", // 分类颜色,iconfont 上的颜色,如:#aa33ff
                "createTime": "2024-08-22T15:30:00Z", // 分类创建时间
                "updateTime": "2024-08-22T15:45:00Z", // 分类更新时间
                "status": 1 // 状态 0-下架;1-正常
                }
        ]
    },
    "message": "更新成功"
}

26. 创建公告

  • 请求方法: POST
  • 请求 URL: /api/admin/notice/create

请求参数

字段名 类型 描述 是否必须
title string 公告标题 否
content string 公告内容 否
createTime time.Time 创建时间 否
validTime time.Time 有效时间 否
status int 公告状态(1-上架, 0-下架) 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "创建成功"
}

27. 更新公告

  • 请求方法: POST
  • 请求 URL: /api/admin/notice/update

请求参数

字段名 类型 描述 是否必须
id int64 公告ID 是
title string 公告标题 否
content string 公告内容 否
createTime time.Time 创建时间 否
validTime time.Time 有效时间 否
status int 公告状态(1-上架, 0-下架) 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

28. 获取通知列表

  • 请求方法: POST
  • 请求 URL: /api/admin/notice/getNoticeList

请求参数

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
status int 公告状态(1-上架, 0-下架, -1-全部) 是

返回结果

{
    "code": 1,
    "data": {
        "count": 11212,  // 总条数
        "list": [
            {
                "id": 1234567890123456789, // 公告 ID
                "title": "Sample Notice Title", // 公告标题
                "content": "This is the content of the notice.", // 公告内容
                "createTime": "2024-08-22T15:30:00Z", // 创建时间
                "updateTime": "2024-08-22T15:45:00Z", // 更新时间
                "validTime": "2024-12-31T23:59:59Z", // 有效时间
                "status": 1 // 公告状态(1-上架, 0-下架)
            }
        ]
    },
    "message": "获取成功"
}

29. 获取通知详情

  • 请求方法: POST
  • 请求 URL: /api/admin/notice/getNoticeInfo

请求参数

字段名 类型 描述 是否必须
id int64 通知ID 是

返回结果

{
    "code": 1,
    "data": {
        "id": 1234567890123456789, // 公告 ID
        "title": "Sample Notice Title", // 公告标题
        "content": "This is the content of the notice.", // 公告内容
        "createTime": "2024-08-22T15:30:00Z", // 创建时间
        "updateTime": "2024-08-22T15:45:00Z", // 更新时间
        "validTime": "2024-12-31T23:59:59Z", // 有效时间
        "status": 1 // 公告状态(1-上架, 0-下架)
    },
    "message": "获取成功"
}

30. 创建专栏

  • 请求方法: POST
  • 请求 URL: /api/admin/special/create

请求参数

字段名 类型 描述 是否必须
title string 名称 否
intro string 介绍 否
cover string 封面 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "创建成功"
}

31. 更新专栏

  • 请求方法: POST
  • 请求 URL: /api/admin/special/update

请求参数

字段名 类型 描述 是否必须
id int64 专栏ID 否
title string 名称 否
intro string 介绍 否
cover string 封面 否
status int 状态:10-未发布;20-已删除;30-已发布 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

32. 搜索专栏

  • 请求方法: POST
  • 请求 URL: /api/admin/special/searchSpecial

请求参数

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
word string 关键字 否
status int 博客的状态值:10-已创建;20-已下架;30-已发布 否

返回结果

{
    "code": 1,
    "data": {
        "count": 1231231,  // 总条数
        "list": [
            {
                "id": 1, // id
                "title": "Sample Special Title", // 标题
                "intro": "This is a brief introduction.", // 简介
                "cover": "https://example.com/cover.jpg", // 封面
                "createTime": "2024-08-22T15:30:00Z", // 创建时间
                "updateTime": "2024-08-22T15:45:00Z", // 更新时间
                "publishTime": "2024-08-23T09:00:00Z", // 发布时间
                "status": 30, // 状态
                "totalCount": 23432, // 总小节数
                "publishedCount": 112 // 已发布的小节数
            }
        ]
    },
    "message": "获取数据成功"
}

33. 专栏添加小节

  • 请求方法: POST
  • 请求 URL: /api/admin/special/addSection

请求参数

字段名 类型 描述 是否必须
specialId int64 专栏ID 是
title string 小节标题 否
seq int 排序 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "添加成功"
}

34. 专栏更新小节

  • 请求方法: POST
  • 请求 URL: /api/admin/special/updateSection

请求参数

字段名 类型 描述 是否必须
specialId int64 所属专栏 ID 是
sectionId int64 小节 ID 是
title string 小节的标题 否
intro string 小节的简介,暂时用不到 否
content string md 编辑器产生的内容,对应的 md 内容 否
html string md 编辑器产生的内容,对应的生成的 HTML 否
tags string 标签,英文逗号分隔,如:"并发,线程,Java" 否
isHtml int 0:md 编辑器产生的内容,1:富文本编辑器产生的内容 否
readCount int64 阅读数 否
seq int 序号,从小到大排序,默认 100 否
status int 小节状态 10-已创建;20-已下架;30-已发布 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

35. 专栏获取小节列表

  • 请求方法: POST
  • 请求 URL: /api/admin/special/getSectionList

请求参数

字段名 类型 描述 是否必须
specialId int64 所属专栏 ID 是
status int 小节状态 10-已创建;20-已下架;30-已发布 否

返回结果

{
    "code": 1,
    "data": {
        "count": 12321, // 总条数
        "list": [
            {
            "id": 1, // 小节 ID
            "title": "Sample Section Title", // 小节的标题
            "intro": "This is a brief introduction.", // 小节的简介,暂时用不到
            "content": "This is the Markdown content.", // md 编辑器产生的内容,对应的 md 内容
            "html": "<p>This is the generated HTML content.</p>", // md 编辑器产生的内容,对应的生成的 HTML
            "tags": "并发,线程,Java", // 标签,英文逗号分隔,如:"并发,线程,Java"
            "isHtml": 1, // 0:md 编辑器产生的内容,1:富文本编辑器产生的内容
            "readCount": 1234, // 阅读数
            "specialId": 9876543210123456789, // 所属专栏 ID
            "seq": 100, // 序号,从小到大排序,默认 100
            "createTime": "2024-08-22T15:30:00Z", // 创建时间
            "updateTime": "2024-08-22T15:45:00Z", // 更新时间
            "publishTime": "2024-08-23T09:00:00Z", // 发布时间
            "status": 30 // 小节状态
            }
        ]
    },
    "message": "获取数据成功"
}

36. 专栏获取小节详情

  • 请求方法: POST
  • 请求 URL: /api/admin/special/getSectionDetail

请求参数

字段名 类型 描述 是否必须
sectionId int64 小节 ID 是

返回结果

{
    "code": 1,
    "data": {
        "id": 1, // 小节 ID
        "title": "Sample Section Title", // 小节的标题
        "intro": "This is a brief introduction.", // 小节的简介,暂时用不到
        "content": "This is the Markdown content.", // md 编辑器产生的内容,对应的 md 内容
        "html": "<p>This is the generated HTML content.</p>", // md 编辑器产生的内容,对应的生成的 HTML
        "tags": "并发,线程,Java", // 标签,英文逗号分隔,如:"并发,线程,Java"
        "isHtml": 1, // 0:md 编辑器产生的内容,1:富文本编辑器产生的内容
        "readCount": 1234, // 阅读数
        "specialId": 9876543210123456789, // 所属专栏 ID
        "seq": 100, // 序号,从小到大排序,默认 100
        "createTime": "2024-08-22T15:30:00Z", // 创建时间
        "updateTime": "2024-08-22T15:45:00Z", // 更新时间
        "publishTime": "2024-08-23T09:00:00Z", // 发布时间
        "status": 30 // 小节状态
    },
    "message": "获取小节详情成功"
}

37. 上传图片

  • 请求方法: POST
  • 请求 URL: /api/admin/file/uploadImg

请求参数

字段名 类型 描述 是否必须
uploadfile file 图片文件 是

返回结果

{
    "code": 1,
    "data": {
        "filename": "http://xxx.png", // 图片地址
    },
    "message": "上传文件成功"
}

38. 创建轮播图

  • 请求方法: POST
  • 请求 URL: /api/admin/banner/create

请求参数

字段名 类型 描述 是否必须
title string 名称 是
url string 图片URL 是
targetUrl string 跳转 URL 否
seq int 序号 是

返回结果

{
    "code": 1,
    "data": null,
    "message": "添加成功"
}

39. 更新轮播图

  • 请求方法: POST
  • 请求 URL: /api/admin/banner/update

请求参数

字段名 类型 描述 是否必须
id int64 轮播图ID 是
title string 名称 是
url string 图片URL 是
targetUrl string 跳转 URL 否
seq int 序号 是
status int 轮播图状态 0-已下架,1-正常 否

返回结果

{
    "code": 1,
    "data": null,
    "message": "更新成功"
}

40. 获取轮播图

  • 请求方法: GET
  • 请求 URL: /api/admin/banner/getBannerInfo

请求参数

字段名 类型 描述 是否必须
id int64 轮播图ID 是

返回结果

{
    "code": 1,
    "data": {
        "id": 1, // banner id
        "title": "Sample Banner Title", // banner 标题
        "url": "https://example.com/banner.jpg", // 图片 url
        "targetUrl": "https://example.com/target", // 跳转到的目标 url
        "seq": 1, // 序号,从小到大排序
        "createTime": "2024-08-22T15:30:00Z", // 创建时间
        "status": 1 // banner 状态
    },
    "message": "获取成功"
}

41. 获取轮播图列表

  • 请求方法: GET
  • 请求 URL: /api/admin/banner/getBannerList

请求参数

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
status int 轮播图的状态值:0-已下架,1-正常,-1-全部 是

返回结果

{
    "code": 1,
    "data": {
        "count": 123, //总条数
        "list": [
            {
                "id": 1, // banner id
                "title": "Sample Banner Title", // banner 标题
                "url": "https://example.com/banner.jpg", // 图片 url
                "targetUrl": "https://example.com/target", // 跳转到的目标 url
                "seq": 1, // 序号,从小到大排序
                "createTime": "2024-08-22T15:30:00Z", // 创建时间
                "status": 1 // banner 状态
            }
        ]
    },
    "message": "获取成功"
}

42. 获取轮播图列表

  • 请求方法: POST
  • 请求 URL: /api/admin/workStation/getStatistics

请求参数

字段名 类型 描述 是否必须
pageNum int 分页页码 是
pageSize int 分页大小 是
status int 轮播图的状态值:0-已下架,1-正常,-1-全部 是

返回结果

{
    "code": 1,
    "data": {
        "blogCnt": 120, // 博客数
        "specialCnt": 30, // 专栏数
        "linkCnt": 50, // 友链数
        "adminCnt": 5, // 管理员数
        "bannerCnt": 10, // 轮播图数
        "newBlogToday": 3, // 今日新增博客数
        "newSpecialTodayCnt": 1 // 今日新增专栏数
    },
    "message": "success"
}

评论

暂无评论