diff --git a/api/governance/governance.pb.go b/api/governance/governance.pb.go new file mode 100644 index 0000000..b37a54d --- /dev/null +++ b/api/governance/governance.pb.go @@ -0,0 +1,966 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.1 +// protoc v3.20.3 +// source: governance.proto + +package governance + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` + Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + UpdatedAt int64 `protobuf:"varint,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` + Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator,omitempty"` + OperatorId int32 `protobuf:"varint,8,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *Item) Reset() { + *x = Item{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Item) ProtoMessage() {} + +func (x *Item) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Item.ProtoReflect.Descriptor instead. +func (*Item) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{0} +} + +func (x *Item) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Item) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Item) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +func (x *Item) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *Item) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *Item) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *Item) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *Item) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` // 1 下架 2 上架 + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=pageSize,proto3" json:"pageSize,omitempty"` +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{1} +} + +func (x *ListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Data []*Item `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *ListResp) Reset() { + *x = ListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResp) ProtoMessage() {} + +func (x *ListResp) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResp.ProtoReflect.Descriptor instead. +func (*ListResp) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{2} +} + +func (x *ListResp) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *ListResp) GetData() []*Item { + if x != nil { + return x.Data + } + return nil +} + +type DeleteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteReq) Reset() { + *x = DeleteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteReq) ProtoMessage() {} + +func (x *DeleteReq) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteReq.ProtoReflect.Descriptor instead. +func (*DeleteReq) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteReq) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +type DeleteResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteResp) Reset() { + *x = DeleteResp{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResp) ProtoMessage() {} + +func (x *DeleteResp) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResp.ProtoReflect.Descriptor instead. +func (*DeleteResp) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{4} +} + +type EditReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` + Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + Operator string `protobuf:"bytes,6,opt,name=operator,proto3" json:"operator,omitempty"` + OperatorId int32 `protobuf:"varint,7,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *EditReq) Reset() { + *x = EditReq{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EditReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditReq) ProtoMessage() {} + +func (x *EditReq) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditReq.ProtoReflect.Descriptor instead. +func (*EditReq) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{5} +} + +func (x *EditReq) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *EditReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *EditReq) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +func (x *EditReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *EditReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *EditReq) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *EditReq) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type EditResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EditResp) Reset() { + *x = EditResp{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EditResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditResp) ProtoMessage() {} + +func (x *EditResp) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditResp.ProtoReflect.Descriptor instead. +func (*EditResp) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{6} +} + +type CreateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Sort uint32 `protobuf:"varint,2,opt,name=sort,proto3" json:"sort,omitempty"` + Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + Operator string `protobuf:"bytes,5,opt,name=operator,proto3" json:"operator,omitempty"` + OperatorId int32 `protobuf:"varint,6,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *CreateReq) Reset() { + *x = CreateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateReq) ProtoMessage() {} + +func (x *CreateReq) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateReq.ProtoReflect.Descriptor instead. +func (*CreateReq) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreateReq) GetSort() uint32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *CreateReq) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +func (x *CreateReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *CreateReq) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *CreateReq) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type CreateResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateResp) Reset() { + *x = CreateResp{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResp) ProtoMessage() {} + +func (x *CreateResp) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResp.ProtoReflect.Descriptor instead. +func (*CreateResp) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{8} +} + +type DisplayReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DisplayReq) Reset() { + *x = DisplayReq{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisplayReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisplayReq) ProtoMessage() {} + +func (x *DisplayReq) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisplayReq.ProtoReflect.Descriptor instead. +func (*DisplayReq) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{9} +} + +type DisplayResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*Item `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *DisplayResp) Reset() { + *x = DisplayResp{} + if protoimpl.UnsafeEnabled { + mi := &file_governance_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisplayResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisplayResp) ProtoMessage() {} + +func (x *DisplayResp) ProtoReflect() protoreflect.Message { + mi := &file_governance_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisplayResp.ProtoReflect.Descriptor instead. +func (*DisplayResp) Descriptor() ([]byte, []int) { + return file_governance_proto_rawDescGZIP(), []int{10} +} + +func (x *DisplayResp) GetData() []*Item { + if x != nil { + return x.Data + } + return nil +} + +var File_governance_proto protoreflect.FileDescriptor + +var file_governance_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xd2, + 0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x46, 0x0a, 0x08, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x24, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x1b, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, + 0xb7, 0x01, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x0a, 0x0a, 0x08, 0x45, 0x64, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xa9, 0x01, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x0c, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x22, 0x33, 0x0a, + 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x76, + 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x32, 0xaa, 0x02, 0x0a, 0x0a, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x67, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, + 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x33, 0x0a, 0x04, 0x45, 0x64, 0x69, 0x74, 0x12, 0x13, 0x2e, 0x67, 0x6f, 0x76, 0x65, + 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, + 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x45, 0x64, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, + 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x00, 0x12, 0x3c, 0x0a, 0x07, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, + 0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, + 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x3b, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_governance_proto_rawDescOnce sync.Once + file_governance_proto_rawDescData = file_governance_proto_rawDesc +) + +func file_governance_proto_rawDescGZIP() []byte { + file_governance_proto_rawDescOnce.Do(func() { + file_governance_proto_rawDescData = protoimpl.X.CompressGZIP(file_governance_proto_rawDescData) + }) + return file_governance_proto_rawDescData +} + +var file_governance_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_governance_proto_goTypes = []interface{}{ + (*Item)(nil), // 0: governance.Item + (*ListReq)(nil), // 1: governance.ListReq + (*ListResp)(nil), // 2: governance.ListResp + (*DeleteReq)(nil), // 3: governance.DeleteReq + (*DeleteResp)(nil), // 4: governance.DeleteResp + (*EditReq)(nil), // 5: governance.EditReq + (*EditResp)(nil), // 6: governance.EditResp + (*CreateReq)(nil), // 7: governance.CreateReq + (*CreateResp)(nil), // 8: governance.CreateResp + (*DisplayReq)(nil), // 9: governance.DisplayReq + (*DisplayResp)(nil), // 10: governance.DisplayResp +} +var file_governance_proto_depIdxs = []int32{ + 0, // 0: governance.ListResp.data:type_name -> governance.Item + 0, // 1: governance.DisplayResp.data:type_name -> governance.Item + 1, // 2: governance.Governance.List:input_type -> governance.ListReq + 3, // 3: governance.Governance.Delete:input_type -> governance.DeleteReq + 5, // 4: governance.Governance.Edit:input_type -> governance.EditReq + 7, // 5: governance.Governance.Create:input_type -> governance.CreateReq + 9, // 6: governance.Governance.Display:input_type -> governance.DisplayReq + 2, // 7: governance.Governance.List:output_type -> governance.ListResp + 4, // 8: governance.Governance.Delete:output_type -> governance.DeleteResp + 6, // 9: governance.Governance.Edit:output_type -> governance.EditResp + 8, // 10: governance.Governance.Create:output_type -> governance.CreateResp + 10, // 11: governance.Governance.Display:output_type -> governance.DisplayResp + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_governance_proto_init() } +func file_governance_proto_init() { + if File_governance_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_governance_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EditReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EditResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisplayReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_governance_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisplayResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_governance_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_governance_proto_goTypes, + DependencyIndexes: file_governance_proto_depIdxs, + MessageInfos: file_governance_proto_msgTypes, + }.Build() + File_governance_proto = out.File + file_governance_proto_rawDesc = nil + file_governance_proto_goTypes = nil + file_governance_proto_depIdxs = nil +} diff --git a/api/governance/governance.proto b/api/governance/governance.proto new file mode 100644 index 0000000..796bc3b --- /dev/null +++ b/api/governance/governance.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package governance; +//import "descriptor.proto"; +//import "validator.proto"; + +option go_package = "./;governance"; + +service Governance{ + rpc List(ListReq) returns (ListResp) {} + rpc Delete(DeleteReq) returns (DeleteResp) {} + rpc Edit(EditReq) returns (EditResp) {} + rpc Create(CreateReq) returns (CreateResp) {} + rpc Display(DisplayReq) returns (DisplayResp) {} +} + +message Item{ + int32 id = 1; + string title = 2; + string attachment = 3; + int32 sort = 4; + int32 status = 5; + int64 updatedAt = 6; + string operator = 7; + int32 operatorId = 8; +} + +message ListReq{ + string title = 1; + int32 status = 2; // 1 下架 2 上架 + int32 page = 3; + int32 pageSize = 4; +} + +message ListResp{ + int32 total = 1; + repeated Item data =2; +} + +message DeleteReq{ + int32 id = 1; +} + +message DeleteResp{ +} + +message EditReq{ + uint32 id = 1; + string title = 2; + string attachment = 3; + int32 sort = 4; + int32 status = 5; + string operator = 6; + int32 operatorId = 7; +} + +message EditResp{ +} + +message CreateReq{ + string title = 1; + uint32 sort = 2; + string attachment = 3; + int32 status = 4; + string operator = 5; + int32 operatorId = 6; +} + +message CreateResp{ + +} + +message DisplayReq{ + +} + +message DisplayResp{ + repeated Item data = 1; +} \ No newline at end of file diff --git a/api/governance/governance.validator.pb.go b/api/governance/governance.validator.pb.go new file mode 100644 index 0000000..a8c0c3f --- /dev/null +++ b/api/governance/governance.validator.pb.go @@ -0,0 +1,64 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: governance.proto + +package governance + +import ( + fmt "fmt" + math "math" + proto "github.com/golang/protobuf/proto" + github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func (this *Item) Validate() error { + return nil +} +func (this *ListReq) Validate() error { + return nil +} +func (this *ListResp) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *DeleteReq) Validate() error { + return nil +} +func (this *DeleteResp) Validate() error { + return nil +} +func (this *EditReq) Validate() error { + return nil +} +func (this *EditResp) Validate() error { + return nil +} +func (this *CreateReq) Validate() error { + return nil +} +func (this *CreateResp) Validate() error { + return nil +} +func (this *DisplayReq) Validate() error { + return nil +} +func (this *DisplayResp) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} diff --git a/api/governance/governance_triple.pb.go b/api/governance/governance_triple.pb.go new file mode 100644 index 0000000..df07aa0 --- /dev/null +++ b/api/governance/governance_triple.pb.go @@ -0,0 +1,327 @@ +// Code generated by protoc-gen-go-triple. DO NOT EDIT. +// versions: +// - protoc-gen-go-triple v1.0.8 +// - protoc v3.20.3 +// source: governance.proto + +package governance + +import ( + context "context" + protocol "dubbo.apache.org/dubbo-go/v3/protocol" + dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3" + invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation" + grpc_go "github.com/dubbogo/grpc-go" + codes "github.com/dubbogo/grpc-go/codes" + metadata "github.com/dubbogo/grpc-go/metadata" + status "github.com/dubbogo/grpc-go/status" + common "github.com/dubbogo/triple/pkg/common" + constant "github.com/dubbogo/triple/pkg/common/constant" + triple "github.com/dubbogo/triple/pkg/triple" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc_go.SupportPackageIsVersion7 + +// GovernanceClient is the client API for Governance 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 GovernanceClient interface { + List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) + Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) + Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) + Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) + Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) +} + +type governanceClient struct { + cc *triple.TripleConn +} + +type GovernanceClientImpl struct { + List func(ctx context.Context, in *ListReq) (*ListResp, error) + Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error) + Edit func(ctx context.Context, in *EditReq) (*EditResp, error) + Create func(ctx context.Context, in *CreateReq) (*CreateResp, error) + Display func(ctx context.Context, in *DisplayReq) (*DisplayResp, error) +} + +func (c *GovernanceClientImpl) GetDubboStub(cc *triple.TripleConn) GovernanceClient { + return NewGovernanceClient(cc) +} + +func (c *GovernanceClientImpl) XXX_InterfaceName() string { + return "governance.Governance" +} + +func NewGovernanceClient(cc *triple.TripleConn) GovernanceClient { + return &governanceClient{cc} +} + +func (c *governanceClient) List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) { + out := new(ListResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out) +} + +func (c *governanceClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) { + out := new(DeleteResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out) +} + +func (c *governanceClient) Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) { + out := new(EditResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out) +} + +func (c *governanceClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) { + out := new(CreateResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out) +} + +func (c *governanceClient) Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) { + out := new(DisplayResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Display", in, out) +} + +// GovernanceServer is the server API for Governance service. +// All implementations must embed UnimplementedGovernanceServer +// for forward compatibility +type GovernanceServer interface { + List(context.Context, *ListReq) (*ListResp, error) + Delete(context.Context, *DeleteReq) (*DeleteResp, error) + Edit(context.Context, *EditReq) (*EditResp, error) + Create(context.Context, *CreateReq) (*CreateResp, error) + Display(context.Context, *DisplayReq) (*DisplayResp, error) + mustEmbedUnimplementedGovernanceServer() +} + +// UnimplementedGovernanceServer must be embedded to have forward compatible implementations. +type UnimplementedGovernanceServer struct { + proxyImpl protocol.Invoker +} + +func (UnimplementedGovernanceServer) List(context.Context, *ListReq) (*ListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedGovernanceServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedGovernanceServer) Edit(context.Context, *EditReq) (*EditResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented") +} +func (UnimplementedGovernanceServer) Create(context.Context, *CreateReq) (*CreateResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedGovernanceServer) Display(context.Context, *DisplayReq) (*DisplayResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Display not implemented") +} +func (s *UnimplementedGovernanceServer) XXX_SetProxyImpl(impl protocol.Invoker) { + s.proxyImpl = impl +} + +func (s *UnimplementedGovernanceServer) XXX_GetProxyImpl() protocol.Invoker { + return s.proxyImpl +} + +func (s *UnimplementedGovernanceServer) XXX_ServiceDesc() *grpc_go.ServiceDesc { + return &Governance_ServiceDesc +} +func (s *UnimplementedGovernanceServer) XXX_InterfaceName() string { + return "governance.Governance" +} + +func (UnimplementedGovernanceServer) mustEmbedUnimplementedGovernanceServer() {} + +// UnsafeGovernanceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GovernanceServer will +// result in compilation errors. +type UnsafeGovernanceServer interface { + mustEmbedUnimplementedGovernanceServer() +} + +func RegisterGovernanceServer(s grpc_go.ServiceRegistrar, srv GovernanceServer) { + s.RegisterService(&Governance_ServiceDesc, srv) +} + +func _Governance_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("List", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Governance_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Delete", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Governance_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(EditReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Edit", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Governance_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Create", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Governance_Display_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(DisplayReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Display", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +// Governance_ServiceDesc is the grpc_go.ServiceDesc for Governance service. +// It's only intended for direct use with grpc_go.RegisterService, +// and not to be introspected or modified (even as a copy) +var Governance_ServiceDesc = grpc_go.ServiceDesc{ + ServiceName: "governance.Governance", + HandlerType: (*GovernanceServer)(nil), + Methods: []grpc_go.MethodDesc{ + { + MethodName: "List", + Handler: _Governance_List_Handler, + }, + { + MethodName: "Delete", + Handler: _Governance_Delete_Handler, + }, + { + MethodName: "Edit", + Handler: _Governance_Edit_Handler, + }, + { + MethodName: "Create", + Handler: _Governance_Create_Handler, + }, + { + MethodName: "Display", + Handler: _Governance_Display_Handler, + }, + }, + Streams: []grpc_go.StreamDesc{}, + Metadata: "governance.proto", +} diff --git a/api/pressreleases/press_releases.pb.go b/api/pressreleases/press_releases.pb.go new file mode 100644 index 0000000..b54edaa --- /dev/null +++ b/api/pressreleases/press_releases.pb.go @@ -0,0 +1,1215 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.29.1 +// protoc v3.20.3 +// source: press_releases.proto + +package pressreleases + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + CreatedAt uint64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Sort uint32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + Attachment string `protobuf:"bytes,6,opt,name=attachment,proto3" json:"attachment,omitempty"` + UpdatedAt uint64 `protobuf:"varint,7,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` + Operator string `protobuf:"bytes,8,opt,name=operator,proto3" json:"operator,omitempty"` + OperatorId int32 `protobuf:"varint,9,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *Item) Reset() { + *x = Item{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Item) ProtoMessage() {} + +func (x *Item) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Item.ProtoReflect.Descriptor instead. +func (*Item) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{0} +} + +func (x *Item) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Item) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Item) GetCreatedAt() uint64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *Item) GetSort() uint32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *Item) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *Item) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +func (x *Item) GetUpdatedAt() uint64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *Item) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *Item) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + StartTime uint64 `protobuf:"varint,2,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime uint64 `protobuf:"varint,3,opt,name=endTime,proto3" json:"endTime,omitempty"` + Status uint32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + Display uint32 `protobuf:"varint,5,opt,name=display,proto3" json:"display,omitempty"` + Page int32 `protobuf:"varint,6,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,7,opt,name=pageSize,proto3" json:"pageSize,omitempty"` +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{1} +} + +func (x *ListReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListReq) GetStartTime() uint64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ListReq) GetEndTime() uint64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *ListReq) GetStatus() uint32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ListReq) GetDisplay() uint32 { + if x != nil { + return x.Display + } + return 0 +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Data []*Item `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *ListResp) Reset() { + *x = ListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResp) ProtoMessage() {} + +func (x *ListResp) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResp.ProtoReflect.Descriptor instead. +func (*ListResp) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{2} +} + +func (x *ListResp) GetTotal() uint64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *ListResp) GetData() []*Item { + if x != nil { + return x.Data + } + return nil +} + +type DisplayReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DisplayReq) Reset() { + *x = DisplayReq{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisplayReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisplayReq) ProtoMessage() {} + +func (x *DisplayReq) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisplayReq.ProtoReflect.Descriptor instead. +func (*DisplayReq) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{3} +} + +type DisplayResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []*Item `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *DisplayResp) Reset() { + *x = DisplayResp{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisplayResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisplayResp) ProtoMessage() {} + +func (x *DisplayResp) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisplayResp.ProtoReflect.Descriptor instead. +func (*DisplayResp) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{4} +} + +func (x *DisplayResp) GetData() []*Item { + if x != nil { + return x.Data + } + return nil +} + +type EditReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + CreatedAt uint64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Sort uint32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + Attachment string `protobuf:"bytes,6,opt,name=attachment,proto3" json:"attachment,omitempty"` + Status uint32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` + Operator string `protobuf:"bytes,8,opt,name=operator,proto3" json:"operator,omitempty"` + OperatorId int32 `protobuf:"varint,9,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *EditReq) Reset() { + *x = EditReq{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EditReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditReq) ProtoMessage() {} + +func (x *EditReq) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditReq.ProtoReflect.Descriptor instead. +func (*EditReq) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{5} +} + +func (x *EditReq) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *EditReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *EditReq) GetCreatedAt() uint64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *EditReq) GetSort() uint32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *EditReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *EditReq) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +func (x *EditReq) GetStatus() uint32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *EditReq) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *EditReq) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type EditResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EditResp) Reset() { + *x = EditResp{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EditResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditResp) ProtoMessage() {} + +func (x *EditResp) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditResp.ProtoReflect.Descriptor instead. +func (*EditResp) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{6} +} + +type CreateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + CreatedAt uint64 `protobuf:"varint,2,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Sort uint32 `protobuf:"varint,3,opt,name=sort,proto3" json:"sort,omitempty"` + Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` + Attachment string `protobuf:"bytes,5,opt,name=attachment,proto3" json:"attachment,omitempty"` + Status uint32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` + Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator,omitempty"` + OperatorId int32 `protobuf:"varint,8,opt,name=operatorId,proto3" json:"operatorId,omitempty"` +} + +func (x *CreateReq) Reset() { + *x = CreateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateReq) ProtoMessage() {} + +func (x *CreateReq) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateReq.ProtoReflect.Descriptor instead. +func (*CreateReq) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreateReq) GetCreatedAt() uint64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *CreateReq) GetSort() uint32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *CreateReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *CreateReq) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +func (x *CreateReq) GetStatus() uint32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *CreateReq) GetOperator() string { + if x != nil { + return x.Operator + } + return "" +} + +func (x *CreateReq) GetOperatorId() int32 { + if x != nil { + return x.OperatorId + } + return 0 +} + +type CreateResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateResp) Reset() { + *x = CreateResp{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResp) ProtoMessage() {} + +func (x *CreateResp) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResp.ProtoReflect.Descriptor instead. +func (*CreateResp) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{8} +} + +type DeleteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteReq) Reset() { + *x = DeleteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteReq) ProtoMessage() {} + +func (x *DeleteReq) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteReq.ProtoReflect.Descriptor instead. +func (*DeleteReq) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteReq) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +type DeleteResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteResp) Reset() { + *x = DeleteResp{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResp) ProtoMessage() {} + +func (x *DeleteResp) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResp.ProtoReflect.Descriptor instead. +func (*DeleteResp) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{10} +} + +type GetReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetReq) Reset() { + *x = GetReq{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetReq) ProtoMessage() {} + +func (x *GetReq) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetReq.ProtoReflect.Descriptor instead. +func (*GetReq) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{11} +} + +func (x *GetReq) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + CreatedAt uint64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` + Attachment string `protobuf:"bytes,5,opt,name=attachment,proto3" json:"attachment,omitempty"` +} + +func (x *GetResp) Reset() { + *x = GetResp{} + if protoimpl.UnsafeEnabled { + mi := &file_press_releases_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetResp) ProtoMessage() {} + +func (x *GetResp) ProtoReflect() protoreflect.Message { + mi := &file_press_releases_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResp.ProtoReflect.Descriptor instead. +func (*GetResp) Descriptor() ([]byte, []int) { + return file_press_releases_proto_rawDescGZIP(), []int{12} +} + +func (x *GetResp) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *GetResp) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *GetResp) GetCreatedAt() uint64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *GetResp) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *GetResp) GetAttachment() string { + if x != nil { + return x.Attachment + } + return "" +} + +var File_press_releases_proto protoreflect.FileDescriptor + +var file_press_releases_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x70, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x73, 0x22, 0xf2, 0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0xb9, 0x01, 0x0a, 0x07, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x49, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x27, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x22, + 0x36, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xef, 0x01, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x0a, 0x0a, 0x08, 0x45, 0x64, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xe1, 0x01, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x18, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x87, 0x01, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x32, 0x83, 0x03, 0x0a, 0x0d, 0x50, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x16, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x07, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x19, + 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x44, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x04, 0x45, 0x64, 0x69, 0x74, 0x12, + 0x16, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, + 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x18, 0x2e, + 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x72, + 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x12, 0x5a, 0x10, + 0x2e, 0x2f, 0x3b, 0x70, 0x72, 0x65, 0x73, 0x73, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_press_releases_proto_rawDescOnce sync.Once + file_press_releases_proto_rawDescData = file_press_releases_proto_rawDesc +) + +func file_press_releases_proto_rawDescGZIP() []byte { + file_press_releases_proto_rawDescOnce.Do(func() { + file_press_releases_proto_rawDescData = protoimpl.X.CompressGZIP(file_press_releases_proto_rawDescData) + }) + return file_press_releases_proto_rawDescData +} + +var file_press_releases_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_press_releases_proto_goTypes = []interface{}{ + (*Item)(nil), // 0: pressreleases.Item + (*ListReq)(nil), // 1: pressreleases.ListReq + (*ListResp)(nil), // 2: pressreleases.ListResp + (*DisplayReq)(nil), // 3: pressreleases.DisplayReq + (*DisplayResp)(nil), // 4: pressreleases.DisplayResp + (*EditReq)(nil), // 5: pressreleases.EditReq + (*EditResp)(nil), // 6: pressreleases.EditResp + (*CreateReq)(nil), // 7: pressreleases.CreateReq + (*CreateResp)(nil), // 8: pressreleases.CreateResp + (*DeleteReq)(nil), // 9: pressreleases.DeleteReq + (*DeleteResp)(nil), // 10: pressreleases.DeleteResp + (*GetReq)(nil), // 11: pressreleases.GetReq + (*GetResp)(nil), // 12: pressreleases.GetResp +} +var file_press_releases_proto_depIdxs = []int32{ + 0, // 0: pressreleases.ListResp.data:type_name -> pressreleases.Item + 0, // 1: pressreleases.DisplayResp.data:type_name -> pressreleases.Item + 1, // 2: pressreleases.PressReleases.List:input_type -> pressreleases.ListReq + 3, // 3: pressreleases.PressReleases.Display:input_type -> pressreleases.DisplayReq + 5, // 4: pressreleases.PressReleases.Edit:input_type -> pressreleases.EditReq + 7, // 5: pressreleases.PressReleases.Create:input_type -> pressreleases.CreateReq + 9, // 6: pressreleases.PressReleases.Delete:input_type -> pressreleases.DeleteReq + 11, // 7: pressreleases.PressReleases.Get:input_type -> pressreleases.GetReq + 2, // 8: pressreleases.PressReleases.List:output_type -> pressreleases.ListResp + 4, // 9: pressreleases.PressReleases.Display:output_type -> pressreleases.DisplayResp + 6, // 10: pressreleases.PressReleases.Edit:output_type -> pressreleases.EditResp + 8, // 11: pressreleases.PressReleases.Create:output_type -> pressreleases.CreateResp + 10, // 12: pressreleases.PressReleases.Delete:output_type -> pressreleases.DeleteResp + 12, // 13: pressreleases.PressReleases.Get:output_type -> pressreleases.GetResp + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_press_releases_proto_init() } +func file_press_releases_proto_init() { + if File_press_releases_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_press_releases_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisplayReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisplayResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EditReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EditResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_press_releases_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_press_releases_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_press_releases_proto_goTypes, + DependencyIndexes: file_press_releases_proto_depIdxs, + MessageInfos: file_press_releases_proto_msgTypes, + }.Build() + File_press_releases_proto = out.File + file_press_releases_proto_rawDesc = nil + file_press_releases_proto_goTypes = nil + file_press_releases_proto_depIdxs = nil +} diff --git a/api/pressreleases/press_releases.proto b/api/pressreleases/press_releases.proto new file mode 100644 index 0000000..64a9c98 --- /dev/null +++ b/api/pressreleases/press_releases.proto @@ -0,0 +1,101 @@ +syntax = "proto3"; +package pressreleases; +//import "descriptor.proto"; +//import "validator.proto"; + +option go_package = "./;pressreleases"; + +service PressReleases{ + rpc List(ListReq) returns (ListResp) {} + rpc Display(DisplayReq) returns (DisplayResp) {} + rpc Edit(EditReq) returns (EditResp) {} + rpc Create(CreateReq) returns (CreateResp) {} + rpc Delete(DeleteReq) returns (DeleteResp) {} + rpc Get(GetReq) returns (GetResp) {} +} + +message Item{ + uint32 id = 1; + string title = 2; + uint64 createdAt = 3; + uint32 sort = 4; + string content = 5; + string attachment = 6; + uint64 updatedAt = 7; + string operator = 8; + int32 operatorId = 9; +} + +message ListReq{ + string title = 1; + uint64 startTime = 2; + uint64 endTime = 3; + uint32 status = 4; + uint32 display = 5; + int32 page = 6; + int32 pageSize = 7; +} + +message ListResp{ + uint64 total = 1; + repeated Item data = 2; +} + +message DisplayReq{ + +} + +message DisplayResp{ + repeated Item data = 1; +} + +message EditReq{ + uint32 id = 1; + string title = 2; + uint64 createdAt = 3; + uint32 sort = 4; + string content = 5; + string attachment = 6; + uint32 status = 7; + string operator = 8; + int32 operatorId = 9; + +} + +message EditResp{ +} + +message CreateReq{ + string title = 1; + uint64 createdAt = 2; + uint32 sort = 3; + string content = 4; + string attachment = 5; + uint32 status = 6; + string operator = 7; + int32 operatorId = 8; +} + +message CreateResp{ + +} + +message DeleteReq{ + uint32 id = 1; +} + +message DeleteResp{ + +} + +message GetReq{ + int64 id = 1; +} + +message GetResp{ + uint32 id = 1; + string title = 2; + uint64 createdAt = 3; + string content = 4; + string attachment = 5; +} \ No newline at end of file diff --git a/api/pressreleases/press_releases.validator.pb.go b/api/pressreleases/press_releases.validator.pb.go new file mode 100644 index 0000000..9481a14 --- /dev/null +++ b/api/pressreleases/press_releases.validator.pb.go @@ -0,0 +1,70 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: press_releases.proto + +package pressreleases + +import ( + fmt "fmt" + math "math" + proto "github.com/golang/protobuf/proto" + github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func (this *Item) Validate() error { + return nil +} +func (this *ListReq) Validate() error { + return nil +} +func (this *ListResp) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *DisplayReq) Validate() error { + return nil +} +func (this *DisplayResp) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *EditReq) Validate() error { + return nil +} +func (this *EditResp) Validate() error { + return nil +} +func (this *CreateReq) Validate() error { + return nil +} +func (this *CreateResp) Validate() error { + return nil +} +func (this *DeleteReq) Validate() error { + return nil +} +func (this *DeleteResp) Validate() error { + return nil +} +func (this *GetReq) Validate() error { + return nil +} +func (this *GetResp) Validate() error { + return nil +} diff --git a/api/pressreleases/press_releases_triple.pb.go b/api/pressreleases/press_releases_triple.pb.go new file mode 100644 index 0000000..a3ba335 --- /dev/null +++ b/api/pressreleases/press_releases_triple.pb.go @@ -0,0 +1,372 @@ +// Code generated by protoc-gen-go-triple. DO NOT EDIT. +// versions: +// - protoc-gen-go-triple v1.0.8 +// - protoc v3.20.3 +// source: press_releases.proto + +package pressreleases + +import ( + context "context" + protocol "dubbo.apache.org/dubbo-go/v3/protocol" + dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3" + invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation" + grpc_go "github.com/dubbogo/grpc-go" + codes "github.com/dubbogo/grpc-go/codes" + metadata "github.com/dubbogo/grpc-go/metadata" + status "github.com/dubbogo/grpc-go/status" + common "github.com/dubbogo/triple/pkg/common" + constant "github.com/dubbogo/triple/pkg/common/constant" + triple "github.com/dubbogo/triple/pkg/triple" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc_go.SupportPackageIsVersion7 + +// PressReleasesClient is the client API for PressReleases 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 PressReleasesClient interface { + List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) + Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) + Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) + Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) + Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) + Get(ctx context.Context, in *GetReq, opts ...grpc_go.CallOption) (*GetResp, common.ErrorWithAttachment) +} + +type pressReleasesClient struct { + cc *triple.TripleConn +} + +type PressReleasesClientImpl struct { + List func(ctx context.Context, in *ListReq) (*ListResp, error) + Display func(ctx context.Context, in *DisplayReq) (*DisplayResp, error) + Edit func(ctx context.Context, in *EditReq) (*EditResp, error) + Create func(ctx context.Context, in *CreateReq) (*CreateResp, error) + Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error) + Get func(ctx context.Context, in *GetReq) (*GetResp, error) +} + +func (c *PressReleasesClientImpl) GetDubboStub(cc *triple.TripleConn) PressReleasesClient { + return NewPressReleasesClient(cc) +} + +func (c *PressReleasesClientImpl) XXX_InterfaceName() string { + return "pressreleases.PressReleases" +} + +func NewPressReleasesClient(cc *triple.TripleConn) PressReleasesClient { + return &pressReleasesClient{cc} +} + +func (c *pressReleasesClient) List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) { + out := new(ListResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out) +} + +func (c *pressReleasesClient) Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) { + out := new(DisplayResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Display", in, out) +} + +func (c *pressReleasesClient) Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) { + out := new(EditResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out) +} + +func (c *pressReleasesClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) { + out := new(CreateResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out) +} + +func (c *pressReleasesClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) { + out := new(DeleteResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out) +} + +func (c *pressReleasesClient) Get(ctx context.Context, in *GetReq, opts ...grpc_go.CallOption) (*GetResp, common.ErrorWithAttachment) { + out := new(GetResp) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Get", in, out) +} + +// PressReleasesServer is the server API for PressReleases service. +// All implementations must embed UnimplementedPressReleasesServer +// for forward compatibility +type PressReleasesServer interface { + List(context.Context, *ListReq) (*ListResp, error) + Display(context.Context, *DisplayReq) (*DisplayResp, error) + Edit(context.Context, *EditReq) (*EditResp, error) + Create(context.Context, *CreateReq) (*CreateResp, error) + Delete(context.Context, *DeleteReq) (*DeleteResp, error) + Get(context.Context, *GetReq) (*GetResp, error) + mustEmbedUnimplementedPressReleasesServer() +} + +// UnimplementedPressReleasesServer must be embedded to have forward compatible implementations. +type UnimplementedPressReleasesServer struct { + proxyImpl protocol.Invoker +} + +func (UnimplementedPressReleasesServer) List(context.Context, *ListReq) (*ListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedPressReleasesServer) Display(context.Context, *DisplayReq) (*DisplayResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Display not implemented") +} +func (UnimplementedPressReleasesServer) Edit(context.Context, *EditReq) (*EditResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented") +} +func (UnimplementedPressReleasesServer) Create(context.Context, *CreateReq) (*CreateResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedPressReleasesServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedPressReleasesServer) Get(context.Context, *GetReq) (*GetResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (s *UnimplementedPressReleasesServer) XXX_SetProxyImpl(impl protocol.Invoker) { + s.proxyImpl = impl +} + +func (s *UnimplementedPressReleasesServer) XXX_GetProxyImpl() protocol.Invoker { + return s.proxyImpl +} + +func (s *UnimplementedPressReleasesServer) XXX_ServiceDesc() *grpc_go.ServiceDesc { + return &PressReleases_ServiceDesc +} +func (s *UnimplementedPressReleasesServer) XXX_InterfaceName() string { + return "pressreleases.PressReleases" +} + +func (UnimplementedPressReleasesServer) mustEmbedUnimplementedPressReleasesServer() {} + +// UnsafePressReleasesServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PressReleasesServer will +// result in compilation errors. +type UnsafePressReleasesServer interface { + mustEmbedUnimplementedPressReleasesServer() +} + +func RegisterPressReleasesServer(s grpc_go.ServiceRegistrar, srv PressReleasesServer) { + s.RegisterService(&PressReleases_ServiceDesc, srv) +} + +func _PressReleases_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("List", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _PressReleases_Display_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(DisplayReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Display", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _PressReleases_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(EditReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Edit", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _PressReleases_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Create", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _PressReleases_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Delete", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _PressReleases_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReq) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("Get", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +// PressReleases_ServiceDesc is the grpc_go.ServiceDesc for PressReleases service. +// It's only intended for direct use with grpc_go.RegisterService, +// and not to be introspected or modified (even as a copy) +var PressReleases_ServiceDesc = grpc_go.ServiceDesc{ + ServiceName: "pressreleases.PressReleases", + HandlerType: (*PressReleasesServer)(nil), + Methods: []grpc_go.MethodDesc{ + { + MethodName: "List", + Handler: _PressReleases_List_Handler, + }, + { + MethodName: "Display", + Handler: _PressReleases_Display_Handler, + }, + { + MethodName: "Edit", + Handler: _PressReleases_Edit_Handler, + }, + { + MethodName: "Create", + Handler: _PressReleases_Create_Handler, + }, + { + MethodName: "Delete", + Handler: _PressReleases_Delete_Handler, + }, + { + MethodName: "Get", + Handler: _PressReleases_Get_Handler, + }, + }, + Streams: []grpc_go.StreamDesc{}, + Metadata: "press_releases.proto", +} diff --git a/pkg/router/router.go b/pkg/router/router.go index 4c61f15..ae95bdb 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -6,7 +6,9 @@ import ( "fonchain-fiee/pkg/service/account" "fonchain-fiee/pkg/service/auth" "fonchain-fiee/pkg/service/file" + "fonchain-fiee/pkg/service/governance" "fonchain-fiee/pkg/service/lang" + "fonchain-fiee/pkg/service/pressreleases" "fonchain-fiee/pkg/service/qr" "fonchain-fiee/pkg/service/redirect" "fonchain-fiee/pkg/service/upload" @@ -127,6 +129,32 @@ func NewRouter() *gin.Engine { resourceRoute.GET("/preview", file.Preview) resourceRoute.GET("/list", file.List) } + + { + // 官网文档 + governanceRoute := v1.Group("/governance") + governanceRouteLogin := governanceRoute.Group("", middleware.CheckWebLogin(service.AccountProvider)) + + governanceRoute.POST("/list", governance.List) + governanceRouteLogin.GET("/display", governance.Display) + governanceRouteLogin.POST("", governance.Create) + governanceRouteLogin.PUT("", governance.Edit) + governanceRouteLogin.DELETE("", governance.Delete) + + } + { + // 官网新闻 + pressreleasesRoute := v1.Group("/pressreleases") + pressreleasesRouteLogin := pressreleasesRoute.Group("", middleware.CheckWebLogin(service.AccountProvider)) + + pressreleasesRoute.GET("/display", pressreleases.Display) + pressreleasesRoute.GET("", pressreleases.Get) + pressreleasesRouteLogin.POST("/list", pressreleases.List) + pressreleasesRouteLogin.POST("", pressreleases.Create) + pressreleasesRouteLogin.PUT("", pressreleases.Edit) + pressreleasesRouteLogin.DELETE("", pressreleases.Delete) + + } //静态文件 r.StaticFS("/api/static", http.Dir("./runtime")) r.NoRoute(func(c *gin.Context) { diff --git a/pkg/service/governance/governance.go b/pkg/service/governance/governance.go new file mode 100644 index 0000000..2afb59e --- /dev/null +++ b/pkg/service/governance/governance.go @@ -0,0 +1,88 @@ +package governance + +import ( + "strconv" + + "github.com/gin-gonic/gin" + + "fonchain-fiee/api/governance" + "fonchain-fiee/pkg/model/login" + "fonchain-fiee/pkg/service" +) + +func Create(ctx *gin.Context) { + var req governance.CreateReq + if err := ctx.ShouldBindJSON(&req); err != nil { + service.Error(ctx, err) + return + } + user := login.GetUserInfoFromC(ctx) + // user := login.Info{ + // Name: "test" + strconv.Itoa(rand.Intn(10)), + // ID: uint64(rand.Intn(10)), + // } + req.Operator = user.Name + req.OperatorId = int32(user.ID) + resp, err := service.GovernanceProvider.Create(ctx, &req) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func Delete(ctx *gin.Context) { + id, err := strconv.Atoi(ctx.Query("id")) + if err != nil { + service.Error(ctx, err) + return + } + resp, err := service.GovernanceProvider.Delete(ctx, &governance.DeleteReq{ + Id: int32(id), + }) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func Display(ctx *gin.Context) { + resp, err := service.GovernanceProvider.Display(ctx, &governance.DisplayReq{}) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func List(ctx *gin.Context) { + var req governance.ListReq + if err := ctx.ShouldBindJSON(&req); err != nil { + service.Error(ctx, err) + return + } + resp, err := service.GovernanceProvider.List(ctx, &req) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func Edit(ctx *gin.Context) { + var req governance.EditReq + if err := ctx.ShouldBindJSON(&req); err != nil { + service.Error(ctx, err) + return + } + user := login.GetUserInfoFromC(ctx) + req.Operator = user.Name + req.OperatorId = int32(user.ID) + resp, err := service.GovernanceProvider.Edit(ctx, &req) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} diff --git a/pkg/service/init.go b/pkg/service/init.go index 9346448..c41a5a8 100644 --- a/pkg/service/init.go +++ b/pkg/service/init.go @@ -7,8 +7,10 @@ import ( "fonchain-fiee/api/bundle" "fonchain-fiee/api/cast" "fonchain-fiee/api/files" + "fonchain-fiee/api/governance" "fonchain-fiee/api/order" "fonchain-fiee/api/payment" + "fonchain-fiee/api/pressreleases" pkConfig "fonchain-fiee/pkg/config" "os" @@ -25,6 +27,8 @@ var OrderProvider = new(order.OrderClientImpl) var FilesProvider = new(files.FileClientImpl) var PaymentProvider = new(payment.PaymentCentClientImpl) var CastProvider = new(cast.CastClientImpl) +var GovernanceProvider = new(governance.GovernanceClientImpl) +var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl) func init() { config.SetConsumerService(BundleProvider) @@ -34,7 +38,8 @@ func init() { config.SetConsumerService(AccountFieeProvider) config.SetConsumerService(CastProvider) config.SetConsumerService(FilesProvider) - + config.SetConsumerService(GovernanceProvider) + config.SetConsumerService(PressReleasesProvider) if err := config.Load(); err != nil { panic(err) } diff --git a/pkg/service/pressreleases/pressreleases.go b/pkg/service/pressreleases/pressreleases.go new file mode 100644 index 0000000..bf0a676 --- /dev/null +++ b/pkg/service/pressreleases/pressreleases.go @@ -0,0 +1,100 @@ +package pressreleases + +import ( + "strconv" + + "github.com/gin-gonic/gin" + + "fonchain-fiee/api/pressreleases" + "fonchain-fiee/pkg/model/login" + "fonchain-fiee/pkg/service" +) + +func Create(ctx *gin.Context) { + var req pressreleases.CreateReq + if err := ctx.ShouldBindJSON(&req); err != nil { + service.Error(ctx, err) + return + } + user := login.GetUserInfoFromC(ctx) + req.Operator = user.Name + req.OperatorId = int32(user.ID) + resp, err := service.PressReleasesProvider.Create(ctx, &req) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func Delete(ctx *gin.Context) { + id, err := strconv.Atoi(ctx.Query("id")) + if err != nil { + service.Error(ctx, err) + return + } + resp, err := service.PressReleasesProvider.Delete(ctx, &pressreleases.DeleteReq{ + Id: uint32(id), + }) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func Display(ctx *gin.Context) { + resp, err := service.PressReleasesProvider.Display(ctx, &pressreleases.DisplayReq{}) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func List(ctx *gin.Context) { + var req pressreleases.ListReq + if err := ctx.ShouldBindJSON(&req); err != nil { + service.Error(ctx, err) + return + } + resp, err := service.PressReleasesProvider.List(ctx, &req) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func Edit(ctx *gin.Context) { + var req pressreleases.EditReq + if err := ctx.ShouldBindJSON(&req); err != nil { + service.Error(ctx, err) + return + } + user := login.GetUserInfoFromC(ctx) + req.Operator = user.Name + req.OperatorId = int32(user.ID) + resp, err := service.PressReleasesProvider.Edit(ctx, &req) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +} + +func Get(ctx *gin.Context) { + id, err := strconv.Atoi(ctx.Query("id")) + if err != nil { + service.Error(ctx, err) + return + } + resp, err := service.PressReleasesProvider.Get(ctx, &pressreleases.GetReq{ + Id: int64(id), + }) + if err != nil { + service.Error(ctx, err) + return + } + service.Success(ctx, resp) +}