SystemController.go_new 2.7 KB

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