Ver código fonte

修改计算单元

jyq 4 anos atrás
pai
commit
2d8249e0bb

+ 1 - 1
assembly/base/service/shop.go

@@ -384,7 +384,7 @@ func (s Shop) ShopVenueEquipQuery(token string, objectShopId int64, jsonStr stri
 func (s Shop) ShopVenueEquipAdd(token string, objectShopId int64, jsonStr string, sign string) string {
 	optId := s.checkPermission(token, objectShopId)
 
-	rst, err := postgre.PGShop{}.ShopVenueEquipQuery(optId, objectShopId, jsonStr, sign)
+	rst, err := postgre.PGShop{}.ShopVenueEquipAdd(optId, objectShopId, jsonStr, sign)
 	if err != nil {
 		panic(errors.PGError)
 	}

+ 1 - 1
assembly/heartRate/model/hr_course_detail.go

@@ -14,6 +14,6 @@ type HrResult struct {
 	BreakTime        int  `json:"break_time"`
 }
 type HrCourseDetail struct {
-	HcId int
+	CrID int
 	HrResult
 }

+ 3 - 1
assembly/heartRate/repository/postgre/hr.go

@@ -8,10 +8,11 @@
 package postgre
 
 import (
-	"github.com/sirupsen/logrus"
 	"sportfitness/base/assembly/heartRate/model"
 	"sync"
 	"time"
+
+	"github.com/sirupsen/logrus"
 )
 
 type PGHr struct {
@@ -180,6 +181,7 @@ func (p PGHr) workSaveHrSaveMap() {
 	}
 }
 
+// trySaveHrSaveMap 维护R3
 func (p PGHr) trySaveHrSaveMap() {
 	var deleteKeys []string
 	for sn, v := range hrSaveMap {

+ 3 - 2
assembly/heartRate/repository/redis/hr_store_r4.go

@@ -3,9 +3,10 @@ package redis
 import (
 	"encoding/json"
 	"fmt"
+	"sportfitness/base/assembly/heartRate/model"
+
 	"github.com/go-redis/redis/v8"
 	"github.com/sirupsen/logrus"
-	"sportfitness/base/assembly/heartRate/model"
 )
 
 const hrStoreR4Key = prefix + ":hr_store_r4"
@@ -18,7 +19,7 @@ func HrStoreR4(list []model.HrCourseDetail) {
 				panic(err2)
 			}
 
-			pipeliner.Set(ctx, fmt.Sprintf("%s:%d", hrStoreR4Key, one.HcId), data, 0)
+			pipeliner.Set(ctx, fmt.Sprintf("%s:%d", hrStoreR4Key, one.CrID), data, 0)
 		}
 		return nil
 	})

+ 2 - 1
assembly/heartRate/service/calculation_unit.go

@@ -1,10 +1,11 @@
 package service
 
 import (
-	"github.com/sirupsen/logrus"
 	"sportfitness/base/assembly/heartRate/model"
 	"sportfitness/base/assembly/heartRate/repository/postgre"
 	"sportfitness/base/assembly/heartRate/repository/redis"
+
+	"github.com/sirupsen/logrus"
 )
 
 type CalculationUnit struct {