From 37d95baf9b4f787ea76830058d89631fad6318de Mon Sep 17 00:00:00 2001 From: saria alam Date: Wed, 18 Oct 2023 00:14:27 +0600 Subject: [PATCH] #Add Notifications data model --- internal/model/notifications.pb.go | 216 +++++++++++++++++++++++++++++ internal/model/notifications.proto | 17 +++ 2 files changed, 233 insertions(+) create mode 100644 internal/model/notifications.pb.go create mode 100644 internal/model/notifications.proto diff --git a/internal/model/notifications.pb.go b/internal/model/notifications.pb.go new file mode 100644 index 0000000..7497eb6 --- /dev/null +++ b/internal/model/notifications.pb.go @@ -0,0 +1,216 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: notifications.proto + +package model + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 Notifications struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` + Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` + Image string `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"` + Sound string `protobuf:"bytes,5,opt,name=sound,proto3" json:"sound,omitempty"` + Time *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=time,proto3" json:"time,omitempty"` + Channel string `protobuf:"bytes,7,opt,name=channel,proto3" json:"channel,omitempty"` + PriorityLevel int64 `protobuf:"varint,8,opt,name=priority_level,json=priorityLevel,proto3" json:"priority_level,omitempty"` +} + +func (x *Notifications) Reset() { + *x = Notifications{} + if protoimpl.UnsafeEnabled { + mi := &file_notifications_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Notifications) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Notifications) ProtoMessage() {} + +func (x *Notifications) ProtoReflect() protoreflect.Message { + mi := &file_notifications_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 Notifications.ProtoReflect.Descriptor instead. +func (*Notifications) Descriptor() ([]byte, []int) { + return file_notifications_proto_rawDescGZIP(), []int{0} +} + +func (x *Notifications) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Notifications) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *Notifications) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *Notifications) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *Notifications) GetSound() string { + if x != nil { + return x.Sound + } + return "" +} + +func (x *Notifications) GetTime() *timestamppb.Timestamp { + if x != nil { + return x.Time + } + return nil +} + +func (x *Notifications) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *Notifications) GetPriorityLevel() int64 { + if x != nil { + return x.PriorityLevel + } + return 0 +} + +var File_notifications_proto protoreflect.FileDescriptor + +var file_notifications_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 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, 0xee, 0x01, + 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 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, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6f, 0x75, 0x6e, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2e, 0x0a, + 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 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, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x69, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0d, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x09, + 0x5a, 0x07, 0x2e, 0x3b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_notifications_proto_rawDescOnce sync.Once + file_notifications_proto_rawDescData = file_notifications_proto_rawDesc +) + +func file_notifications_proto_rawDescGZIP() []byte { + file_notifications_proto_rawDescOnce.Do(func() { + file_notifications_proto_rawDescData = protoimpl.X.CompressGZIP(file_notifications_proto_rawDescData) + }) + return file_notifications_proto_rawDescData +} + +var file_notifications_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_notifications_proto_goTypes = []interface{}{ + (*Notifications)(nil), // 0: model.Notifications + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_notifications_proto_depIdxs = []int32{ + 1, // 0: model.Notifications.time:type_name -> google.protobuf.Timestamp + 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 +} + +func init() { file_notifications_proto_init() } +func file_notifications_proto_init() { + if File_notifications_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_notifications_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Notifications); 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_notifications_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_notifications_proto_goTypes, + DependencyIndexes: file_notifications_proto_depIdxs, + MessageInfos: file_notifications_proto_msgTypes, + }.Build() + File_notifications_proto = out.File + file_notifications_proto_rawDesc = nil + file_notifications_proto_goTypes = nil + file_notifications_proto_depIdxs = nil +} diff --git a/internal/model/notifications.proto b/internal/model/notifications.proto new file mode 100644 index 0000000..f0e315a --- /dev/null +++ b/internal/model/notifications.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package model; +option go_package = ".;model"; +import "google/protobuf/timestamp.proto"; + +message Notifications{ + string title= 1; + string body= 2; + string source = 3; + string image = 4; + string sound= 5 ; + google.protobuf.Timestamp time = 6 ; + string channel = 7; + int64 priority_level = 8; +} +