Implementing list endpoints
This commit is contained in:
@ -32,8 +32,17 @@ var _ = Service("front", func() {
|
||||
})
|
||||
})
|
||||
|
||||
// Method("listItems", func() {
|
||||
// })
|
||||
Method("listItems", func() {
|
||||
Payload(Empty)
|
||||
Result(ArrayOf(Item))
|
||||
|
||||
HTTP(func() {
|
||||
GET("/item")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
})
|
||||
})
|
||||
|
||||
Method("createItem", func() {
|
||||
Payload(Item)
|
||||
@ -89,8 +98,17 @@ var _ = Service("front", func() {
|
||||
})
|
||||
})
|
||||
|
||||
// Method("listCharacters", func() {
|
||||
// })
|
||||
Method("listCharacters", func() {
|
||||
Payload(Empty)
|
||||
Result(ArrayOf(Character))
|
||||
|
||||
HTTP(func() {
|
||||
GET("/character")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
})
|
||||
})
|
||||
|
||||
Method("createCharacter", func() {
|
||||
Payload(Character)
|
||||
@ -160,5 +178,19 @@ var _ = Service("front", func() {
|
||||
})
|
||||
})
|
||||
|
||||
Method("listInventoryItems", func() {
|
||||
Payload(func() {
|
||||
Field(1, "characterId", Int)
|
||||
})
|
||||
Result(ArrayOf(Item))
|
||||
|
||||
HTTP(func() {
|
||||
GET("/character/{characterId}/item")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
})
|
||||
})
|
||||
|
||||
Files("/openapi.json", "./gen/http/openapi.json")
|
||||
})
|
||||
|
Reference in New Issue
Block a user