add mileage field
idk why but i missed it
This commit is contained in:
parent
58752d513f
commit
6142ac93b9
@ -3,7 +3,7 @@
|
||||
`make && make run`
|
||||
|
||||
## Create a new car:
|
||||
`curl -X POST http://localhost:8080/v1/cars -d '{"data" : {"type" : "cars" , "attributes": {"brand" : "bmw", "model": "x5", "price": 999, "status": "OnTheWay"}}}'`
|
||||
`curl -X POST http://localhost:8080/v1/cars -d '{"data" : {"type" : "cars" , "attributes": {"brand" : "bmw", "model": "x5", "price": 999, "status": "OnTheWay", "mileage": 0}}}'`
|
||||
|
||||
## List cars:
|
||||
`curl -X GET http://localhost:8080/v1/cars`
|
||||
|
@ -15,6 +15,7 @@ type Car struct {
|
||||
Model string `json:"model"`
|
||||
Price uint64 `json:"price"`
|
||||
Status string `json:"status"` // OnTheWay, InStock, Sold, Discontinued
|
||||
Mileage int64 `json:"mileage"` // I suppose it should be made unsigned, but that's what the task says ¯\_(ツ)_/¯
|
||||
}
|
||||
|
||||
func (c Car) Verify() (bool, api2go.HTTPError) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user