Documentation ¶
Overview ¶
Package needyv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterNeedyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNeedyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NeedyServiceClient) error
- func RegisterNeedyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNeedyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NeedyServiceServer) error
- func RegisterNeedyServiceServer(s grpc.ServiceRegistrar, srv NeedyServiceServer)
- type GetStudentNeedyInfoResponse
- func (*GetStudentNeedyInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetStudentNeedyInfoResponse) GetData() *StudentNeedyInfo
- func (x *GetStudentNeedyInfoResponse) GetError() int32
- func (x *GetStudentNeedyInfoResponse) GetMsg() string
- func (*GetStudentNeedyInfoResponse) ProtoMessage()
- func (x *GetStudentNeedyInfoResponse) ProtoReflect() protoreflect.Message
- func (x *GetStudentNeedyInfoResponse) Reset()
- func (x *GetStudentNeedyInfoResponse) String() string
- type NeedyServiceClient
- type NeedyServiceServer
- type StudentNeedyInfo
- func (*StudentNeedyInfo) Descriptor() ([]byte, []int)deprecated
- func (x *StudentNeedyInfo) GetItems() []*StudentNeedyInfo_Nested
- func (x *StudentNeedyInfo) GetNeedyStudent() bool
- func (x *StudentNeedyInfo) GetSex() int32
- func (x *StudentNeedyInfo) GetStaffId() string
- func (x *StudentNeedyInfo) GetStaffName() string
- func (*StudentNeedyInfo) ProtoMessage()
- func (x *StudentNeedyInfo) ProtoReflect() protoreflect.Message
- func (x *StudentNeedyInfo) Reset()
- func (x *StudentNeedyInfo) String() string
- type StudentNeedyInfo_Nested
- func (*StudentNeedyInfo_Nested) Descriptor() ([]byte, []int)deprecated
- func (x *StudentNeedyInfo_Nested) GetNeedyStudent() bool
- func (x *StudentNeedyInfo_Nested) GetSchoolYear() int32
- func (*StudentNeedyInfo_Nested) ProtoMessage()
- func (x *StudentNeedyInfo_Nested) ProtoReflect() protoreflect.Message
- func (x *StudentNeedyInfo_Nested) Reset()
- func (x *StudentNeedyInfo_Nested) String() string
- type UnimplementedNeedyServiceServer
- type UnsafeNeedyServiceServer
Constants ¶
const (
NeedyService_GetStudentNeedyInfo_FullMethodName = "/campusapis.needy.v1.NeedyService/GetStudentNeedyInfo"
)
Variables ¶
var File_campusapis_needy_v1_needy_proto protoreflect.FileDescriptor
var NeedyService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "campusapis.needy.v1.NeedyService", HandlerType: (*NeedyServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetStudentNeedyInfo", Handler: _NeedyService_GetStudentNeedyInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "campusapis/needy/v1/needy.proto", }
NeedyService_ServiceDesc is the grpc.ServiceDesc for NeedyService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNeedyServiceHandler ¶
func RegisterNeedyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterNeedyServiceHandler registers the http handlers for service NeedyService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNeedyServiceHandlerClient ¶
func RegisterNeedyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NeedyServiceClient) error
RegisterNeedyServiceHandlerClient registers the http handlers for service NeedyService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NeedyServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NeedyServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NeedyServiceClient" to call the correct interceptors.
func RegisterNeedyServiceHandlerFromEndpoint ¶
func RegisterNeedyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNeedyServiceHandlerFromEndpoint is same as RegisterNeedyServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNeedyServiceHandlerServer ¶
func RegisterNeedyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NeedyServiceServer) error
RegisterNeedyServiceHandlerServer registers the http handlers for service NeedyService to "mux". UnaryRPC :call NeedyServiceServer 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 RegisterNeedyServiceHandlerFromEndpoint instead.
func RegisterNeedyServiceServer ¶
func RegisterNeedyServiceServer(s grpc.ServiceRegistrar, srv NeedyServiceServer)
Types ¶
type GetStudentNeedyInfoResponse ¶
type GetStudentNeedyInfoResponse struct { Error int32 `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Data *StudentNeedyInfo `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
查询贫困生信息返回体
func (*GetStudentNeedyInfoResponse) Descriptor
deprecated
func (*GetStudentNeedyInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetStudentNeedyInfoResponse.ProtoReflect.Descriptor instead.
func (*GetStudentNeedyInfoResponse) GetData ¶
func (x *GetStudentNeedyInfoResponse) GetData() *StudentNeedyInfo
func (*GetStudentNeedyInfoResponse) GetError ¶
func (x *GetStudentNeedyInfoResponse) GetError() int32
func (*GetStudentNeedyInfoResponse) GetMsg ¶
func (x *GetStudentNeedyInfoResponse) GetMsg() string
func (*GetStudentNeedyInfoResponse) ProtoMessage ¶
func (*GetStudentNeedyInfoResponse) ProtoMessage()
func (*GetStudentNeedyInfoResponse) ProtoReflect ¶
func (x *GetStudentNeedyInfoResponse) ProtoReflect() protoreflect.Message
func (*GetStudentNeedyInfoResponse) Reset ¶
func (x *GetStudentNeedyInfoResponse) Reset()
func (*GetStudentNeedyInfoResponse) String ¶
func (x *GetStudentNeedyInfoResponse) String() string
type NeedyServiceClient ¶
type NeedyServiceClient interface { // 获取学生贫困生申请记录 GetStudentNeedyInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetStudentNeedyInfoResponse, error) }
NeedyServiceClient is the client API for NeedyService 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.
func NewNeedyServiceClient ¶
func NewNeedyServiceClient(cc grpc.ClientConnInterface) NeedyServiceClient
type NeedyServiceServer ¶
type NeedyServiceServer interface { // 获取学生贫困生申请记录 GetStudentNeedyInfo(context.Context, *emptypb.Empty) (*GetStudentNeedyInfoResponse, error) // contains filtered or unexported methods }
NeedyServiceServer is the server API for NeedyService service. All implementations must embed UnimplementedNeedyServiceServer for forward compatibility
type StudentNeedyInfo ¶
type StudentNeedyInfo struct { // 学工号 StaffId string `protobuf:"bytes,1,opt,name=staffId,proto3" json:"staffId,omitempty"` // 姓名 StaffName string `protobuf:"bytes,2,opt,name=staffName,proto3" json:"staffName,omitempty"` // 性别,枚举及含义:1->男 | 2->女 Sex int32 `protobuf:"varint,3,opt,name=sex,proto3" json:"sex,omitempty"` // 是否贫困生 NeedyStudent bool `protobuf:"varint,4,opt,name=needyStudent,proto3" json:"needyStudent,omitempty"` // 每学年贫困详情 Items []*StudentNeedyInfo_Nested `protobuf:"bytes,5,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
贫困生信息
func (*StudentNeedyInfo) Descriptor
deprecated
func (*StudentNeedyInfo) Descriptor() ([]byte, []int)
Deprecated: Use StudentNeedyInfo.ProtoReflect.Descriptor instead.
func (*StudentNeedyInfo) GetItems ¶
func (x *StudentNeedyInfo) GetItems() []*StudentNeedyInfo_Nested
func (*StudentNeedyInfo) GetNeedyStudent ¶
func (x *StudentNeedyInfo) GetNeedyStudent() bool
func (*StudentNeedyInfo) GetSex ¶
func (x *StudentNeedyInfo) GetSex() int32
func (*StudentNeedyInfo) GetStaffId ¶
func (x *StudentNeedyInfo) GetStaffId() string
func (*StudentNeedyInfo) GetStaffName ¶
func (x *StudentNeedyInfo) GetStaffName() string
func (*StudentNeedyInfo) ProtoMessage ¶
func (*StudentNeedyInfo) ProtoMessage()
func (*StudentNeedyInfo) ProtoReflect ¶
func (x *StudentNeedyInfo) ProtoReflect() protoreflect.Message
func (*StudentNeedyInfo) Reset ¶
func (x *StudentNeedyInfo) Reset()
func (*StudentNeedyInfo) String ¶
func (x *StudentNeedyInfo) String() string
type StudentNeedyInfo_Nested ¶
type StudentNeedyInfo_Nested struct { // 特定学年 SchoolYear int32 `protobuf:"varint,1,opt,name=schoolYear,proto3" json:"schoolYear,omitempty"` // 是否是贫困生 NeedyStudent bool `protobuf:"varint,2,opt,name=needyStudent,proto3" json:"needyStudent,omitempty"` // contains filtered or unexported fields }
某年贫困详情
func (*StudentNeedyInfo_Nested) Descriptor
deprecated
func (*StudentNeedyInfo_Nested) Descriptor() ([]byte, []int)
Deprecated: Use StudentNeedyInfo_Nested.ProtoReflect.Descriptor instead.
func (*StudentNeedyInfo_Nested) GetNeedyStudent ¶
func (x *StudentNeedyInfo_Nested) GetNeedyStudent() bool
func (*StudentNeedyInfo_Nested) GetSchoolYear ¶
func (x *StudentNeedyInfo_Nested) GetSchoolYear() int32
func (*StudentNeedyInfo_Nested) ProtoMessage ¶
func (*StudentNeedyInfo_Nested) ProtoMessage()
func (*StudentNeedyInfo_Nested) ProtoReflect ¶
func (x *StudentNeedyInfo_Nested) ProtoReflect() protoreflect.Message
func (*StudentNeedyInfo_Nested) Reset ¶
func (x *StudentNeedyInfo_Nested) Reset()
func (*StudentNeedyInfo_Nested) String ¶
func (x *StudentNeedyInfo_Nested) String() string
type UnimplementedNeedyServiceServer ¶
type UnimplementedNeedyServiceServer struct { }
UnimplementedNeedyServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedNeedyServiceServer) GetStudentNeedyInfo ¶
func (UnimplementedNeedyServiceServer) GetStudentNeedyInfo(context.Context, *emptypb.Empty) (*GetStudentNeedyInfoResponse, error)
type UnsafeNeedyServiceServer ¶
type UnsafeNeedyServiceServer interface {
// contains filtered or unexported methods
}
UnsafeNeedyServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NeedyServiceServer will result in compilation errors.