SystemController_gen.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package controllers
  2. import (
  3. "git.qianqiusoft.com/qianqiusoft/light-apiengine/engine"
  4. "git.qianqiusoft.com/qianqiusoft/light-apiengine/entitys"
  5. "github.com/gin-gonic/gin"
  6. "github.com/xormplus/xorm"
  7. )
  8. // SystemController operations for System
  9. type SystemController struct {
  10. Ctx *gin.Context
  11. Db *xorm.Engine
  12. engine *engine.ApiEngine
  13. Token *entitys.Token
  14. }
  15. func NewSystemController(c *gin.Context, e *engine.ApiEngine) *SystemController {
  16. controller := &SystemController{c, e.OrmEngine, e, nil}
  17. return controller
  18. }
  19. // Login
  20. // @Title Login
  21. // @Description 用户登录
  22. // @Param logininfo false "登录信息"
  23. // @Success 200 {object} models.Account
  24. // @Failure 403 :id is empty
  25. // @router /login [post,get,put]
  26. func (c *SystemController) Login() {
  27. //
  28. System_Login(c)
  29. }
  30. // Logout
  31. // @Title Logout
  32. // @Description 用户退出
  33. // @Success 200 {object} models.Account
  34. // @Failure 403 :id is empty
  35. // @router /logout [post,get]
  36. func (c *SystemController) Logout() {
  37. //
  38. System_Logout(c)
  39. }
  40. // GetMenuTree
  41. // @Title GetMenuTree
  42. // @Description 获取系统菜单
  43. // @Param user string false "用户id"
  44. // @Success 200 {object} models.Account
  45. // @Failure 403 :id is empty
  46. // @router /get_menu_tree [post,get]
  47. func (c *SystemController) GetMenuTree() {
  48. //
  49. System_GetMenuTree(c)
  50. }
  51. // FindUserPage
  52. // @Title FindUserPage
  53. // @Description 获取用户分布数据
  54. // @Param page false "分页参数"
  55. // @Success 200 {object} models.Account
  56. // @Failure 403 :id is empty
  57. // @router /find_user_page [post,get]
  58. func (c *SystemController) FindUserPage() {
  59. //
  60. System_FindUserPage(c)
  61. }
  62. // GetOrgTree
  63. // @Title GetOrgTree
  64. // @Description 获取组织架构树
  65. // @Success 200 {object} models.Account
  66. // @Failure 403 :id is empty
  67. // @router /get_org_tree [post,get]
  68. func (c *SystemController) GetOrgTree() {
  69. //
  70. System_GetOrgTree(c)
  71. }
  72. // FindPermissions
  73. // @Title FindPermissions
  74. // @Description 查找用户的菜单权限标识集合
  75. // @Param user string false "用户id"
  76. // @Success 200 {object} models.Account
  77. // @Failure 403 :id is empty
  78. // @router /find_permissions [post,get,put]
  79. func (c *SystemController) FindPermissions() {
  80. //
  81. System_FindPermissions(c)
  82. }
  83. // AddPermission
  84. // @Title AddPermission
  85. // @Description 查找用户的菜单权限标识集合
  86. // @Param perms string false "权限标识"
  87. // @Param domain string false "域"
  88. // @Success 200 {object} models.Account
  89. // @Failure 403 :id is empty
  90. // @router /add_permission [post,get,put]
  91. func (c *SystemController) AddPermission() {
  92. //
  93. System_AddPermission(c)
  94. }