✨ feat(channel): enhance channel status management
This commit is contained in:
21
types/channel_error.go
Normal file
21
types/channel_error.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package types
|
||||
|
||||
type ChannelError struct {
|
||||
ChannelId int `json:"channel_id"`
|
||||
ChannelType int `json:"channel_type"`
|
||||
ChannelName string `json:"channel_name"`
|
||||
IsMultiKey bool `json:"is_multi_key"`
|
||||
AutoBan bool `json:"auto_ban"`
|
||||
UsingKey string `json:"using_key"`
|
||||
}
|
||||
|
||||
func NewChannelError(channelId int, channelType int, channelName string, isMultiKey bool, usingKey string, autoBan bool) *ChannelError {
|
||||
return &ChannelError{
|
||||
ChannelId: channelId,
|
||||
ChannelType: channelType,
|
||||
ChannelName: channelName,
|
||||
IsMultiKey: isMultiKey,
|
||||
AutoBan: autoBan,
|
||||
UsingKey: usingKey,
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ const (
|
||||
ErrorCodeChannelModelMappedError ErrorCode = "channel:model_mapped_error"
|
||||
ErrorCodeChannelAwsClientError ErrorCode = "channel:aws_client_error"
|
||||
ErrorCodeChannelInvalidKey ErrorCode = "channel:invalid_key"
|
||||
ErrorCodeChannelResponseTimeExceeded ErrorCode = "channel:response_time_exceeded"
|
||||
|
||||
// client request error
|
||||
ErrorCodeReadRequestBodyFailed ErrorCode = "read_request_body_failed"
|
||||
|
||||
Reference in New Issue
Block a user