package ocr

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 GetMyClassifyLogLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewGetMyClassifyLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMyClassifyLogLogic {
	return &GetMyClassifyLogLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
}

func (l *GetMyClassifyLogLogic) GetMyClassifyLog() (*plantPb.ClassifyLogListResp, error) {
	userId := fmt.Sprintf("%v", l.ctx.Value("userId"))
	return l.svcCtx.PlantRpc.GetMyClassifyLog(l.ctx, &plantPb.GetProfileReq{UserId: userId})
}
