package task import ( "net/http" "github.com/zeromicro/go-zero/rest/httpx" "nova_task/internal/logic/task" "nova_task/internal/svc" ) // 获取社区列表 func GetCommunityListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := task.NewGetCommunityListLogic(r.Context(), svcCtx) resp, err := l.GetCommunityList() if err != nil { httpx.ErrorCtx(r.Context(), w, err) } else { httpx.OkJsonCtx(r.Context(), w, resp) } } }