76 lines
1.4 KiB
Go
76 lines
1.4 KiB
Go
package design
|
|
|
|
import (
|
|
. "crossnokaye-interview-assignment/design"
|
|
|
|
. "goa.design/goa/v3/dsl"
|
|
)
|
|
|
|
var _ = API("character", func() {
|
|
Title("Character Srvice")
|
|
Server("character", func() {
|
|
Host("localhost", func() {
|
|
URI("grpc://localhost:8083")
|
|
})
|
|
})
|
|
})
|
|
|
|
var _ = Service("character", func() {
|
|
Description("A GRPC back service that handles CRUD operations for the characters and their attributes")
|
|
|
|
Method("getCharacter", func() {
|
|
Payload(Int)
|
|
Result(Character)
|
|
Error("NotFound")
|
|
Error("BadRequest")
|
|
|
|
GRPC(func() {
|
|
Response(CodeOK)
|
|
Response("NotFound", CodeNotFound)
|
|
Response("BadRequest", CodeInvalidArgument)
|
|
})
|
|
})
|
|
|
|
// Method("listCharacters", func() {
|
|
// })
|
|
|
|
Method("createCharacter", func() {
|
|
Payload(Character)
|
|
Result(Character)
|
|
Error("BadRequest")
|
|
Error("NotFound")
|
|
|
|
GRPC(func() {
|
|
Response(CodeOK)
|
|
Response("NotFound", CodeNotFound)
|
|
Response("BadRequest", CodeInvalidArgument)
|
|
})
|
|
})
|
|
|
|
Method("updateCharacter", func() {
|
|
Payload(Character)
|
|
Result(Character)
|
|
Error("NotFound")
|
|
Error("BadRequest")
|
|
|
|
GRPC(func() {
|
|
Response(CodeOK)
|
|
Response("NotFound", CodeNotFound)
|
|
Response("BadRequest", CodeInvalidArgument)
|
|
})
|
|
})
|
|
|
|
Method("deleteCharacter", func() {
|
|
Payload(Int)
|
|
Result(Empty)
|
|
Error("NotFound")
|
|
Error("BadRequest")
|
|
|
|
GRPC(func() {
|
|
Response(CodeOK)
|
|
Response("NotFound", CodeNotFound)
|
|
Response("BadRequest", CodeInvalidArgument)
|
|
})
|
|
})
|
|
})
|