feat(quitcheckin): persist hp and log hp changes

This commit is contained in:
nepiedg
2026-04-16 11:33:41 +08:00
parent 6e0a06cfcf
commit a32ec911a1
7 changed files with 582 additions and 42 deletions
+3
View File
@@ -21,6 +21,9 @@ type Profile struct {
Motivation string `gorm:"column:motivation;size:200;comment:戒烟初心" json:"motivation"`
NotifyTime string `gorm:"column:notify_time;size:5;comment:提醒时间(HH:MM)" json:"notify_time"`
ResetRule string `gorm:"column:reset_rule;size:64;comment:连续天数重置规则" json:"reset_rule"`
// HpCurrent 表示“肺部 HP”(0~100)。允许为 NULL:用于兼容老数据,首次访问时再做迁移初始化。
HpCurrent *int `gorm:"column:hp_current;comment:肺部HP(0~100)" json:"hp_current,omitempty"`
}
// TableName 返回用户资料表名。