Public Repository

Last pushed: 6 months ago
Short Description
Short description is empty for this repo.
Full Description

Third Assignment

Paleidimas:
Atsisiuntus docker-compose.yml failą paleisti komandas:
docker-compose up -d

Servisas pasiekiamas adresu: http://193.219.91.103:1813/
arba lokaliai http://localhost:8080

Naudojami web servisai:
eima1995/people:1
danmerix/company:3

Realizuota autentifikacija JWT metodu

roles:

 admin          - all paths
 user           - vehicle

/login (post)

admin role
{
  "username": "admin",
  "password": "admin"
}
user role
{
  "username": "000000",
  "password": "000000"
}

/register (post)

{
  "username": "user2",
  "password": "password",
  "passwordConfirm": "password"
}

Authentication:

You need to login with username and password
    POST /login
        {
            "username": "admin",
            "password": "admin"
        }
Token will be generated. You need to add it to your header. Header example
token dasij9fs03kjfdi3kjsdiy.f438fsff43.f4frefegr

Get:

 /insurance/person/:name  - kliento paieska
 /person                  - draudimo kompanijos vartotoja
 /person/:id              - vartotojas pagal id
 /vehicle                 - draudimo kompanijos masinos
 /vehicle/:id             - mašina pagal id
 /insurance               - sukurti draudimai
 /insurance/:id           - draudimas pagal id
 /                        - draudimu sarasas (nedetalus)

Post:

 /insurance               - sukurti naują draudimą
 /person                  - sukurti naują vartotoją
 /vehicle                 - sukurti naują mašiną

Put:

 /person/:id               - atnaujinti vartotoją
 /insurance                - vartotojo atnaujinimas

Delete:

 /insurance/:id          - ištrinti vartotoją

POST Examples:

/insurance

 {
"id": 10,
"isPrivate": true,
"price": 0,
"startDate": "2016-12-03 00:00:00",
"endDate": "2017-12-03 00:00:00",
"person": {
"id": 1,
"name": "Julius",
"surname": "Smulius",
"gender": "male",
"address": "Ikalnes 45"
},
"vehicle": {
"id": 1,
"model": "Skoda",
"brand": "Superb",
"productionDate": "2014-12-24 00:00:00"
}
}

/person

{
  "id":1,
  "name":"Petras",
  "surname":"Petraitis",
  "gender":"male",
  "address":"Ikalnes 45"
}

/vehicle

{
    "id": 1,
    "model": "Masina",
    "brand": "Markė",
    "productionDate": "2018-10-10 00:00:00"
}

PUT Examples:

/person/1

{
  "id":1,
  "name":"Petras",
  "surname":"Petraitis",
  "gender":"male",
  "address":"Ikalnes 45"
}

/insurance

{
  "id":1,
  "name":"Petras",
  "surname":"Petraitis",
  "gender":"male",
  "address":"Ikalnes 45"
}

Notes:

No notes.

Docker Pull Command
Owner
ccteam