Người dùng PDA
Mô tả
Quản trị tài khoản PDA / user nội bộ merchant. Các API hỗ trợ:
- GET /pdaUsers: Danh sách
- GET /count: Đếm
- POST /pdaUsers: Tạo
- PUT /{user_name}: Cập nhật
- PUT /{user_name}/password: Đổi mật khẩu
- PUT /{user_name}/toggleActive: Bật/tắt
- GET /{user_name}/roles: Roles của user
API
GET /api/pdaUsers
Danh sách người dùng PDA:
Tham số query:
| Tên trường | Kiểu dữ liệu | Mô tả | Bắt buộc |
|---|---|---|---|
user_name | string | Tên đăng nhập | Không |
full_name | string | Họ tên | Không |
status | string | Trạng thái | Không |
warehouse_id | string | Id kho | Không |
created_from | string | yyyy-MM-dd'T'HH:mm:ss | Không |
created_to | string | yyyy-MM-dd'T'HH:mm:ss | Không |
page | integer | Trang | Không |
size | integer | Số bản ghi trên trang | Không |
sort | string | Tên trường sắp xếp | Không |
order | string | asc / desc | Không |
GET /api/pdaUsers?page=1&size=20
Response Body
{
"code": 200,
"message": "Success",
"result": [],
"page": 1,
"page_size": 20,
"total": 0
}
GET /api/pdaUsers/count
Đếm người dùng PDA.
GET /api/pdaUsers/count
Response Body
{
"code": 200,
"message": "Success",
"result": 10
}
POST /api/pdaUsers
Tạo người dùng PDA.
Request Body
| Tên trường | Kiểu dữ liệu | Mô tả | Bắt buộc |
|---|---|---|---|
full_name | string | Họ tên (tối đa 100) | Có |
user_name | string | Tên đăng nhập | Có |
role_ids | string[] | Danh sách role id | Không |
status | string | active | inactive |
warehouse_ids | string[] | Phạm vi kho | Không |
POST /api/pdaUsers
Request Body
{
"full_name": "Nguyen A",
"user_name": "pda01",
"role_ids": ["{role-id}"],
"status": "active",
"warehouse_ids": []
}
Response Body
{
"code": 200,
"message": "Success",
"result": true
}
PUT /api/pdaUsers/{user_name}
Cập nhật người dùng PDA (không đổi user_name).
Request Body
| Tên trường | Kiểu dữ liệu | Mô tả | Bắt buộc |
|---|---|---|---|
full_name | string | Họ tên | Có |
role_ids | string[] | Danh sách role id | Không |
status | string | active | inactive |
warehouse_ids | string[] | Phạm vi kho | Không |
PUT /api/pdaUsers/\{user_name\}
Request Body
{
"full_name": "Nguyen A",
"role_ids": ["{role-id}"],
"status": "active"
}
Response Body
{
"code": 200,
"message": "Success",
"result": true
}
PUT /api/pdaUsers/{user_name}/password
Cập nhật mật khẩu PDA.
Request Body
| Tên trường | Kiểu dữ liệu | Mô tả | Bắt buộc |
|---|---|---|---|
password | string | Mật khẩu mới (≥ 8 ký tự) | Có |
PUT /api/pdaUsers/\{user_name\}/password
Request Body
{ "password": "********" }
Response Body
{
"code": 200,
"message": "Success",
"result": true
}
PUT /api/pdaUsers/{user_name}/toggleActive
Bật / tắt active. Không có body.
PUT /api/pdaUsers/\{user_name\}/toggleActive
Response Body
{
"code": 200,
"message": "Success",
"result": true
}
GET /api/pdaUsers/{user_name}/roles
Roles gán cho user PDA.
GET /api/pdaUsers/\{user_name\}/roles
Response Body
{
"code": 200,
"message": "Success",
"result": {}
}