Successfully returning getItem response from item service

This commit is contained in:
Brandon Watson
2023-08-13 20:40:27 -05:00
parent 98796d96fd
commit 346d87f3d1
3 changed files with 37 additions and 13 deletions

View File

@ -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)
})
})
})
})