feat: 用户中心
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package request
|
||||
|
||||
type UpdateProfile struct {
|
||||
Nickname string `json:"nickname"`
|
||||
AvatarId string `json:"avatarId"`
|
||||
}
|
||||
@@ -8,5 +8,5 @@ type LevelConfig struct {
|
||||
Level int `json:"level" gorm:"column:level"` // 等级数值
|
||||
Title string `json:"title" gorm:"column:title"` // 等级称号 (e.g., "萌芽园丁")
|
||||
MinSunlight int64 `json:"minSunlight" gorm:"column:min_sunlight"` // 达到该等级所需的最小阳光值
|
||||
Perks string `json:"perks" gorm:"column:column:perks"` // 解锁权益描述 (e.g., "解锁智能诊断")
|
||||
Perks string `json:"perks" gorm:"column:perks"` // 解锁权益描述 (e.g., "解锁智能诊断")
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -8,7 +8,8 @@ type Menu struct {
|
||||
Category int `json:"category" form:"category"`
|
||||
Name string `gorm:"size:20" json:"name" form:"name"`
|
||||
Title string `gorm:"size:20" json:"title" form:"title"`
|
||||
Code string `gorm:"size:20" json:"code" form:"code"`
|
||||
Code string `gorm:"size:50" json:"code" form:"code"`
|
||||
Path string `gorm:"size:100" json:"path" form:"path"`
|
||||
Permission string `gorm:"size:20" json:"permission" form:"permission"`
|
||||
Locale string `gorm:"size:50" json:"locale" form:"locale"`
|
||||
Icon string `gorm:"size:20" json:"icon" form:"icon"`
|
||||
|
||||
Reference in New Issue
Block a user