feat: 拉取积分质押操作记录的接口

This commit is contained in:
2025-04-08 20:25:23 +08:00
parent 8119bcefdc
commit 85daa4b093
12 changed files with 500 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"nova_task/internal/consts"
"nova_task/internal/model"
"nova_task/internal/pkg/errs"
"nova_task/internal/svc"
"time"
@@ -49,6 +50,18 @@ func (c *Cron) Run() {
if err != nil {
return err
}
_, err = c.svcCtx.StakePointsLogModel.WithSession(session).Insert(ctx, &model.NhStakePointsLog{
Uid: n.Uid,
RoleId: n.RoleId,
LevelId: n.LevelId,
Level: n.Level,
Points: -int(n.Points),
Action: 4,
})
if err != nil {
logx.Errorw("stake points log error", logx.Field("err", err), logx.Field("role_id", n.RoleId), logx.Field("uid", n.Uid), logx.Field("level_id", n.LevelId), logx.Field("action", 4))
return errs.New(errs.ErrDatabaseOperate, err)
}
_, err = c.svcCtx.GameAction(c.ctx, int64(n.RoleId), consts.GameActionStakePoints, map[string]any{
"level": n.Level,
"operation": 4,