2024-12-30 03:58:14 +00:00
|
|
|
package accountlogic
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
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 LineCodeToAccessTokenLogic struct {
|
|
|
|
ctx context.Context
|
|
|
|
svcCtx *svc.ServiceContext
|
|
|
|
logx.Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewLineCodeToAccessTokenLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LineCodeToAccessTokenLogic {
|
|
|
|
return &LineCodeToAccessTokenLogic{
|
|
|
|
ctx: ctx,
|
|
|
|
svcCtx: svcCtx,
|
|
|
|
Logger: logx.WithContext(ctx),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// LineCodeToAccessToken Line 驗證相關
|
2025-02-08 01:59:21 +00:00
|
|
|
func (l *LineCodeToAccessTokenLogic) LineCodeToAccessToken(in *member.LineGetTokenReq) (*member.LineAccessTokenResp, error) {
|
|
|
|
token, err := l.svcCtx.AccountUseCase.LineCodeToAccessToken(l.ctx, in.GetCode())
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2024-12-30 03:58:14 +00:00
|
|
|
|
2025-02-08 01:59:21 +00:00
|
|
|
return &member.LineAccessTokenResp{
|
|
|
|
Token: token.AccessToken,
|
|
|
|
}, nil
|
2024-12-30 03:58:14 +00:00
|
|
|
}
|