fusenapi/server/websocket/internal/handler/datatransferhandler.go
laodaming d93b009816 fix
2023-10-11 18:54:54 +08:00

25 lines
567 B
Go

package handler
import (
"fusenapi/utils/basic"
"net/http"
"fusenapi/server/websocket/internal/logic"
"fusenapi/server/websocket/internal/svc"
"fusenapi/server/websocket/internal/types"
)
func DataTransferHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.DataTransferReq
_, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewDataTransferLogic(r.Context(), svcCtx)
l.DataTransfer(&req, w, r)
}
}