Nhảy đến nội dung

getAttributes

Lấy tất cả các đối tượng tập hợp thuộc tính.

AttributesSets?.getAttributes( langCode?, offset?, limit?, typeId?, sortBy? );

Ví dụ tối thiểu

const value = await AttributesSets.getAttributes()
Schema

langCode: string
Mã ngôn ngữ. Mặc định: "en_US"
ví dụ: "en_US"

limit: number
tham số giới hạn việc chọn các bản ghi. Mặc định: 30
ví dụ: 30

offset: number
tham số offset của việc chọn bản ghi. Mặc định: 0
ví dụ: 0

typeId: number
định danh của loại tập hợp thuộc tính. Mặc định: null
ví dụ: NaN

sortBy: string
định danh của loại tập hợp thuộc tính. Mặc định: "id"
ví dụ: "id"

Phương thức này trả về tất cả các đối tượng tập hợp thuộc tính và tổng số.

Ví dụ phản hồi

{
"total": 16,
"items": [
{
"id": 27,
"updatedDate": "2025-02-26T17:18:11.275Z",
"version": 0,
"identifier": "admins",
"typeId": 1,
"title": "Quản trị viên",
"schema": {
"admin-text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "admin-text",
"localizeInfos": {
"title": "Văn bản quản trị viên"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 1,
"type": "forAdmins"
},
"position": 1
},
{
"id": 22,
"updatedDate": "2025-03-23T12:23:56.420Z",
"version": 0,
"identifier": "block",
"typeId": 2,
"title": "Khối",
"schema": {
"block-text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "block-text",
"localizeInfos": {
"title": "Văn bản khối"
}
},
"interval": {
"id": 2,
"type": "timeInterval",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "interval",
"localizeInfos": {
"title": "Khoảng thời gian",
"intervals": [
{
"id": "c6466cd8-c55d-4583-97c5-42b684210f12",
"range": [],
"external": [],
"fullMonth": 2,
"intervals": [
{
"id": "ab0e3e90-8153-4679-aea4-198c5022f8d4",
"end": {
"hours": 19,
"minutes": 0
},
"start": {
"hours": 9,
"minutes": 0
},
"period": 60
}
],
"inEveryMonth": true,
"selectedYear": 2025
}
]
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 2,
"type": "forBlocks"
},
"position": 2
},
{
"id": 17,
"updatedDate": "2025-02-26T16:25:01.688Z",
"version": 0,
"identifier": "page",
"typeId": 4,
"title": "Trang",
"schema": {
"text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "text",
"localizeInfos": {
"title": "Văn bản"
}
},
"number": {
"id": 2,
"type": "integer",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "number",
"localizeInfos": {
"title": "Số"
}
},
"real": {
"id": 3,
"type": "real",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "real",
"localizeInfos": {
"title": "Thực"
}
},
"float": {
"id": 4,
"type": "float",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "float",
"localizeInfos": {
"title": "Số thực"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 4,
"type": "forPages"
},
"position": 3
},
"..."
]
}

Schema phản hồi

Schema

total: number
Tổng số mục.
ví dụ: 100

items: IAttributeSetsEntity[]
mảng IAttributeSetsEntity chứa các thực thể tập hợp thuộc tính.
ví dụ:

[
{
"id": 1,
"identifier": "set1"
},
{
"id": 2,
"identifier": "set2"
}
]