Quellcode durchsuchen

修改存过函数名

jyq vor 4 Jahren
Ursprung
Commit
29c4d5b1fe

+ 1 - 1
api/grpc/base.go

@@ -1067,7 +1067,7 @@ func (a Api) TmpClassDetailAdd(ctx context.Context, r *pb.CourseStandardRequest)
 		return rst, nil
 	}
 	if q.IsHr == 1 {
-		hrRs := service.Hr{}.HrClassDetailDel(token, q.ShopID, q.JsonStr, sign)
+		hrRs := service.Hr{}.TmpClassDetailAdd(token, q.ShopID, q.JsonStr, sign)
 		if !a.checkRs(hrRs) {
 			rst := a.toWebFunc(hrRs)
 			return rst, nil

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

@@ -156,6 +156,16 @@ func (h Hr) HrClassDetailAdd(token string, objectShopId int64, jsonStr string, s
 	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)
 

+ 15 - 12
assembly/heartRate/model/hr_course_detail.go

@@ -1,18 +1,21 @@
 package model
 
 type HrResult struct {
-	Cle              int  `json:"cle"`
-	PureCalorieNoVo2 int  `json:"pure_calorie_no_vo_2"`
-	Ck               int  `json:"ck"`
-	SportPer         int  `json:"sport_per"`
-	HeartRate        int  `json:"heart_rate"`
-	AvgHr            int  `json:"avg_hr"`
-	MaxHr            int  `json:"max_hr"`
-	Battery          int  `json:"battery"`
-	GroupNo          int  `json:"group_no"`
-	IsPrivate        int  `json:"is_private"`
-	IsWin            bool `json:"is_win"`
-	IsBest           bool `json:"is_best"`
+	Cle              int    `json:"cle"`
+	PureCalorieNoVo2 int    `json:"pure_calorie_no_vo_2"`
+	Ck               int    `json:"ck"`
+	SportPer         int    `json:"sport_per"`
+	HeartRate        int    `json:"heart_rate"`
+	AvgHr            int    `json:"avg_hr"`
+	MaxHr            int    `json:"max_hr"`
+	Battery          int    `json:"battery"`
+	GroupNo          int    `json:"group_no"`
+	IsPrivate        int    `json:"is_private"`
+	IsBirthday       int    `json:"is_birthday"`
+	IsWin            bool   `json:"is_win"`
+	IsBest           bool   `json:"is_best"`
+	HeadImg          string `json:"head_img"`
+	Name             string `json:"name"`
 }
 type HrCourseDetail struct {
 	CrID int

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

@@ -116,6 +116,13 @@ func (PGHr) HrClassDetailAdd(optUserId int64, objectShopId int64, jsonStr string
 	return
 }
 
+func (PGHr) TmpClassDetailAdd(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_hr_tmp_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