2024-12-30 03:58:14 +00:00
|
|
|
package accountlogic
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2025-02-08 02:23:54 +00:00
|
|
|
"code.30cm.net/digimon/app-cloudep-member-server/pkg/domain/usecase"
|
|
|
|
|
|
|
|
"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 VerifyPlatformAuthResultLogic struct {
|
|
|
|
ctx context.Context
|
|
|
|
svcCtx *svc.ServiceContext
|
|
|
|
logx.Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewVerifyPlatformAuthResultLogic(ctx context.Context, svcCtx *svc.ServiceContext) *VerifyPlatformAuthResultLogic {
|
|
|
|
return &VerifyPlatformAuthResultLogic{
|
|
|
|
ctx: ctx,
|
|
|
|
svcCtx: svcCtx,
|
|
|
|
Logger: logx.WithContext(ctx),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// VerifyPlatformAuthResult 驗證 google 登入是否有效
|
|
|
|
func (l *VerifyPlatformAuthResultLogic) VerifyPlatformAuthResult(in *member.VerifyAuthResultReq) (*member.VerifyAuthResultResp, error) {
|
2025-02-08 02:23:54 +00:00
|
|
|
result, err := l.svcCtx.AccountUseCase.VerifyPlatformAuthResult(l.ctx, usecase.VerifyAuthResultRequest{
|
|
|
|
Account: in.GetAccount(),
|
|
|
|
Token: in.GetToken(),
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2024-12-30 03:58:14 +00:00
|
|
|
|
2025-02-08 02:23:54 +00:00
|
|
|
return &member.VerifyAuthResultResp{
|
|
|
|
Status: result.Status,
|
|
|
|
}, nil
|
2024-12-30 03:58:14 +00:00
|
|
|
}
|