feat: 等级配置

This commit is contained in:
Blizzard
2026-02-11 11:37:35 +08:00
parent 6be24bdbda
commit 4ccab96ca2
12 changed files with 272 additions and 18 deletions
+15
View File
@@ -0,0 +1,15 @@
package request
type CreateLevelConf struct {
Level int `json:"level"` // 等级数值
Title string `json:"title"` // 等级称号 (e.g., "萌芽园丁")
MinSunlight int64 `json:"minSunlight"` // 达到该等级所需的最小阳光值
Perks string `json:"perks"` // 解锁权益描述 (e.g., "解锁智能诊断")
}
type UpdateLevelConf struct {
Id string `json:"id" binding:"required"`
Level int `json:"level"` // 等级数值
Title string `json:"title"` // 等级称号 (e.g., "萌芽园丁")
MinSunlight int64 `json:"minSunlight"` // 达到该等级所需的最小阳光值
Perks string `json:"perks"` // 解锁权益描述 (e.g., "解锁智能诊断")
}
+18
View File
@@ -0,0 +1,18 @@
package plant
import (
"sundynix-go/config"
"sundynix-go/global"
)
// BadgeConfig 徽章配置
type BadgeConfig struct {
global.BaseModel
GroupId string `json:"group_id"` // 徽章组 (用于系列徽章,如浇水铜/银/金)
Name string `json:"name"` // 徽章名称
Description string `json:"description"` // 描述
Tier config.BadgeTier `json:"tier"` // 稀有度
TargetAction config.ActionType `json:"target_action"` // 关联的行为
TargetCount int `json:"target_count"` // 需要完成该行为的次数
IconURL string `json:"icon_url"` // 徽章图标地址
}
+12
View File
@@ -0,0 +1,12 @@
package plant
import "sundynix-go/global"
// LevelConfig 等级配置
type LevelConfig struct {
global.BaseModel
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., "解锁智能诊断")
}