Должности пользователей



Структура моделей, назначение полей

Модель UserPosition — представляет должности пользователей

* @property integer $id // ИД
* @property string $title // Название должности
* @property time $admission_length // продолжительность приёма
- default value "00:30:00"

Примеры запросов

Создание должности

curl -l -H "Accept: application/json" -H "X-REST-API-KEY: ee9528f3b9c3ad9cdecfbd9723043334" -X \
POST -d '{"title": "Doctor", "admission_length": "00:30:00”}' \ http://example/rest/api/userPosition

{

 
{
"success": true,
"message": "Record(s) Created",
"data": {
"totalCount": 1,
"userPosition": [
{
"admission_length": "00:30:00",
"title": "Doctor",
"id": "21"
}
]
}
}

Получение всех должностей

curl -l -H "Accept: application/json" -H "X-REST-API-KEY: ee9528f3b9c3ad9cdecfbd9723043334" -X \ http://example/rest/api/userPosition

{

{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": "8",
"userPosition": [
{
"id": "7",
"title": "Парикмахер",
"admission_length": "00:30:00"
},
{
"id": "8",
"title": "администратор",
"admission_length": "00:30:00"
},
{
"id": "14",
"title": "Врач",
"admission_length": "00:30:00"
},
{
"id": "15",
"title": "Мед персонал",
"admission_length": "00:30:00"
},
{
"id": "16",
"title": "Регистратор",
"admission_length": "00:30:00"
},
{
"id": "18",
"title": "Хирург",
"admission_length": "00:30:00"
},
{
"id": "20",
"title": "text",
"admission_length": "00:30:00"
},
{
"id": "21",
"title": "Doctor",
"admission_length": "00:30:00"
}
]
}
}

Получение должностей по ИД

curl -l -H "Accept: application/json" -H "X-REST-API-KEY: ee9528f3b9c3ad9cdecfbd9723043334" -X \ http://example/rest/api/userPosition/7

{

{
"success": true,
"message": "Record Retrieved Successfully",
"data": {
"totalCount": 1,
"userPosition": {
"id": "7",
"title": "Парикмахер",
"admission_length": "00:30:00"
}
}
}