31 lines
787 B
Go
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)
|
||
|
}
|
||
|
}
|
||
|
}
|