bookstore.api 540 B

123456789101112131415161718192021222324252627282930313233
  1. type (
  2. addReq struct {
  3. book string `form:"book"`
  4. price int64 `form:"price"`
  5. }
  6. addResp struct {
  7. ok bool `json:"ok"`
  8. }
  9. )
  10. type (
  11. checkReq struct {
  12. book string `form:"book"`
  13. }
  14. checkResp struct {
  15. found bool `json:"found"`
  16. price int64 `json:"price"`
  17. }
  18. )
  19. service bookstore-api {
  20. @server(
  21. handler: AddHandler
  22. )
  23. get /add (addReq) returns (addResp)
  24. @server(
  25. handler: CheckHandler
  26. )
  27. get /check (checkReq) returns (checkResp)
  28. }