youtu_grpc/app/auth_service/internal/server/auth_service_server.go

46 lines
1.4 KiB
Go
Raw Normal View History

2025-02-07 15:18:26 +08:00
// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.6
2025-02-14 17:21:32 +08:00
// Source: auth_service.proto
2025-02-07 15:18:26 +08:00
package server
import (
"context"
2025-02-14 17:21:32 +08:00
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/auth_service/auth"
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/auth_service/internal/logic"
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/auth_service/internal/svc"
2025-02-07 15:18:26 +08:00
)
type AuthServiceServer struct {
svcCtx *svc.ServiceContext
2025-02-14 10:30:15 +08:00
auth.UnimplementedAuthServiceServer
2025-02-07 15:18:26 +08:00
}
func NewAuthServiceServer(svcCtx *svc.ServiceContext) *AuthServiceServer {
return &AuthServiceServer{
svcCtx: svcCtx,
}
}
2025-02-14 10:30:15 +08:00
func (s *AuthServiceServer) Ping(ctx context.Context, in *auth.Request) (*auth.Response, error) {
l := logic.NewPingLogic(ctx, s.svcCtx)
2025-02-07 15:18:26 +08:00
return l.Ping(in)
}
2025-02-14 10:30:15 +08:00
func (s *AuthServiceServer) Code2Session(ctx context.Context, in *auth.Code2SessionRequest) (*auth.Code2SessionResponse, error) {
l := logic.NewCode2SessionLogic(ctx, s.svcCtx)
2025-02-07 15:18:26 +08:00
return l.Code2Session(in)
}
2025-02-14 10:30:15 +08:00
func (s *AuthServiceServer) GetAccessToken(ctx context.Context, in *auth.GetAccessTokenRequest) (*auth.GetAccessTokenResponse, error) {
l := logic.NewGetAccessTokenLogic(ctx, s.svcCtx)
2025-02-07 15:18:26 +08:00
return l.GetAccessToken(in)
}
2025-02-24 11:37:19 +08:00
// 刷新AccessToken
func (s *AuthServiceServer) RefreshAccessToken(ctx context.Context, in *auth.RefreshAccessTokenRequest) (*auth.RefreshAccessTokenResponse, error) {
l := logic.NewRefreshAccessTokenLogic(ctx, s.svcCtx)
return l.RefreshAccessToken(in)
}