32 lines
739 B
Go
32 lines
739 B
Go
|
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)
|
||
|
}
|
||
|
}
|
||
|
}
|