mirror of
https://github.com/usual2970/certimate.git
synced 2025-08-18 07:11:44 +00:00
feat: new deployment provider: wangsu cdn
This commit is contained in:
15
internal/pkg/sdk3rd/wangsu/cdn/api.go
Normal file
15
internal/pkg/sdk3rd/wangsu/cdn/api.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package cdn
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (c *Client) BatchUpdateCertificateConfig(req *BatchUpdateCertificateConfigRequest) (*BatchUpdateCertificateConfigResponse, error) {
|
||||
resp := &BatchUpdateCertificateConfigResponse{}
|
||||
_, err := c.client.SendRequestWithResult(http.MethodPut, "/api/config/certificate/batch", req, resp)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
return resp, err
|
||||
}
|
20
internal/pkg/sdk3rd/wangsu/cdn/client.go
Normal file
20
internal/pkg/sdk3rd/wangsu/cdn/client.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package cdn
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/usual2970/certimate/internal/pkg/sdk3rd/wangsu/openapi"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
client *openapi.Client
|
||||
}
|
||||
|
||||
func NewClient(accessKey, secretKey string) *Client {
|
||||
return &Client{client: openapi.NewClient(accessKey, secretKey)}
|
||||
}
|
||||
|
||||
func (c *Client) WithTimeout(timeout time.Duration) *Client {
|
||||
c.client.WithTimeout(timeout)
|
||||
return c
|
||||
}
|
26
internal/pkg/sdk3rd/wangsu/cdn/models.go
Normal file
26
internal/pkg/sdk3rd/wangsu/cdn/models.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package cdn
|
||||
|
||||
import (
|
||||
"github.com/usual2970/certimate/internal/pkg/sdk3rd/wangsu/openapi"
|
||||
)
|
||||
|
||||
type baseResponse struct {
|
||||
RequestId *string `json:"requestId,omitempty"`
|
||||
Code *string `json:"code,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
var _ openapi.Result = (*baseResponse)(nil)
|
||||
|
||||
func (r *baseResponse) SetRequestId(requestId string) {
|
||||
r.RequestId = &requestId
|
||||
}
|
||||
|
||||
type BatchUpdateCertificateConfigRequest struct {
|
||||
CertificateId int64 `json:"certificateId" required:"true"`
|
||||
DomainNames []string `json:"domainNames" required:"true"`
|
||||
}
|
||||
|
||||
type BatchUpdateCertificateConfigResponse struct {
|
||||
baseResponse
|
||||
}
|
Reference in New Issue
Block a user