vo.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package syncer
  2. import "time"
  3. const (
  4. SYNC_ACTION_INSERT = "Insert"
  5. SYNC_ACTION_UPDATE = "Update"
  6. SYNC_ACTION_DELETE = "Delete"
  7. // ClientPriceUpdate
  8. TYPE_CLIENT_PRICE_UPDATE = "ClientPriceUpdate"
  9. )
  10. type Model struct {
  11. ID uint64 `json:"id" gorm:"primary_key"`
  12. Type string `json:"type" gorm:"not null"`
  13. CreatedAt time.Time `json:"create_at"`
  14. UpdatedAt time.Time `json:"update_at"`
  15. }
  16. type SyncLog struct {
  17. Model
  18. DataType string `json:"data_type"` // data type
  19. Data string `json:"data" sql:"type:varchar(5000)"` // data in json string
  20. Action string `json:"action"` // [Insert,Update,Delete]
  21. Synced bool `json:"synced"`
  22. }
  23. // Client data
  24. type ClientPriceUpdate struct {
  25. Model
  26. CompanyId uint64 `json:"company_id"` // only used by FOS
  27. StationId uint64 `json:"station_id"` // only used by FOS
  28. PriceUpdateId uint64 `json:"price_update_id"`
  29. GradeId uint64 `json:"grade_id"`
  30. GradeText string `json:"grade_text"`
  31. GradePrice uint64 `json:"grade_price"`
  32. NewGradePrice uint64 `json:"new_grade_price"`
  33. }