mirror of
https://github.com/outbackdingo/databunker.git
synced 2026-01-27 18:18:43 +00:00
use endtime in db
This commit is contained in:
@@ -11,17 +11,17 @@ import (
|
||||
)
|
||||
|
||||
type consentEvent struct {
|
||||
When int32 `json:"when,omitempty" structs:"when"`
|
||||
Who string `json:"who,omitempty" structs:"who"`
|
||||
Mode string `json:"mode,omitempty" structs:"mode"`
|
||||
Token string `json:"token,omitempty" structs:"token"`
|
||||
Brief string `json:"brief,omitempty" structs:"brief"`
|
||||
Message string `json:"message,omitempty" structs:"message,omitempty"`
|
||||
Status string `json:"status,omitempty" structs:"status"`
|
||||
Expiration int32 `json:"expiration,omitempty" structs:"expiration"`
|
||||
When int32 `json:"when,omitempty" structs:"when"`
|
||||
Who string `json:"who,omitempty" structs:"who"`
|
||||
Mode string `json:"mode,omitempty" structs:"mode"`
|
||||
Token string `json:"token,omitempty" structs:"token"`
|
||||
Brief string `json:"brief,omitempty" structs:"brief"`
|
||||
Message string `json:"message,omitempty" structs:"message,omitempty"`
|
||||
Status string `json:"status,omitempty" structs:"status"`
|
||||
Endtime int32 `json:"endtime,omitempty" structs:"endtime"`
|
||||
}
|
||||
|
||||
func (dbobj dbcon) createConsentRecord(userTOKEN string, mode string, usercode string, brief string, message string, status string, expiration int32) {
|
||||
func (dbobj dbcon) createConsentRecord(userTOKEN string, mode string, usercode string, brief string, message string, status string, endtime int32) {
|
||||
now := int32(time.Now().Unix())
|
||||
if len(userTOKEN) > 0 {
|
||||
// first check if this consent exists, then update
|
||||
@@ -36,20 +36,20 @@ func (dbobj dbcon) createConsentRecord(userTOKEN string, mode string, usercode s
|
||||
bdoc := bson.M{}
|
||||
bdoc["when"] = now
|
||||
bdoc["status"] = status
|
||||
bdoc["expiration"] = expiration
|
||||
bdoc["endtime"] = endtime
|
||||
dbobj.updateRecord2(TblName.Consent, "token", userTOKEN, "brief", brief, &bdoc, nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
ev := consentEvent{
|
||||
When: now,
|
||||
Who: usercode,
|
||||
Token: userTOKEN,
|
||||
Mode: mode,
|
||||
Brief: brief,
|
||||
Message: message,
|
||||
Status: status,
|
||||
Expiration: expiration,
|
||||
When: now,
|
||||
Who: usercode,
|
||||
Token: userTOKEN,
|
||||
Mode: mode,
|
||||
Brief: brief,
|
||||
Message: message,
|
||||
Status: status,
|
||||
Endtime: endtime,
|
||||
}
|
||||
// in any case - insert record
|
||||
fmt.Printf("insert consent record\n")
|
||||
|
||||
Reference in New Issue
Block a user