tianyuan-api-server/apps/admin/internal/handler/review/getpendingenterprisehandler.go
2024-10-02 00:57:17 +08:00

31 lines
787 B
Go

package review
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/review"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func GetPendingEnterpriseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetPendingEnterpriseReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := review.NewGetPendingEnterpriseLogic(r.Context(), svcCtx)
resp, err := l.GetPendingEnterprise(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}