Successfully returning getItem response from item service
This commit is contained in:
@ -9,17 +9,19 @@ import (
|
||||
var _ = API("item", func() {
|
||||
Title("Item Service")
|
||||
Server("item", func() {
|
||||
Host("localhost", func() {
|
||||
URI("grpc://localhost:8082")
|
||||
})
|
||||
})
|
||||
Host("localhost", func() {
|
||||
URI("grpc://localhost:8082")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
var _ = Service("item", func() {
|
||||
Description("A GRPC back service that handles CRUD operations for the items that exist and their attributes")
|
||||
|
||||
Method("getItem", func() {
|
||||
Payload(Int)
|
||||
Payload(func() {
|
||||
Field(1, "id", Int)
|
||||
})
|
||||
Result(Item)
|
||||
Error("NotFound")
|
||||
|
||||
@ -53,7 +55,9 @@ var _ = Service("item", func() {
|
||||
})
|
||||
|
||||
Method("deleteItem", func() {
|
||||
Payload(Int)
|
||||
Payload(func() {
|
||||
Field(1, "id", Int)
|
||||
})
|
||||
Result(Empty)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
@ -64,4 +68,4 @@ var _ = Service("item", func() {
|
||||
Response("BadRequest", CodeInvalidArgument)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user