Updating resources according to instructions
This commit is contained in:
@ -20,12 +20,12 @@ var _ = Service("front", func() {
|
||||
Description("A GRPC back service that handles CRUD operations for the Items that exist and their attributes")
|
||||
|
||||
Method("getItem", func() {
|
||||
Payload(Int)
|
||||
Payload(String)
|
||||
Result(Item)
|
||||
Error("NotFound")
|
||||
|
||||
HTTP(func() {
|
||||
GET("/item/{id}")
|
||||
GET("/item/{name}")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
@ -63,7 +63,7 @@ var _ = Service("front", func() {
|
||||
Error("BadRequest")
|
||||
|
||||
HTTP(func() {
|
||||
PUT("/item/{id}")
|
||||
PUT("/item/{name}")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
@ -71,13 +71,13 @@ var _ = Service("front", func() {
|
||||
})
|
||||
|
||||
Method("deleteItem", func() {
|
||||
Payload(Int)
|
||||
Payload(String)
|
||||
Result(Empty)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
HTTP(func() {
|
||||
DELETE("/item/{id}")
|
||||
DELETE("/item/{name}")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
@ -85,13 +85,13 @@ var _ = Service("front", func() {
|
||||
})
|
||||
|
||||
Method("getCharacter", func() {
|
||||
Payload(Int)
|
||||
Payload(String)
|
||||
Result(Character)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
HTTP(func() {
|
||||
GET("/character/{id}")
|
||||
GET("/character/{name}")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
@ -131,7 +131,7 @@ var _ = Service("front", func() {
|
||||
Error("BadRequest")
|
||||
|
||||
HTTP(func() {
|
||||
PUT("/character/{id}")
|
||||
PUT("/character/{name}")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
@ -139,13 +139,13 @@ var _ = Service("front", func() {
|
||||
})
|
||||
|
||||
Method("deleteCharacter", func() {
|
||||
Payload(Int)
|
||||
Payload(String)
|
||||
Result(Empty)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
HTTP(func() {
|
||||
DELETE("/character/{id}")
|
||||
DELETE("/character/{name}")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
@ -159,7 +159,7 @@ var _ = Service("front", func() {
|
||||
Error("BadRequest")
|
||||
|
||||
HTTP(func() {
|
||||
POST("/character/{characterId}/item")
|
||||
POST("/character/{characterName}/item")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
})
|
||||
@ -172,7 +172,7 @@ var _ = Service("front", func() {
|
||||
Error("BadRequest")
|
||||
|
||||
HTTP(func() {
|
||||
DELETE("/character/{characterId}/item/{itemId}")
|
||||
DELETE("/character/{characterName}/item/{itemName}")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
})
|
||||
@ -180,12 +180,12 @@ var _ = Service("front", func() {
|
||||
|
||||
Method("listInventoryItems", func() {
|
||||
Payload(func() {
|
||||
Field(1, "characterId", Int)
|
||||
Field(1, "characterName", String)
|
||||
})
|
||||
Result(ArrayOf(Item))
|
||||
|
||||
HTTP(func() {
|
||||
GET("/character/{characterId}/item")
|
||||
GET("/character/{characterName}/item")
|
||||
Response(StatusOK)
|
||||
Response(StatusBadRequest)
|
||||
Response(StatusNotFound)
|
||||
|
Reference in New Issue
Block a user