mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 13:39:53 +00:00
refactor: clean code
This commit is contained in:
parent
39f8484b2a
commit
53133db456
3
internal/pkg/vendors/1panel-sdk/client.go
vendored
3
internal/pkg/vendors/1panel-sdk/client.go
vendored
@ -88,6 +88,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||||||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||||
resp, err := c.sendRequest(method, path, params)
|
resp, err := c.sendRequest(method, path, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if resp != nil {
|
||||||
|
json.Unmarshal(resp.Body(), &result)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
internal/pkg/vendors/cachefly-sdk/client.go
vendored
3
internal/pkg/vendors/cachefly-sdk/client.go
vendored
@ -68,6 +68,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||||||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||||
resp, err := c.sendRequest(method, path, params)
|
resp, err := c.sendRequest(method, path, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if resp != nil {
|
||||||
|
json.Unmarshal(resp.Body(), &result)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
internal/pkg/vendors/cdnfly-sdk/client.go
vendored
3
internal/pkg/vendors/cdnfly-sdk/client.go
vendored
@ -74,6 +74,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||||||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||||
resp, err := c.sendRequest(method, path, params)
|
resp, err := c.sendRequest(method, path, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if resp != nil {
|
||||||
|
json.Unmarshal(resp.Body(), &result)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
internal/pkg/vendors/dnsla-sdk/client.go
vendored
3
internal/pkg/vendors/dnsla-sdk/client.go
vendored
@ -69,6 +69,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||||||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result BaseResponse) error {
|
||||||
resp, err := c.sendRequest(method, path, params)
|
resp, err := c.sendRequest(method, path, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if resp != nil {
|
||||||
|
json.Unmarshal(resp.Body(), &result)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
internal/pkg/vendors/safeline-sdk/client.go
vendored
3
internal/pkg/vendors/safeline-sdk/client.go
vendored
@ -56,6 +56,9 @@ func (c *Client) sendRequest(path string, params interface{}) (*resty.Response,
|
|||||||
func (c *Client) sendRequestWithResult(path string, params interface{}, result BaseResponse) error {
|
func (c *Client) sendRequestWithResult(path string, params interface{}, result BaseResponse) error {
|
||||||
resp, err := c.sendRequest(path, params)
|
resp, err := c.sendRequest(path, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if resp != nil {
|
||||||
|
json.Unmarshal(resp.Body(), &result)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,6 +73,9 @@ func (c *Client) sendRequest(method string, path string, params interface{}) (*r
|
|||||||
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result interface{}) error {
|
func (c *Client) sendRequestWithResult(method string, path string, params interface{}, result interface{}) error {
|
||||||
resp, err := c.sendRequest(method, path, params)
|
resp, err := c.sendRequest(method, path, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if resp != nil {
|
||||||
|
json.Unmarshal(resp.Body(), &result)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user