feat: 用户中心

This commit is contained in:
Blizzard
2026-02-11 14:33:00 +08:00
parent 4ccab96ca2
commit 112a1f439c
17 changed files with 1571 additions and 138 deletions
+21
View File
@@ -0,0 +1,21 @@
package plant
import (
"sundynix-go/global"
"sundynix-go/model/system"
)
type UserProfile struct {
global.BaseModel
UserId string `json:"userId" gorm:"index;column:user_id"`
Nickname string `json:"nickname" gorm:"column:nick_name"`
AvatarId string `json:"avatarId" gorm:"column:avatar_id"`
LevelId string `json:"levelId" gorm:"column:level_id"` // 当前等级id
CurrentSunlight int64 `json:"currentSunlight" gorm:"column:current_sunlight"` // 当前持有阳光值 (可消耗)
TotalSunlight int64 `json:"totalSunlight" gorm:"column:total_sunlight"` // 历史累计阳光值 (用于计算等级)
PlantCount int64 `json:"plantCount" gorm:"column:plant_count"`
CareCount int64 `json:"careCount" gorm:"column:care_count"`
PostCount int64 `json:"postCount" gorm:"column:post_count"`
Avatar *system.Oss `json:"avatar" gorm:"foreignKey:AvatarId"`
Level *LevelConfig `json:"level" gorm:"foreignKey:LevelId"`
}