jyq преди 4 години
родител
ревизия
67b3becc71

+ 63 - 4
api/grpc/base.go

@@ -87,6 +87,56 @@ func (a Api) SignOut(ctx context.Context, q *pb.DefaultRequest) (*pb.DefaultRepl
 
 // ----------------------- 商家信息管理 ---------------------------------------------
 
+// AcrossUserSimpleQuery 可跨店会员简单查询
+func (a Api) AcrossUserSimpleQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
+	// 获取token,并验证签名函数
+	token, q, sign := a.webToGoVerify(ctx, r)
+	rs := service.User{}.AcrossUserSimpleQuery(token, q.ShopID, q.JsonStr, sign)
+
+	rst := a.toWebFunc(rs)
+	return rst, nil
+}
+
+// VipUserSimpleQuery 会员简单查询
+func (a Api) VipUserSimpleQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
+	// 获取token,并验证签名函数
+	token, q, sign := a.webToGoVerify(ctx, r)
+	rs := service.User{}.AcrossUserSimpleQuery(token, q.ShopID, q.JsonStr, sign)
+	rst := a.toWebFunc(rs)
+	return rst, nil
+}
+
+// TempVipUserSimpleQuery 临时会员简单查询
+func (a Api) TempVipUserSimpleQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
+	// 获取token,并验证签名函数
+	token, q, sign := a.webToGoVerify(ctx, r)
+	rs := service.User{}.TempVipUserSimpleQuery(token, q.ShopID, q.JsonStr, sign)
+	rst := a.toWebFunc(rs)
+	return rst, nil
+}
+
+// ClassSimpleQuery 课目简单查询
+func (a Api) ClassSimpleQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
+	// 获取token,并验证签名函数
+	token, q, sign := a.webToGoVerify(ctx, r)
+
+	rs := service.Class{}.ClassSimpleQuery(token, q.ShopID, q.JsonStr, sign)
+	rst := a.toWebFunc(rs)
+	return rst, nil
+}
+
+// SelectHrSensors 心率带简单查询
+func (a Api) SelectHrSensors(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
+	// 获取token,并验证签名函数
+	token, q, sign := a.webToGoVerify(ctx, r)
+
+	rs := service.Hr{}.SelectHrSensors(token, q.ShopID, q.JsonStr, sign)
+	rst := a.toWebFunc(rs)
+	return rst, nil
+}
+
+// ----------------------- 商家信息管理 ---------------------------------------------
+
 func (a Api) ManageableShopList(ctx context.Context, r *pb.ShopListRequest) (*pb.ShopListReply, error) {
 	token := a.getToken(ctx)
 
@@ -944,10 +994,10 @@ func (a Api) UnBindHrSensor(ctx context.Context, r *pb.StandardRequest) (*pb.Sta
 
 // ----------------------- 微信管理 ---------------------------------------------
 
-// GenVerifyImageByWinXin 微信登陆获取图片验证码
-func (Api) GenVerifyImageByWinXin(ctx context.Context, q *pb.GenVerifyImageRequest) (*pb.GenVerifyImageReply, error) {
-	height := int(q.Height)
-	width := int(q.Width)
+// GenVerifyImageByWeiXin 微信登陆获取图片验证码
+func (Api) GenVerifyImageByWeiXin(ctx context.Context, r *pb.GenVerifyImageRequest) (*pb.GenVerifyImageReply, error) {
+	height := int(r.Height)
+	width := int(r.Width)
 
 	id, pic := service.VerifyCode{}.GenImage(height, width)
 
@@ -957,6 +1007,15 @@ func (Api) GenVerifyImageByWinXin(ctx context.Context, q *pb.GenVerifyImageReque
 	}, nil
 }
 
+// GenPhoneVerifyCodeByWeiXin 微信登陆获取短信验证码
+func (a Api) GenPhoneVerifyCodeByWeiXin(ctx context.Context, r *pb.GenPhoneVerifyCodeRequest) (*pb.DefaultReply, error) {
+	//service.VerifyCode{}.GetPhoneVFCode(
+	//	a.getSysToken(ctx),
+	//	in.Account, in.Ip, in.Code, in.TemplateCode, in.VerifyType, time.Duration(in.ExpireDurationNano))
+
+	return &pb.DefaultReply{}, nil
+}
+
 // VipUserWeiXinLogin 微信登陆
 func (a Api) VipUserWeiXinLogin(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
 	// 获取token,并验证签名函数

+ 7 - 0
assembly/base/repository/postgre/class.go

@@ -198,3 +198,10 @@ func (PGClass) STTDetailAllowDelCheck(optUserId int64, objectShopId int64, jsonS
 
 	return
 }
+
+func (PGClass) ClassSimpleQuery(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_class_simple_query(? ,? ,?, ? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}

+ 21 - 0
assembly/base/repository/postgre/shop.go

@@ -275,3 +275,24 @@ func (PGShop) VipUserClassQuery(optUserId int64, objectShopId int64, jsonStr str
 
 	return
 }
+
+func (PGShop) AcrossUserSimpleQuery(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_across_user_simple_query(? ,? ,?, ? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}
+
+func (PGShop) VipUserSimpleQuery(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_vip_user_simple_query(? ,? ,?, ? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}
+
+func (PGShop) TmpVipUserSimpleQuery(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_tmp_user_simple_query(? ,? ,?, ? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}

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

@@ -285,3 +285,13 @@ func (c Class) STTDetailAllowDelCheck(token string, objectShopId int64, jsonStr
 	}
 	return rst
 }
+
+func (c Class) ClassSimpleQuery(token string, objectShopId int64, jsonStr string, sign string) string {
+	optId := c.checkPermission(token, objectShopId)
+
+	rst, err := postgre.PGClass{}.ClassSimpleQuery(optId, objectShopId, jsonStr, sign)
+	if err != nil {
+		panic(errors.PGError)
+	}
+	return rst
+}

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

@@ -105,3 +105,13 @@ func (h Hr) UnBindHrSensor(token string, objectShopId int64, jsonStr string, sig
 	}
 	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
+}

+ 33 - 0
assembly/base/service/user.go

@@ -322,3 +322,36 @@ func (u User) GetOverlayImgQiNiuToken(token, fileName string) *pb.QiNiuTokenRepl
 
 	return &pb.QiNiuTokenReply{Token: t}
 }
+
+// AcrossUserSimpleQuery 可跨店会员简单查询
+func (u User) AcrossUserSimpleQuery(token string, objectShopId int64, jsonStr string, sign string) string {
+	optId := u.checkPermission(token, objectShopId)
+
+	rst, err := postgre.PGShop{}.AcrossUserSimpleQuery(optId, objectShopId, jsonStr, sign)
+	if err != nil {
+		panic(errors.PGError)
+	}
+	return rst
+}
+
+// VipUserSimpleQuery 会员简单查询
+func (u User) VipUserSimpleQuery(token string, objectShopId int64, jsonStr string, sign string) string {
+	optId := u.checkPermission(token, objectShopId)
+
+	rst, err := postgre.PGShop{}.VipUserSimpleQuery(optId, objectShopId, jsonStr, sign)
+	if err != nil {
+		panic(errors.PGError)
+	}
+	return rst
+}
+
+// TempVipUserSimpleQuery 临时会员简单查询
+func (u User) TempVipUserSimpleQuery(token string, objectShopId int64, jsonStr string, sign string) string {
+	optId := u.checkPermission(token, objectShopId)
+
+	rst, err := postgre.PGShop{}.TmpVipUserSimpleQuery(optId, objectShopId, jsonStr, sign)
+	if err != nil {
+		panic(errors.PGError)
+	}
+	return rst
+}

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

@@ -72,3 +72,10 @@ func (PGHr) CrUnBind(optUserId int64, objectShopId int64, jsonStr string, verfSt
 
 	return
 }
+
+func (PGHr) UnBindSensorsQuery(optUserId int64, objectShopId int64, jsonStr string, verfStr string) (result string, err error) {
+	err = getClient().Raw("select fn_unbind_sensors_query(? ,? ,? )", optUserId, objectShopId, jsonStr, verfStr).
+		Scan(&result).Error
+
+	return
+}