mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-07 21:19:51 +00:00
fix: #626
This commit is contained in:
parent
c10ceed753
commit
32ff658e84
20
internal/pkg/vendors/cdnfly-sdk/models.go
vendored
20
internal/pkg/vendors/cdnfly-sdk/models.go
vendored
@ -1,6 +1,6 @@
|
||||
package cdnflysdk
|
||||
|
||||
import "encoding/json"
|
||||
import "fmt"
|
||||
|
||||
type BaseResponse interface {
|
||||
GetCode() string
|
||||
@ -8,12 +8,24 @@ type BaseResponse interface {
|
||||
}
|
||||
|
||||
type baseResponse struct {
|
||||
Code json.Number `json:"code"`
|
||||
Message string `json:"msg"`
|
||||
Code any `json:"code"`
|
||||
Message string `json:"msg"`
|
||||
}
|
||||
|
||||
func (r *baseResponse) GetCode() string {
|
||||
return r.Code.String()
|
||||
if r.Code == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
if code, ok := r.Code.(int); ok {
|
||||
return fmt.Sprintf("%d", code)
|
||||
}
|
||||
|
||||
if code, ok := r.Code.(string); ok {
|
||||
return code
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
func (r *baseResponse) GetMessage() string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user