# News Category
# Add News Category
Sử dụng API này để thêm bản ghi mới
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
companyId | Number | get in token payload | ✔️ |
name | String | ✔️ | |
slug | String | ✔️ | |
parentId | Number | ✔️ | |
description | String | ✔️ | |
titleSeo | String | ✔️ | |
descriptionSeo | String | ✔️ | |
createdBy | Number | get in token payload | ✔️ |
updatedBy | Number | get in token payload | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [
{
...<data>
}
],
"$rltUpdate": [],
"$rltRemove": [],
"$rltDelete": []
}
}
curl -X POST http://localhost:3000/newsCategory/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$add": [
{
"name": "name",
"slug": "slug",
"parentId": "parentId",
"description": "description",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo"
}
]
}
}'
# Update News Category
Sử dụng API này để cập nhật nội dung
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
id | Number | ✔️ | |
companyId | Number | get in token payload | ✔️ |
name | String | ✔️ | |
slug | String | ✔️ | |
parentId | Number | ✔️ | |
description | String | ✔️ | |
titleSeo | String | ✔️ | |
descriptionSeo | String | ✔️ | |
updatedBy | Number | get in token payload | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [],
"$rltUpdate": [
{
...<data>
}
],
"$rltRemove": [],
"$rltDelete": []
}
}
curl -X POST http://localhost:3000/newsCategory/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$update": [
{
"id": 1,
"name": "name",
"slug": "slug",
"parentId": "parentId",
"description": "description",
"titleSeo": "titleSeo",
"descriptionSeo": "descriptionSeo"
}
]
}
}'
# Delete News Category
Sử dụng API này để xóa bản ghi trên giao diện
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
id | Number | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [],
"$rltUpdate": [],
"$rltRemove": [],
"$rltDelete": [
{
...<data>
}
]
}
}
curl -X POST http://localhost:3000/newsCategory/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$delete": [
{
"id": 1
}
]
}
}'
# Remove News Category
Sử dụng API này để xóa bản ghi khỏi database
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
id | Number | ✔️ |
# Response
{
"status": true,
"items": {
"$rltAdd": [],
"$rltUpdate": [],
"$rltRemove": [
{
...<data>
}
],
"$rltDelete": []
}
}
curl -X POST http://localhost:3000/newsCategory/setList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"items": {
"$remove": [
{
"id": 1
}
]
}
}'
# Get List News Category
Sử dụng API này để lấy danh sách News Category
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
companyId | Number | get in token payload | ✔️ |
name | String | ➖ |
# Response
{
"status": true,
"message": "success",
"totalRows": 28,
"items": [
{
"id": 1,
"id": 73,
"parentId": 10,
"companyId": 1,
"name": "Văn Phòng Phẩm",
"slug": "van-phong-pham",
"description": "",
"titleSeo": "Văn Phòng Phẩm",
"descriptionSeo": "",
"deleted": 0,
"createdBy": 1,
"updatedBy": 1,
"createdAt": "2021-08-27T05:19:50.000Z",
"updatedAt": "2021-09-07T11:41:25.000Z"
},
{
...<data>
}
]
}
curl -X POST http://localhost:3000/newsCategory/getListPaging \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{
"name": "name"
}'
# Publish Menu List News Category
Sử dụng API này để lấy publish file json danh sách NewsCategory
# Endpoint
# Parameters
Name | Type | Description | Required |
---|---|---|---|
companyId | Number | get in token payload | ✔️ |
# Response
{
"status": true,
"messageCode": "success",
"messageContent": "success"
}
curl -X POST http://localhost:3000/newsCategory/ei/publishMenuList \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <const name="MOCK_TOKEN" />' \
--data '{}'