1
This commit is contained in:
parent
b122c9c26d
commit
afdce6f3f4
@ -17,3 +17,5 @@ type Player interface {
|
||||
type PlayerMgr interface{}
|
||||
type Mail interface{}
|
||||
type MailMgr interface{}
|
||||
|
||||
type ControllerMgr interface{}
|
||||
|
@ -12,6 +12,7 @@ const (
|
||||
APP_MODULE_IDX = iota
|
||||
PLAYER_MGR_MODULE_IDX
|
||||
MAIL_MGR_MODULE_IDX
|
||||
CONTROLLER_MGR_MODULE_IDX
|
||||
MAX_MODULE_IDX
|
||||
)
|
||||
|
||||
|
24
server/mailserver/controller/controllermgr.go
Normal file
24
server/mailserver/controller/controllermgr.go
Normal file
@ -0,0 +1,24 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"main/middleware"
|
||||
)
|
||||
|
||||
type ControllerMgr struct {
|
||||
|
||||
}
|
||||
|
||||
func (this* ControllerMgr) Init() {
|
||||
f5.GetApp().GetGinEngine().Use(middleware.CaForward)
|
||||
f5.GetApp().GetGinEngine().Use(middleware.CaAuth)
|
||||
f5.GetApp().RegisterCaHandle("mail", "getMailList", mail_getMail)
|
||||
f5.GetApp().RegisterCaHandle("mail", "markMail", mail_markMail)
|
||||
f5.GetApp().RegisterCaHandle("mail", "getUnreadMailCnt", mail_getUnreadMailCnt)
|
||||
f5.GetApp().RegisterCaHandle("mail", "getAttachment", mail_getAttachment)
|
||||
f5.GetApp().RegisterCaHandle("mail", "deleteMails", mail_deleteMails)
|
||||
}
|
||||
|
||||
func (this* ControllerMgr) UnInit() {
|
||||
|
||||
}
|
@ -1,13 +1,5 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"f5"
|
||||
)
|
||||
|
||||
func init() {
|
||||
f5.GetApp().RegisterCaHandle("mail", "getMailList", mail_getMail)
|
||||
f5.GetApp().RegisterCaHandle("mail", "markMail", mail_markMail)
|
||||
f5.GetApp().RegisterCaHandle("mail", "getUnreadMailCnt", mail_getUnreadMailCnt)
|
||||
f5.GetApp().RegisterCaHandle("mail", "getAttachment", mail_getAttachment)
|
||||
f5.GetApp().RegisterCaHandle("mail", "deleteMails", mail_deleteMails)
|
||||
}
|
||||
|
@ -11,11 +11,13 @@ var modules [constant.MAX_MODULE_IDX]q5.Module
|
||||
var initOrders = []int32{
|
||||
constant.PLAYER_MGR_MODULE_IDX,
|
||||
constant.MAIL_MGR_MODULE_IDX,
|
||||
constant.CONTROLLER_MGR_MODULE_IDX,
|
||||
}
|
||||
|
||||
var app common.App
|
||||
var playerMgr common.PlayerMgr
|
||||
var mailMgr common.MailMgr
|
||||
var controllerMgr common.ControllerMgr
|
||||
|
||||
func GetApp() common.App {
|
||||
return app
|
||||
@ -45,6 +47,10 @@ func RegModule(idx int32, m q5.Module) {
|
||||
{
|
||||
mailMgr = m.(common.MailMgr)
|
||||
}
|
||||
case constant.CONTROLLER_MGR_MODULE_IDX:
|
||||
{
|
||||
controllerMgr = m.(common.ControllerMgr)
|
||||
}
|
||||
default:
|
||||
{
|
||||
panic("unknow module")
|
||||
|
@ -2,8 +2,9 @@ package middleware
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"f5"
|
||||
)
|
||||
|
||||
func CaAuth(c *gin.Context) {
|
||||
|
||||
f5.GetSysLog().Info("CaAuth")
|
||||
}
|
||||
|
@ -2,8 +2,9 @@ package middleware
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"f5"
|
||||
)
|
||||
|
||||
func CaForward(c *gin.Context) {
|
||||
|
||||
f5.GetSysLog().Info("CaForward")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user