| 13 | ) |
| 14 | |
| 15 | func ToKeyStatus(status string) ai_key_dto.KeyStatus { |
| 16 | switch status { |
| 17 | case StatusNormal: |
| 18 | return ai_key_dto.KeyNormal |
| 19 | case StatusInvalidRequest: |
| 20 | return ai_key_dto.KeyNormal |
| 21 | case StatusQuotaExhausted: |
| 22 | return ai_key_dto.KeyExceed |
| 23 | case StatusExpired: |
| 24 | return ai_key_dto.KeyExpired |
| 25 | case StatusExceeded: |
| 26 | return ai_key_dto.KeyNormal |
| 27 | case StatusInvalid: |
| 28 | return ai_key_dto.KeyError |
| 29 | case StatusTimeout: |
| 30 | return ai_key_dto.KeyError |
| 31 | default: |
| 32 | return ai_key_dto.KeyNormal |
| 33 | } |
| 34 | } |