This commit is contained in:
aozhiwei 2024-04-18 09:20:39 +08:00
parent 32151093dc
commit 7073914e00
2 changed files with 24 additions and 8 deletions

View File

@ -115,20 +115,24 @@ CREATE TABLE `t_member` (
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
--
-- Table structure for table `t_user`
-- Table structure for table `t_inbox`
--
DROP TABLE IF EXISTS `t_user`;
DROP TABLE IF EXISTS `t_inbox`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_user` (
CREATE TABLE `t_inbox` (
`idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '账号id',
`maildata` text COMMENT '账号',
`mail_id` bigint NOT NULL COMMENT '邮件id',
`state` int(11) NOT NULL DEFAULT '0' COMMENT '1:已读取 2:已删除',
`expiretime` int(11) NOT NULL DEFAULT '0' COMMENT '过期时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `account_id` (`account_id`)
UNIQUE KEY `idx_account_id_mail_id` (`account_id`, `mail_id`),
KEY `idx_state` (`state`),
KEY `idx_expiretime` (`expiretime`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

View File

@ -22,10 +22,16 @@ type player struct {
accountId string
sessionId string
registerTime int32
loaded bool
readMailHash map[int64]*ReadMail
deletedMailHash map[int64]*DeletedMail
}
func (this *player) init() {
this.readMailHash = make(map[int64]*ReadMail)
this.deletedMailHash = make(map[int64]*DeletedMail)
}
func (this *player) Lock() {
this.lock.Lock()
}
@ -39,15 +45,15 @@ func (this *player) GetAccountId() string {
}
func (this *player) MarkMails(mails []common.Mail) {
this.checkLock()
}
func (this *player) GetAttachment(mails []common.Mail) {
this.checkLock()
}
func (this *player) DeleteMails(mails []common.Mail) {
this.checkLock()
}
func (this *player) checkLock() {
@ -55,3 +61,9 @@ func (this *player) checkLock() {
panic("player checkLock error")
}
}
func newPlayer() *player {
p := new(player)
p.init()
return p
}