Files
sundynix-micro-be/app/plant/api/internal/logic/myPlant/gettodaytasklistlogic.go
T
2026-05-23 13:55:05 +08:00

25 lines
717 B
Go

package myPlant
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/logx"
"sundynix-micro-go/app/plant/api/internal/svc"
plantPb "sundynix-micro-go/app/plant/rpc/plant"
)
type GetTodayTaskListLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetTodayTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetTodayTaskListLogic {
return &GetTodayTaskListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
}
func (l *GetTodayTaskListLogic) GetTodayTaskList() (*plantPb.CareTaskListResp, error) {
userId := fmt.Sprintf("%v", l.ctx.Value("userId"))
return l.svcCtx.PlantRpc.GetTodayTaskList(l.ctx, &plantPb.GetProfileReq{UserId: userId})
}