312 lines
14 KiB
Go
312 lines
14 KiB
Go
// Code generated by protoc-gen-triple. DO NOT EDIT.
|
|
//
|
|
// Source: moderation.proto
|
|
package moderation
|
|
|
|
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 (
|
|
// ModerationServiceName is the fully-qualified name of the ModerationService service.
|
|
ModerationServiceName = "github.com.topfans.backend.pkg.proto.moderation.ModerationService"
|
|
)
|
|
|
|
// 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 (
|
|
// ModerationServiceGetReportCategoriesProcedure is the fully-qualified name of the ModerationService's GetReportCategories RPC.
|
|
ModerationServiceGetReportCategoriesProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/GetReportCategories"
|
|
// ModerationServiceGetFeedbackCategoriesProcedure is the fully-qualified name of the ModerationService's GetFeedbackCategories RPC.
|
|
ModerationServiceGetFeedbackCategoriesProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/GetFeedbackCategories"
|
|
// ModerationServiceSubmitReportProcedure is the fully-qualified name of the ModerationService's SubmitReport RPC.
|
|
ModerationServiceSubmitReportProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/SubmitReport"
|
|
// ModerationServiceListMyReportsProcedure is the fully-qualified name of the ModerationService's ListMyReports RPC.
|
|
ModerationServiceListMyReportsProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/ListMyReports"
|
|
// ModerationServiceGetReportProcedure is the fully-qualified name of the ModerationService's GetReport RPC.
|
|
ModerationServiceGetReportProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/GetReport"
|
|
// ModerationServiceSubmitFeedbackProcedure is the fully-qualified name of the ModerationService's SubmitFeedback RPC.
|
|
ModerationServiceSubmitFeedbackProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/SubmitFeedback"
|
|
// ModerationServiceListMyFeedbacksProcedure is the fully-qualified name of the ModerationService's ListMyFeedbacks RPC.
|
|
ModerationServiceListMyFeedbacksProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/ListMyFeedbacks"
|
|
// ModerationServiceGetFeedbackProcedure is the fully-qualified name of the ModerationService's GetFeedback RPC.
|
|
ModerationServiceGetFeedbackProcedure = "/github.com.topfans.backend.pkg.proto.moderation.ModerationService/GetFeedback"
|
|
)
|
|
|
|
var (
|
|
_ ModerationService = (*ModerationServiceImpl)(nil)
|
|
)
|
|
|
|
// ModerationService is a client for the github.com.topfans.backend.pkg.proto.moderation.ModerationService service.
|
|
type ModerationService interface {
|
|
GetReportCategories(ctx context.Context, req *GetReportCategoriesRequest, opts ...client.CallOption) (*GetReportCategoriesResponse, error)
|
|
GetFeedbackCategories(ctx context.Context, req *GetFeedbackCategoriesRequest, opts ...client.CallOption) (*GetFeedbackCategoriesResponse, error)
|
|
SubmitReport(ctx context.Context, req *SubmitReportRequest, opts ...client.CallOption) (*SubmitReportResponse, error)
|
|
ListMyReports(ctx context.Context, req *ListMyReportsRequest, opts ...client.CallOption) (*ListMyReportsResponse, error)
|
|
GetReport(ctx context.Context, req *GetReportRequest, opts ...client.CallOption) (*GetReportResponse, error)
|
|
SubmitFeedback(ctx context.Context, req *SubmitFeedbackRequest, opts ...client.CallOption) (*SubmitFeedbackResponse, error)
|
|
ListMyFeedbacks(ctx context.Context, req *ListMyFeedbacksRequest, opts ...client.CallOption) (*ListMyFeedbacksResponse, error)
|
|
GetFeedback(ctx context.Context, req *GetFeedbackRequest, opts ...client.CallOption) (*GetFeedbackResponse, error)
|
|
}
|
|
|
|
// NewModerationService constructs a client for the moderation.ModerationService service.
|
|
func NewModerationService(cli *client.Client, opts ...client.ReferenceOption) (ModerationService, error) {
|
|
conn, err := cli.DialWithInfo("github.com.topfans.backend.pkg.proto.moderation.ModerationService", &ModerationService_ClientInfo, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &ModerationServiceImpl{
|
|
conn: conn,
|
|
}, nil
|
|
}
|
|
|
|
func SetConsumerModerationService(srv common.RPCService) {
|
|
dubbo.SetConsumerServiceWithInfo(srv, &ModerationService_ClientInfo)
|
|
}
|
|
|
|
// ModerationServiceImpl implements ModerationService.
|
|
type ModerationServiceImpl struct {
|
|
conn *client.Connection
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) GetReportCategories(ctx context.Context, req *GetReportCategoriesRequest, opts ...client.CallOption) (*GetReportCategoriesResponse, error) {
|
|
resp := new(GetReportCategoriesResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetReportCategories", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) GetFeedbackCategories(ctx context.Context, req *GetFeedbackCategoriesRequest, opts ...client.CallOption) (*GetFeedbackCategoriesResponse, error) {
|
|
resp := new(GetFeedbackCategoriesResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetFeedbackCategories", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) SubmitReport(ctx context.Context, req *SubmitReportRequest, opts ...client.CallOption) (*SubmitReportResponse, error) {
|
|
resp := new(SubmitReportResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "SubmitReport", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) ListMyReports(ctx context.Context, req *ListMyReportsRequest, opts ...client.CallOption) (*ListMyReportsResponse, error) {
|
|
resp := new(ListMyReportsResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "ListMyReports", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) GetReport(ctx context.Context, req *GetReportRequest, opts ...client.CallOption) (*GetReportResponse, error) {
|
|
resp := new(GetReportResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetReport", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) SubmitFeedback(ctx context.Context, req *SubmitFeedbackRequest, opts ...client.CallOption) (*SubmitFeedbackResponse, error) {
|
|
resp := new(SubmitFeedbackResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "SubmitFeedback", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) ListMyFeedbacks(ctx context.Context, req *ListMyFeedbacksRequest, opts ...client.CallOption) (*ListMyFeedbacksResponse, error) {
|
|
resp := new(ListMyFeedbacksResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "ListMyFeedbacks", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
func (c *ModerationServiceImpl) GetFeedback(ctx context.Context, req *GetFeedbackRequest, opts ...client.CallOption) (*GetFeedbackResponse, error) {
|
|
resp := new(GetFeedbackResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetFeedback", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
var ModerationService_ClientInfo = client.ClientInfo{
|
|
InterfaceName: "github.com.topfans.backend.pkg.proto.moderation.ModerationService",
|
|
MethodNames: []string{"GetReportCategories", "GetFeedbackCategories", "SubmitReport", "ListMyReports", "GetReport", "SubmitFeedback", "ListMyFeedbacks", "GetFeedback"},
|
|
ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) {
|
|
dubboCli := dubboCliRaw.(*ModerationServiceImpl)
|
|
dubboCli.conn = conn
|
|
},
|
|
}
|
|
|
|
// ModerationServiceHandler is an implementation of the github.com.topfans.backend.pkg.proto.moderation.ModerationService service.
|
|
type ModerationServiceHandler interface {
|
|
GetReportCategories(context.Context, *GetReportCategoriesRequest) (*GetReportCategoriesResponse, error)
|
|
GetFeedbackCategories(context.Context, *GetFeedbackCategoriesRequest) (*GetFeedbackCategoriesResponse, error)
|
|
SubmitReport(context.Context, *SubmitReportRequest) (*SubmitReportResponse, error)
|
|
ListMyReports(context.Context, *ListMyReportsRequest) (*ListMyReportsResponse, error)
|
|
GetReport(context.Context, *GetReportRequest) (*GetReportResponse, error)
|
|
SubmitFeedback(context.Context, *SubmitFeedbackRequest) (*SubmitFeedbackResponse, error)
|
|
ListMyFeedbacks(context.Context, *ListMyFeedbacksRequest) (*ListMyFeedbacksResponse, error)
|
|
GetFeedback(context.Context, *GetFeedbackRequest) (*GetFeedbackResponse, error)
|
|
}
|
|
|
|
func RegisterModerationServiceHandler(srv *server.Server, hdlr ModerationServiceHandler, opts ...server.ServiceOption) error {
|
|
return srv.Register(hdlr, &ModerationService_ServiceInfo, opts...)
|
|
}
|
|
|
|
func SetProviderModerationService(srv common.RPCService) {
|
|
dubbo.SetProviderServiceWithInfo(srv, &ModerationService_ServiceInfo)
|
|
}
|
|
|
|
var ModerationService_ServiceInfo = server.ServiceInfo{
|
|
InterfaceName: "github.com.topfans.backend.pkg.proto.moderation.ModerationService",
|
|
ServiceType: (*ModerationServiceHandler)(nil),
|
|
Methods: []server.MethodInfo{
|
|
{
|
|
Name: "GetReportCategories",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetReportCategoriesRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetReportCategoriesRequest)
|
|
res, err := handler.(ModerationServiceHandler).GetReportCategories(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "GetFeedbackCategories",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetFeedbackCategoriesRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetFeedbackCategoriesRequest)
|
|
res, err := handler.(ModerationServiceHandler).GetFeedbackCategories(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "SubmitReport",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(SubmitReportRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*SubmitReportRequest)
|
|
res, err := handler.(ModerationServiceHandler).SubmitReport(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "ListMyReports",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(ListMyReportsRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*ListMyReportsRequest)
|
|
res, err := handler.(ModerationServiceHandler).ListMyReports(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "GetReport",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetReportRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetReportRequest)
|
|
res, err := handler.(ModerationServiceHandler).GetReport(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "SubmitFeedback",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(SubmitFeedbackRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*SubmitFeedbackRequest)
|
|
res, err := handler.(ModerationServiceHandler).SubmitFeedback(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "ListMyFeedbacks",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(ListMyFeedbacksRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*ListMyFeedbacksRequest)
|
|
res, err := handler.(ModerationServiceHandler).ListMyFeedbacks(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
{
|
|
Name: "GetFeedback",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetFeedbackRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetFeedbackRequest)
|
|
res, err := handler.(ModerationServiceHandler).GetFeedback(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
},
|
|
}
|