// Code generated by protoc-gen-triple. DO NOT EDIT. // // Source: proto/activity.proto package activity import ( "context" ) import ( "dubbo.apache.org/dubbo-go/v3" "dubbo.apache.org/dubbo-go/v3/client" "dubbo.apache.org/dubbo-go/v3/common" "dubbo.apache.org/dubbo-go/v3/common/constant" "dubbo.apache.org/dubbo-go/v3/protocol/triple/triple_protocol" "dubbo.apache.org/dubbo-go/v3/server" ) // This is a compile-time assertion to ensure that this generated file and the Triple package // are compatible. If you get a compiler error that this constant is not defined, this code was // generated with a version of Triple newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of Triple or updating the Triple // version compiled into your binary. const _ = triple_protocol.IsAtLeastVersion0_1_0 const ( // ActivityServiceName is the fully-qualified name of the ActivityService service. ActivityServiceName = "topfans.activity.ActivityService" ) // These constants are the fully-qualified names of the RPCs defined in this package. They're // exposed at runtime as procedure and as the final two segments of the HTTP route. // // Note that these are different from the fully-qualified method names used by // google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to // reflection-formatted method names, remove the leading slash and convert the remaining slash to a // period. const ( // ActivityServiceGetActivityListProcedure is the fully-qualified name of the ActivityService's GetActivityList RPC. ActivityServiceGetActivityListProcedure = "/topfans.activity.ActivityService/GetActivityList" // ActivityServiceGetActivityProcedure is the fully-qualified name of the ActivityService's GetActivity RPC. ActivityServiceGetActivityProcedure = "/topfans.activity.ActivityService/GetActivity" // ActivityServiceGetActivityItemsProcedure is the fully-qualified name of the ActivityService's GetActivityItems RPC. ActivityServiceGetActivityItemsProcedure = "/topfans.activity.ActivityService/GetActivityItems" // ActivityServiceGetProgressProcedure is the fully-qualified name of the ActivityService's GetProgress RPC. ActivityServiceGetProgressProcedure = "/topfans.activity.ActivityService/GetProgress" // ActivityServicePurchaseItemProcedure is the fully-qualified name of the ActivityService's PurchaseItem RPC. ActivityServicePurchaseItemProcedure = "/topfans.activity.ActivityService/PurchaseItem" // ActivityServiceGetContributionRankingProcedure is the fully-qualified name of the ActivityService's GetContributionRanking RPC. ActivityServiceGetContributionRankingProcedure = "/topfans.activity.ActivityService/GetContributionRanking" ) var ( _ ActivityService = (*ActivityServiceImpl)(nil) ) // ActivityService is a client for the topfans.activity.ActivityService service. type ActivityService interface { GetActivityList(ctx context.Context, req *GetActivityListRequest, opts ...client.CallOption) (*GetActivityListResponse, error) GetActivity(ctx context.Context, req *GetProgressRequest, opts ...client.CallOption) (*Activity, error) GetActivityItems(ctx context.Context, req *GetProgressRequest, opts ...client.CallOption) (*ActivityItemsResponse, error) GetProgress(ctx context.Context, req *GetProgressRequest, opts ...client.CallOption) (*GetProgressResponse, error) PurchaseItem(ctx context.Context, req *PurchaseItemRequest, opts ...client.CallOption) (*PurchaseItemResponse, error) GetContributionRanking(ctx context.Context, req *ContributionRankingRequest, opts ...client.CallOption) (*ContributionRankingResponse, error) } // NewActivityService constructs a client for the activity.ActivityService service. func NewActivityService(cli *client.Client, opts ...client.ReferenceOption) (ActivityService, error) { conn, err := cli.DialWithInfo("topfans.activity.ActivityService", &ActivityService_ClientInfo, opts...) if err != nil { return nil, err } return &ActivityServiceImpl{ conn: conn, }, nil } func SetConsumerActivityService(srv common.RPCService) { dubbo.SetConsumerServiceWithInfo(srv, &ActivityService_ClientInfo) } // ActivityServiceImpl implements ActivityService. type ActivityServiceImpl struct { conn *client.Connection } func (c *ActivityServiceImpl) GetActivityList(ctx context.Context, req *GetActivityListRequest, opts ...client.CallOption) (*GetActivityListResponse, error) { resp := new(GetActivityListResponse) if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetActivityList", opts...); err != nil { return nil, err } return resp, nil } func (c *ActivityServiceImpl) GetActivity(ctx context.Context, req *GetProgressRequest, opts ...client.CallOption) (*Activity, error) { resp := new(Activity) if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetActivity", opts...); err != nil { return nil, err } return resp, nil } func (c *ActivityServiceImpl) GetActivityItems(ctx context.Context, req *GetProgressRequest, opts ...client.CallOption) (*ActivityItemsResponse, error) { resp := new(ActivityItemsResponse) if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetActivityItems", opts...); err != nil { return nil, err } return resp, nil } func (c *ActivityServiceImpl) GetProgress(ctx context.Context, req *GetProgressRequest, opts ...client.CallOption) (*GetProgressResponse, error) { resp := new(GetProgressResponse) if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetProgress", opts...); err != nil { return nil, err } return resp, nil } func (c *ActivityServiceImpl) PurchaseItem(ctx context.Context, req *PurchaseItemRequest, opts ...client.CallOption) (*PurchaseItemResponse, error) { resp := new(PurchaseItemResponse) if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "PurchaseItem", opts...); err != nil { return nil, err } return resp, nil } func (c *ActivityServiceImpl) GetContributionRanking(ctx context.Context, req *ContributionRankingRequest, opts ...client.CallOption) (*ContributionRankingResponse, error) { resp := new(ContributionRankingResponse) if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetContributionRanking", opts...); err != nil { return nil, err } return resp, nil } var ActivityService_ClientInfo = client.ClientInfo{ InterfaceName: "topfans.activity.ActivityService", MethodNames: []string{"GetActivityList", "GetActivity", "GetActivityItems", "GetProgress", "PurchaseItem", "GetContributionRanking"}, ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) { dubboCli := dubboCliRaw.(*ActivityServiceImpl) dubboCli.conn = conn }, } // ActivityServiceHandler is an implementation of the topfans.activity.ActivityService service. type ActivityServiceHandler interface { GetActivityList(context.Context, *GetActivityListRequest) (*GetActivityListResponse, error) GetActivity(context.Context, *GetProgressRequest) (*Activity, error) GetActivityItems(context.Context, *GetProgressRequest) (*ActivityItemsResponse, error) GetProgress(context.Context, *GetProgressRequest) (*GetProgressResponse, error) PurchaseItem(context.Context, *PurchaseItemRequest) (*PurchaseItemResponse, error) GetContributionRanking(context.Context, *ContributionRankingRequest) (*ContributionRankingResponse, error) } func RegisterActivityServiceHandler(srv *server.Server, hdlr ActivityServiceHandler, opts ...server.ServiceOption) error { return srv.Register(hdlr, &ActivityService_ServiceInfo, opts...) } func SetProviderActivityService(srv common.RPCService) { dubbo.SetProviderServiceWithInfo(srv, &ActivityService_ServiceInfo) } var ActivityService_ServiceInfo = server.ServiceInfo{ InterfaceName: "topfans.activity.ActivityService", ServiceType: (*ActivityServiceHandler)(nil), Methods: []server.MethodInfo{ { Name: "GetActivityList", Type: constant.CallUnary, ReqInitFunc: func() interface{} { return new(GetActivityListRequest) }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*GetActivityListRequest) res, err := handler.(ActivityServiceHandler).GetActivityList(ctx, req) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, { Name: "GetActivity", Type: constant.CallUnary, ReqInitFunc: func() interface{} { return new(GetProgressRequest) }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*GetProgressRequest) res, err := handler.(ActivityServiceHandler).GetActivity(ctx, req) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, { Name: "GetActivityItems", Type: constant.CallUnary, ReqInitFunc: func() interface{} { return new(GetProgressRequest) }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*GetProgressRequest) res, err := handler.(ActivityServiceHandler).GetActivityItems(ctx, req) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, { Name: "GetProgress", Type: constant.CallUnary, ReqInitFunc: func() interface{} { return new(GetProgressRequest) }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*GetProgressRequest) res, err := handler.(ActivityServiceHandler).GetProgress(ctx, req) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, { Name: "PurchaseItem", Type: constant.CallUnary, ReqInitFunc: func() interface{} { return new(PurchaseItemRequest) }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*PurchaseItemRequest) res, err := handler.(ActivityServiceHandler).PurchaseItem(ctx, req) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, { Name: "GetContributionRanking", Type: constant.CallUnary, ReqInitFunc: func() interface{} { return new(ContributionRankingRequest) }, MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { req := args[0].(*ContributionRankingRequest) res, err := handler.(ActivityServiceHandler).GetContributionRanking(ctx, req) if err != nil { return nil, err } return triple_protocol.NewResponse(res), nil }, }, }, }