1
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
|
||||
"fusenapi/server/data-transfer/internal/logic"
|
||||
"fusenapi/server/data-transfer/internal/svc"
|
||||
)
|
||||
|
||||
// 获取二维码配置列表
|
||||
func GetQrCodeSetListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := logic.NewGetQrCodeSetListLogic(r.Context(), svcCtx)
|
||||
resp := l.GetQrCodeSetList()
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,14 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
svc2 "fusenapi/server/data-transfer/internal/svc"
|
||||
"net/http"
|
||||
|
||||
"fusenapi/server/data-transfer/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc2.ServiceContext) {
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
@@ -16,6 +17,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc2.ServiceContext) {
|
||||
Path: "/standard-logo/list",
|
||||
Handler: GetStandardLogoListHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/qrcode-set/list",
|
||||
Handler: GetQrCodeSetListHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user