27 lines
911 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package client
import (
"context"
"google.golang.org/grpc"
luckygiftv1 "hyapp.local/api/proto/luckygift/v1"
)
// LuckyGiftClient abstracts gateway access to lucky-gift-service eligibility checks.
// gateway-service 只做 App HTTP 协议转换幸运礼物规则、RTP 和奖池仍由 lucky-gift-service 独占。
type LuckyGiftClient interface {
CheckLuckyGift(ctx context.Context, req *luckygiftv1.CheckLuckyGiftRequest) (*luckygiftv1.CheckLuckyGiftResponse, error)
}
type grpcLuckyGiftClient struct {
client luckygiftv1.LuckyGiftServiceClient
}
func NewGRPCLuckyGiftClient(conn *grpc.ClientConn) LuckyGiftClient {
return &grpcLuckyGiftClient{client: luckygiftv1.NewLuckyGiftServiceClient(conn)}
}
func (c *grpcLuckyGiftClient) CheckLuckyGift(ctx context.Context, req *luckygiftv1.CheckLuckyGiftRequest) (*luckygiftv1.CheckLuckyGiftResponse, error) {
return c.client.CheckLuckyGift(ctx, req)
}