add bookstore example

This commit is contained in:
kevin
2020-09-03 23:26:04 +08:00
parent 167422ac4f
commit 11dd3d75ec
44 changed files with 1741 additions and 121 deletions

View File

@@ -0,0 +1,33 @@
type (
addReq struct {
book string `form:"book"`
price int64 `form:"price"`
}
addResp struct {
ok bool `json:"ok"`
}
)
type (
checkReq struct {
book string `form:"book"`
}
checkResp struct {
found bool `json:"found"`
price int64 `json:"price"`
}
)
service bookstore-api {
@server(
handler: AddHandler
)
get /add(addReq) returns(addResp)
@server(
handler: CheckHandler
)
get /check(checkReq) returns(checkResp)
}