优化节点日志

This commit is contained in:
刘祥超
2021-11-30 16:42:27 +08:00
parent 02420aacc5
commit 99af79c9c2
6 changed files with 109 additions and 79 deletions

View File

@@ -0,0 +1,9 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package nodeconfigs
type NodeLogType = string
const (
NodeLogTypeListenAddressFailed NodeLogType = "listenAddressFailed"
)

View File

@@ -25,7 +25,7 @@ func HumanError(err error) error {
case codes.Unimplemented:
return errors.New("请求的RPC服务或方法不存在可能是没有升级API节点或者当前节点没有升级" + err.Error())
case codes.Unavailable:
return errors.New("RPC当前不可用1、当前节点的api.yaml配置中的地址填写正确2、请确保API节点已启动并检查当前节点和API节点之间的网络连接是正常的。错误信息" + err.Error())
return errors.New("RPC当前不可用1、请确保当前节点的api.yaml配置中的地址填写正确2、请确保API节点已启动并检查当前节点和API节点之间的网络连接是正常的。错误信息" + err.Error())
}
return err

View File

@@ -42,6 +42,8 @@ type NodeLog struct {
IsFixed bool `protobuf:"varint,10,opt,name=isFixed,proto3" json:"isFixed,omitempty"`
OriginId int64 `protobuf:"varint,11,opt,name=originId,proto3" json:"originId,omitempty"`
IsRead bool `protobuf:"varint,12,opt,name=isRead,proto3" json:"isRead,omitempty"`
ParamsJSON []byte `protobuf:"bytes,13,opt,name=paramsJSON,proto3" json:"paramsJSON,omitempty"`
Type string `protobuf:"bytes,14,opt,name=type,proto3" json:"type,omitempty"`
}
func (x *NodeLog) Reset() {
@@ -160,12 +162,26 @@ func (x *NodeLog) GetIsRead() bool {
return false
}
func (x *NodeLog) GetParamsJSON() []byte {
if x != nil {
return x.ParamsJSON
}
return nil
}
func (x *NodeLog) GetType() string {
if x != nil {
return x.Type
}
return ""
}
var File_models_model_node_log_proto protoreflect.FileDescriptor
var file_models_model_node_log_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70,
0x62, 0x22, 0xad, 0x02, 0x0a, 0x07, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x0e, 0x0a,
0x62, 0x22, 0xe1, 0x02, 0x0a, 0x07, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
@@ -184,8 +200,11 @@ var file_models_model_node_log_proto_rawDesc = []byte{
0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52,
0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x52,
0x65, 0x61, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x52, 0x65, 0x61,
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18,
0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f,
0x4e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -419,16 +419,16 @@ func (x *ListNodeLogsResponse) GetNodeLogs() []*NodeLog {
}
// 设置日志为已修复
type FixNodeLogRequest struct {
type FixNodeLogsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NodeLogId int64 `protobuf:"varint,1,opt,name=nodeLogId,proto3" json:"nodeLogId,omitempty"`
NodeLogIds []int64 `protobuf:"varint,1,rep,packed,name=nodeLogIds,proto3" json:"nodeLogIds,omitempty"`
}
func (x *FixNodeLogRequest) Reset() {
*x = FixNodeLogRequest{}
func (x *FixNodeLogsRequest) Reset() {
*x = FixNodeLogsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_node_log_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -436,13 +436,13 @@ func (x *FixNodeLogRequest) Reset() {
}
}
func (x *FixNodeLogRequest) String() string {
func (x *FixNodeLogsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FixNodeLogRequest) ProtoMessage() {}
func (*FixNodeLogsRequest) ProtoMessage() {}
func (x *FixNodeLogRequest) ProtoReflect() protoreflect.Message {
func (x *FixNodeLogsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_node_log_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -454,16 +454,16 @@ func (x *FixNodeLogRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use FixNodeLogRequest.ProtoReflect.Descriptor instead.
func (*FixNodeLogRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use FixNodeLogsRequest.ProtoReflect.Descriptor instead.
func (*FixNodeLogsRequest) Descriptor() ([]byte, []int) {
return file_service_node_log_proto_rawDescGZIP(), []int{5}
}
func (x *FixNodeLogRequest) GetNodeLogId() int64 {
func (x *FixNodeLogsRequest) GetNodeLogIds() []int64 {
if x != nil {
return x.NodeLogId
return x.NodeLogIds
}
return 0
return nil
}
// 计算未读的日志数量
@@ -647,51 +647,51 @@ var file_service_node_log_proto_rawDesc = []byte{
0x14, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64,
0x65, 0x4c, 0x6f, 0x67, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x31,
0x0a, 0x11, 0x46, 0x69, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x49,
0x64, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x6e, 0x72,
0x65, 0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x03, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x49, 0x64, 0x73, 0x22,
0x1e, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65,
0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32,
0xf5, 0x03, 0x0a, 0x0e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x47, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4c,
0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0d, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x18, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52,
0x65, 0x4c, 0x6f, 0x67, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x34,
0x0a, 0x12, 0x46, 0x69, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x49,
0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f,
0x67, 0x49, 0x64, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c,
0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x49, 0x64, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x49,
0x64, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4e,
0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x32, 0xf7, 0x03, 0x0a, 0x0e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f,
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f,
0x0a, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12,
0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f,
0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x41, 0x0a, 0x0c, 0x6c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12,
0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x66, 0x69, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67,
0x73, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f,
0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x51, 0x0a, 0x16, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x4c,
0x6f, 0x67, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c,
0x6c, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0c,
0x6c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x17, 0x2e, 0x70,
0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e,
0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x33, 0x0a, 0x0a, 0x66, 0x69, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x15, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x78, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63,
0x63, 0x65, 0x73, 0x73, 0x12, 0x51, 0x0a, 0x16, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c,
0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x21,
0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x6e, 0x72, 0x65,
0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1d, 0x2e,
0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67,
0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x12,
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65,
0x61, 0x64, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f,
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x12, 0x49, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f,
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67,
0x73, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x15,
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67,
0x73, 0x52, 0x65, 0x61, 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x41, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x61, 0x64,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -713,7 +713,7 @@ var file_service_node_log_proto_goTypes = []interface{}{
(*CountNodeLogsRequest)(nil), // 2: pb.CountNodeLogsRequest
(*ListNodeLogsRequest)(nil), // 3: pb.ListNodeLogsRequest
(*ListNodeLogsResponse)(nil), // 4: pb.ListNodeLogsResponse
(*FixNodeLogRequest)(nil), // 5: pb.FixNodeLogRequest
(*FixNodeLogsRequest)(nil), // 5: pb.FixNodeLogsRequest
(*CountAllUnreadNodeLogsRequest)(nil), // 6: pb.CountAllUnreadNodeLogsRequest
(*UpdateNodeLogsReadRequest)(nil), // 7: pb.UpdateNodeLogsReadRequest
(*UpdateAllNodeLogsReadRequest)(nil), // 8: pb.UpdateAllNodeLogsReadRequest
@@ -727,14 +727,14 @@ var file_service_node_log_proto_depIdxs = []int32{
0, // 2: pb.NodeLogService.createNodeLogs:input_type -> pb.CreateNodeLogsRequest
2, // 3: pb.NodeLogService.countNodeLogs:input_type -> pb.CountNodeLogsRequest
3, // 4: pb.NodeLogService.listNodeLogs:input_type -> pb.ListNodeLogsRequest
5, // 5: pb.NodeLogService.fixNodeLog:input_type -> pb.FixNodeLogRequest
5, // 5: pb.NodeLogService.fixNodeLogs:input_type -> pb.FixNodeLogsRequest
6, // 6: pb.NodeLogService.countAllUnreadNodeLogs:input_type -> pb.CountAllUnreadNodeLogsRequest
7, // 7: pb.NodeLogService.updateNodeLogsRead:input_type -> pb.UpdateNodeLogsReadRequest
8, // 8: pb.NodeLogService.updateAllNodeLogsRead:input_type -> pb.UpdateAllNodeLogsReadRequest
1, // 9: pb.NodeLogService.createNodeLogs:output_type -> pb.CreateNodeLogsResponse
10, // 10: pb.NodeLogService.countNodeLogs:output_type -> pb.RPCCountResponse
4, // 11: pb.NodeLogService.listNodeLogs:output_type -> pb.ListNodeLogsResponse
11, // 12: pb.NodeLogService.fixNodeLog:output_type -> pb.RPCSuccess
11, // 12: pb.NodeLogService.fixNodeLogs:output_type -> pb.RPCSuccess
10, // 13: pb.NodeLogService.countAllUnreadNodeLogs:output_type -> pb.RPCCountResponse
11, // 14: pb.NodeLogService.updateNodeLogsRead:output_type -> pb.RPCSuccess
11, // 15: pb.NodeLogService.updateAllNodeLogsRead:output_type -> pb.RPCSuccess
@@ -814,7 +814,7 @@ func file_service_node_log_proto_init() {
}
}
file_service_node_log_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FixNodeLogRequest); i {
switch v := v.(*FixNodeLogsRequest); i {
case 0:
return &v.state
case 1:
@@ -901,7 +901,7 @@ type NodeLogServiceClient interface {
// 列出单页日志
ListNodeLogs(ctx context.Context, in *ListNodeLogsRequest, opts ...grpc.CallOption) (*ListNodeLogsResponse, error)
// 设置日志为已修复
FixNodeLog(ctx context.Context, in *FixNodeLogRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
FixNodeLogs(ctx context.Context, in *FixNodeLogsRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 计算未读的日志数量
CountAllUnreadNodeLogs(ctx context.Context, in *CountAllUnreadNodeLogsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
// 设置日志为已读
@@ -945,9 +945,9 @@ func (c *nodeLogServiceClient) ListNodeLogs(ctx context.Context, in *ListNodeLog
return out, nil
}
func (c *nodeLogServiceClient) FixNodeLog(ctx context.Context, in *FixNodeLogRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
func (c *nodeLogServiceClient) FixNodeLogs(ctx context.Context, in *FixNodeLogsRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NodeLogService/fixNodeLog", in, out, opts...)
err := c.cc.Invoke(ctx, "/pb.NodeLogService/fixNodeLogs", in, out, opts...)
if err != nil {
return nil, err
}
@@ -990,7 +990,7 @@ type NodeLogServiceServer interface {
// 列出单页日志
ListNodeLogs(context.Context, *ListNodeLogsRequest) (*ListNodeLogsResponse, error)
// 设置日志为已修复
FixNodeLog(context.Context, *FixNodeLogRequest) (*RPCSuccess, error)
FixNodeLogs(context.Context, *FixNodeLogsRequest) (*RPCSuccess, error)
// 计算未读的日志数量
CountAllUnreadNodeLogs(context.Context, *CountAllUnreadNodeLogsRequest) (*RPCCountResponse, error)
// 设置日志为已读
@@ -1012,8 +1012,8 @@ func (*UnimplementedNodeLogServiceServer) CountNodeLogs(context.Context, *CountN
func (*UnimplementedNodeLogServiceServer) ListNodeLogs(context.Context, *ListNodeLogsRequest) (*ListNodeLogsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListNodeLogs not implemented")
}
func (*UnimplementedNodeLogServiceServer) FixNodeLog(context.Context, *FixNodeLogRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method FixNodeLog not implemented")
func (*UnimplementedNodeLogServiceServer) FixNodeLogs(context.Context, *FixNodeLogsRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method FixNodeLogs not implemented")
}
func (*UnimplementedNodeLogServiceServer) CountAllUnreadNodeLogs(context.Context, *CountAllUnreadNodeLogsRequest) (*RPCCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountAllUnreadNodeLogs not implemented")
@@ -1083,20 +1083,20 @@ func _NodeLogService_ListNodeLogs_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _NodeLogService_FixNodeLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FixNodeLogRequest)
func _NodeLogService_FixNodeLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FixNodeLogsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NodeLogServiceServer).FixNodeLog(ctx, in)
return srv.(NodeLogServiceServer).FixNodeLogs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NodeLogService/FixNodeLog",
FullMethod: "/pb.NodeLogService/FixNodeLogs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NodeLogServiceServer).FixNodeLog(ctx, req.(*FixNodeLogRequest))
return srv.(NodeLogServiceServer).FixNodeLogs(ctx, req.(*FixNodeLogsRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -1172,8 +1172,8 @@ var _NodeLogService_serviceDesc = grpc.ServiceDesc{
Handler: _NodeLogService_ListNodeLogs_Handler,
},
{
MethodName: "fixNodeLog",
Handler: _NodeLogService_FixNodeLog_Handler,
MethodName: "fixNodeLogs",
Handler: _NodeLogService_FixNodeLogs_Handler,
},
{
MethodName: "countAllUnreadNodeLogs",

View File

@@ -16,4 +16,6 @@ message NodeLog {
bool isFixed = 10;
int64 originId = 11;
bool isRead = 12;
bytes paramsJSON = 13;
string type = 14;
}

View File

@@ -18,7 +18,7 @@ service NodeLogService {
rpc listNodeLogs (ListNodeLogsRequest) returns (ListNodeLogsResponse);
// 设置日志为已修复
rpc fixNodeLog (FixNodeLogRequest) returns (RPCSuccess);
rpc fixNodeLogs (FixNodeLogsRequest) returns (RPCSuccess);
// 计算未读的日志数量
rpc countAllUnreadNodeLogs(CountAllUnreadNodeLogsRequest) returns (RPCCountResponse);
@@ -75,8 +75,8 @@ message ListNodeLogsResponse {
}
// 设置日志为已修复
message FixNodeLogRequest {
int64 nodeLogId = 1;
message FixNodeLogsRequest {
repeated int64 nodeLogIds = 1;
}
// 计算未读的日志数量