This commit is contained in:
aozhiwei 2024-04-13 12:30:56 +08:00
parent 8be7812708
commit e136dfc54a
3 changed files with 18 additions and 40 deletions

View File

@ -5,7 +5,7 @@ import (
"main/global"
)
var _mailMgr = new(MailMgr)
var _mailMgr = new(mailMgr)
func init() {
global.RegModule(constant.MAIL_MGR_MODULE_IDX, _mailMgr)

View File

@ -7,28 +7,7 @@ import (
//"strings"
)
type Attachment struct {
ItemId int `json:"itemid"`
ItemNum int `json:"itemnum"`
}
// GMMail mail mgr
type GMMail struct {
GameId int `json:"gameid"`
MailId int64 `json:"mailid,string"`
From string `json:"from"`
To string `json:"to"`
Subject string `json:"subject"`
Content string `json:"content"`
SendTime int32 `json:"sendtime"`
ExpireTime int32 `json:"expiretime"`
MailType int `json:"mailtype"`
MailSubType int `json:"mailsubtype"`
Ext string `json:"ext"`
ATT []*Attachment `json:"attachments"`
}
type Mail struct {
type mail struct {
GameId int `json:"-"`
MailId int64 `json:"mailid,string"`
From string `json:"from"`
@ -43,15 +22,14 @@ type Mail struct {
UserType int `json:"-"`
CreateTime int32 `json:"-"`
Ext string `json:"ext"`
ATT []*Attachment `json:"attachments"`
}
func (m *Mail) Init() {
func (m *mail) Init() {
}
func NewMail() *Mail {
m := new(Mail)
func NewMail() *mail {
m := new(mail)
m.Init()
return m
}

View File

@ -5,40 +5,40 @@ import (
"github.com/gin-gonic/gin"
)
type MailMgr struct {
idHash map[int64]*Mail
type mailMgr struct {
idHash map[int64]*mail
}
func (this *MailMgr) Init() {
this.idHash = make(map[int64]*Mail)
this.fetchMailFromDB()
func (this *mailMgr) Init() {
this.idHash = make(map[int64]*mail)
this.fetchmailFromDB()
}
func (this *MailMgr) UnInit() {
func (this *mailMgr) UnInit() {
}
func (this *MailMgr) fetchMailFromDB() {
func (this *mailMgr) fetchmailFromDB() {
}
func (this *MailMgr) loadFromDB() {
func (this *mailMgr) loadFromDB() {
}
func (this *MailMgr) caGetMailList(common.Player, *gin.Context) {
func (this *mailMgr) caGetMailList(common.Player, *gin.Context) {
}
func (this *MailMgr) caMarkMail(common.Player, *gin.Context) {
func (this *mailMgr) caMarkMail(common.Player, *gin.Context) {
}
func (this *MailMgr) caGetUnreadMailCnt(common.Player, *gin.Context) {
func (this *mailMgr) caGetUnreadMailCnt(common.Player, *gin.Context) {
}
func (this *MailMgr) caGetAttachment(common.Player, *gin.Context) {
func (this *mailMgr) caGetAttachment(common.Player, *gin.Context) {
}
func (this *MailMgr) caDeleteMails(common.Player, *gin.Context) {
func (this *mailMgr) caDeleteMails(common.Player, *gin.Context) {
}