model.go 720 B

1234567891011121314151617181920212223
  1. package manager
  2. import "go-common/library/time"
  3. // Model for manager.
  4. type Model struct {
  5. ModelID int64 `json:"model_id"`
  6. System string `json:"-"`
  7. ModelName string `json:"model_name"`
  8. ModelFlag string `json:"model_flag"`
  9. HasDependence bool `json:"has_dependence"`
  10. GitURL string `json:"git_url"`
  11. Count int64 `json:"count"`
  12. CTime time.Time `json:"-"`
  13. MTime time.Time `json:"-"`
  14. }
  15. // Models model sorted.
  16. type Models []*Model
  17. func (a Models) Len() int { return len(a) }
  18. func (a Models) Less(i, j int) bool { return int64(a[i].ModelID) < int64(a[j].ModelID) }
  19. func (a Models) Swap(i, j int) { a[i], a[j] = a[j], a[i] }