This commit is contained in:
laodaming
2023-06-08 11:03:20 +08:00
parent e790be8c1a
commit a9e0f6b98e
18 changed files with 44 additions and 47 deletions

View File

@@ -0,0 +1,25 @@
package handler
import (
"errors"
logic2 "fusenapi/server/data-transfer/internal/logic"
svc2 "fusenapi/server/data-transfer/internal/svc"
"net/http"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/rest/httpx"
)
func GetStandardLogoListHandler(svcCtx *svc2.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := logic2.NewGetStandardLogoListLogic(r.Context(), svcCtx)
resp := l.GetStandardLogoList()
if resp != nil {
httpx.OkJsonCtx(r.Context(), w, resp)
} else {
err := errors.New("server logic is error, resp must not be nil")
httpx.ErrorCtx(r.Context(), w, err)
logx.Error(err)
}
}
}

View File

@@ -0,0 +1,22 @@
// Code generated by goctl. DO NOT EDIT.
package handler
import (
svc2 "fusenapi/server/data-transfer/internal/svc"
"net/http"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc2.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/standard-logo/list",
Handler: GetStandardLogoListHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
)
}