二测质押用户奖励

This commit is contained in:
lianghuanjie
2025-01-10 11:34:52 +08:00
parent 84d23a295d
commit a6efc2236a
8 changed files with 100 additions and 20 deletions

View File

@@ -4,6 +4,8 @@ import (
"context"
"encoding/json"
"errors"
"github.com/spf13/cast"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"nova_task/internal/consts"
@@ -21,6 +23,7 @@ type (
GetNftStakeTaskConf(ctx context.Context) (conf NftStakeTaskConf, err error)
GetCarvApiKey(ctx context.Context) (apiKey string, err error)
GetAdminSecret(ctx context.Context) (secret string, err error)
GetCarvIoInviterId(ctx context.Context) uint
}
customNhSystemConfigModel struct {
@@ -28,6 +31,17 @@ type (
}
)
func (m *customNhSystemConfigModel) GetCarvIoInviterId(ctx context.Context) uint {
cf, err := m.FindOneByName(ctx, consts.AdminSecret)
if err != nil {
if !errors.Is(err, sqlx.ErrNotFound) {
logx.Errorw("GetCarvIoInviterId error", logx.Field("err", err))
}
return 0
}
return cast.ToUint(cf.Value)
}
func (m *customNhSystemConfigModel) GetAdminSecret(ctx context.Context) (secret string, err error) {
cf, err := m.FindOneByName(ctx, consts.AdminSecret)
if err != nil {