package domain import "time" // Provider 供应商领域模型 type Provider struct { ID string `json:"id"` Name string `json:"name"` APIKey string `json:"api_key"` BaseURL string `json:"base_url"` Protocol string `json:"protocol"` Enabled bool `json:"enabled"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } // MaskAPIKey 掩码 API Key(仅显示最后 4 个字符) func (p *Provider) MaskAPIKey() { if len(p.APIKey) > 4 { p.APIKey = "***" + p.APIKey[len(p.APIKey)-4:] } else { p.APIKey = "***" } }