GetAPIKeyByKey 根据密钥获取API密钥
(key string)
| 96 | |
| 97 | // GetAPIKeyByKey 根据密钥获取API密钥 |
| 98 | func 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密钥 |
| 107 | func GetAPIKeysByEid(eid int64) ([]APIKey, error) { |
no outgoing calls
no test coverage detected