节点日志增加服务ID、是否修复等字段

This commit is contained in:
GoEdgeLab
2021-05-23 20:45:37 +08:00
parent 27935eb0a6
commit b91dc09425
4 changed files with 273 additions and 82 deletions

View File

@@ -30,13 +30,16 @@ type NodeLog struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Level string `protobuf:"bytes,4,opt,name=level,proto3" json:"level,omitempty"`
NodeId int64 `protobuf:"varint,5,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
CreatedAt int64 `protobuf:"varint,6,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Count int32 `protobuf:"varint,7,opt,name=count,proto3" json:"count,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
Level string `protobuf:"bytes,5,opt,name=level,proto3" json:"level,omitempty"`
NodeId int64 `protobuf:"varint,6,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
CreatedAt int64 `protobuf:"varint,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Count int32 `protobuf:"varint,8,opt,name=count,proto3" json:"count,omitempty"`
ServerId int64 `protobuf:"varint,9,opt,name=serverId,proto3" json:"serverId,omitempty"`
IsFixed bool `protobuf:"varint,10,opt,name=isFixed,proto3" json:"isFixed,omitempty"`
}
func (x *NodeLog) Reset() {
@@ -71,6 +74,13 @@ func (*NodeLog) Descriptor() ([]byte, []int) {
return file_models_model_node_log_proto_rawDescGZIP(), []int{0}
}
func (x *NodeLog) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NodeLog) GetRole() string {
if x != nil {
return x.Role
@@ -120,24 +130,42 @@ func (x *NodeLog) GetCount() int32 {
return 0
}
func (x *NodeLog) GetServerId() int64 {
if x != nil {
return x.ServerId
}
return 0
}
func (x *NodeLog) GetIsFixed() bool {
if x != nil {
return x.IsFixed
}
return false
}
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, 0xb3, 0x01, 0x0a, 0x07, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x12, 0x0a,
0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c,
0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x62, 0x22, 0xf9, 0x01, 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,
0x74, 0x61, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04,
0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6e,
0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64,
0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64,
0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41,
0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41,
0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x46, 0x69, 0x78, 0x65, 0x64, 0x18, 0x0a,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@@ -127,6 +127,7 @@ type CountNodeLogsRequest struct {
DayTo string `protobuf:"bytes,4,opt,name=dayTo,proto3" json:"dayTo,omitempty"`
Keyword string `protobuf:"bytes,5,opt,name=keyword,proto3" json:"keyword,omitempty"`
Level string `protobuf:"bytes,6,opt,name=level,proto3" json:"level,omitempty"`
ServerId int64 `protobuf:"varint,7,opt,name=serverId,proto3" json:"serverId,omitempty"`
}
func (x *CountNodeLogsRequest) Reset() {
@@ -203,6 +204,13 @@ func (x *CountNodeLogsRequest) GetLevel() string {
return ""
}
func (x *CountNodeLogsRequest) GetServerId() int64 {
if x != nil {
return x.ServerId
}
return 0
}
// 列出单页日志
type ListNodeLogsRequest struct {
state protoimpl.MessageState
@@ -217,6 +225,9 @@ type ListNodeLogsRequest struct {
DayTo string `protobuf:"bytes,6,opt,name=dayTo,proto3" json:"dayTo,omitempty"`
Keyword string `protobuf:"bytes,7,opt,name=keyword,proto3" json:"keyword,omitempty"`
Level string `protobuf:"bytes,8,opt,name=level,proto3" json:"level,omitempty"`
ServerId int64 `protobuf:"varint,9,opt,name=serverId,proto3" json:"serverId,omitempty"`
FixedState int32 `protobuf:"varint,10,opt,name=fixedState,proto3" json:"fixedState,omitempty"`
AllServers bool `protobuf:"varint,11,opt,name=allServers,proto3" json:"allServers,omitempty"` // 是否获取所有服务相关的日志
}
func (x *ListNodeLogsRequest) Reset() {
@@ -307,6 +318,27 @@ func (x *ListNodeLogsRequest) GetLevel() string {
return ""
}
func (x *ListNodeLogsRequest) GetServerId() int64 {
if x != nil {
return x.ServerId
}
return 0
}
func (x *ListNodeLogsRequest) GetFixedState() int32 {
if x != nil {
return x.FixedState
}
return 0
}
func (x *ListNodeLogsRequest) GetAllServers() bool {
if x != nil {
return x.AllServers
}
return false
}
type ListNodeLogsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -354,6 +386,54 @@ func (x *ListNodeLogsResponse) GetNodeLogs() []*NodeLog {
return nil
}
// 设置日志为已修复
type FixNodeLogRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NodeLogId int64 `protobuf:"varint,1,opt,name=nodeLogId,proto3" json:"nodeLogId,omitempty"`
}
func (x *FixNodeLogRequest) Reset() {
*x = FixNodeLogRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_node_log_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FixNodeLogRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FixNodeLogRequest) ProtoMessage() {}
func (x *FixNodeLogRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_node_log_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 FixNodeLogRequest.ProtoReflect.Descriptor instead.
func (*FixNodeLogRequest) Descriptor() ([]byte, []int) {
return file_service_node_log_proto_rawDescGZIP(), []int{5}
}
func (x *FixNodeLogRequest) GetNodeLogId() int64 {
if x != nil {
return x.NodeLogId
}
return 0
}
var File_service_node_log_proto protoreflect.FileDescriptor
var file_service_node_log_proto_rawDesc = []byte{
@@ -368,7 +448,7 @@ var file_service_node_log_proto_rawDesc = []byte{
0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x52, 0x08, 0x6e, 0x6f,
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0xa2, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f,
0x22, 0xbe, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f,
0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64,
0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
@@ -378,38 +458,52 @@ var file_service_node_log_proto_rawDesc = []byte{
0x64, 0x61, 0x79, 0x54, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12,
0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xcd, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f,
0x64, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a,
0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e,
0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66,
0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65,
0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x46, 0x72, 0x6f, 0x6d,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x61, 0x79, 0x46, 0x72, 0x6f, 0x6d, 0x12,
0x14, 0x0a, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x64, 0x61, 0x79, 0x54, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12,
0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x3f, 0x0a, 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, 0x32, 0xdd, 0x01, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x22, 0xa9, 0x02, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f,
0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64,
0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x61, 0x79, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x64, 0x61, 0x79, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x64,
0x61, 0x79, 0x54, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x61, 0x79, 0x54,
0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c,
0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65,
0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20,
0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a,
0x0a, 0x66, 0x69, 0x78, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0a, 0x66, 0x69, 0x78, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x61, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x08, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x22, 0x3f, 0x0a,
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, 0x32, 0x92, 0x02, 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, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
@@ -425,27 +519,31 @@ func file_service_node_log_proto_rawDescGZIP() []byte {
return file_service_node_log_proto_rawDescData
}
var file_service_node_log_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_service_node_log_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_service_node_log_proto_goTypes = []interface{}{
(*CreateNodeLogsRequest)(nil), // 0: pb.CreateNodeLogsRequest
(*CreateNodeLogsResponse)(nil), // 1: pb.CreateNodeLogsResponse
(*CountNodeLogsRequest)(nil), // 2: pb.CountNodeLogsRequest
(*ListNodeLogsRequest)(nil), // 3: pb.ListNodeLogsRequest
(*ListNodeLogsResponse)(nil), // 4: pb.ListNodeLogsResponse
(*NodeLog)(nil), // 5: pb.NodeLog
(*RPCCountResponse)(nil), // 6: pb.RPCCountResponse
(*FixNodeLogRequest)(nil), // 5: pb.FixNodeLogRequest
(*NodeLog)(nil), // 6: pb.NodeLog
(*RPCCountResponse)(nil), // 7: pb.RPCCountResponse
(*RPCSuccess)(nil), // 8: pb.RPCSuccess
}
var file_service_node_log_proto_depIdxs = []int32{
5, // 0: pb.CreateNodeLogsRequest.nodeLogs:type_name -> pb.NodeLog
5, // 1: pb.ListNodeLogsResponse.nodeLogs:type_name -> pb.NodeLog
6, // 0: pb.CreateNodeLogsRequest.nodeLogs:type_name -> pb.NodeLog
6, // 1: pb.ListNodeLogsResponse.nodeLogs:type_name -> pb.NodeLog
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
1, // 5: pb.NodeLogService.createNodeLogs:output_type -> pb.CreateNodeLogsResponse
6, // 6: pb.NodeLogService.countNodeLogs:output_type -> pb.RPCCountResponse
4, // 7: pb.NodeLogService.listNodeLogs:output_type -> pb.ListNodeLogsResponse
5, // [5:8] is the sub-list for method output_type
2, // [2:5] is the sub-list for method input_type
5, // 5: pb.NodeLogService.fixNodeLog:input_type -> pb.FixNodeLogRequest
1, // 6: pb.NodeLogService.createNodeLogs:output_type -> pb.CreateNodeLogsResponse
7, // 7: pb.NodeLogService.countNodeLogs:output_type -> pb.RPCCountResponse
4, // 8: pb.NodeLogService.listNodeLogs:output_type -> pb.ListNodeLogsResponse
8, // 9: pb.NodeLogService.fixNodeLog:output_type -> pb.RPCSuccess
6, // [6:10] is the sub-list for method output_type
2, // [2:6] 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
@@ -519,6 +617,18 @@ func file_service_node_log_proto_init() {
return nil
}
}
file_service_node_log_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FixNodeLogRequest); 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{
@@ -526,7 +636,7 @@ func file_service_node_log_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_node_log_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
@@ -558,6 +668,8 @@ type NodeLogServiceClient interface {
CountNodeLogs(ctx context.Context, in *CountNodeLogsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
// 列出单页日志
ListNodeLogs(ctx context.Context, in *ListNodeLogsRequest, opts ...grpc.CallOption) (*ListNodeLogsResponse, error)
// 设置日志为已修复
FixNodeLog(ctx context.Context, in *FixNodeLogRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
}
type nodeLogServiceClient struct {
@@ -595,6 +707,15 @@ 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) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NodeLogService/fixNodeLog", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// NodeLogServiceServer is the server API for NodeLogService service.
type NodeLogServiceServer interface {
// 创建日志
@@ -603,6 +724,8 @@ type NodeLogServiceServer interface {
CountNodeLogs(context.Context, *CountNodeLogsRequest) (*RPCCountResponse, error)
// 列出单页日志
ListNodeLogs(context.Context, *ListNodeLogsRequest) (*ListNodeLogsResponse, error)
// 设置日志为已修复
FixNodeLog(context.Context, *FixNodeLogRequest) (*RPCSuccess, error)
}
// UnimplementedNodeLogServiceServer can be embedded to have forward compatible implementations.
@@ -618,6 +741,9 @@ 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 RegisterNodeLogServiceServer(s *grpc.Server, srv NodeLogServiceServer) {
s.RegisterService(&_NodeLogService_serviceDesc, srv)
@@ -677,6 +803,24 @@ 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)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NodeLogServiceServer).FixNodeLog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NodeLogService/FixNodeLog",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NodeLogServiceServer).FixNodeLog(ctx, req.(*FixNodeLogRequest))
}
return interceptor(ctx, in, info, handler)
}
var _NodeLogService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.NodeLogService",
HandlerType: (*NodeLogServiceServer)(nil),
@@ -693,6 +837,10 @@ var _NodeLogService_serviceDesc = grpc.ServiceDesc{
MethodName: "listNodeLogs",
Handler: _NodeLogService_ListNodeLogs_Handler,
},
{
MethodName: "fixNodeLog",
Handler: _NodeLogService_FixNodeLog_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_node_log.proto",

View File

@@ -4,11 +4,14 @@ option go_package = "./pb";
package pb;
message NodeLog {
string role = 1;
string tag = 2;
string description = 3;
string level = 4;
int64 nodeId = 5;
int64 createdAt = 6;
int32 count = 7;
int64 id = 1;
string role = 2;
string tag = 3;
string description = 4;
string level = 5;
int64 nodeId = 6;
int64 createdAt = 7;
int32 count = 8;
int64 serverId = 9;
bool isFixed = 10;
}

View File

@@ -16,6 +16,9 @@ service NodeLogService {
// 列出单页日志
rpc listNodeLogs (ListNodeLogsRequest) returns (ListNodeLogsResponse);
// 设置日志为已修复
rpc fixNodeLog (FixNodeLogRequest) returns (RPCSuccess);
}
// 创建日志
@@ -35,6 +38,7 @@ message CountNodeLogsRequest {
string dayTo = 4;
string keyword = 5;
string level = 6;
int64 serverId = 7;
}
// 列出单页日志
@@ -48,8 +52,16 @@ message ListNodeLogsRequest {
string dayTo = 6;
string keyword = 7;
string level = 8;
int64 serverId = 9;
int32 fixedState = 10;
bool allServers = 11; // 是否获取所有服务相关的日志
}
message ListNodeLogsResponse {
repeated NodeLog nodeLogs = 1;
}
// 设置日志为已修复
message FixNodeLogRequest {
int64 nodeLogId = 1;
}