积分档位增加精灵配置

This commit is contained in:
2025-04-27 14:55:38 +08:00
parent a22b45eb2f
commit 109d76cd2e
5 changed files with 23 additions and 4 deletions

View File

@@ -26,10 +26,12 @@ type GetStakeLevelListReq {
type PointStakeLevel { type PointStakeLevel {
Id int `json:"id"` // 档位id Id int `json:"id"` // 档位id
Title string `json:"title"` // 档位标题 Title string `json:"title"` // 档位标题
ElfName string `json:"elf_name"` // 精灵名称
Level int `json:"level"` // 精灵等级 Level int `json:"level"` // 精灵等级
Points int `json:"points"` // 积分数量 Points int `json:"points"` // 积分数量
Days float64 `json:"days"` // 质押天数 Days float64 `json:"days"` // 质押天数
RenewDays float64 `json:"renew_days"` // 续期天数 RenewDays float64 `json:"renew_days"` // 续期天数
Rate float64 `json:"rate"` // 返利比率
} }
type StakeLevel { type StakeLevel {

View File

@@ -1425,6 +1425,10 @@
"type": "string", "type": "string",
"description": " 档位标题" "description": " 档位标题"
}, },
"elf_name": {
"type": "string",
"description": " 精灵名称"
},
"level": { "level": {
"type": "integer", "type": "integer",
"format": "int32", "format": "int32",
@@ -1444,16 +1448,23 @@
"type": "number", "type": "number",
"format": "double", "format": "double",
"description": " 续期天数" "description": " 续期天数"
},
"rate": {
"type": "number",
"format": "double",
"description": " 返利比率"
} }
}, },
"title": "PointStakeLevel", "title": "PointStakeLevel",
"required": [ "required": [
"id", "id",
"title", "title",
"elf_name",
"level", "level",
"points", "points",
"days", "days",
"renew_days" "renew_days",
"rate"
] ]
}, },
"Result": { "Result": {

View File

@@ -52,6 +52,8 @@ func (l *GetStakeLevelListLogic) GetStakeLevelList(req *types.GetStakeLevelListR
ls = append(ls, types.PointStakeLevel{ ls = append(ls, types.PointStakeLevel{
Id: int(lv.Id), Id: int(lv.Id),
Title: lv.Title, Title: lv.Title,
ElfName: lv.ElfName,
Rate: lv.Rate.InexactFloat64(),
Level: int(lv.Level), Level: int(lv.Level),
Points: int(lv.Points), Points: int(lv.Points),
Days: lv.Days.InexactFloat64(), Days: lv.Days.InexactFloat64(),

View File

@@ -48,6 +48,8 @@ type (
Status int8 `db:"status"` // 状态0=正常1=停用 Status int8 `db:"status"` // 状态0=正常1=停用
CreatedAt time.Time `db:"created_at"` // 创建时间 CreatedAt time.Time `db:"created_at"` // 创建时间
UpdatedAt time.Time `db:"updated_at"` // 修改时间 UpdatedAt time.Time `db:"updated_at"` // 修改时间
ElfName string `db:"elf_name"` // 精灵名称
Rate decimal.Decimal `db:"rate"` // 返利比率
} }
) )
@@ -79,14 +81,14 @@ func (m *defaultNhStakeHomePointConfigModel) FindOne(ctx context.Context, id uin
} }
func (m *defaultNhStakeHomePointConfigModel) Insert(ctx context.Context, data *NhStakeHomePointConfig) (sql.Result, error) { func (m *defaultNhStakeHomePointConfigModel) Insert(ctx context.Context, data *NhStakeHomePointConfig) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?)", m.table, nhStakeHomePointConfigRowsExpectAutoSet) query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?)", m.table, nhStakeHomePointConfigRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status) ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status, data.ElfName, data.Rate)
return ret, err return ret, err
} }
func (m *defaultNhStakeHomePointConfigModel) Update(ctx context.Context, data *NhStakeHomePointConfig) error { func (m *defaultNhStakeHomePointConfigModel) Update(ctx context.Context, data *NhStakeHomePointConfig) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, nhStakeHomePointConfigRowsWithPlaceHolder) query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, nhStakeHomePointConfigRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status, data.Id) _, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.Points, data.Days, data.RenewDays, data.Status, data.ElfName, data.Rate, data.Id)
return err return err
} }

View File

@@ -144,10 +144,12 @@ type PioneerReward struct {
type PointStakeLevel struct { type PointStakeLevel struct {
Id int `json:"id"` // 档位id Id int `json:"id"` // 档位id
Title string `json:"title"` // 档位标题 Title string `json:"title"` // 档位标题
ElfName string `json:"elf_name"` // 精灵名称
Level int `json:"level"` // 精灵等级 Level int `json:"level"` // 精灵等级
Points int `json:"points"` // 积分数量 Points int `json:"points"` // 积分数量
Days float64 `json:"days"` // 质押天数 Days float64 `json:"days"` // 质押天数
RenewDays float64 `json:"renew_days"` // 续期天数 RenewDays float64 `json:"renew_days"` // 续期天数
Rate float64 `json:"rate"` // 返利比率
} }
type Result struct { type Result struct {