package myPlant

import (
	"net/http"
	"sundynix-micro-go/app/plant/api/internal/logic/myPlant"
	"sundynix-micro-go/app/plant/api/internal/svc"
	"sundynix-micro-go/common/response"
)

func GetTodayTaskListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := myPlant.NewGetTodayTaskListLogic(r.Context(), svcCtx)
		resp, err := l.GetTodayTaskList()
		if err != nil {
			response.Fail(w, err.Error())
		} else {
			response.OkWithData(w, resp)
		}
	}
}
