Edit proto & add Diagdate
Build and Push Docker Image / build_and_push (push) Successful in 3m29s
Details
Build and Push Docker Image / build_and_push (push) Successful in 3m29s
Details
This commit is contained in:
parent
5b4eff783c
commit
726bb4643c
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
|
||||
|
@ -19,6 +20,7 @@ func (e Diag) ToStorageType() storage.Diag {
|
|||
Ui_schema: e.UiSchema,
|
||||
Data: map[string]any{},
|
||||
Deleted: e.Deleted,
|
||||
Diagdate: e.Diagdate.AsTime(),
|
||||
}
|
||||
|
||||
for k, d := range e.Data.GetFields() {
|
||||
|
@ -56,6 +58,7 @@ func DiagFromStorageType(diag *storage.Diag) (*Diag, error) {
|
|||
UiSchema: diag.Ui_schema,
|
||||
Data: data,
|
||||
Deleted: diag.Deleted,
|
||||
Diagdate: timestamppb.New(diag.Diagdate),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
structpb "google.golang.org/protobuf/types/known/structpb"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
@ -33,6 +34,7 @@ type Diag struct {
|
|||
UiSchema string `protobuf:"bytes,5,opt,name=ui_schema,json=uiSchema,proto3" json:"ui_schema,omitempty"`
|
||||
Data *structpb.Struct `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Deleted bool `protobuf:"varint,7,opt,name=deleted,proto3" json:"deleted,omitempty"`
|
||||
Diagdate *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=diagdate,proto3" json:"diagdate,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Diag) Reset() {
|
||||
|
@ -114,29 +116,41 @@ func (x *Diag) GetDeleted() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (x *Diag) GetDiagdate() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.Diagdate
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_diag_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_diag_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x64, 0x69, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74,
|
||||
0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x01, 0x0a, 0x04, 0x44,
|
||||
0x69, 0x61, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
|
||||
0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x73, 0x63,
|
||||
0x68, 0x65, 0x6d, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e,
|
||||
0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x69, 0x5f, 0x73, 0x63, 0x68,
|
||||
0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x69, 0x53, 0x63, 0x68,
|
||||
0x65, 0x6d, 0x61, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69,
|
||||
0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70,
|
||||
0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x64, 0x69, 0x61, 0x67,
|
||||
0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x02, 0x0a, 0x04,
|
||||
0x44, 0x69, 0x61, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x73,
|
||||
0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6a, 0x73, 0x6f,
|
||||
0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x69, 0x5f, 0x73, 0x63,
|
||||
0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x69, 0x53, 0x63,
|
||||
0x68, 0x65, 0x6d, 0x61, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x08, 0x64,
|
||||
0x69, 0x61, 0x67, 0x64, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x64, 0x69, 0x61, 0x67, 0x64,
|
||||
0x61, 0x74, 0x65, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67,
|
||||
0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74,
|
||||
0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x64, 0x69, 0x61, 0x67, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61,
|
||||
0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -155,14 +169,16 @@ var file_diag_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
|||
var file_diag_proto_goTypes = []any{
|
||||
(*Diag)(nil), // 0: Diag
|
||||
(*structpb.Struct)(nil), // 1: google.protobuf.Struct
|
||||
(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
|
||||
}
|
||||
var file_diag_proto_depIdxs = []int32{
|
||||
1, // 0: Diag.data:type_name -> google.protobuf.Struct
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
2, // 1: Diag.diagdate:type_name -> google.protobuf.Timestamp
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] 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_diag_proto_init() }
|
||||
|
|
|
@ -3,6 +3,7 @@ syntax = "proto3";
|
|||
option go_package = "git.coopgo.io/coopgo-platform/diags/grpcapi";
|
||||
|
||||
import "google/protobuf/struct.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
message Diag {
|
||||
string id = 1;
|
||||
|
@ -12,4 +13,5 @@ message Diag {
|
|||
string ui_schema = 5;
|
||||
google.protobuf.Struct data = 6;
|
||||
bool deleted = 7;
|
||||
google.protobuf.Timestamp diagdate = 8;
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package storage
|
||||
|
||||
import "time"
|
||||
|
||||
type Diag struct {
|
||||
ID string `json:"id" bson:"_id"`
|
||||
Name string `json:"name"`
|
||||
|
@ -8,4 +10,5 @@ type Diag struct {
|
|||
Ui_schema string `json:"ui_schema"`
|
||||
Data map[string]any `json:"data"`
|
||||
Deleted bool `json:"deleted"`
|
||||
Diagdate time.Time `json:"diagdate"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue