|
@@ -18,7 +18,7 @@ type CdnService interface {
|
|
CreateGroup(ctx context.Context, req v1.Group) (int64, error)
|
|
CreateGroup(ctx context.Context, req v1.Group) (int64, error)
|
|
BindPlan(ctx context.Context, req v1.Plan) (int64, error)
|
|
BindPlan(ctx context.Context, req v1.Plan) (int64, error)
|
|
RenewPlan(ctx context.Context, req v1.RenewalPlan) error
|
|
RenewPlan(ctx context.Context, req v1.RenewalPlan) error
|
|
- CreateWebsite(ctx context.Context, req v1.Website) (int64, error)
|
|
|
|
|
|
+ CreateWebsite(ctx context.Context, req v1.WebsiteSend) (int64, error)
|
|
EditServerType(ctx context.Context, req v1.EditWebsite, apiType string) error
|
|
EditServerType(ctx context.Context, req v1.EditWebsite, apiType string) error
|
|
EditProtocol(ctx context.Context, req v1.ProxyJson, action string) error
|
|
EditProtocol(ctx context.Context, req v1.ProxyJson, action string) error
|
|
CreateOrigin(ctx context.Context, req v1.Origin) (int64, error)
|
|
CreateOrigin(ctx context.Context, req v1.Origin) (int64, error)
|
|
@@ -309,31 +309,15 @@ func (s *cdnService) RenewPlan(ctx context.Context, req v1.RenewalPlan) error {
|
|
}
|
|
}
|
|
|
|
|
|
// 创建网站
|
|
// 创建网站
|
|
-func (s *cdnService) CreateWebsite(ctx context.Context, req v1.Website) (int64, error) {
|
|
|
|
- var httpJSON, httpsJSON []byte
|
|
|
|
- var err error
|
|
|
|
- if req.HttpJSON.Listen != nil {
|
|
|
|
- httpJSON, err = json.Marshal(req.HttpJSON)
|
|
|
|
- if err != nil {
|
|
|
|
- return 0, err
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if req.HttpsJSON.Listen != nil {
|
|
|
|
- httpsJSON, err = json.Marshal(req.HttpsJSON)
|
|
|
|
- if err != nil {
|
|
|
|
- return 0, err
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+func (s *cdnService) CreateWebsite(ctx context.Context, req v1.WebsiteSend) (int64, error) {
|
|
formData := map[string]interface{}{
|
|
formData := map[string]interface{}{
|
|
"userId": req.UserId,
|
|
"userId": req.UserId,
|
|
"type": req.Type,
|
|
"type": req.Type,
|
|
"name": req.Name,
|
|
"name": req.Name,
|
|
"description": req.Description,
|
|
"description": req.Description,
|
|
"serverNamesJSON": req.ServerNamesJSON,
|
|
"serverNamesJSON": req.ServerNamesJSON,
|
|
- "httpJSON": httpJSON,
|
|
|
|
- "httpsJSON": httpsJSON,
|
|
|
|
|
|
+ "httpJSON": req.HttpJSON,
|
|
|
|
+ "httpsJSON": req.HttpsJSON,
|
|
"tcpJSON": req.TcpJSON,
|
|
"tcpJSON": req.TcpJSON,
|
|
"tlsJSON": req.TlsJSON,
|
|
"tlsJSON": req.TlsJSON,
|
|
"udpJSON": req.UdpJSON,
|
|
"udpJSON": req.UdpJSON,
|