二测质押用户奖励
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user