You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
664 B

package routers
import (
"auxpi/bootstrap"
"auxpi/controllers"
"auxpi/controllers/api"
"auxpi/controllers/upload"
"github.com/astaxie/beego"
)
var siteConfig = bootstrap.Config()
func init() {
//注册控制器内的路由
beego.Include(&controllers.UpLoadController{})
beego.Include(&page.PagesController{})
//API 路由单独控制
if siteConfig.OpenApiUpLoad {
beego.Router("api/v1/upload", &api.ApiUpLoadController{}, "post:ApiUpLoadHandle")
beego.Router("api/v1/upload", &api.ApiUpLoadController{}, "get,put,patch,delete,options,head:ErrorCapture")
} else {
beego.Router("api/v1/upload", &api.ApiUpLoadController{}, "*:ErrorCapture")
}
}