|
|
@ -295,6 +295,7 @@ type GetFeedsOptions struct { |
|
|
|
IncludePrivate bool // include private actions
|
|
|
|
IncludePrivate bool // include private actions
|
|
|
|
OnlyPerformedBy bool // only actions performed by requested user
|
|
|
|
OnlyPerformedBy bool // only actions performed by requested user
|
|
|
|
IncludeDeleted bool // include deleted actions
|
|
|
|
IncludeDeleted bool // include deleted actions
|
|
|
|
|
|
|
|
Date string // the day we want activity for: YYYY-MM-DD
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetFeeds returns actions according to the provided options
|
|
|
|
// GetFeeds returns actions according to the provided options
|
|
|
@ -380,5 +381,17 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) { |
|
|
|
cond = cond.And(builder.Eq{"is_deleted": false}) |
|
|
|
cond = cond.And(builder.Eq{"is_deleted": false}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if opts.Date != "" { |
|
|
|
|
|
|
|
dateLow, err := time.Parse("2006-01-02", opts.Date) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
log.Warn("Unable to parse %s, filter not applied: %v", opts.Date, err) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
dateHigh := dateLow.Add(86399000000000) // 23h59m59s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cond = cond.And(builder.Gte{"created_unix": dateLow.Unix()}) |
|
|
|
|
|
|
|
cond = cond.And(builder.Lte{"created_unix": dateHigh.Unix()}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return cond, nil |
|
|
|
return cond, nil |
|
|
|
} |
|
|
|
} |
|
|
|