Customer
class
Attribute | Type |
---|---|
id |
Int |
firstName |
String |
lastName |
String |
CustomerPost
class
Attribute | Type |
---|---|
firstName |
String |
lastName |
String |
CustomerService
class
findAll(): Seq[Customer]
find(id: Int): Customer
insert(post: CustomerPost): Customer
update(customer: Customer): Customer
CustomerUpdate
class
Attribute | Type |
---|---|
firstName |
String |
lastName |
String |
Request
GET /customers
Response
[
{ "id": 1, "firstName": "Linda", "lastName": "Stewart" },
{ "id": 2, "firstName": "Mary", "lastName": "Watson" },
{ "id": 3, "firstName": "Andrew", "lastName": "Carter" }
]
Request
GET /customers/1
Response
{ "id": 1, "firstName": "Linda", "lastName": "Stewart" },
Request
POST /customers
{ "firstName": "Paul", "lastName": "Simpson" }
Response
{ "id": 4, "firstName": "Paul", "lastName": "Simpson" }
Request
POST /customers/4
{ "firstName": "Paul", "lastName": "Simon" }
Response
Updated 1 Customer
Protect API with HTTP Basic Authentication