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

25 lines
687 B
Go

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