fusenapi/server/websocket/internal/handler/datatransferhandler.go

25 lines
567 B
Go
Raw Normal View History

2023-10-11 10:54:54 +00:00
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)
}
}