🏗️ microservice fabric splitting
This commit is contained in:
44
app/file/api/internal/handler/routes.go
Normal file
44
app/file/api/internal/handler/routes.go
Normal file
@@ -0,0 +1,44 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.3
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
upscale "schisandra-album-cloud-microservices/app/file/api/internal/handler/upscale"
|
||||
websocket "schisandra-album-cloud-microservices/app/file/api/internal/handler/websocket"
|
||||
"schisandra-album-cloud-microservices/app/file/api/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.SecurityHeadersMiddleware, serverCtx.NonceMiddleware},
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/upload",
|
||||
Handler: upscale.UploadImageHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
rest.WithPrefix("/api/auth/upscale"),
|
||||
rest.WithTimeout(10000*time.Millisecond),
|
||||
rest.WithMaxBytes(10485760),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
Path: "/file",
|
||||
Handler: websocket.FileWebsocketHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/ws"),
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user