panel.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package http
  2. import (
  3. "go-common/app/admin/main/vip/model"
  4. "go-common/library/ecode"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. func vipPriceConfigs(c *bm.Context) {
  8. arg := new(model.ArgVipPrice)
  9. if err := c.Bind(arg); err != nil {
  10. return
  11. }
  12. c.JSON(vipSvc.VipPriceConfigs(c, arg))
  13. }
  14. func vipPriceConfigID(c *bm.Context) {
  15. arg := new(model.ArgVipPriceID)
  16. if err := c.Bind(arg); err != nil {
  17. return
  18. }
  19. c.JSON(vipSvc.VipPriceConfigID(c, arg))
  20. }
  21. func addVipPriceConfig(c *bm.Context) {
  22. arg := new(model.ArgAddOrUpVipPrice)
  23. if err := c.Bind(arg); err != nil {
  24. return
  25. }
  26. c.JSON(nil, vipSvc.AddVipPriceConfig(c, arg))
  27. }
  28. func upVipPriceConfig(c *bm.Context) {
  29. arg := new(model.ArgAddOrUpVipPrice)
  30. if err := c.Bind(arg); err != nil {
  31. return
  32. }
  33. if arg.ID == 0 {
  34. c.JSON(nil, ecode.RequestErr)
  35. return
  36. }
  37. c.JSON(nil, vipSvc.UpVipPriceConfig(c, arg))
  38. }
  39. func delVipPriceConfig(c *bm.Context) {
  40. arg := new(model.ArgVipPriceID)
  41. if err := c.Bind(arg); err != nil {
  42. return
  43. }
  44. c.JSON(nil, vipSvc.DelVipPriceConfig(c, arg))
  45. }
  46. func vipDPriceConfigs(c *bm.Context) {
  47. arg := new(model.ArgVipPriceID)
  48. if err := c.Bind(arg); err != nil {
  49. return
  50. }
  51. c.JSON(vipSvc.VipDPriceConfigs(c, arg))
  52. }
  53. func vipDPriceConfigID(c *bm.Context) {
  54. arg := new(model.ArgVipDPriceID)
  55. if err := c.Bind(arg); err != nil {
  56. return
  57. }
  58. c.JSON(vipSvc.VipDPriceConfigID(c, arg))
  59. }
  60. func addVipDPriceConfig(c *bm.Context) {
  61. arg := new(model.ArgAddOrUpVipDPrice)
  62. if err := c.Bind(arg); err != nil {
  63. return
  64. }
  65. c.JSON(nil, vipSvc.AddVipDPriceConfig(c, arg))
  66. }
  67. func upVipDPriceConfig(c *bm.Context) {
  68. arg := new(model.ArgAddOrUpVipDPrice)
  69. if err := c.Bind(arg); err != nil {
  70. return
  71. }
  72. c.JSON(nil, vipSvc.UpVipDPriceConfig(c, arg))
  73. }
  74. func delVipDPriceConfig(c *bm.Context) {
  75. arg := new(model.ArgVipDPriceID)
  76. if err := c.Bind(arg); err != nil {
  77. return
  78. }
  79. c.JSON(nil, vipSvc.DelVipDPriceConfig(c, arg))
  80. }
  81. func vipPanelTypes(c *bm.Context) {
  82. c.JSON(vipSvc.PanelPlatFormTypes(c))
  83. }