nic-chen commented on a change in pull request #488:
URL: https://github.com/apache/apisix-dashboard/pull/488#discussion_r491637228
##########
File path: api/internal/handler/ssl/ssl.go
##########
@@ -0,0 +1,252 @@
+package ssl
+
+import (
+ "crypto/tls"
+ "crypto/x509"
+ "encoding/pem"
+ "errors"
+ "fmt"
+ "reflect"
+ "strings"
+
+ "github.com/api7/go-jsonpatch"
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/data"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+type Handler struct {
+ sslStore *store.GenericStore
+}
+
+func NewHandler() (handler.RouteRegister, error) {
+ s, err := store.NewGenericStore(store.GenericStoreOption{
+ BasePath: "/apisix/ssl",
+ ObjType: reflect.TypeOf(entity.SSL{}),
+ KeyFunc: func(obj interface{}) string {
+ r := obj.(*entity.SSL)
+ return r.ID
+ },
+ })
+ if err != nil {
+ return nil, err
+ }
+ if err := s.Init(); err != nil {
+ return nil, err
+ }
+
+ utils.AppendToClosers(s.Close)
+ return &Handler{
+ sslStore: s,
+ }, nil
+}
+
+func (h *Handler) ApplyRoute(r *gin.Engine) {
+ r.GET("/apisix/admin/ssl/:id", wgin.Wraps(h.Get,
+ wrapper.InputType(reflect.TypeOf(GetInput{}))))
+ r.GET("/apisix/admin/ssl", wgin.Wraps(h.List,
Review comment:
@juzhiyuan we should keep the same uri with 'admin api' currently
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]