thirdv1

package
v0.0.0-...-a9153d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package thirdv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	WeixiaoService_GetSchoolCardBalance_FullMethodName  = "/campusapis.third.v1.WeixiaoService/GetSchoolCardBalance"
	WeixiaoService_GetLibraryBorrow_FullMethodName      = "/campusapis.third.v1.WeixiaoService/GetLibraryBorrow"
	WeixiaoService_GetStudentCourse_FullMethodName      = "/campusapis.third.v1.WeixiaoService/GetStudentCourse"
	WeixiaoService_GetStudentCourseScore_FullMethodName = "/campusapis.third.v1.WeixiaoService/GetStudentCourseScore"
	WeixiaoService_GetStudentExam_FullMethodName        = "/campusapis.third.v1.WeixiaoService/GetStudentExam"
)

Variables

View Source
var File_campusapis_third_v1_weixiao_proto protoreflect.FileDescriptor
View Source
var WeixiaoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "campusapis.third.v1.WeixiaoService",
	HandlerType: (*WeixiaoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSchoolCardBalance",
			Handler:    _WeixiaoService_GetSchoolCardBalance_Handler,
		},
		{
			MethodName: "GetLibraryBorrow",
			Handler:    _WeixiaoService_GetLibraryBorrow_Handler,
		},
		{
			MethodName: "GetStudentCourse",
			Handler:    _WeixiaoService_GetStudentCourse_Handler,
		},
		{
			MethodName: "GetStudentCourseScore",
			Handler:    _WeixiaoService_GetStudentCourseScore_Handler,
		},
		{
			MethodName: "GetStudentExam",
			Handler:    _WeixiaoService_GetStudentExam_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "campusapis/third/v1/weixiao.proto",
}

WeixiaoService_ServiceDesc is the grpc.ServiceDesc for WeixiaoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterWeixiaoServiceHandler

func RegisterWeixiaoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterWeixiaoServiceHandler registers the http handlers for service WeixiaoService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterWeixiaoServiceHandlerClient

func RegisterWeixiaoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WeixiaoServiceClient) error

RegisterWeixiaoServiceHandlerClient registers the http handlers for service WeixiaoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WeixiaoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WeixiaoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WeixiaoServiceClient" to call the correct interceptors.

func RegisterWeixiaoServiceHandlerFromEndpoint

func RegisterWeixiaoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterWeixiaoServiceHandlerFromEndpoint is same as RegisterWeixiaoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterWeixiaoServiceHandlerServer

func RegisterWeixiaoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WeixiaoServiceServer) error

RegisterWeixiaoServiceHandlerServer registers the http handlers for service WeixiaoService to "mux". UnaryRPC :call WeixiaoServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWeixiaoServiceHandlerFromEndpoint instead.

func RegisterWeixiaoServiceServer

func RegisterWeixiaoServiceServer(s grpc.ServiceRegistrar, srv WeixiaoServiceServer)

Types

type CommonWeixiaoPostRequest

type CommonWeixiaoPostRequest struct {
	RawData string `protobuf:"bytes,1,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"`
	AppKey  string `protobuf:"bytes,2,opt,name=app_key,json=appKey,proto3" json:"app_key,omitempty"`
	// contains filtered or unexported fields
}

func (*CommonWeixiaoPostRequest) Descriptor deprecated

func (*CommonWeixiaoPostRequest) Descriptor() ([]byte, []int)

Deprecated: Use CommonWeixiaoPostRequest.ProtoReflect.Descriptor instead.

func (*CommonWeixiaoPostRequest) GetAppKey

func (x *CommonWeixiaoPostRequest) GetAppKey() string

func (*CommonWeixiaoPostRequest) GetRawData

func (x *CommonWeixiaoPostRequest) GetRawData() string

func (*CommonWeixiaoPostRequest) ProtoMessage

func (*CommonWeixiaoPostRequest) ProtoMessage()

func (*CommonWeixiaoPostRequest) ProtoReflect

func (x *CommonWeixiaoPostRequest) ProtoReflect() protoreflect.Message

func (*CommonWeixiaoPostRequest) Reset

func (x *CommonWeixiaoPostRequest) Reset()

func (*CommonWeixiaoPostRequest) String

func (x *CommonWeixiaoPostRequest) String() string

type CommonWeixiaoPostResponse

type CommonWeixiaoPostResponse struct {
	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	RawData string `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"`
	AppKey  string `protobuf:"bytes,4,opt,name=app_key,json=appKey,proto3" json:"app_key,omitempty"`
	// contains filtered or unexported fields
}

func (*CommonWeixiaoPostResponse) Descriptor deprecated

func (*CommonWeixiaoPostResponse) Descriptor() ([]byte, []int)

Deprecated: Use CommonWeixiaoPostResponse.ProtoReflect.Descriptor instead.

func (*CommonWeixiaoPostResponse) GetAppKey

func (x *CommonWeixiaoPostResponse) GetAppKey() string

func (*CommonWeixiaoPostResponse) GetCode

func (x *CommonWeixiaoPostResponse) GetCode() int32

func (*CommonWeixiaoPostResponse) GetMessage

func (x *CommonWeixiaoPostResponse) GetMessage() string

func (*CommonWeixiaoPostResponse) GetRawData

func (x *CommonWeixiaoPostResponse) GetRawData() string

func (*CommonWeixiaoPostResponse) ProtoMessage

func (*CommonWeixiaoPostResponse) ProtoMessage()

func (*CommonWeixiaoPostResponse) ProtoReflect

func (*CommonWeixiaoPostResponse) Reset

func (x *CommonWeixiaoPostResponse) Reset()

func (*CommonWeixiaoPostResponse) String

func (x *CommonWeixiaoPostResponse) String() string

type UnimplementedWeixiaoServiceServer

type UnimplementedWeixiaoServiceServer struct {
}

UnimplementedWeixiaoServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedWeixiaoServiceServer) GetLibraryBorrow

func (UnimplementedWeixiaoServiceServer) GetSchoolCardBalance

func (UnimplementedWeixiaoServiceServer) GetStudentCourse

func (UnimplementedWeixiaoServiceServer) GetStudentCourseScore

func (UnimplementedWeixiaoServiceServer) GetStudentExam

type UnsafeWeixiaoServiceServer

type UnsafeWeixiaoServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeWeixiaoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WeixiaoServiceServer will result in compilation errors.

type WeixiaoServiceClient

type WeixiaoServiceClient interface {
	// 用户校园卡面余额字段同步
	// https://wiki.weixiao.qq.com/api/school/balance.html
	GetSchoolCardBalance(ctx context.Context, in *CommonWeixiaoPostRequest, opts ...grpc.CallOption) (*CommonWeixiaoPostResponse, error)
	// 用户校园卡面借书字段同步
	// https://wiki.weixiao.qq.com/api/school/borrow.html
	GetLibraryBorrow(ctx context.Context, in *CommonWeixiaoPostRequest, opts ...grpc.CallOption) (*CommonWeixiaoPostResponse, error)
	// 查课表Pro数据同步
	// https://wiki.weixiao.qq.com/api/school/course.html
	GetStudentCourse(ctx context.Context, in *CommonWeixiaoPostRequest, opts ...grpc.CallOption) (*CommonWeixiaoPostResponse, error)
	// 查成绩Pro数据同步
	// https://wiki.weixiao.qq.com/api/school/courseScore.html
	GetStudentCourseScore(ctx context.Context, in *CommonWeixiaoPostRequest, opts ...grpc.CallOption) (*CommonWeixiaoPostResponse, error)
	// 查考试数据同步
	// https://wiki.weixiao.qq.com/api/school/checkExam.html
	GetStudentExam(ctx context.Context, in *CommonWeixiaoPostRequest, opts ...grpc.CallOption) (*CommonWeixiaoPostResponse, error)
}

WeixiaoServiceClient is the client API for WeixiaoService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type WeixiaoServiceServer

type WeixiaoServiceServer interface {
	// 用户校园卡面余额字段同步
	// https://wiki.weixiao.qq.com/api/school/balance.html
	GetSchoolCardBalance(context.Context, *CommonWeixiaoPostRequest) (*CommonWeixiaoPostResponse, error)
	// 用户校园卡面借书字段同步
	// https://wiki.weixiao.qq.com/api/school/borrow.html
	GetLibraryBorrow(context.Context, *CommonWeixiaoPostRequest) (*CommonWeixiaoPostResponse, error)
	// 查课表Pro数据同步
	// https://wiki.weixiao.qq.com/api/school/course.html
	GetStudentCourse(context.Context, *CommonWeixiaoPostRequest) (*CommonWeixiaoPostResponse, error)
	// 查成绩Pro数据同步
	// https://wiki.weixiao.qq.com/api/school/courseScore.html
	GetStudentCourseScore(context.Context, *CommonWeixiaoPostRequest) (*CommonWeixiaoPostResponse, error)
	// 查考试数据同步
	// https://wiki.weixiao.qq.com/api/school/checkExam.html
	GetStudentExam(context.Context, *CommonWeixiaoPostRequest) (*CommonWeixiaoPostResponse, error)
	// contains filtered or unexported methods
}

WeixiaoServiceServer is the server API for WeixiaoService service. All implementations must embed UnimplementedWeixiaoServiceServer for forward compatibility

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL