diff.go 602 B

1234567891011121314151617181920212223242526272829
  1. package service
  2. import (
  3. "go-common/app/job/main/passport-game-data/model"
  4. "go-common/library/log"
  5. )
  6. const (
  7. _statusOK = 0
  8. _statusPending = 1
  9. _statusNo = 2
  10. )
  11. func doCompare(cloud *model.AsoAccount, local *model.OriginAsoAccount, pending bool) int {
  12. if cloud == nil || local == nil {
  13. log.Info("either cloud or local aso account is nil, cloud %+v, local: %+v", cloud, local)
  14. return _statusNo
  15. }
  16. if cloud.Mtime.After(local.Mtime) {
  17. if model.Default(local).Equals(cloud) {
  18. return _statusOK
  19. }
  20. return _statusNo
  21. }
  22. if pending {
  23. return _statusPending
  24. }
  25. return _statusNo
  26. }