add qcxg7a2b
This commit is contained in:
@@ -40,24 +40,24 @@ type WhiteListListResponse struct {
|
||||
|
||||
// API调用记录相关DTO
|
||||
type ApiCallRecordResponse struct {
|
||||
ID string `json:"id"`
|
||||
AccessId string `json:"access_id"`
|
||||
UserId string `json:"user_id"`
|
||||
ProductId *string `json:"product_id,omitempty"`
|
||||
ProductName *string `json:"product_name,omitempty"`
|
||||
TransactionId string `json:"transaction_id"`
|
||||
ClientIp string `json:"client_ip"`
|
||||
Status string `json:"status"`
|
||||
StartAt string `json:"start_at"`
|
||||
EndAt *string `json:"end_at,omitempty"`
|
||||
Cost *string `json:"cost,omitempty"`
|
||||
ErrorType *string `json:"error_type,omitempty"`
|
||||
ErrorMsg *string `json:"error_msg,omitempty"`
|
||||
TranslatedErrorMsg *string `json:"translated_error_msg,omitempty"`
|
||||
CompanyName *string `json:"company_name,omitempty"`
|
||||
User *UserSimpleResponse `json:"user,omitempty"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
ID string `json:"id"`
|
||||
AccessId string `json:"access_id"`
|
||||
UserId string `json:"user_id"`
|
||||
ProductId *string `json:"product_id,omitempty"`
|
||||
ProductName *string `json:"product_name,omitempty"`
|
||||
TransactionId string `json:"transaction_id"`
|
||||
ClientIp string `json:"client_ip"`
|
||||
Status string `json:"status"`
|
||||
StartAt string `json:"start_at"`
|
||||
EndAt *string `json:"end_at,omitempty"`
|
||||
Cost *string `json:"cost,omitempty"`
|
||||
ErrorType *string `json:"error_type,omitempty"`
|
||||
ErrorMsg *string `json:"error_msg,omitempty"`
|
||||
TranslatedErrorMsg *string `json:"translated_error_msg,omitempty"`
|
||||
CompanyName *string `json:"company_name,omitempty"`
|
||||
User *UserSimpleResponse `json:"user,omitempty"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
// UserSimpleResponse 用户简单信息响应
|
||||
@@ -95,8 +95,6 @@ func NewErrorResponse(code int, message, transactionId string) *ApiCallResponse
|
||||
Code: code,
|
||||
Message: message,
|
||||
TransactionId: transactionId,
|
||||
Data: "",
|
||||
Data: "",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,3 +45,9 @@ func GetErrorCode(err error) int {
|
||||
}
|
||||
return 1001 // 默认返回接口异常
|
||||
}
|
||||
|
||||
// GetErrorMessage 获取错误对应的错误消息
|
||||
func GetErrorMessage(err error) string {
|
||||
// 直接返回预定义的错误消息
|
||||
return err.Error()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user