2024-12-30 03:58:14 +00:00
|
|
|
package accountlogic
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2025-02-08 01:59:21 +00:00
|
|
|
"code.30cm.net/digimon/app-cloudep-member-server/pkg/domain/usecase"
|
|
|
|
|
2025-02-04 08:58:01 +00:00
|
|
|
"code.30cm.net/digimon/app-cloudep-member-server/gen_result/pb/member"
|
|
|
|
"code.30cm.net/digimon/app-cloudep-member-server/internal/svc"
|
2024-12-30 03:58:14 +00:00
|
|
|
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
|
|
)
|
|
|
|
|
|
|
|
type UpdateUserTokenLogic struct {
|
|
|
|
ctx context.Context
|
|
|
|
svcCtx *svc.ServiceContext
|
|
|
|
logx.Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewUpdateUserTokenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserTokenLogic {
|
|
|
|
return &UpdateUserTokenLogic{
|
|
|
|
ctx: ctx,
|
|
|
|
svcCtx: svcCtx,
|
|
|
|
Logger: logx.WithContext(ctx),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// UpdateUserToken 更新密碼
|
|
|
|
func (l *UpdateUserTokenLogic) UpdateUserToken(in *member.UpdateTokenReq) (*member.OKResp, error) {
|
2025-02-08 01:59:21 +00:00
|
|
|
// 更新密碼
|
|
|
|
err := l.svcCtx.AccountUseCase.UpdateUserToken(l.ctx, usecase.UpdateTokenRequest{
|
|
|
|
Account: in.GetAccount(),
|
|
|
|
Token: in.GetToken(),
|
|
|
|
Platform: in.GetPlatform(),
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2024-12-30 03:58:14 +00:00
|
|
|
|
|
|
|
return &member.OKResp{}, nil
|
|
|
|
}
|