新增 comb298y 人事背调组合包
This commit is contained in:
31
apps/api/internal/handler/COMB/comb298yhandler.go
Normal file
31
apps/api/internal/handler/COMB/comb298yhandler.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package COMB
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"tianyuan-api/apps/api/internal/logic/COMB"
|
||||
"tianyuan-api/apps/api/internal/svc"
|
||||
"tianyuan-api/apps/api/internal/types"
|
||||
"tianyuan-api/pkg/errs"
|
||||
"tianyuan-api/pkg/response"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func COMB298YHandler(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 {
|
||||
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
|
||||
return
|
||||
}
|
||||
|
||||
l := COMB.NewCOMB298YLogic(r.Context(), svcCtx)
|
||||
resp, err := l.COMB298Y(&req)
|
||||
if err != nil {
|
||||
response.Fail(r.Context(), w, err, resp)
|
||||
} else {
|
||||
response.Success(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ package handler
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
COMB "tianyuan-api/apps/api/internal/handler/COMB"
|
||||
FLXG "tianyuan-api/apps/api/internal/handler/FLXG"
|
||||
IVYZ "tianyuan-api/apps/api/internal/handler/IVYZ"
|
||||
JRZQ "tianyuan-api/apps/api/internal/handler/JRZQ"
|
||||
@@ -17,6 +18,20 @@ import (
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/COMB298Y",
|
||||
Handler: COMB.COMB298YHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
|
||||
|
||||
Reference in New Issue
Block a user