router3.go
449 字节
package routers
import (
"oppmg/services/crontab"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
)
func init() {
testNs := beego.NewNamespace("/test",
beego.NSCond(func(ctx *context.Context) bool {
if beego.BConfig.RunMode == "prod" {
return false
}
return true
}),
beego.NSGet("/create_rank_peroid",
func(ctx *context.Context) {
crontab.AutoCreateRankPeriod()
}),
)
beego.AddNamespace(testNs)
}