go-zero/example/bookstore/api/bookstore.api

33 lines
540 B
Plaintext
Raw Normal View History

2020-09-03 23:26:04 +08:00
type (
addReq struct {
book string `form:"book"`
price int64 `form:"price"`
}
2020-09-03 23:26:04 +08:00
addResp struct {
ok bool `json:"ok"`
}
2020-09-03 23:26:04 +08:00
)
type (
checkReq struct {
book string `form:"book"`
}
2020-09-03 23:26:04 +08:00
checkResp struct {
found bool `json:"found"`
price int64 `json:"price"`
}
2020-09-03 23:26:04 +08:00
)
service bookstore-api {
@server(
handler: AddHandler
)
get /add (addReq) returns (addResp)
2020-09-03 23:26:04 +08:00
@server(
handler: CheckHandler
)
get /check (checkReq) returns (checkResp)
2020-09-03 23:26:04 +08:00
}