captcha.api 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. syntax = "v1"
  2. info(
  3. title: "captcha api"
  4. desc: "captcha api"
  5. author: "Ryan Su"
  6. email: "yuansu.china.work@gmail.com"
  7. version: "v1.0"
  8. )
  9. import "../base.api"
  10. // The information of captcha | 验证码数据
  11. type CaptchaInfo {
  12. CaptchaId string `json:"captchaId"`
  13. ImgPath string `json:"imgPath"`
  14. }
  15. // The response data of captcha | 验证码返回数据
  16. type CaptchaResp {
  17. BaseDataInfo
  18. // The menu authorization data | 菜单授权信息数据
  19. Data CaptchaInfo `json:"data"`
  20. }
  21. // The email captcha request | 邮箱验证码请求参数
  22. type EmailCaptchaReq {
  23. // The email address | 邮箱地址
  24. Email string `json:"email"`
  25. }
  26. // The sms captcha request | 短信验证码请求参数
  27. type SmsCaptchaReq {
  28. // The phone number | 电话号码
  29. PhoneNumber string `json:"phoneNumber"`
  30. }
  31. @server(
  32. group: captcha
  33. )
  34. service Core {
  35. // Get captcha | 获取验证码
  36. @handler getCaptcha
  37. get /captcha returns (CaptchaResp)
  38. }
  39. @server(
  40. group: captcha
  41. )
  42. service Core {
  43. // Get Email Captcha | 获取邮箱验证码
  44. @handler getEmailCaptcha
  45. post /captcha/email (EmailCaptchaReq) returns (BaseMsgResp)
  46. // Get SMS Captcha | 获取短信验证码
  47. @handler getSmsCaptcha
  48. post /captcha/sms (SmsCaptchaReq) returns (BaseMsgResp)
  49. }