muyu-apiserver/gateway/internal/handler/crm/relation/listDownstreamHandler.go

31 lines
704 B
Go
Raw Normal View History

package relation
import (
"net/http"
"muyu-apiserver/gateway/internal/logic/crm/relation"
"muyu-apiserver/gateway/internal/svc"
"muyu-apiserver/gateway/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func ListDownstreamHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.CrmListRelationsReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := relation.NewListDownstreamLogic(r.Context(), svcCtx)
resp, err := l.ListDownstream(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}