后台用户管理新增“人工实名

This commit is contained in:
yml2213
2026-06-28 01:06:35 +08:00
parent 21aabd77f1
commit 18eba36ef9
12 changed files with 453 additions and 16 deletions
@@ -79,7 +79,7 @@ func (p *CloudMarketProvider) Start(ctx context.Context, req StartRequest) (Prov
resp, err := p.client.Do(httpReq)
if err != nil {
return ProviderResult{}, fmt.Errorf("realname cloud market request failed: %w", err)
return ProviderResult{}, fmt.Errorf("%w: realname cloud market request failed: %v", ErrProviderUnavailable, err)
}
defer resp.Body.Close()
@@ -165,7 +165,7 @@ func cloudMarketHTTPError(statusCode int, reason string) error {
func parseCloudMarketResult(raw json.RawMessage) (int, error) {
if len(raw) == 0 || string(raw) == "null" {
return 0, fmt.Errorf("realname cloud market result missing")
return 0, fmt.Errorf("%w: realname cloud market result missing", ErrProviderUnavailable)
}
var number int
if err := json.Unmarshal(raw, &number); err == nil {
@@ -184,7 +184,7 @@ func parseCloudMarketResult(raw json.RawMessage) (int, error) {
return 110, nil
}
}
return 0, fmt.Errorf("realname cloud market result invalid: %s", string(raw))
return 0, fmt.Errorf("%w: realname cloud market result invalid: %s", ErrProviderUnavailable, string(raw))
}
func firstNonEmpty(values ...string) string {