model.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package model
  2. import (
  3. "encoding/json"
  4. )
  5. // consts
  6. const (
  7. ActUpdateExp = "updateExp"
  8. ActUpdateLevel = "updateLevel"
  9. ActUpdateFace = "updateFace"
  10. ActUpdateMoral = "updateMoral"
  11. ActUpdateUname = "updateUname"
  12. ActUpdateRealname = "updateRealname"
  13. ActUpdateByAdmin = "updateByAdmin"
  14. ActBlockUser = "blockUser"
  15. )
  16. // consts
  17. const (
  18. CacheKeyBase = "bs_%d" // key of baseInfo
  19. CacheKeyMoral = "moral_%d" // key of detail
  20. CacheKeyInfo = "i_"
  21. )
  22. // Binlog is
  23. type Binlog struct {
  24. Action string `json:"action"`
  25. Table string `json:"table"`
  26. New json.RawMessage `json:"new"`
  27. Old json.RawMessage `json:"old"`
  28. }
  29. // NewExp userexp for mysql scan.
  30. type NewExp struct {
  31. Mid int64 `json:"mid"`
  32. Exp int64 `json:"exp"`
  33. Flag int32 `json:"flag"`
  34. }
  35. // NeastMid is
  36. type NeastMid struct {
  37. Mid int64 `json:"mid"`
  38. }
  39. // NotifyInfo notify info.
  40. type NotifyInfo struct {
  41. Uname string `json:"uname"`
  42. Mid int64 `json:"mid"`
  43. Type string `json:"type"`
  44. NewName string `json:"newName"`
  45. Action string `json:"action"`
  46. }
  47. // ExpMessage exp msg
  48. type ExpMessage struct {
  49. Mid int64 `json:"mid"`
  50. Exp int64 `json:"exp"`
  51. }
  52. // MemberBase is
  53. type MemberBase struct {
  54. Mid int64 `json:"mid"`
  55. Name string `json:"name"`
  56. Sex int64 `json:"sex"`
  57. Face string `json:"face"`
  58. Sign string `json:"sign"`
  59. Rank int64 `json:"rank"`
  60. }