内容分类
内容分类操作
以下操作都需指明操作的内容库,方法如下:
let MyContentCategory = new BaaS.ContentCategory(contentGroupID)
参数说明
contentGroupID
Number
是
内容库 ID
创建内容分类
MyContentCategory.create({name, parent})
参数说明
name
String
是
内容分类名称
parent
Number
否
父分类 ID
返回参数
subcategories
Number Array
子内容分类
parent
Object
父分类对象
id
Number
内容分类 ID
name
String
内容分类名称
created_at
Number
创建时间
update_at
Number
更新时间
请求示例
返回示例
res.data:
获取内容分类详情
MyContentCategory.get(categoryID)
参数说明
categoryID
Number
是
内容分类 ID
返回参数
subcategories
Number Array
子内容分类
created_at
Number
创建时间
parent
Object
父分类对象
id
Number
内容分类 ID
name
String
内容分类名称
update_at
Number
更新时间
请求示例
返回示例
res.data:
获取内容分类总数
BaaS.ContentCategory#count()
查询,获取内容分类列表
BaaS.ContentCategory#find(options)
参数说明
options:
withCount
boolean
否
true
是否返回 total_count
{{totalCount.withCountTips()}}
排序
内容分类查询排序与数据表排序方法一致,但只支持对以下指定字段进行排序:
created_at
内容分类创建时间
updated_at
内容分类更新时间
分页
内容分类查询排序与数据表分页方法一致。
请求示例
更新内容分类
MyContentCategory.update(categoryID, {name, parent})
参数说明
categoryID
Number
是
内容分类 ID
name
String
是
内容分类名称
parent
Number
否
父分类 ID
返回参数
subcategories
Number Array
子内容分类
parent
Object
父分类对象
id
Number
内容分类 ID
name
String
内容分类名称
created_at
Number
创建时间
update_at
Number
更新时间
请求示例
返回示例
res.data:
删除内容
MyContentCategory.delete()
参数说明
categoryID
Number
是
内容分类 ID
请求示例
返回示例
res.data:
Last updated
Was this helpful?