segments_all.go 466 B

12345678910111213141516
  1. package repository
  2. import (
  3. "github.com/hwholiday/gid/v2/entity"
  4. "github.com/hwholiday/gid/v2/library/log"
  5. "github.com/hwholiday/gid/v2/library/tool"
  6. "go.uber.org/zap"
  7. )
  8. //只取6个小时有变化的Tag
  9. func (r *Repository) SegmentsGetAll() (res []entity.Segments, err error) {
  10. if err = r.db.Where("update_time >= ?", tool.GetTimeUnix()-21600).Find(&res); err != nil {
  11. log.GetLogger().Error("[Repository] SegmentsGetAll Find", zap.Error(err))
  12. }
  13. return
  14. }