37 lines
911 B
Go
37 lines
911 B
Go
|
|
// 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 RemoveAccountDevicesLogic struct {
|
||
|
|
logx.Logger
|
||
|
|
ctx context.Context
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewRemoveAccountDevicesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RemoveAccountDevicesLogic {
|
||
|
|
return &RemoveAccountDevicesLogic{
|
||
|
|
Logger: logx.WithContext(ctx),
|
||
|
|
ctx: ctx,
|
||
|
|
svcCtx: svcCtx,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (l *RemoveAccountDevicesLogic) RemoveAccountDevices() (resp *types.AccountDeviceMutationResponse, err error) {
|
||
|
|
removed, err := l.svcCtx.AuthService.RemoveOtherDevices(l.ctx, design.UserIDFromContext(l.ctx))
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return &types.AccountDeviceMutationResponse{Removed: removed}, nil
|
||
|
|
}
|