1.0.0 • Published 3 months ago
��# API GP REMAKE
Overview
API n�y �ng vai tr� l� ph�n ph� tr� cho d� �n t�t nghi�p �t 2
USER - Ng��i d�ng
- ng k� - ch� d�nh cho Quarn lys
POST /user/register
Body | Type | Description |
---|
name | TEXT | T�n nh�n vi�n |
email | TEXT | Email ng k� |
role_ID | VARCHAR | Vai tr� |
N�u role c� gi� tr� l� l� Nh�n vi�n th� c� th�m: |
job | VARCHAR | Ch�c v� |
POST /user/login
Body | Type | Description |
---|
email | TEXT | Email |
password | TEXT | M�t kh�u |
GET /user/logout/${id} = session id login
Parameter | Type | Description |
---|
id | VARCHAR | Id session ng��i d�ng ng nh�p |
PUT /user/update/${id} = id c�a ng��i d�ng
Parameter | Type | Description |
---|
id | string | Id ng��i d�ng |
Body | Type | Description |
---|
name | string | T�n |
email | string | Email |
address | string | �a ch� |
phone | string | S� i�n tho�i |
birthday | string | Ng�y sinh |
citizenIdentityCard | string | Cn c��c c�ng d�n |
gender | string | Gi�i t�nh |
role | string | Vai tr� |
job | string | Ch�c v� |
avatar | Blob | �nh �i di�n |
status | Boolean | Tr�ng th�i |
PUT /user/change-password/${id} = id c�a ng��i d�ng
Body | Type | Description |
---|
oldpassword | string | M�t kh�u ci |
password | string | M�t kh�u m�i |
GET /user/forgot-password
QUERY | Type | Description |
---|
email | string | Email |
POST /user/verify-confirmation-code
Body | Type | Description |
---|
email | string | email � ph�n qu�n m�t kh�u |
confirmationCode | string | m� x�c th�c � trong mail |
PUT /user/reset-password
Body | Type | Description |
---|
email | string | email � ph�n qu�n m�t kh�u |
newPassword | string | M�t kh�u m�i |
DELETE /user/delete/:id
Body | Type | Description |
---|
id | string | Id ng��i d�ng |
GET /user/list
- Th�m l��ng cho ng��i d�ng
POST /user/salary/:id
Body | Type | Description |
---|
year | string | Nm l��ng |
month | string | Th�ng l��ng |
salary | number | L��ng c�a th�ng |
bonus | number | Th��ng c�a th�ng |
- G�i danh s�ch l��ng ng��i d�ng
GET /user/salary/:id
Parameter | Type | Description |
---|
id | string | Id ng��i d�ng |
QUERY | Type | Description |
---|
year | string | Nm l��ng |
month | string | Th�ng l��ng, c� th� kh�ng th�m |
- C�p nh�p l��ng ng��i d�ng
PUT /user/salary/:id
Parameter | Type | Description |
---|
id | string | Id ng��i d�ng |
QUERY | Type | Description |
---|
year | string | Nm l��ng |
month | string | Th�ng l��ng |
Body | Type | Description |
---|
salary | number | L��ng |
bonus | number | Th��ng |
DELETE /user/salary/:id
Parameter | Type | Description |
---|
id | string | Id ng��i d�ng |
QUERY | Type | Description |
---|
year | string | Nm l��ng |
month | string | Th�ng l��ng |
CLIENT - Kh�ch h�ng
POST /client/create
Body | Type | Description |
---|
name | string | T�n kh�ch h�ng |
address | string | �a ch� |
phone | string | S� i�n tho�i |
phone2 | string | S� i�n tho�i ph� |
gender | string | Gi�i t�nh |
creatorID | number | Id ng��i t�o |
GET /client/list
GET /client/detail/:id
Parameter | Type | Description |
---|
id | string | Id c�a kh�ch h�ng |
PUT /client/update/${id} = id c�a kh�ch h�ng
Parameter | Type | Description |
---|
id | string | Id c�a kh�ch h�ng |
Body | Type | Description |
---|
name | string | T�n kh�ch h�ng |
address | string | �a ch� |
phone | string | S� i�n tho�i |
phone2 | string | S� i�n tho�i ph� |
gender | string | Gi�i t�nh |
DELETE /client/delete/:id
Parameter | Type | Description |
---|
id | string | id c�a kh�ch h�ng |
SERVICE - D�ch v�
POST /service/create
Body | Type | Description |
---|
name | string | T�n d�ch v� |
description | string | M� t� |
price | string | Gi� |
image | Blob | �nh d�ch v� |
PUT /service/update/:id
Parameter | Type | Description |
---|
id | string | Id d�ch v� |
Body | Type | Description |
---|
name | string | T�n d�ch v� |
description | string | M� t� |
price | string | Gi� |
image | Blob | �nh d�ch v� |
DELETE /service/delete/:id
Parameter | Type | Description |
---|
id | string | Id d�ch v� |
GET /service/list/:id
Parameter | Type | Description |
---|
id | string | Id d�ch v� |
GET /service/detail/:id
Parameter | Type | Description |
---|
id | string | Id d�ch v� |
Wedding Outfit - �o c��i
POST /WeddingOutfit/create
Body | Type | Description |
---|
name | string | T�n �o c��i |
description | string | M� t� |
size | string | Size |
price | string | Gi� |
color | string | M�u s�c |
image | Blob | H�nh �nh |
PUT /WeddingOutfit/update/:id
Parameter | Type | Description |
---|
id | string | Id �o c��i |
Body | Type | Description |
---|
name | string | T�n �o c��i |
description | string | M� t� |
size | string | Size |
price | string | Gi� |
color | string | M�u s�c |
image | Blob | H�nh �nh |
status | Blob | Tr�ng th�i |
DELETE /WeddingOutfit/delete/:id
Parameter | Type | Description |
---|
id | string | Id �o c��i |
GET /WeddingOutfit/list/
GET /WeddingOutfit/detail/:id
Parameter | Type | Description |
---|
id | string | Id �o c��i |
Contract - H�p �ng
POST /contract/create
Body | Type | Description |
---|
userId | string | Id ng��i t�o h�p �ng |
clientId | string | Id kh�ch h�ng |
services | string | Danh s�ch d�ch v� |
weddingOutfit | string | Danh s�ch �o c��i |
note | string | Ghi ch� |
deliveryDate | string | Ng�y tr� �nh |
location | string | �a ch� |
prepayment | string | Ti�n �t c�c |
additionalCosts | string | Chi phi ph�t sinh |
priceTotal | string | T�ng ti�n |
services | Type | Description |
---|
userId | string | Id ng��i t�o h�p �ng |
serviceId | string | Id d�ch v� |
weddingOutfit | Type | Description |
---|
userId | string | Id ng��i t�o h�p �ng |
weddingOutfitId | string | Id �o c��i |
rentalDate | DATE | Ng�y thu� |
returnDate | DATE | Ng�y tr� |
description | string | M� t� |
additionalCosts | Type | Description |
---|
description | string | M� t� |
price | string | Ti�n ph�t sinh |
GET /contract/list/
- Danh s�ch h�p �ng theo ng��i d�ng
GET /contract/list/:id
Params | Type | Description |
---|
userId | string | Id ng��i d�ng |
GET /contract/detail/:id
Params | Type | Description |
---|
contract ID | string | Id h�p �ng |
GET /contract/delete/:id
Params | Type | Description |
---|
contract ID | string | Id h�p �ng |
Work - C�ng vi�c
POST /work/create
BODY | Type | Description |
---|
name | string | T�n lo�i c�ng vi�c |
GET /work/list
PUT /work/update/:id
PARAMS | Type | Description |
---|
id | string | Id lo�i c�ng vi�c mu�n s�a |
BODY | Type | Description |
---|
name | string | T�n lo�i c�ng vi�c |
DELETE /work/delete/:id
PARAMS | Type | Description |
---|
id | string | Id lo�i c�ng vi�c mu�n xo� |
- Th�m c�ng vi�c cho nh�n vi�n
POST /work/add-work
BODY | Type | Description |
---|
workType_ID | string | Id lo�i c�ng vi�c |
user_ID | string | Id nh�n vi�n |
workDate | string | Ng�y l�m vi�c |
address | string | �a ch� |
note | string | Ghi ch� |
- Danh s�ch c�ng vi�c c�a t�t c� nh�n vi�n
GET /work/list-work
- Danh s�ch c�ng vi�c c�a nh�n vi�n
GET /work/user-work/:id?date=DD/MM/YYYY
PARAMS | Type | Description |
---|
id | string | Id nh�n vi�n |
QUERY | Type | Description |
---|
date | DATE | �n n�u mu�n hi�n th� t�t c� ng�y l�m |
- Danh s�ch nh�n vi�n c� th� th�m c�ng vi�c trong n�y
GET /work/list-user-add-work?date=DD/MM/YYYY
QUERY | Type | Description |
---|
date | DATE | �n n�u mu�n hi�n th� t�t c� |
GET /work/detail-work/:id
PARAMS | Type | Description |
---|
id | string | Id c�ng vi�c |
PUT /work/update-work/:id
PARAMS | Type | Description |
---|
id | string | Id c�ng vi�c |
BODY | Type | Description |
---|
workType_ID | string | Id lo�i c�ng vi�c |
user_ID | string | Id nh�n vi�n |
workDate | string | Ng�y l�m |
address | string | �a ch� |
note | string | Ghi ch� |
status | string | Tr�ng th�i |
DELETE /work/delete-work/:id
PARAMS | Type | Description |
---|
id | string | Id c�ng vi�c |