Parcourir la source

修改存过函数名称

jyq il y a 4 ans
Parent
commit
0c3db376fa
3 fichiers modifiés avec 132 ajouts et 9 suppressions
  1. 37 9
      api/grpc/base.go
  2. 60 0
      assembly/base/service/hr.go
  3. 35 0
      assembly/heartRate/repository/postgre/hr.go

+ 37 - 9
api/grpc/base.go

@@ -928,8 +928,8 @@ func (a Api) ClassStartPrepare(ctx context.Context, r *pb.CourseStandardRequest)
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
-		if !a.checkRs(rs) {
+		hrRs := service.Hr{}.HrClassStartPrepare(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
 			rst := a.toWebFunc(rs)
 			return rst, nil
 		}
@@ -967,7 +967,11 @@ func (a Api) VipClassDetailAdd(ctx context.Context, r *pb.CourseStandardRequest)
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
+		hrRs := service.Hr{}.HrClassDetailAdd(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
+			rst := a.toWebFunc(rs)
+			return rst, nil
+		}
 	}
 	if q.IsScore == 1 {
 		// todo 调用评分系统接口
@@ -988,7 +992,11 @@ func (a Api) VipClassDetailDel(ctx context.Context, r *pb.CourseStandardRequest)
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
+		hrRs := service.Hr{}.HrClassDetailDel(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
+			rst := a.toWebFunc(rs)
+			return rst, nil
+		}
 	}
 	if q.IsScore == 1 {
 		// todo 调用评分系统接口
@@ -1009,7 +1017,11 @@ func (a Api) TmpClassDetailAdd(ctx context.Context, r *pb.CourseStandardRequest)
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
+		hrRs := service.Hr{}.HrClassDetailDel(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
+			rst := a.toWebFunc(rs)
+			return rst, nil
+		}
 	}
 	if q.IsScore == 1 {
 		// todo 调用评分系统接口
@@ -1030,7 +1042,11 @@ func (a Api) TmpClassDetailDel(ctx context.Context, r *pb.CourseStandardRequest)
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
+		hrRs := service.Hr{}.HrClassDetailDel(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
+			rst := a.toWebFunc(rs)
+			return rst, nil
+		}
 	}
 	if q.IsScore == 1 {
 		// todo 调用评分系统接口
@@ -1051,7 +1067,11 @@ func (a Api) VipClassDetailStatueEdit(ctx context.Context, r *pb.CourseStandardR
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
+		hrRs := service.Hr{}.HrClassDetailStatusEdit(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
+			rst := a.toWebFunc(rs)
+			return rst, nil
+		}
 	}
 	if q.IsScore == 1 {
 		// todo 调用评分系统接口
@@ -1072,7 +1092,11 @@ func (a Api) ClassStartConfirm(ctx context.Context, r *pb.CourseStandardRequest)
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
+		hrRs := service.Hr{}.HrClassStartConfirm(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
+			rst := a.toWebFunc(rs)
+			return rst, nil
+		}
 	}
 	if q.IsScore == 1 {
 		// todo 调用评分系统接口
@@ -1103,7 +1127,11 @@ func (a Api) ClassGiveUpConfirm(ctx context.Context, r *pb.CourseStandardRequest
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		//todo 调用心率系统接口
+		hrRs := service.Hr{}.HrClassGiveUpConfirm(token, q.ShopID, q.JsonStr, sign)
+		if !a.checkRs(hrRs) {
+			rst := a.toWebFunc(rs)
+			return rst, nil
+		}
 	}
 	if q.IsScore == 1 {
 		// todo 调用评分系统接口

+ 60 - 0
assembly/base/service/hr.go

@@ -125,3 +125,63 @@ func (h Hr) AfterClassAddClassDetail(token string, objectShopId int64, jsonStr s
 	}
 	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) 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) 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
+}

+ 35 - 0
assembly/heartRate/repository/postgre/hr.go

@@ -86,3 +86,38 @@ func (PGHr) HrClassDetailStatusEdit(optUserId int64, objectShopId int64, jsonStr
 
 	return
 }
+
+func (PGHr) HrClassStartPrepare(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_hr_class_start_prepare(? ,? ,? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}
+
+func (PGHr) HrClassDetailAdd(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_hr_class_detail_add(? ,? ,? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}
+
+func (PGHr) HrClassDetailDel(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_hr_class_detail_del(? ,? ,? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}
+
+func (PGHr) HrClassStartConfirm(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_hr_class_start_confirm(? ,? ,? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}
+
+func (PGHr) HrClassGiveUpConfirm(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_hr_class_give_up_confirm(? ,? ,? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}