| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- // Package service
- /**
- * @ File:
- * @ Date: 2021/5/6 17:44
- * @ Author: JYQ
- * @ Description:
- */
- package service
- import (
- "sportfitness/base/assembly/heartRate/repository/postgre"
- "sportfitness/base/errors"
- )
- type Hr struct {
- base
- }
- func (h Hr) HrSensorsPublicQuery(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.PublicSensorQuery(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrSensorsPvtQuery(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.PrivateSensorQuery(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) AddHrSensors(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.PublicSensorsAdd(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) AddPvtHrSensors(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.PrivateSensorsAdd(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) EditHrSensors(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.SensorsEdit(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrSensorsDel(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.SensorsDel(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) PKGroupChg(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.PkGroupChg(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) BindHrSensor(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.CrBind(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) UnBindHrSensor(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.CrUnBind(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) SelectHrSensors(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.UnBindSensorsQuery(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) AfterClassAddClassDetail(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.HrClassDetailStatusEdit(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrClassStartPrepare(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.HrClassStartPrepare(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) ClassStartPrepareEdit(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.ClassInfoEditBeforeStart(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrClassDetailAdd(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.HrClassDetailAdd(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) TmpClassDetailAdd(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.TmpClassDetailAdd(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrClassDetailDel(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.HrClassDetailDel(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrClassDetailStatusEdit(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.HrClassDetailStatusEdit(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrClassStartConfirm(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.HrClassStartConfirm(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
- func (h Hr) HrClassGiveUpConfirm(token string, objectShopId int64, jsonStr string, sign string) string {
- optId := h.checkPermission(token, objectShopId)
- rst, err := postgre.PGHr{}.HrClassGiveUpConfirm(optId, objectShopId, jsonStr, sign)
- if err != nil {
- panic(errors.PGError)
- }
- return rst
- }
|