role.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package controller
  2. import (
  3. "net/http"
  4. "bet24.com/log"
  5. "bet24.com/servers/adminserver/dao"
  6. "github.com/gin-gonic/gin"
  7. )
  8. //角色列表
  9. func RoleList(c *gin.Context) {
  10. obj := dao.NewRoleList()
  11. obj.DoAction(nil)
  12. c.JSON(http.StatusOK, obj.Out)
  13. return
  14. }
  15. //添加角色用户
  16. func RoleUserAdd(c *gin.Context) {
  17. obj := dao.NewRoleUserAdd()
  18. if err := c.ShouldBind(&obj.In); err != nil {
  19. log.Debug("%s shouldBind err %v", "roleUserAdd", err)
  20. return
  21. }
  22. obj.DoAction(nil)
  23. c.JSON(http.StatusOK, nil)
  24. return
  25. }
  26. //用户角色列表
  27. func RoleListByAdmin(c *gin.Context) {
  28. obj := dao.NewRoleListByAdmin()
  29. if err := c.ShouldBind(&obj.In); err != nil {
  30. log.Debug("%s shouldBind err %v", "roleListByAdmin", err)
  31. return
  32. }
  33. obj.DoAction(nil)
  34. c.JSON(http.StatusOK, obj.Out)
  35. return
  36. }
  37. //角色设置页面
  38. func RoleSetPage(c *gin.Context) {
  39. obj := dao.NewRoleSetPage()
  40. if err := c.ShouldBind(&obj.In); err != nil {
  41. log.Debug("%s shouldBind err %v", "roleSetPage", err)
  42. return
  43. }
  44. obj.DoAction(nil)
  45. c.JSON(http.StatusOK, obj.Out)
  46. return
  47. }
  48. //角色页面列表
  49. func RolePageList(c *gin.Context) {
  50. obj := dao.NewRolePageList()
  51. if err := c.ShouldBind(&obj.In); err != nil {
  52. log.Debug("%s shouldBind err %v", "rolePageList", err)
  53. return
  54. }
  55. obj.DoAction(nil)
  56. c.JSON(http.StatusOK, obj.Out)
  57. return
  58. }
  59. //角色用户列表
  60. func RoleUserList(c *gin.Context) {
  61. obj := dao.NewRoleUserList()
  62. obj.DoAction(nil)
  63. c.JSON(http.StatusOK, obj.Out)
  64. return
  65. }