float62 32 格式化为两位
This commit is contained in:
@@ -0,0 +1,418 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v4.25.8
|
||||
// source: task/task.proto
|
||||
|
||||
package task
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Response struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||
Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Response) Reset() {
|
||||
*x = Response{}
|
||||
mi := &file_task_task_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Response) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Response) ProtoMessage() {}
|
||||
|
||||
func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
|
||||
func (*Response) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Response) GetCode() int32 {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Response) GetMsg() string {
|
||||
if x != nil {
|
||||
return x.Msg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Response) GetData() string {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type EmtpyRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EmtpyRequest) Reset() {
|
||||
*x = EmtpyRequest{}
|
||||
mi := &file_task_task_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EmtpyRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EmtpyRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EmtpyRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EmtpyRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EmtpyRequest) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type EditRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
|
||||
Time int32 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"`
|
||||
Province int64 `protobuf:"varint,4,opt,name=province,proto3" json:"province,omitempty"`
|
||||
ProvinceName string `protobuf:"bytes,5,opt,name=province_name,json=provinceName,proto3" json:"province_name,omitempty"`
|
||||
Task string `protobuf:"bytes,6,opt,name=task,proto3" json:"task,omitempty"`
|
||||
Award string `protobuf:"bytes,7,opt,name=award,proto3" json:"award,omitempty"`
|
||||
ProductId int64 `protobuf:"varint,8,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EditRequest) Reset() {
|
||||
*x = EditRequest{}
|
||||
mi := &file_task_task_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EditRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EditRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EditRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EditRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EditRequest) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetType() int32 {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetTime() int32 {
|
||||
if x != nil {
|
||||
return x.Time
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetProvince() int64 {
|
||||
if x != nil {
|
||||
return x.Province
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetProvinceName() string {
|
||||
if x != nil {
|
||||
return x.ProvinceName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetTask() string {
|
||||
if x != nil {
|
||||
return x.Task
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetAward() string {
|
||||
if x != nil {
|
||||
return x.Award
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EditRequest) GetProductId() int64 {
|
||||
if x != nil {
|
||||
return x.ProductId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type IdRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *IdRequest) Reset() {
|
||||
*x = IdRequest{}
|
||||
mi := &file_task_task_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *IdRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IdRequest) ProtoMessage() {}
|
||||
|
||||
func (x *IdRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IdRequest.ProtoReflect.Descriptor instead.
|
||||
func (*IdRequest) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *IdRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type StatusRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
|
||||
Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StatusRequest) Reset() {
|
||||
*x = StatusRequest{}
|
||||
mi := &file_task_task_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StatusRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatusRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StatusRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_task_task_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StatusRequest) Descriptor() ([]byte, []int) {
|
||||
return file_task_task_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *StatusRequest) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StatusRequest) GetStatus() int32 {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *StatusRequest) GetReason() string {
|
||||
if x != nil {
|
||||
return x.Reason
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_task_task_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_task_task_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x0ftask/task.proto\x12\x04task\x1a\x1cgoogle/api/annotations.proto\"D\n" +
|
||||
"\bResponse\x12\x12\n" +
|
||||
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x10\n" +
|
||||
"\x03msg\x18\x02 \x01(\tR\x03msg\x12\x12\n" +
|
||||
"\x04data\x18\x03 \x01(\tR\x04data\"\x0e\n" +
|
||||
"\fEmtpyRequest\"\xcf\x01\n" +
|
||||
"\vEditRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" +
|
||||
"\x04type\x18\x02 \x01(\x05R\x04type\x12\x12\n" +
|
||||
"\x04time\x18\x03 \x01(\x05R\x04time\x12\x1a\n" +
|
||||
"\bprovince\x18\x04 \x01(\x03R\bprovince\x12#\n" +
|
||||
"\rprovince_name\x18\x05 \x01(\tR\fprovinceName\x12\x12\n" +
|
||||
"\x04task\x18\x06 \x01(\tR\x04task\x12\x14\n" +
|
||||
"\x05award\x18\a \x01(\tR\x05award\x12\x1d\n" +
|
||||
"\n" +
|
||||
"product_id\x18\b \x01(\x03R\tproductId\"\x1b\n" +
|
||||
"\tIdRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\"O\n" +
|
||||
"\rStatusRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x16\n" +
|
||||
"\x06status\x18\x02 \x01(\x05R\x06status\x12\x16\n" +
|
||||
"\x06reason\x18\x03 \x01(\tR\x06reason2\x88\x03\n" +
|
||||
"\x04Task\x12L\n" +
|
||||
"\x05Items\x12\x12.task.EmtpyRequest\x1a\x0e.task.Response\"\x1f\x82\xd3\xe4\x93\x02\x19:\x01*\x12\x14/admin/v3/task/items\x12G\n" +
|
||||
"\x04Info\x12\x0f.task.IdRequest\x1a\x0e.task.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\x12\x13/admin/v3/task/info\x12M\n" +
|
||||
"\x06Create\x12\x11.task.EditRequest\x1a\x0e.task.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/admin/v3/task/create\x12I\n" +
|
||||
"\x04Edit\x12\x11.task.EditRequest\x1a\x0e.task.Response\"\x1e\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/admin/v3/task/edit\x12O\n" +
|
||||
"\x06Status\x12\x13.task.StatusRequest\x1a\x0e.task.Response\" \x82\xd3\xe4\x93\x02\x1a:\x01*\"\x15/admin/v3/task/statusB\bZ\x06./taskb\x06proto3"
|
||||
|
||||
var (
|
||||
file_task_task_proto_rawDescOnce sync.Once
|
||||
file_task_task_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_task_task_proto_rawDescGZIP() []byte {
|
||||
file_task_task_proto_rawDescOnce.Do(func() {
|
||||
file_task_task_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_task_task_proto_rawDesc), len(file_task_task_proto_rawDesc)))
|
||||
})
|
||||
return file_task_task_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_task_task_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_task_task_proto_goTypes = []any{
|
||||
(*Response)(nil), // 0: task.Response
|
||||
(*EmtpyRequest)(nil), // 1: task.EmtpyRequest
|
||||
(*EditRequest)(nil), // 2: task.EditRequest
|
||||
(*IdRequest)(nil), // 3: task.IdRequest
|
||||
(*StatusRequest)(nil), // 4: task.StatusRequest
|
||||
}
|
||||
var file_task_task_proto_depIdxs = []int32{
|
||||
1, // 0: task.Task.Items:input_type -> task.EmtpyRequest
|
||||
3, // 1: task.Task.Info:input_type -> task.IdRequest
|
||||
2, // 2: task.Task.Create:input_type -> task.EditRequest
|
||||
2, // 3: task.Task.Edit:input_type -> task.EditRequest
|
||||
4, // 4: task.Task.Status:input_type -> task.StatusRequest
|
||||
0, // 5: task.Task.Items:output_type -> task.Response
|
||||
0, // 6: task.Task.Info:output_type -> task.Response
|
||||
0, // 7: task.Task.Create:output_type -> task.Response
|
||||
0, // 8: task.Task.Edit:output_type -> task.Response
|
||||
0, // 9: task.Task.Status:output_type -> task.Response
|
||||
5, // [5:10] is the sub-list for method output_type
|
||||
0, // [0:5] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_task_task_proto_init() }
|
||||
func file_task_task_proto_init() {
|
||||
if File_task_task_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_task_task_proto_rawDesc), len(file_task_task_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_task_task_proto_goTypes,
|
||||
DependencyIndexes: file_task_task_proto_depIdxs,
|
||||
MessageInfos: file_task_task_proto_msgTypes,
|
||||
}.Build()
|
||||
File_task_task_proto = out.File
|
||||
file_task_task_proto_goTypes = nil
|
||||
file_task_task_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v4.25.8
|
||||
// source: task/task.proto
|
||||
|
||||
package task
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Task_Items_FullMethodName = "/task.Task/Items"
|
||||
Task_Info_FullMethodName = "/task.Task/Info"
|
||||
Task_Create_FullMethodName = "/task.Task/Create"
|
||||
Task_Edit_FullMethodName = "/task.Task/Edit"
|
||||
Task_Status_FullMethodName = "/task.Task/Status"
|
||||
)
|
||||
|
||||
// TaskClient is the client API for Task 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 TaskClient interface {
|
||||
Items(ctx context.Context, in *EmtpyRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Info(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Create(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Edit(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type taskClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewTaskClient(cc grpc.ClientConnInterface) TaskClient {
|
||||
return &taskClient{cc}
|
||||
}
|
||||
|
||||
func (c *taskClient) Items(ctx context.Context, in *EmtpyRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Task_Items_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskClient) Info(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Task_Info_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskClient) Create(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Task_Create_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskClient) Edit(ctx context.Context, in *EditRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Task_Edit_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *taskClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Task_Status_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// TaskServer is the server API for Task service.
|
||||
// All implementations must embed UnimplementedTaskServer
|
||||
// for forward compatibility.
|
||||
type TaskServer interface {
|
||||
Items(context.Context, *EmtpyRequest) (*Response, error)
|
||||
Info(context.Context, *IdRequest) (*Response, error)
|
||||
Create(context.Context, *EditRequest) (*Response, error)
|
||||
Edit(context.Context, *EditRequest) (*Response, error)
|
||||
Status(context.Context, *StatusRequest) (*Response, error)
|
||||
mustEmbedUnimplementedTaskServer()
|
||||
}
|
||||
|
||||
// UnimplementedTaskServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedTaskServer struct{}
|
||||
|
||||
func (UnimplementedTaskServer) Items(context.Context, *EmtpyRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Items not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServer) Info(context.Context, *IdRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Info not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServer) Create(context.Context, *EditRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServer) Edit(context.Context, *EditRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Edit not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServer) Status(context.Context, *StatusRequest) (*Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Status not implemented")
|
||||
}
|
||||
func (UnimplementedTaskServer) mustEmbedUnimplementedTaskServer() {}
|
||||
func (UnimplementedTaskServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTaskServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TaskServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeTaskServer interface {
|
||||
mustEmbedUnimplementedTaskServer()
|
||||
}
|
||||
|
||||
func RegisterTaskServer(s grpc.ServiceRegistrar, srv TaskServer) {
|
||||
// If the following call panics, it indicates UnimplementedTaskServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Task_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Task_Items_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EmtpyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServer).Items(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Task_Items_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServer).Items(ctx, req.(*EmtpyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Task_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServer).Info(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Task_Info_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServer).Info(ctx, req.(*IdRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Task_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EditRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServer).Create(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Task_Create_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServer).Create(ctx, req.(*EditRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Task_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EditRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServer).Edit(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Task_Edit_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServer).Edit(ctx, req.(*EditRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Task_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(TaskServer).Status(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Task_Status_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TaskServer).Status(ctx, req.(*StatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Task_ServiceDesc is the grpc.ServiceDesc for Task service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Task_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "task.Task",
|
||||
HandlerType: (*TaskServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Items",
|
||||
Handler: _Task_Items_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Info",
|
||||
Handler: _Task_Info_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Create",
|
||||
Handler: _Task_Create_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Edit",
|
||||
Handler: _Task_Edit_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Status",
|
||||
Handler: _Task_Status_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "task/task.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user