update constant
This commit is contained in:
parent
d9852ad3e5
commit
1f592675a4
|
@ -0,0 +1,6 @@
|
||||||
|
package fcm
|
||||||
|
|
||||||
|
const (
|
||||||
|
logDBName = "log_fcm"
|
||||||
|
maxTokensPerSend = 1000
|
||||||
|
)
|
|
@ -6,11 +6,6 @@ import (
|
||||||
"github.com/thoas/go-funk"
|
"github.com/thoas/go-funk"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
logDBName = "fcm"
|
|
||||||
maxTokensPerSend = 1000
|
|
||||||
)
|
|
||||||
|
|
||||||
// base64Decode ...
|
// base64Decode ...
|
||||||
func base64Decode(text string) []byte {
|
func base64Decode(text string) []byte {
|
||||||
sDec, _ := b64.StdEncoding.DecodeString(text)
|
sDec, _ := b64.StdEncoding.DecodeString(text)
|
||||||
|
|
2
log.go
2
log.go
|
@ -35,7 +35,7 @@ func (s Service) saveLog(doc Log) {
|
||||||
|
|
||||||
// Assign data
|
// Assign data
|
||||||
doc.ID = mongodb.NewObjectID()
|
doc.ID = mongodb.NewObjectID()
|
||||||
doc.CreatedAt = Now()
|
doc.CreatedAt = now()
|
||||||
|
|
||||||
if _, err := s.DB.Collection(logDBName).InsertOne(ctx, doc); err != nil {
|
if _, err := s.DB.Collection(logDBName).InsertOne(ctx, doc); err != nil {
|
||||||
pretty.Println("*** FCM create log error", err.Error())
|
pretty.Println("*** FCM create log error", err.Error())
|
||||||
|
|
11
time.go
11
time.go
|
@ -10,14 +10,13 @@ import "time"
|
||||||
|
|
||||||
const timezoneHCM = "Asia/Ho_Chi_Minh"
|
const timezoneHCM = "Asia/Ho_Chi_Minh"
|
||||||
|
|
||||||
// GetHCMLocation ...
|
// getHCMLocation ...
|
||||||
func GetHCMLocation() *time.Location {
|
func getHCMLocation() *time.Location {
|
||||||
l, _ := time.LoadLocation(timezoneHCM)
|
l, _ := time.LoadLocation(timezoneHCM)
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// now ...
|
||||||
// Now ...
|
func now() time.Time {
|
||||||
func Now() time.Time {
|
return time.Now().In(getHCMLocation())
|
||||||
return time.Now().In(GetHCMLocation())
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue