mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-25 02:08:44 +08:00
33 lines
479 B
Plaintext
33 lines
479 B
Plaintext
|
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)
|
||
|
}
|