mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-18 21:55:08 +00:00
format the date
This commit is contained in:
@@ -90,7 +90,7 @@ func (e *Rss) fetch(f *pb.Feed) error {
|
|||||||
Feed: f.Url,
|
Feed: f.Url,
|
||||||
Link: item.Link,
|
Link: item.Link,
|
||||||
Content: content,
|
Content: content,
|
||||||
Date: item.Date.Unix(),
|
Date: item.Date.Format(time.RFC3339Nano),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error saving item: %v", err)
|
return fmt.Errorf("Error saving item: %v", err)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ type Entry struct {
|
|||||||
// article content
|
// article content
|
||||||
Content string `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"`
|
Content string `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"`
|
||||||
// data of the entry
|
// data of the entry
|
||||||
Date int64 `protobuf:"varint,7,opt,name=date,proto3" json:"date,omitempty"`
|
Date string `protobuf:"bytes,7,opt,name=date,proto3" json:"date,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Entry) Reset() {
|
func (x *Entry) Reset() {
|
||||||
@@ -192,11 +192,11 @@ func (x *Entry) GetContent() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Entry) GetDate() int64 {
|
func (x *Entry) GetDate() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Date
|
return x.Date
|
||||||
}
|
}
|
||||||
return 0
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type AddRequest struct {
|
type AddRequest struct {
|
||||||
@@ -591,7 +591,7 @@ var file_proto_rss_proto_rawDesc = []byte{
|
|||||||
0x61, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61,
|
0x61, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61,
|
||||||
0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20,
|
0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||||
0x64, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65,
|
0x64, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65,
|
||||||
0x22, 0x4e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
|
0x22, 0x4e, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
|
||||||
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
|
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
|
||||||
0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ message Entry {
|
|||||||
// article content
|
// article content
|
||||||
string content = 6;
|
string content = 6;
|
||||||
// data of the entry
|
// data of the entry
|
||||||
int64 date = 7;
|
string date = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AddRequest {
|
message AddRequest {
|
||||||
|
|||||||
Reference in New Issue
Block a user