feat: 添加用户记账连击(streak)功能,包括服务、处理器、模型和仓库层。
This commit is contained in:
@@ -241,3 +241,11 @@ func (s *StreakService) CheckAndResetStreak(userID uint) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetContributionData returns daily transaction counts for the past year
|
||||
func (s *StreakService) GetContributionData(userID uint) ([]models.DailyContribution, error) {
|
||||
now := time.Now()
|
||||
startDate := now.AddDate(-1, 0, 0) // 1 year ago
|
||||
|
||||
return s.repo.GetDailyContribution(userID, startDate, now)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user