@@ -6,17 +6,17 @@ import (
66 "errors"
77 "fmt"
88 "time"
9-
9+
1010 "github.com/eolinker/eosc/log"
1111 "gorm.io/gorm"
12-
12+
1313 "github.com/APIParkLab/APIPark/gateway"
14-
14+
1515 "github.com/google/uuid"
16-
16+
1717 "github.com/APIParkLab/APIPark/service/cluster"
1818 "github.com/eolinker/go-common/store"
19-
19+
2020 certificatedto "github.com/APIParkLab/APIPark/module/certificate/dto"
2121 "github.com/APIParkLab/APIPark/service/certificate"
2222 "github.com/eolinker/ap-account/service/account"
@@ -64,7 +64,7 @@ func (m *imlCertificate) getCertificates(ctx context.Context, clusterId string)
6464}
6565
6666func (m * imlCertificate ) initGateway (ctx context.Context , clusterId string , clientDriver gateway.IClientDriver ) error {
67- certificateClient , err := clientDriver .Dynamic ("certificate" )
67+ certificateClient , err := clientDriver .Dynamic ("certificate" , "" )
6868 if err != nil {
6969 return err
7070 }
@@ -76,10 +76,10 @@ func (m *imlCertificate) initGateway(ctx context.Context, clusterId string, clie
7676}
7777
7878func (m * imlCertificate ) save (ctx context.Context , id string , clusterId string , create * certificatedto.FileInput ) (* certificatedto.Certificate , error ) {
79-
79+
8080 keyData , err := base64 .StdEncoding .DecodeString (create .Key )
8181 if err != nil {
82-
82+
8383 return nil , fmt .Errorf ("decode key error: %w" , err )
8484 }
8585 certData , err := base64 .StdEncoding .DecodeString (create .Cert )
@@ -105,7 +105,7 @@ func (m *imlCertificate) syncGateway(ctx context.Context, clusterId string, rele
105105 log .Warn ("close apinto client:" , err )
106106 }
107107 }()
108- dynamicClient , err := client .Dynamic ("certificate" )
108+ dynamicClient , err := client .Dynamic ("certificate" , "" )
109109 if err != nil {
110110 return err
111111 }
@@ -116,7 +116,7 @@ func (m *imlCertificate) syncGateway(ctx context.Context, clusterId string, rele
116116}
117117
118118func (m * imlCertificate ) Create (ctx context.Context , create * certificatedto.FileInput ) error {
119-
119+
120120 return m .transaction .Transaction (ctx , func (ctx context.Context ) error {
121121 id := uuid .New ().String ()
122122 version := time .Now ().Format ("20060102150405" )
@@ -143,7 +143,7 @@ func (m *imlCertificate) Create(ctx context.Context, create *certificatedto.File
143143 }
144144 return nil
145145 })
146-
146+
147147}
148148
149149func (m * imlCertificate ) Update (ctx context.Context , id string , edit * certificatedto.FileInput ) error {
0 commit comments