285 lines
12 KiB
Go
285 lines
12 KiB
Go
// Code generated by protoc-gen-triple. DO NOT EDIT.
|
|
//
|
|
// Source: proto/gallery.proto
|
|
package gallery
|
|
|
|
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 (
|
|
// GalleryServiceName is the fully-qualified name of the GalleryService service.
|
|
GalleryServiceName = "topfans.gallery.GalleryService"
|
|
)
|
|
|
|
// 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 (
|
|
// GalleryServiceGetMyGalleryProcedure is the fully-qualified name of the GalleryService's GetMyGallery RPC.
|
|
GalleryServiceGetMyGalleryProcedure = "/topfans.gallery.GalleryService/GetMyGallery"
|
|
// GalleryServiceGetUserGalleryProcedure is the fully-qualified name of the GalleryService's GetUserGallery RPC.
|
|
GalleryServiceGetUserGalleryProcedure = "/topfans.gallery.GalleryService/GetUserGallery"
|
|
// GalleryServicePlaceAssetProcedure is the fully-qualified name of the GalleryService's PlaceAsset RPC.
|
|
GalleryServicePlaceAssetProcedure = "/topfans.gallery.GalleryService/PlaceAsset"
|
|
// GalleryServiceUnlockSlotProcedure is the fully-qualified name of the GalleryService's UnlockSlot RPC.
|
|
GalleryServiceUnlockSlotProcedure = "/topfans.gallery.GalleryService/UnlockSlot"
|
|
// GalleryServiceRemoveFromSlotProcedure is the fully-qualified name of the GalleryService's RemoveFromSlot RPC.
|
|
GalleryServiceRemoveFromSlotProcedure = "/topfans.gallery.GalleryService/RemoveFromSlot"
|
|
// GalleryServiceGetMyExhibitedAssetsProcedure is the fully-qualified name of the GalleryService's GetMyExhibitedAssets RPC.
|
|
GalleryServiceGetMyExhibitedAssetsProcedure = "/topfans.gallery.GalleryService/GetMyExhibitedAssets"
|
|
// GalleryServiceGetInspirationFlowProcedure is the fully-qualified name of the GalleryService's GetInspirationFlow RPC.
|
|
GalleryServiceGetInspirationFlowProcedure = "/topfans.gallery.GalleryService/GetInspirationFlow"
|
|
)
|
|
|
|
var (
|
|
_ GalleryService = (*GalleryServiceImpl)(nil)
|
|
)
|
|
|
|
// GalleryService is a client for the topfans.gallery.GalleryService service.
|
|
type GalleryService interface {
|
|
GetMyGallery(ctx context.Context, req *GetMyGalleryRequest, opts ...client.CallOption) (*GetMyGalleryResponse, error)
|
|
GetUserGallery(ctx context.Context, req *GetUserGalleryRequest, opts ...client.CallOption) (*GetUserGalleryResponse, error)
|
|
PlaceAsset(ctx context.Context, req *PlaceAssetRequest, opts ...client.CallOption) (*PlaceAssetResponse, error)
|
|
UnlockSlot(ctx context.Context, req *UnlockSlotRequest, opts ...client.CallOption) (*UnlockSlotResponse, error)
|
|
RemoveFromSlot(ctx context.Context, req *RemoveFromSlotRequest, opts ...client.CallOption) (*RemoveFromSlotResponse, error)
|
|
GetMyExhibitedAssets(ctx context.Context, req *GetMyExhibitedAssetsRequest, opts ...client.CallOption) (*GetMyExhibitedAssetsResponse, error)
|
|
GetInspirationFlow(ctx context.Context, req *GetInspirationFlowRequest, opts ...client.CallOption) (*GetInspirationFlowResponse, error)
|
|
}
|
|
|
|
// NewGalleryService constructs a client for the gallery.GalleryService service.
|
|
func NewGalleryService(cli *client.Client, opts ...client.ReferenceOption) (GalleryService, error) {
|
|
conn, err := cli.DialWithInfo("topfans.gallery.GalleryService", &GalleryService_ClientInfo, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &GalleryServiceImpl{
|
|
conn: conn,
|
|
}, nil
|
|
}
|
|
|
|
func SetConsumerGalleryService(srv common.RPCService) {
|
|
dubbo.SetConsumerServiceWithInfo(srv, &GalleryService_ClientInfo)
|
|
}
|
|
|
|
// GalleryServiceImpl implements GalleryService.
|
|
type GalleryServiceImpl struct {
|
|
conn *client.Connection
|
|
}
|
|
|
|
func (c *GalleryServiceImpl) GetMyGallery(ctx context.Context, req *GetMyGalleryRequest, opts ...client.CallOption) (*GetMyGalleryResponse, error) {
|
|
resp := new(GetMyGalleryResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetMyGallery", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *GalleryServiceImpl) GetUserGallery(ctx context.Context, req *GetUserGalleryRequest, opts ...client.CallOption) (*GetUserGalleryResponse, error) {
|
|
resp := new(GetUserGalleryResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetUserGallery", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *GalleryServiceImpl) PlaceAsset(ctx context.Context, req *PlaceAssetRequest, opts ...client.CallOption) (*PlaceAssetResponse, error) {
|
|
resp := new(PlaceAssetResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "PlaceAsset", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *GalleryServiceImpl) UnlockSlot(ctx context.Context, req *UnlockSlotRequest, opts ...client.CallOption) (*UnlockSlotResponse, error) {
|
|
resp := new(UnlockSlotResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "UnlockSlot", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *GalleryServiceImpl) RemoveFromSlot(ctx context.Context, req *RemoveFromSlotRequest, opts ...client.CallOption) (*RemoveFromSlotResponse, error) {
|
|
resp := new(RemoveFromSlotResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "RemoveFromSlot", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *GalleryServiceImpl) GetMyExhibitedAssets(ctx context.Context, req *GetMyExhibitedAssetsRequest, opts ...client.CallOption) (*GetMyExhibitedAssetsResponse, error) {
|
|
resp := new(GetMyExhibitedAssetsResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetMyExhibitedAssets", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *GalleryServiceImpl) GetInspirationFlow(ctx context.Context, req *GetInspirationFlowRequest, opts ...client.CallOption) (*GetInspirationFlowResponse, error) {
|
|
resp := new(GetInspirationFlowResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetInspirationFlow", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
var GalleryService_ClientInfo = client.ClientInfo{
|
|
InterfaceName: "topfans.gallery.GalleryService",
|
|
MethodNames: []string{"GetMyGallery", "GetUserGallery", "PlaceAsset", "UnlockSlot", "RemoveFromSlot", "GetMyExhibitedAssets", "GetInspirationFlow"},
|
|
ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) {
|
|
dubboCli := dubboCliRaw.(*GalleryServiceImpl)
|
|
dubboCli.conn = conn
|
|
},
|
|
}
|
|
|
|
// GalleryServiceHandler is an implementation of the topfans.gallery.GalleryService service.
|
|
type GalleryServiceHandler interface {
|
|
GetMyGallery(context.Context, *GetMyGalleryRequest) (*GetMyGalleryResponse, error)
|
|
GetUserGallery(context.Context, *GetUserGalleryRequest) (*GetUserGalleryResponse, error)
|
|
PlaceAsset(context.Context, *PlaceAssetRequest) (*PlaceAssetResponse, error)
|
|
UnlockSlot(context.Context, *UnlockSlotRequest) (*UnlockSlotResponse, error)
|
|
RemoveFromSlot(context.Context, *RemoveFromSlotRequest) (*RemoveFromSlotResponse, error)
|
|
GetMyExhibitedAssets(context.Context, *GetMyExhibitedAssetsRequest) (*GetMyExhibitedAssetsResponse, error)
|
|
GetInspirationFlow(context.Context, *GetInspirationFlowRequest) (*GetInspirationFlowResponse, error)
|
|
}
|
|
|
|
func RegisterGalleryServiceHandler(srv *server.Server, hdlr GalleryServiceHandler, opts ...server.ServiceOption) error {
|
|
return srv.Register(hdlr, &GalleryService_ServiceInfo, opts...)
|
|
}
|
|
|
|
func SetProviderGalleryService(srv common.RPCService) {
|
|
dubbo.SetProviderServiceWithInfo(srv, &GalleryService_ServiceInfo)
|
|
}
|
|
|
|
var GalleryService_ServiceInfo = server.ServiceInfo{
|
|
InterfaceName: "topfans.gallery.GalleryService",
|
|
ServiceType: (*GalleryServiceHandler)(nil),
|
|
Methods: []server.MethodInfo{
|
|
{
|
|
Name: "GetMyGallery",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetMyGalleryRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetMyGalleryRequest)
|
|
res, err := handler.(GalleryServiceHandler).GetMyGallery(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "GetUserGallery",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetUserGalleryRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetUserGalleryRequest)
|
|
res, err := handler.(GalleryServiceHandler).GetUserGallery(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "PlaceAsset",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(PlaceAssetRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*PlaceAssetRequest)
|
|
res, err := handler.(GalleryServiceHandler).PlaceAsset(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "UnlockSlot",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(UnlockSlotRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*UnlockSlotRequest)
|
|
res, err := handler.(GalleryServiceHandler).UnlockSlot(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "RemoveFromSlot",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(RemoveFromSlotRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*RemoveFromSlotRequest)
|
|
res, err := handler.(GalleryServiceHandler).RemoveFromSlot(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "GetMyExhibitedAssets",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetMyExhibitedAssetsRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetMyExhibitedAssetsRequest)
|
|
res, err := handler.(GalleryServiceHandler).GetMyExhibitedAssets(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "GetInspirationFlow",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetInspirationFlowRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetInspirationFlowRequest)
|
|
res, err := handler.(GalleryServiceHandler).GetInspirationFlow(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
},
|
|
}
|