SystemController.go_new 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. package controllers
  2. import (
  3. //"git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
  4. //sysmodel "git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
  5. )
  6. // _Login
  7. // @Title _Login
  8. // @Description 用户登录
  9. // @Param logininfo false "登录信息"
  10. // @Success 200 {object} models.Account
  11. // @Failure 403 :id is empty
  12. func System_Login(c *SystemController) {
  13. var logininfo models.LoginInfo
  14. c.Ctx.BindJSON(&logininfo)
  15. ret := __none_func_system__(logininfo)
  16. if ret {
  17. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  18. }else{
  19. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  20. }
  21. }
  22. // _Logout
  23. // @Title _Logout
  24. // @Description 用户退出
  25. // @Success 200 {object} models.Account
  26. // @Failure 403 :id is empty
  27. func System_Logout(c *SystemController) {
  28. ret := __none_func_system__()
  29. if ret {
  30. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  31. }else{
  32. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  33. }
  34. }
  35. // _GetMenuTree
  36. // @Title _GetMenuTree
  37. // @Description 获取系统菜单
  38. // @Param user string false "用户id"
  39. // @Success 200 {object} models.Account
  40. // @Failure 403 :id is empty
  41. func System_GetMenuTree(c *SystemController) {
  42. user := c.Ctx.Param(":user")
  43. ret := __none_func_system__(user)
  44. if ret {
  45. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  46. }else{
  47. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  48. }
  49. }
  50. // _FindUserPage
  51. // @Title _FindUserPage
  52. // @Description 获取用户分布数据
  53. // @Param page false "分页参数"
  54. // @Success 200 {object} models.Account
  55. // @Failure 403 :id is empty
  56. func System_FindUserPage(c *SystemController) {
  57. var getpageinfo models.GetPageInfo
  58. c.Ctx.BindJSON(&getpageinfo)
  59. ret := __none_func_system__(getpageinfo)
  60. if ret {
  61. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  62. }else{
  63. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  64. }
  65. }
  66. // _GetOrgTree
  67. // @Title _GetOrgTree
  68. // @Description 获取组织架构树
  69. // @Success 200 {object} models.Account
  70. // @Failure 403 :id is empty
  71. func System_GetOrgTree(c *SystemController) {
  72. ret := __none_func_system__()
  73. if ret {
  74. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  75. }else{
  76. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  77. }
  78. }
  79. // _FindPermissions
  80. // @Title _FindPermissions
  81. // @Description 查找用户的菜单权限标识集合
  82. // @Param user string false "用户id"
  83. // @Success 200 {object} models.Account
  84. // @Failure 403 :id is empty
  85. func System_FindPermissions(c *SystemController) {
  86. user := c.Ctx.Param(":user")
  87. ret := __none_func_system__(user)
  88. if ret {
  89. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  90. }else{
  91. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  92. }
  93. }
  94. // _AddPermission
  95. // @Title _AddPermission
  96. // @Description 查找用户的菜单权限标识集合
  97. // @Param user string false "用户id"
  98. // @Success 200 {object} models.Account
  99. // @Failure 403 :id is empty
  100. func System_AddPermission(c *SystemController) {
  101. user := c.Ctx.Param(":user")
  102. ret := __none_func_system__(user)
  103. if ret {
  104. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  105. }else{
  106. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  107. }
  108. }
  109. func __none_func_system__(params ... interface{}) bool{
  110. return true
  111. }