SystemController.go_new 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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__(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__()
  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__(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__(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. // _FindPermissions
  67. // @Title _FindPermissions
  68. // @Description 查找用户的菜单权限标识集合
  69. // @Param user string false "用户id"
  70. // @Success 200 {object} models.Account
  71. // @Failure 403 :id is empty
  72. func System_FindPermissions(c *SystemController) {
  73. user := c.Ctx.Param(":user")
  74. ret := __none_func__(user)
  75. if ret {
  76. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  77. }else{
  78. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  79. }
  80. }
  81. // _AddPermission
  82. // @Title _AddPermission
  83. // @Description 查找用户的菜单权限标识集合
  84. // @Param user string false "用户id"
  85. // @Success 200 {object} models.Account
  86. // @Failure 403 :id is empty
  87. func System_AddPermission(c *SystemController) {
  88. user := c.Ctx.Param(":user")
  89. ret := __none_func__(user)
  90. if ret {
  91. c.Ctx.JSON(200, sysmodel.SysReturn{200, "", nil})
  92. }else{
  93. c.Ctx.JSON(200, sysmodel.SysReturn{500, "", nil})
  94. }
  95. }
  96. func __none_func__(params ... interface{}) bool{
  97. return true
  98. }