log.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package model
  2. import (
  3. "encoding/json"
  4. "go-common/library/time"
  5. )
  6. // ArgSecure arg secure.
  7. type ArgSecure struct {
  8. Mid int64 `json:"mid,omitempty"`
  9. UUID string `json:"uuid,omitempty"`
  10. }
  11. // ArgFeedBack arg feedback.
  12. type ArgFeedBack struct {
  13. Mid int64 `json:"mid,omitempty"`
  14. UUID string `json:"uuid,omitempty"`
  15. IP string `json:"ip,omitempty"`
  16. Type int8 `json:"type,omitempty"`
  17. Ts int64 `json:"ts"`
  18. }
  19. // Log define user login log.
  20. type Log struct {
  21. Mid int64 `json:"mid,omitempty"`
  22. IP uint32 `json:"loginip"`
  23. Location string `json:"location"`
  24. LocationID int64 `json:"location_id,omitempty"`
  25. Time time.Time `json:"timestamp,omitempty"`
  26. Type int8 `json:"type,omitempty"`
  27. }
  28. // Msg is user login status msg.
  29. type Msg struct {
  30. Notify bool `json:"notify"`
  31. Log *Log `json:"log"`
  32. }
  33. // Message is databus message.
  34. type Message struct {
  35. Action string `json:"action"`
  36. Table string `json:"table"`
  37. New json.RawMessage `json:"new"`
  38. Old json.RawMessage `json:"old"`
  39. }
  40. // Expection is user expection record.
  41. type Expection struct {
  42. IP uint64 `json:"ip"`
  43. Time time.Time `json:"time"`
  44. FeedBack int8 `json:"feedback"`
  45. }
  46. // PWDlog is user change password log.
  47. type PWDlog struct {
  48. Mid int64 `json:"mid"`
  49. }
  50. // Record user login record.
  51. type Record struct {
  52. LocID int64 `json:"locid"`
  53. Count int64 `json:"count"`
  54. }
  55. // Often is user often use ipaddr
  56. type Often struct {
  57. Result bool `json:"result"`
  58. }