feat: bind tribally account
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user