captcha.proto 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. syntax = "proto3";
  2. package live.webroom.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. // captcha 相关服务
  6. service Captcha {
  7. // 创建验证码 `midware:"auth"`
  8. rpc create (CreateCaptchaReq) returns (CreateCaptchaResp);
  9. // 校验接口 `midware:"auth" method:"POST"`
  10. rpc verify (VerifyReq) returns (VerifyResp);
  11. }
  12. message CreateCaptchaReq {
  13. int64 type = 1 [(gogoproto.moretags) = 'form:"type"'];
  14. string client_type = 2 [(gogoproto.moretags) = 'form:"client_type"'];
  15. int64 height = 3 [(gogoproto.moretags) = 'form:"height"'];
  16. int64 width = 4 [(gogoproto.moretags) = 'form:"width"'];
  17. }
  18. message CreateCaptchaResp{
  19. int64 type = 1 [(gogoproto.jsontag) = "type"];
  20. GeeTest geetest = 2 [(gogoproto.jsontag) = "geetest"];
  21. Image image = 3 [(gogoproto.jsontag) = "image"];
  22. }
  23. message GeeTest{
  24. string gt = 1 [(gogoproto.jsontag) = "gt"];
  25. string challenge = 2 [(gogoproto.jsontag) = "challenge"];
  26. }
  27. message Image{
  28. string tips = 1 [(gogoproto.jsontag) = "tips"];
  29. string token = 2 [(gogoproto.jsontag) = "token"];
  30. string content = 3 [(gogoproto.jsontag) = "content"];
  31. }
  32. message VerifyReq{
  33. string anti = 1 [(gogoproto.moretags) = 'form:"anti"'];
  34. }
  35. message VerifyResp{
  36. int64 type = 1 [(gogoproto.jsontag) = "type"];
  37. string token = 2 [(gogoproto.jsontag) = "token"];
  38. }