order.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Package service
  2. /**
  3. * @ File:
  4. * @ Date: 2021/4/26 11:19
  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 Order struct {
  14. base
  15. }
  16. func (o Order) OrderListQuery(token string, objectShopId int64, jsonStr string, sign string) string {
  17. optId := o.checkPermission(token, objectShopId)
  18. rst, err := postgre.PGOrder{}.OrderListQuery(optId, objectShopId, jsonStr, sign)
  19. if err != nil {
  20. panic(errors.PGError)
  21. }
  22. return rst
  23. }
  24. func (o Order) OrderAddByManager(token string, objectShopId int64, jsonStr string, sign string) string {
  25. optId := o.checkPermission(token, objectShopId)
  26. rst, err := postgre.PGOrder{}.OrderAdd(optId, objectShopId, jsonStr, sign)
  27. if err != nil {
  28. panic(errors.PGError)
  29. }
  30. return rst
  31. }
  32. func (o Order) OrderCancelByManager(token string, objectShopId int64, jsonStr string, sign string) string {
  33. optId := o.checkPermission(token, objectShopId)
  34. rst, err := postgre.PGOrder{}.OrderCancel(optId, objectShopId, jsonStr, sign)
  35. if err != nil {
  36. panic(errors.PGError)
  37. }
  38. return rst
  39. }
  40. func (o Order) OrderStatistics(token string, objectShopId int64, jsonStr string, sign string) string {
  41. optId := o.checkPermission(token, objectShopId)
  42. rst, err := postgre.PGOrder{}.OrderStatistics(optId, objectShopId, jsonStr, sign)
  43. if err != nil {
  44. panic(errors.PGError)
  45. }
  46. return rst
  47. }
  48. func (o Order) ClassOrderQuery(token string, objectShopId int64, jsonStr string, sign string) string {
  49. optId := o.checkPermission(token, objectShopId)
  50. rst, err := postgre.PGOrder{}.ClassOrderQuery(optId, objectShopId, jsonStr, sign)
  51. if err != nil {
  52. panic(errors.PGError)
  53. }
  54. return rst
  55. }
  56. func (o Order) VipUserOrderQuery(token string, objectShopId int64, jsonStr string, sign string) string {
  57. optId := o.checkPermission(token, objectShopId)
  58. rst, err := postgre.PGOrder{}.VipUserOrderQuery(optId, objectShopId, jsonStr, sign)
  59. if err != nil {
  60. panic(errors.PGError)
  61. }
  62. return rst
  63. }