Skip to main content

Portal / RFID reader

Mô tả​

Cấu hình cổng / reader RFID. Các API hỗ trợ:

API​


GET /api/portals​

Danh sách portal:

Tham số query:

Tên trườngKiểu dữ liệuMô tảBắt buộc
created_fromstringyyyy-MM-dd'T'HH:mm:ssKhông
created_tostringyyyy-MM-dd'T'HH:mm:ssKhông
pageintegerTrangKhông
sizeintegerSố bản ghi trên trangKhông
sortstringTên trường sắp xếpKhông
orderstringasc / descKhông

GET /api/portals?page=1&size=20

result là mảng portal: id, name, ip, hostName, username, readWorkingHours, created_at, created_by, updated_at, updated_by.

Response Body
{
"code": 200,
"message": "Success",
"result": [
{
"id": "{uuid}",
"name": "Cổng 1",
"ip": "192.168.1.50",
"hostName": "reader-1",
"readWorkingHours": true
}
],
"page": 1,
"page_size": 20,
"total": 1
}

GET /api/portals/{id}​

Chi tiết portal / reader.

GET /api/portals/\{id\}

Response Body
{
"code": 200,
"message": "Success",
"result": {}
}

POST /api/portals​

Tạo portal.

Request Body​

Tên trườngKiểu dữ liệuMô tảBắt buộc
namestringTên portalKhông
ipstringIP readerKhông
hostNamestringHostnameKhông
usernamestringUser đăng nhập readerKhông
passwordstringPassword readerKhông
readWorkingHoursbooleanChỉ đọc trong giờ làm việcKhông

POST /api/portals

Request Body
{
"name": "Cổng 1",
"ip": "192.168.1.50",
"hostName": "reader-1",
"username": "admin",
"password": "********",
"readWorkingHours": true
}
Response Body
{
"code": 200,
"message": "Success",
"result": true
}

PUT /api/portals/{id}​

Cập nhật portal (cùng schema create).

Request Body​

Tên trườngKiểu dữ liệuMô tảBắt buộc
namestringTên portalKhông
ipstringIP readerKhông
hostNamestringHostnameKhông
usernamestringUserKhông
passwordstringPasswordKhông
readWorkingHoursbooleanChỉ đọc trong giờ LVKhông

PUT /api/portals/\{id\}

Request Body
{
"name": "Cổng 1",
"ip": "192.168.1.50"
}
Response Body
{
"code": 200,
"message": "Success",
"result": true
}

GET /api/portals/product​

Sản phẩm / sự kiện crossover theo portal:

Tham số query:

Tên trườngKiểu dữ liệuMô tảBắt buộc
pageintegerTrangKhông
sizeintegerSố bản ghi trên trangKhông
sortstringTên trường sắp xếpKhông
orderstringasc / descKhông

GET /api/portals/product?page=1&size=20

Response Body
{
"code": 200,
"message": "Success",
"result": [],
"page": 1,
"page_size": 20,
"total": 0
}