bookstore.api 397 B

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