game7 api

This commit is contained in:
lianghuanjie
2025-01-10 16:20:58 +08:00
parent e9f237ee7c
commit 957537efc4
16 changed files with 359 additions and 24 deletions

View File

@@ -21,9 +21,9 @@ type (
nhSystemConfigModel
GetNftStakeTaskOpenDate(ctx context.Context) (start, end time.Time, err error)
GetNftStakeTaskConf(ctx context.Context) (conf NftStakeTaskConf, err error)
GetCarvApiKey(ctx context.Context) (apiKey string, err error)
GetApiKey(ctx context.Context, name string) (apiKey string, err error)
GetAdminSecret(ctx context.Context) (secret string, err error)
GetCarvIoInviterId(ctx context.Context) uint
GetInviterId(ctx context.Context, name string) uint
}
customNhSystemConfigModel struct {
@@ -31,11 +31,11 @@ type (
}
)
func (m *customNhSystemConfigModel) GetCarvIoInviterId(ctx context.Context) uint {
cf, err := m.FindOneByName(ctx, consts.AdminSecret)
func (m *customNhSystemConfigModel) GetInviterId(ctx context.Context, name string) uint {
cf, err := m.FindOneByName(ctx, name)
if err != nil {
if !errors.Is(err, sqlx.ErrNotFound) {
logx.Errorw("GetCarvIoInviterId error", logx.Field("err", err))
logx.Errorw("GetInviterId error", logx.Field("err", err))
}
return 0
}
@@ -53,8 +53,8 @@ func (m *customNhSystemConfigModel) GetAdminSecret(ctx context.Context) (secret
return cf.Value, nil
}
func (m *customNhSystemConfigModel) GetCarvApiKey(ctx context.Context) (string, error) {
cf, err := m.FindOneByName(ctx, consts.CarvApiKey)
func (m *customNhSystemConfigModel) GetApiKey(ctx context.Context, name string) (string, error) {
cf, err := m.FindOneByName(ctx, name)
if err != nil {
if !errors.Is(err, sqlx.ErrNotFound) {
return "", err