|
|
@@ -949,7 +949,7 @@ func (a Api) ClassStartPrepare(ctx context.Context, r *pb.CourseStandardRequest)
|
|
|
if q.IsHr == 1 {
|
|
|
hrRs := service.Hr{}.HrClassStartPrepare(token, q.ShopID, q.JsonStr, sign)
|
|
|
if !a.checkRs(hrRs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
}
|
|
|
@@ -1017,7 +1017,7 @@ func (a Api) VipClassDetailAdd(ctx context.Context, r *pb.CourseStandardRequest)
|
|
|
if q.IsHr == 1 {
|
|
|
hrRs := service.Hr{}.HrClassDetailAdd(token, q.ShopID, q.JsonStr, sign)
|
|
|
if !a.checkRs(hrRs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
}
|
|
|
@@ -1033,23 +1033,25 @@ func (a Api) VipClassDetailAdd(ctx context.Context, r *pb.CourseStandardRequest)
|
|
|
func (a Api) VipClassDetailDel(ctx context.Context, r *pb.CourseStandardRequest) (*pb.StandardReply, error) {
|
|
|
// 获取token,并验证签名函数
|
|
|
token, q, sign := a.courseToGoVerify(ctx, r)
|
|
|
-
|
|
|
- rs := service.Course{}.VipClassDetailDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
- if !a.checkRs(rs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
- return rst, nil
|
|
|
- }
|
|
|
+ // 删除应该是先删除心率跟评分库,再去删除基础库数据
|
|
|
if q.IsHr == 1 {
|
|
|
hrRs := service.Hr{}.HrClassDetailDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
if !a.checkRs(hrRs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if q.IsScore == 1 {
|
|
|
// todo 调用评分系统接口
|
|
|
}
|
|
|
|
|
|
+ rs := service.Course{}.VipClassDetailDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ if !a.checkRs(rs) {
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+ }
|
|
|
+
|
|
|
rst := a.toWebFunc(rs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
@@ -1067,7 +1069,7 @@ func (a Api) TmpClassDetailAdd(ctx context.Context, r *pb.CourseStandardRequest)
|
|
|
if q.IsHr == 1 {
|
|
|
hrRs := service.Hr{}.HrClassDetailDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
if !a.checkRs(hrRs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
}
|
|
|
@@ -1083,16 +1085,11 @@ func (a Api) TmpClassDetailAdd(ctx context.Context, r *pb.CourseStandardRequest)
|
|
|
func (a Api) TmpClassDetailDel(ctx context.Context, r *pb.CourseStandardRequest) (*pb.StandardReply, error) {
|
|
|
// 获取token,并验证签名函数
|
|
|
token, q, sign := a.courseToGoVerify(ctx, r)
|
|
|
-
|
|
|
- rs := service.Course{}.TmpClassDetailDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
- if !a.checkRs(rs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
- return rst, nil
|
|
|
- }
|
|
|
+ // 删除应该是先删除心率跟评分库,再去删除基础库数据
|
|
|
if q.IsHr == 1 {
|
|
|
hrRs := service.Hr{}.HrClassDetailDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
if !a.checkRs(hrRs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
}
|
|
|
@@ -1100,6 +1097,12 @@ func (a Api) TmpClassDetailDel(ctx context.Context, r *pb.CourseStandardRequest)
|
|
|
// todo 调用评分系统接口
|
|
|
}
|
|
|
|
|
|
+ rs := service.Course{}.TmpClassDetailDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ if !a.checkRs(rs) {
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+ }
|
|
|
+
|
|
|
rst := a.toWebFunc(rs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
@@ -1117,7 +1120,7 @@ func (a Api) VipClassDetailStatueEdit(ctx context.Context, r *pb.CourseStandardR
|
|
|
if q.IsHr == 1 {
|
|
|
hrRs := service.Hr{}.HrClassDetailStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
if !a.checkRs(hrRs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
}
|
|
|
@@ -1134,25 +1137,28 @@ func (a Api) ClassStartConfirm(ctx context.Context, r *pb.CourseStandardRequest)
|
|
|
// 获取token,并验证签名函数
|
|
|
token, q, sign := a.courseToGoVerify(ctx, r)
|
|
|
|
|
|
- //rs := service.Course{}.ClassStartConfirm(token, q.ShopID, q.JsonStr, sign)
|
|
|
- //if !a.checkRs(rs) {
|
|
|
- // rst := a.toWebFunc(rs)
|
|
|
- // return rst, nil
|
|
|
- //}
|
|
|
- //if q.IsHr == 1 {
|
|
|
- // 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 调用评分系统接口
|
|
|
- //}
|
|
|
- // todo 所有步骤执行成功后,调用课程Sn查询接口,生成R1验证Redis
|
|
|
- // todo 使用StdId查询课程绑定显示端EqSn列表,内容为EqSnList,DuIdList
|
|
|
- rs := service.HrRedis{}.ClassStartR1AndOnClassByUUStdID(token, q.ShopID, q.UUStdID)
|
|
|
- println(sign)
|
|
|
+ rs := service.Course{}.ClassStartConfirm(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ if !a.checkRs(rs) {
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+ }
|
|
|
+
|
|
|
+ if q.IsScore == 1 {
|
|
|
+ // todo 调用评分系统接口
|
|
|
+ }
|
|
|
+ if q.IsHr == 1 {
|
|
|
+ hrRs := service.Hr{}.HrClassStartConfirm(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ if !a.checkRs(hrRs) {
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
+ return rst, nil
|
|
|
+ }
|
|
|
+ redisRs := service.HrRedis{}.ClassStartR1AndOnClassByUUStdID(token, q.ShopID, q.UUStdID)
|
|
|
+ if !a.checkRs(redisRs) {
|
|
|
+ rst := a.toWebFunc(redisRs)
|
|
|
+ return rst, nil
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
rst := a.toWebFunc(rs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
@@ -1180,7 +1186,7 @@ func (a Api) ClassGiveUpConfirm(ctx context.Context, r *pb.CourseStandardRequest
|
|
|
if q.IsHr == 1 {
|
|
|
hrRs := service.Hr{}.HrClassGiveUpConfirm(token, q.ShopID, q.JsonStr, sign)
|
|
|
if !a.checkRs(hrRs) {
|
|
|
- rst := a.toWebFunc(rs)
|
|
|
+ rst := a.toWebFunc(hrRs)
|
|
|
return rst, nil
|
|
|
}
|
|
|
}
|