struct.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package main
  2. // *common
  3. type MsgInterface struct {
  4. Success int `json:"success"`
  5. Msg interface{} `json:"msg"`
  6. }
  7. // // *error
  8. // type SimpleJsonMsg struct {
  9. // Success int `json:"success"`
  10. // Msg string `json:"msg"`
  11. // }
  12. // *handler
  13. // login
  14. type HandlerLoginData struct {
  15. Name string `json:"name"`
  16. Password string `json:"password"`
  17. }
  18. // register
  19. type HandlerRegisterData struct {
  20. Name string `json:"name"`
  21. Password string `json:"password"`
  22. Password2 string `json:"password2"`
  23. Key string `json:"key"`
  24. }
  25. // userinfo
  26. type HandlerUserInfo struct {
  27. Name string `json:"name"`
  28. }
  29. // seturl
  30. type HandlerSetUrl struct {
  31. Url string `json:"url"`
  32. }
  33. // geturl
  34. type HandlerGetUrl struct {
  35. Url string `json:"url"`
  36. Status int `json:"status"`
  37. Msg string `json:"msg"`
  38. }
  39. // setkey
  40. // getkey
  41. type HandlerKey struct {
  42. AK string `json:"ak"`
  43. SK string `json:"sk"`
  44. }
  45. // *data
  46. // user
  47. type LogData struct {
  48. Time int `json:"time"`
  49. Name string `json:"name"`
  50. Type int `json:"type"`
  51. }
  52. // admin
  53. type LogDataAdmin struct {
  54. Time int `json:"time"`
  55. Name string `json:"name"`
  56. Type int `json:"type"`
  57. Msg string `json:"msg"`
  58. }
  59. // details
  60. type LogDataDetails struct {
  61. Uid int `json:"id"`
  62. Name string `json:"name"`
  63. Time int `json:"time"` // 最早成功时间
  64. Fail int `json:"fail"` // 失败次数
  65. }