MCPcopy Create free account
hub / github.com/53AI/53AIHub / GetAPIKeyByKey

Function GetAPIKeyByKey

api/model/api_key.go:98–104  ·  view source on GitHub ↗

GetAPIKeyByKey 根据密钥获取API密钥

(key string)

Source from the content-addressed store, hash-verified

96
97// GetAPIKeyByKey 根据密钥获取API密钥
98func GetAPIKeyByKey(key string) (*APIKey, error) {
99 var apiKey APIKey
100 if err := DB.Where(&APIKey{Key: key}).First(&apiKey).Error; err != nil {
101 return nil, err
102 }
103 return &apiKey, nil
104}
105
106// GetAPIKeysByEid 获取企业下的所有API密钥
107func GetAPIKeysByEid(eid int64) ([]APIKey, error) {

Callers 2

SaveMethod · 0.85
ValidateAPIKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected