users service - Watthakorn/EZ_finance GitHub Wiki

users-service

  • list-of-user api

GET /users

Request

{}

Response

[
  {
    "id": 1,
    "fullname": "TestUser",
    "email": "[email protected]",
    "address": "address1",
    "picture": "Tc/f/d/s",
    "username": "username",
    "password": "username",
    "role": "user"
  },
  {
    "id": 2,
    "fullname": "TestManager",
    "email": "[email protected]",
    "address": "address2",
    "picture": "Tc/f/d/s",
    "username": "manager",
    "password": "manager",
    "role": "manager"
  },
  {
    "id": 3,
    "fullname": "TestAdmin",
    "email": "[email protected]",
    "address": "address3",
    "picture": "Tc/f/d/s",
    "username": "admin",
    "password": "admin",
    "role": "admin"
  },
  {
    "id": 4,
    "fullname": "TestUser2",
    "email": "[email protected]",
    "address": "address4",
    "picture": "Tc/f/d/s",
    "username": "username2",
    "password": "username",
    "role": "user"
  },
  {
    "id": 5,
    "fullname": "TestUser3",
    "email": "[email protected]",
    "address": "address5",
    "picture": "Tc/f/d/s",
    "username": "username3",
    "password": "username",
    "role": "user"
  }
]
  • user-detail api

GET /user/{id}

Request

{
    "id": 1
}

Response

{
  "id": 1,
  "fullname": "TestUser",
  "email": "[email protected]",
  "address": "address1",
  "picture": "Tc/f/d/s",
  "username": "username",
  "password": "username",
  "role": "user"
}
  • register api

POST /user/add

Request

{
    "username":"tester",
    "user_fullname":"test case",
    "user_email":"Test@mail",
    "user_address":"test 20001",
    "user_picture":"path to image",
    "password":"aVcde",
    "user_role":"user"
}

Response: status 201 Created

{}
  • update-profile api

put /user/{id}/update

Request


{
    "user_id"=1,
    "user_fullname":"test case",
    "user_email":"Test@mail",
    "user_address":"test 20001",
    "user_picture":"C:\image",
    "password":"teeeAe123"
}

Response : status 200 OK

{
}
  • delete-user api

put /user/{id}/delete

Request

{
    "user_id":1
}

Response : status 200 OK

{
}