tianyuan-api-server/apps/api/internal/handler/QYGL/qygl45bdhandler.go

31 lines
737 B
Go
Raw Normal View History

2024-10-02 00:57:17 +08:00
package QYGL
import (
"net/http"
2024-10-15 20:52:51 +08:00
"tianyuan-api/pkg/errs"
2024-10-12 23:49:59 +08:00
"tianyuan-api/pkg/response"
2024-10-02 00:57:17 +08:00
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/QYGL"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
)
func QYGL45BDHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
2024-10-15 20:52:51 +08:00
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
2024-10-02 00:57:17 +08:00
return
}
l := QYGL.NewQYGL45BDLogic(r.Context(), svcCtx)
resp, err := l.QYGL45BD(&req)
if err != nil {
2024-10-15 20:52:51 +08:00
response.Fail(r.Context(), w, err, resp)
2024-10-02 00:57:17 +08:00
} else {
2024-10-12 23:49:59 +08:00
response.Success(r.Context(), w, resp)
2024-10-02 00:57:17 +08:00
}
}
}