feat: 戒烟成就、梦想图标预设、打卡统计与依赖注入调整
- 成就系统、连续打卡天数计算、管理后台成就 CRUD - 梦想目标图标预设 DreamPreset 与用户端 dream-presets 接口 - 管理后台梦想图标 CRUD;戒烟打卡 summary 修正 - 忽略根目录编译产物 /api Made-with: Cursor
This commit is contained in:
@@ -252,6 +252,10 @@ func (s *SmokeLogService) countResisted(ctx context.Context, uid int, start, end
|
||||
return int(count), nil
|
||||
}
|
||||
|
||||
func (s *SmokeLogService) GetStreakDays(ctx context.Context, uid int, asOf time.Time) (int, error) {
|
||||
return s.computeStreakDays(ctx, uid, asOf)
|
||||
}
|
||||
|
||||
func (s *SmokeLogService) computeStreakDays(ctx context.Context, uid int, asOf time.Time) (int, error) {
|
||||
asOf = dateOnly(asOf)
|
||||
start := asOf.AddDate(0, 0, -400)
|
||||
|
||||
Reference in New Issue
Block a user