23 lines
381 B
Text
23 lines
381 B
Text
#path(/id/{uuid})
|
|
fn get(uuid: uuid) -> Customer:
|
|
service.get(uuid)?or(404)
|
|
|
|
#path(?firstname={name})
|
|
fn get(name: string) -> Customer:
|
|
if name:
|
|
service.get(id)
|
|
else:
|
|
404
|
|
|
|
#path(/)
|
|
fn get() -> list:
|
|
service.get_all()
|
|
|
|
#path(/)
|
|
fn post(customer: Customer):
|
|
service.add(customer)
|
|
|
|
|
|
#path()
|
|
fn put(customer: Customer):
|
|
service.update(customer)
|