// Code scaffolded by goctl. Safe to edit. // goctl 1.10.1 package logic import ( "context" "img_infinite_canvas/internal/domain/design" "img_infinite_canvas/internal/svc" "img_infinite_canvas/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type ListAccountDevicesLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewListAccountDevicesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListAccountDevicesLogic { return &ListAccountDevicesLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *ListAccountDevicesLogic) ListAccountDevices() (resp *types.AccountDeviceListResponse, err error) { devices, err := l.svcCtx.AuthService.ListDevices(l.ctx, design.UserIDFromContext(l.ctx)) if err != nil { return nil, err } return &types.AccountDeviceListResponse{Devices: toAPIAccountDevices(devices)}, nil }