49 lines
2.2 KiB
Go
49 lines
2.2 KiB
Go
package routers
|
|
|
|
import (
|
|
"github.com/astaxie/beego"
|
|
|
|
"github.com/openbrainorg/openbrain/controllers"
|
|
)
|
|
|
|
func init() {
|
|
initAPI()
|
|
}
|
|
|
|
func initAPI() {
|
|
ns :=
|
|
beego.NewNamespace("/api",
|
|
beego.NSInclude(
|
|
&controllers.ApiController{},
|
|
),
|
|
)
|
|
beego.AddNamespace(ns)
|
|
|
|
beego.Router("/api/signin", &controllers.ApiController{}, "POST:Signin")
|
|
beego.Router("/api/signout", &controllers.ApiController{}, "POST:Signout")
|
|
beego.Router("/api/get-account", &controllers.ApiController{}, "GET:GetAccount")
|
|
|
|
beego.Router("/api/get-global-wordsets", &controllers.ApiController{}, "GET:GetGlobalWordsets")
|
|
beego.Router("/api/get-wordsets", &controllers.ApiController{}, "GET:GetWordsets")
|
|
beego.Router("/api/get-wordset", &controllers.ApiController{}, "GET:GetWordset")
|
|
beego.Router("/api/get-wordset-graph", &controllers.ApiController{}, "GET:GetWordsetGraph")
|
|
beego.Router("/api/get-wordset-match", &controllers.ApiController{}, "GET:GetWordsetMatch")
|
|
beego.Router("/api/update-wordset", &controllers.ApiController{}, "POST:UpdateWordset")
|
|
beego.Router("/api/add-wordset", &controllers.ApiController{}, "POST:AddWordset")
|
|
beego.Router("/api/delete-wordset", &controllers.ApiController{}, "POST:DeleteWordset")
|
|
|
|
beego.Router("/api/get-global-vectorsets", &controllers.ApiController{}, "GET:GetGlobalVectorsets")
|
|
beego.Router("/api/get-vectorsets", &controllers.ApiController{}, "GET:GetVectorsets")
|
|
beego.Router("/api/get-vectorset", &controllers.ApiController{}, "GET:GetVectorset")
|
|
beego.Router("/api/update-vectorset", &controllers.ApiController{}, "POST:UpdateVectorset")
|
|
beego.Router("/api/add-vectorset", &controllers.ApiController{}, "POST:AddVectorset")
|
|
beego.Router("/api/delete-vectorset", &controllers.ApiController{}, "POST:DeleteVectorset")
|
|
|
|
beego.Router("/api/get-global-videos", &controllers.ApiController{}, "GET:GetGlobalVideos")
|
|
beego.Router("/api/get-videos", &controllers.ApiController{}, "GET:GetVideos")
|
|
beego.Router("/api/get-video", &controllers.ApiController{}, "GET:GetVideo")
|
|
beego.Router("/api/update-video", &controllers.ApiController{}, "POST:UpdateVideo")
|
|
beego.Router("/api/add-video", &controllers.ApiController{}, "POST:AddVideo")
|
|
beego.Router("/api/delete-video", &controllers.ApiController{}, "POST:DeleteVideo")
|
|
}
|