41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// 梦想目标状态枚举值。
|
|
const (
|
|
RewardGoalStatusActive = "active"
|
|
RewardGoalStatusCompleted = "completed"
|
|
RewardGoalStatusArchived = "archived"
|
|
)
|
|
|
|
// RewardGoal 表示用户的梦想奖励目标。
|
|
type RewardGoal struct {
|
|
ID uint `gorm:"primaryKey;comment:主键" json:"id"`
|
|
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"-"`
|
|
|
|
UID int `gorm:"index;comment:用户ID" json:"-"`
|
|
|
|
Title string `gorm:"column:title;size:64;comment:目标名称" json:"title"`
|
|
TargetAmountCent int `gorm:"column:target_amount_cent;comment:目标金额(分)" json:"target_amount_cent"`
|
|
CoverImage string `gorm:"column:cover_image;size:500;comment:封面图" json:"cover_image,omitempty"`
|
|
Status string `gorm:"column:status;size:32;index;comment:状态" json:"status"`
|
|
CompletedAt *time.Time `gorm:"column:completed_at;comment:完成时间" json:"completed_at,omitempty"`
|
|
}
|
|
|
|
// TableName 返回梦想目标表名。
|
|
func (RewardGoal) TableName() string {
|
|
return "fa_quit_checkin_reward_goal"
|
|
}
|
|
|
|
// TableComment 返回梦想目标表注释。
|
|
func (RewardGoal) TableComment() string {
|
|
return "V2-无烟打卡-梦想目标"
|
|
}
|