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

25 lines
693 B
Go

package ai
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 GetAiChatQuotaLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetAiChatQuotaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAiChatQuotaLogic {
return &GetAiChatQuotaLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
}
func (l *GetAiChatQuotaLogic) GetAiChatQuota() (*plantPb.AiQuotaResp, error) {
userId := fmt.Sprintf("%v", l.ctx.Value("userId"))
return l.svcCtx.PlantRpc.GetAiChatQuota(l.ctx, &plantPb.GetProfileReq{UserId: userId})
}