feat: 每日任务顺延与增删改 + 计划到期续期 + 靠谱养护模板 + 图片URL修复

后端
- 每日任务惰性生成:某天为空则从最近一天顺延复制(done 重置),首天用模板
- 任务增删改 API(POST /pets/:id/tasks、PUT/DELETE /tasks/:id),改动自动顺延
- 30 天计划到期自动归档并按当前阶段生成新一轮
- 内置养护模板重写为兽医常识向:狗每阶段含遛狗/牵引/狂犬,猫含猫砂/梳毛/饮水
- 文件 URL 改为按 object_name + 当前配置动态拼接,换 IP/域名不再有旧地址

小程序
- 首页今日任务加「管理」入口:增删改任务弹层
- 记录时间轴显示照片缩略图(可全屏预览)+ 拍照成功提示
- 社区发布条精简为单个「发布图文」按钮,去掉头像/输入框误触

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-06 10:06:13 +08:00
parent 2f5dd6eefc
commit 28b95a6468
21 changed files with 478 additions and 81 deletions
+4 -4
View File
@@ -39,18 +39,18 @@ func (s *Service) ListRecords(userID, petID string, recordType string, offset, l
}
var records []model.HealthRecord
err := q.Order("occurred_at desc, id desc").Offset(offset).Limit(limit).Find(&records).Error
// file_id 回填图片 URL
// file_id 的记录,图片 URL 一律按当前配置重建(避免存旧地址)
ids := make([]string, 0)
for i := range records {
if records[i].ImageFileID != "" && records[i].ImageURL == "" {
if records[i].ImageFileID != "" {
ids = append(ids, records[i].ImageFileID)
}
}
if len(ids) > 0 {
urls := s.fileURLs(ids)
for i := range records {
if records[i].ImageURL == "" {
records[i].ImageURL = urls[records[i].ImageFileID]
if u := urls[records[i].ImageFileID]; u != "" {
records[i].ImageURL = u
}
}
}