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"
|
||||
)
|
||||
|
||||
const (
|
||||
logDBName = "fcm"
|
||||
maxTokensPerSend = 1000
|
||||
)
|
||||
|
||||
// base64Decode ...
|
||||
func base64Decode(text string) []byte {
|
||||
sDec, _ := b64.StdEncoding.DecodeString(text)
|
||||
|
|
2
log.go
2
log.go
|
@ -35,7 +35,7 @@ func (s Service) saveLog(doc Log) {
|
|||
|
||||
// Assign data
|
||||
doc.ID = mongodb.NewObjectID()
|
||||
doc.CreatedAt = Now()
|
||||
doc.CreatedAt = now()
|
||||
|
||||
if _, err := s.DB.Collection(logDBName).InsertOne(ctx, doc); err != nil {
|
||||
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"
|
||||
|
||||
// GetHCMLocation ...
|
||||
func GetHCMLocation() *time.Location {
|
||||
// getHCMLocation ...
|
||||
func getHCMLocation() *time.Location {
|
||||
l, _ := time.LoadLocation(timezoneHCM)
|
||||
return l
|
||||
}
|
||||
|
||||
|
||||
// Now ...
|
||||
func Now() time.Time {
|
||||
return time.Now().In(GetHCMLocation())
|
||||
// now ...
|
||||
func now() time.Time {
|
||||
return time.Now().In(getHCMLocation())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue