1
This commit is contained in:
parent
be299ef07c
commit
9f395295f0
@ -53,6 +53,10 @@ SMLogin
|
|||||||
用户组
|
用户组
|
||||||
增删改
|
增删改
|
||||||
|
|
||||||
|
事件类型
|
||||||
|
邮件:新增、变更、删除
|
||||||
|
用户组:新增、变更、删除
|
||||||
|
|
||||||
# 参考
|
# 参考
|
||||||
|
|
||||||
https://gorm.io/zh_CN/docs/
|
https://gorm.io/zh_CN/docs/
|
||||||
|
@ -21,9 +21,11 @@ type mailMgr struct {
|
|||||||
groupMails sync.Map //int64 => *mail
|
groupMails sync.Map //int64 => *mail
|
||||||
personalMails sync.Map //string => sync.Map<int64, *mail>
|
personalMails sync.Map //string => sync.Map<int64, *mail>
|
||||||
groupHash sync.Map //int64 => *userGroup
|
groupHash sync.Map //int64 => *userGroup
|
||||||
|
lastSyncEventIdx int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *mailMgr) Init() {
|
func (this *mailMgr) Init() {
|
||||||
|
this.syncEvent()
|
||||||
this.loadMails()
|
this.loadMails()
|
||||||
this.loadGroups()
|
this.loadGroups()
|
||||||
this.loadGroupMembers()
|
this.loadGroupMembers()
|
||||||
@ -265,3 +267,20 @@ func (this *mailMgr) internalGetMail(mailId string) *mail {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *mailMgr) syncEvent() {
|
||||||
|
f5.GetGoStyleDb().SyncSelectCustomQuery(
|
||||||
|
constant.MAIL_DB,
|
||||||
|
"SELECT MAX(idx) FROM t_event;",
|
||||||
|
func(err error, ds *f5.DataSet) {
|
||||||
|
if err != nil {
|
||||||
|
panic("sync event error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ds.Next() {
|
||||||
|
this.lastSyncEventIdx = q5.ToInt64(ds.GetByIndex(0))
|
||||||
|
} else {
|
||||||
|
panic("sync event error")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user