feat: bind tribally account

This commit is contained in:
2025-03-20 17:15:54 +08:00
parent 3f09a65806
commit 937244a1a0
10 changed files with 202 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ type (
GetApiKey(ctx context.Context, name string) (apiKey string, err error)
GetAdminSecret(ctx context.Context) (secret string, err error)
GetInviterId(ctx context.Context, name string) uint
GetTriballyApiKey(ctx context.Context) (apiKey string, err error)
}
customNhSystemConfigModel struct {
@@ -31,6 +32,17 @@ type (
}
)
func (m *customNhSystemConfigModel) GetTriballyApiKey(ctx context.Context) (apiKey string, err error) {
cf, err := m.FindOneByName(ctx, consts.TriballyApiKey)
if err != nil {
if !errors.Is(err, sqlx.ErrNotFound) {
return "", err
}
return "", nil
}
return cf.Value, nil
}
func (m *customNhSystemConfigModel) GetInviterId(ctx context.Context, name string) uint {
cf, err := m.FindOneByName(ctx, name)
if err != nil {