mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 21:49:52 +00:00
fix: #626
This commit is contained in:
parent
c10ceed753
commit
32ff658e84
18
internal/pkg/vendors/cdnfly-sdk/models.go
vendored
18
internal/pkg/vendors/cdnfly-sdk/models.go
vendored
@ -1,6 +1,6 @@
|
|||||||
package cdnflysdk
|
package cdnflysdk
|
||||||
|
|
||||||
import "encoding/json"
|
import "fmt"
|
||||||
|
|
||||||
type BaseResponse interface {
|
type BaseResponse interface {
|
||||||
GetCode() string
|
GetCode() string
|
||||||
@ -8,12 +8,24 @@ type BaseResponse interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type baseResponse struct {
|
type baseResponse struct {
|
||||||
Code json.Number `json:"code"`
|
Code any `json:"code"`
|
||||||
Message string `json:"msg"`
|
Message string `json:"msg"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *baseResponse) GetCode() string {
|
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 {
|
func (r *baseResponse) GetMessage() string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user