router.go 1.2 KB

12345678910111213141516171819202122232425262728
  1. package ldap
  2. import (
  3. "github.com/astaxie/beego"
  4. )
  5. func InitRouter(prefix string) *beego.Namespace {
  6. ns := beego.NewNamespace(prefix+"/ldap",
  7. beego.NSRouter("/server/active", &ServerController{}, "get:GetServer"),
  8. beego.NSRouter("/server/list", &ServerController{}, "post:GetServers"),
  9. beego.NSRouter("/server", &ServerController{}, "post:Update"),
  10. beego.NSRouter("/server/verify", &ServerController{}, "post:Verify"),
  11. beego.NSRouter("/server/detail", &ServerController{}, "get:GetServerDetail"),
  12. beego.NSRouter("/login", &UserController{}, "post:Login"),
  13. beego.NSRouter("/user/sync", &UserController{}, "post:SyncUsers"),
  14. beego.NSRouter("/user/updatePassword", &UserController{}, "post:UpdateUserPassword"),
  15. beego.NSRouter("/user/detail", &UserController{}, "get:GetDetail"),
  16. beego.NSRouter("/user/save", &UserController{}, "post:SaveUser"),
  17. beego.NSRouter("/user/list", &UserController{}, "post:GetUsers"),
  18. // 组织
  19. beego.NSRouter("/organize/detail", &OrganizeController{}, "get:GetDetail"),
  20. beego.NSRouter("/organize/save", &OrganizeController{}, "post:Save"),
  21. beego.NSRouter("/organize/list", &OrganizeController{}, "post:List"),
  22. )
  23. return ns
  24. }