tianyuan-api-server/apps/api/internal/handler/FLXG/flxg162ahandler.go

31 lines
737 B
Go
Raw Normal View History

2024-10-02 00:57:17 +08:00
package FLXG
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/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
)
func FLXG162AHandler(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 := FLXG.NewFLXG162ALogic(r.Context(), svcCtx)
resp, err := l.FLXG162A(&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
}
}
}