courseMGT.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. // Package service
  2. /**
  3. * @ File:
  4. * @ Date: 2021/4/26 11:18
  5. * @ Author: JYQ
  6. * @ Description: 上下课管理
  7. */
  8. package service
  9. import (
  10. "sportfitness/base/assembly/base/repository/postgre"
  11. "sportfitness/base/errors"
  12. )
  13. type Course struct {
  14. base
  15. }
  16. func (c Course) CourseDetailQuery(token string, objectShopId int64, jsonStr string, sign string) string {
  17. optId := c.checkPermission(token, objectShopId)
  18. rst, err := postgre.PGCourse{}.StdListQuery(optId, objectShopId, jsonStr, sign)
  19. if err != nil {
  20. panic(errors.PGError)
  21. }
  22. return rst
  23. }
  24. func (c Course) ClassListByOrderDate(token string, objectShopId int64, jsonStr string, sign string) string {
  25. optId := c.checkPermission(token, objectShopId)
  26. rst, err := postgre.PGCourse{}.ClassListByOrderDate(optId, objectShopId, jsonStr, sign)
  27. if err != nil {
  28. panic(errors.PGError)
  29. }
  30. return rst
  31. }
  32. func (c Course) ClassStartPrepare(token string, objectShopId int64, jsonStr string, sign string) string {
  33. optId := c.checkPermission(token, objectShopId)
  34. rst, err := postgre.PGCourse{}.ClassStartPrepare(optId, objectShopId, jsonStr, sign)
  35. if err != nil {
  36. panic(errors.PGError)
  37. }
  38. return rst
  39. }
  40. func (c Course) ClassStartPrepareEdit(token string, objectShopId int64, jsonStr string, sign string) string {
  41. optId := c.checkPermission(token, objectShopId)
  42. rst, err := postgre.PGCourse{}.ClassInfoEditBeforeStart(optId, objectShopId, jsonStr, sign)
  43. if err != nil {
  44. panic(errors.PGError)
  45. }
  46. return rst
  47. }
  48. func (c Course) VipClassDetailQuery(token string, objectShopId int64, jsonStr string, sign string) string {
  49. optId := c.checkPermission(token, objectShopId)
  50. rst, err := postgre.PGCourse{}.ClassDetailListQuery(optId, objectShopId, jsonStr, sign)
  51. if err != nil {
  52. panic(errors.PGError)
  53. }
  54. return rst
  55. }
  56. func (c Course) VipClassDetailAdd(token string, objectShopId int64, jsonStr string, sign string) string {
  57. optId := c.checkPermission(token, objectShopId)
  58. rst, err := postgre.PGCourse{}.ClassDetailAdd(optId, objectShopId, jsonStr, sign)
  59. if err != nil {
  60. panic(errors.PGError)
  61. }
  62. return rst
  63. }
  64. func (c Course) VipClassDetailDel(token string, objectShopId int64, jsonStr string, sign string) string {
  65. optId := c.checkPermission(token, objectShopId)
  66. rst, err := postgre.PGCourse{}.ClassDetailDel(optId, objectShopId, jsonStr, sign)
  67. if err != nil {
  68. panic(errors.PGError)
  69. }
  70. return rst
  71. }
  72. func (c Course) TmpClassDetailAdd(token string, objectShopId int64, jsonStr string, sign string) string {
  73. optId := c.checkPermission(token, objectShopId)
  74. rst, err := postgre.PGCourse{}.ClassTmpUserDetailAdd(optId, objectShopId, jsonStr, sign)
  75. if err != nil {
  76. panic(errors.PGError)
  77. }
  78. return rst
  79. }
  80. func (c Course) TmpClassDetailDel(token string, objectShopId int64, jsonStr string, sign string) string {
  81. optId := c.checkPermission(token, objectShopId)
  82. rst, err := postgre.PGCourse{}.ClassTmpUserDetailDel(optId, objectShopId, jsonStr, sign)
  83. if err != nil {
  84. panic(errors.PGError)
  85. }
  86. return rst
  87. }
  88. func (c Course) VipClassDetailStatueEdit(token string, objectShopId int64, jsonStr string, sign string) string {
  89. optId := c.checkPermission(token, objectShopId)
  90. rst, err := postgre.PGCourse{}.ClassDetailStatusEdit(optId, objectShopId, jsonStr, sign)
  91. if err != nil {
  92. panic(errors.PGError)
  93. }
  94. return rst
  95. }
  96. func (c Course) ClassStartConfirm(token string, objectShopId int64, jsonStr string, sign string) string {
  97. optId := c.checkPermission(token, objectShopId)
  98. rst, err := postgre.PGCourse{}.ClassStartConfirm(optId, objectShopId, jsonStr, sign)
  99. if err != nil {
  100. panic(errors.PGError)
  101. }
  102. return rst
  103. }
  104. func (c Course) ClassOverConfirm(token string, objectShopId int64, jsonStr string, sign string) string {
  105. optId := c.checkPermission(token, objectShopId)
  106. rst, err := postgre.PGCourse{}.ClassOverConfirm(optId, objectShopId, jsonStr, sign)
  107. if err != nil {
  108. panic(errors.PGError)
  109. }
  110. return rst
  111. }
  112. func (c Course) ClassGiveUpConfirm(token string, objectShopId int64, jsonStr string, sign string) string {
  113. optId := c.checkPermission(token, objectShopId)
  114. rst, err := postgre.PGCourse{}.ClassGiveUpConfirm(optId, objectShopId, jsonStr, sign)
  115. if err != nil {
  116. panic(errors.PGError)
  117. }
  118. return rst
  119. }