email reward

This commit is contained in:
lianghuanjie
2025-01-03 20:44:03 +08:00
parent bc0aeec1da
commit b098e50eb0
36 changed files with 1188 additions and 51 deletions

View File

@@ -3,6 +3,7 @@ package model
import (
"context"
"encoding/json"
"errors"
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"nova_task/internal/consts"
@@ -18,6 +19,8 @@ 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)
GetAdminSecret(ctx context.Context) (secret string, err error)
}
customNhSystemConfigModel struct {
@@ -25,6 +28,28 @@ type (
}
)
func (m *customNhSystemConfigModel) GetAdminSecret(ctx context.Context) (secret string, err error) {
cf, err := m.FindOneByName(ctx, consts.CarvApiKey)
if err != nil {
if !errors.Is(err, sqlx.ErrNotFound) {
return "", err
}
return "", nil
}
return cf.Value, nil
}
func (m *customNhSystemConfigModel) GetCarvApiKey(ctx context.Context) (string, error) {
cf, err := m.FindOneByName(ctx, consts.CarvApiKey)
if err != nil {
if !errors.Is(err, sqlx.ErrNotFound) {
return "", err
}
return "", nil
}
return cf.Value, nil
}
// NewNhSystemConfigModel returns a model for the database table.
func NewNhSystemConfigModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) NhSystemConfigModel {
return &customNhSystemConfigModel{