Files
novatask/internal/handler/task/get_community_list_handler.go
2024-12-19 21:14:14 +08:00

23 lines
506 B
Go

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)
}
}
}