|
|
@@ -2,10 +2,11 @@ package grpc
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
- "google.golang.org/grpc/metadata"
|
|
|
pb "sportfitness/base/api/grpc/base"
|
|
|
"sportfitness/base/assembly/base/service"
|
|
|
"strings"
|
|
|
+
|
|
|
+ "google.golang.org/grpc/metadata"
|
|
|
)
|
|
|
|
|
|
type Api struct {
|
|
|
@@ -31,7 +32,7 @@ func (Api) getUserAgent(ctx context.Context) string {
|
|
|
|
|
|
func (Api) getToken(ctx context.Context) (token string) {
|
|
|
if md, ok := metadata.FromIncomingContext(ctx); ok {
|
|
|
- sl := md.Get("token")
|
|
|
+ sl := md.Get("Token")
|
|
|
if len(sl) >= 1 {
|
|
|
token = sl[0]
|
|
|
}
|
|
|
@@ -39,9 +40,32 @@ func (Api) getToken(ctx context.Context) (token string) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// webToGoVerify 前端入Go验证签名函数,只允许StandardRequest进行验证
|
|
|
+func (a Api) webToGoVerify(ctx context.Context, q *pb.StandardRequest) (string, *pb.StandardRequest, string) {
|
|
|
+ token := a.getToken(ctx)
|
|
|
+
|
|
|
+ //wtgStr = q.JsonStr
|
|
|
+ wtgSign := q.Sign // 生成新签名
|
|
|
+ return token, q, wtgSign
|
|
|
+}
|
|
|
+
|
|
|
+func (Api) goToWebSigner(content string) (gtwStr, gtwSign string) {
|
|
|
+ gtwStr = content
|
|
|
+ gtwSign = ""
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func (a Api) toWebFunc(content string) *pb.StandardReply {
|
|
|
+ gtwStr, gtwSign := a.goToWebSigner(content) // 空函数,go透传给前台数据时生成签名
|
|
|
+ return &pb.StandardReply{
|
|
|
+ JsonRst: gtwStr,
|
|
|
+ Sign: gtwSign,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func (a Api) SignIn(ctx context.Context, q *pb.SignInRequest) (*pb.SignInReply, error) {
|
|
|
token := service.User{}.SignInUserCodePassword(
|
|
|
- q.Name, q.Password, a.getRemoteIp(ctx), a.getUserAgent(ctx), q.CodeID, q.VerifyCode)
|
|
|
+ q.Name, q.Password, a.getRemoteIp(ctx), a.getUserAgent(ctx), q.CodeId, q.VerifyCode)
|
|
|
|
|
|
return &pb.SignInReply{Token: token}, nil
|
|
|
}
|
|
|
@@ -51,6 +75,467 @@ func (a Api) GenVerifyImage(ctx context.Context, q *pb.GenVerifyImageRequest) (*
|
|
|
return &pb.GenVerifyImageReply{ImageBase64: imageBase64, CodeId: codeId}, nil
|
|
|
}
|
|
|
|
|
|
+func (a Api) SignOut(ctx context.Context, q *pb.DefaultRequest) (*pb.DefaultReply, error) {
|
|
|
+ token := a.getToken(ctx)
|
|
|
+ service.User{}.SignOut(token)
|
|
|
+ return &pb.DefaultReply{}, nil
|
|
|
+}
|
|
|
+
|
|
|
//func (a Api) SignUpInWithPhone() {
|
|
|
//
|
|
|
//}
|
|
|
+
|
|
|
+// ----------------------- 商家信息管理 ---------------------------------------------
|
|
|
+
|
|
|
+func (a Api) ManageableShopList(ctx context.Context, r *pb.ShopListRequest) (*pb.ShopListReply, error) {
|
|
|
+ token := a.getToken(ctx)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ManageableShopList(token, r)
|
|
|
+
|
|
|
+ return rs, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopGroupQuery 商家跨店分组查询
|
|
|
+func (a Api) ShopGroupQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopGroupQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// GetShopNavi 查询商家栏目:分级查询,查询一级菜单parentId传入0
|
|
|
+func (a Api) GetShopNavi(ctx context.Context, r *pb.GetShopNaviRequest) (*pb.GetShopNaviReply, error) {
|
|
|
+ token := a.getToken(ctx)
|
|
|
+
|
|
|
+ rs := service.Shop{}.GetShopNavi(token, r)
|
|
|
+ return rs, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopGroupAdd 商家跨店分组添加
|
|
|
+func (a Api) ShopGroupAdd(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopGroupAdd(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopGroupEdit 商家跨店分组编辑
|
|
|
+func (a Api) ShopGroupEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopGroupEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopGroupStatusEdit 商家跨店分组状态修改
|
|
|
+func (a Api) ShopGroupStatusEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopGroupStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopGroupDetailsQuery 跨店分组详情查询
|
|
|
+func (a Api) ShopGroupDetailsQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopGroupDetailsQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueQuery 商家区域查询
|
|
|
+func (a Api) ShopVenueQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueAdd 商家区域添加
|
|
|
+func (a Api) ShopVenueAdd(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueAdd(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueEdit 商家区域编辑
|
|
|
+func (a Api) ShopVenueEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueStatusEdit 商家区域状态修改
|
|
|
+func (a Api) ShopVenueStatusEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueEquipQuery 商家设备查询
|
|
|
+func (a Api) ShopVenueEquipQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueEquipQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueEquipEdit 商家设备编辑
|
|
|
+func (a Api) ShopVenueEquipEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueEquipEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueEquipStatusEdit 商家设备状态修改
|
|
|
+func (a Api) ShopVenueEquipStatusEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueEquipStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVenueEquipStatusDel 商家设备删除
|
|
|
+func (a Api) ShopVenueEquipStatusDel(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopVenueEquipStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopConfigQuery 商家配置查询
|
|
|
+func (a Api) ShopConfigQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopConfigQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopConfigEdit 商家配置编辑
|
|
|
+func (a Api) ShopConfigEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Shop{}.ShopConfigEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// --------------------------商家会员管理----------------------------------------------------
|
|
|
+
|
|
|
+// ShopVipUserQuery 商家会员查询
|
|
|
+func (a Api) ShopVipUserQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.ShopVipUserQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVipUserAdd 商家会员添加
|
|
|
+func (a Api) ShopVipUserAdd(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.ShopVipUserAdd(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVipUserEdit 商家会员编辑
|
|
|
+func (a Api) ShopVipUserEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.ShopVipUserEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ShopVipUserStatusEdit 商家会员状态编辑
|
|
|
+func (a Api) ShopVipUserStatusEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.ShopVipUserStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AcrossVipUserQuery 跨店会员查询
|
|
|
+func (a Api) AcrossVipUserQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.AcrossVipUserQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AcrossVipUserAdd 跨店会员添加
|
|
|
+func (a Api) AcrossVipUserAdd(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.AcrossVipUserQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AcrossVipUserDel 跨店会员删除
|
|
|
+func (a Api) AcrossVipUserDel(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.AcrossVipUserDel(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipPhoneQuery 商家会员手机号查询
|
|
|
+func (a Api) VipPhoneQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipPhoneQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipMainPhoneCheck 商家会员主手机号校验
|
|
|
+func (a Api) VipMainPhoneCheck(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipMainPhoneCheck(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipOtherPhoneAdd 商家会员其他手机号添加
|
|
|
+func (a Api) VipOtherPhoneAdd(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipOtherPhoneAdd(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipOtherPhoneEdit 商家会员其他手机号编辑
|
|
|
+func (a Api) VipOtherPhoneEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipOtherPhoneEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// TempVipUserQuery 商家临时会员查询
|
|
|
+func (a Api) TempVipUserQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.TempVipUserQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// TempVipUserAdd 商家临时会员添加
|
|
|
+func (a Api) TempVipUserAdd(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.TempVipUserAdd(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// TempVipUserEdit 商家临时会员编辑
|
|
|
+func (a Api) TempVipUserEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.TempVipUserEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// TempVipUserStatusEdit 商家临时会员状态修改
|
|
|
+func (a Api) TempVipUserStatusEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.TempVipUserStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipHourEdit 商家会员课时编辑
|
|
|
+func (a Api) VipHourEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.TempVipUserStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipConsumeListQuery 商家会员消费课时查询
|
|
|
+func (a Api) VipConsumeListQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipConsumeListQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipConsumeDetailQuery 商家会员消费课时详情查询
|
|
|
+func (a Api) VipConsumeDetailQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipConsumeDetailQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipClassRelationEdit 商家会员对应课程增删
|
|
|
+func (a Api) VipClassRelationEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipClassRelationEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// VipHourChgQuery 商家会员消费课时详情查询
|
|
|
+func (a Api) VipHourChgQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.User{}.VipHourChgQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// GetSimpleQiNiuToken 获取七牛简单Token
|
|
|
+func (a Api) GetSimpleQiNiuToken(ctx context.Context, r *pb.DefaultRequest) (*pb.QiNiuTokenReply, error) {
|
|
|
+ token := a.getToken(ctx)
|
|
|
+ rs := service.User{}.GetSimpleQiNiuToken(token)
|
|
|
+ return rs, nil
|
|
|
+}
|
|
|
+
|
|
|
+// GetOverlayImgQiNiuToken 获取七牛可覆盖文件Token
|
|
|
+func (a Api) GetOverlayImgQiNiuToken(ctx context.Context, r *pb.GetOverlayImgRequest) (*pb.QiNiuTokenReply, error) {
|
|
|
+ token := a.getToken(ctx)
|
|
|
+
|
|
|
+ rs := service.User{}.GetOverlayImgQiNiuToken(token, r.FileName)
|
|
|
+ return rs, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClassQuery 商家基础课程查询
|
|
|
+func (a Api) ClassQuery(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Class{}.ClassQuery(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClassAdd 商家基础课程添加
|
|
|
+func (a Api) ClassAdd(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Class{}.ClassAdd(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClassEdit 商家基础课程编辑
|
|
|
+func (a Api) ClassEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Class{}.ClassEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClassStatusEdit 商家基础课程状态编辑
|
|
|
+func (a Api) ClassStatusEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Class{}.ClassStatusEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClassColorEdit 商家基础课程颜色修改
|
|
|
+func (a Api) ClassColorEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Class{}.ClassColorEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClassWxVisibleEdit 商家基础课程微信显示状态修改
|
|
|
+func (a Api) ClassWxVisibleEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Class{}.ClassWxVisibleEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClassVipEdit 商家课程会员增删
|
|
|
+func (a Api) ClassVipEdit(ctx context.Context, r *pb.StandardRequest) (*pb.StandardReply, error) {
|
|
|
+ // 获取token,并验证签名函数
|
|
|
+ token, q, sign := a.webToGoVerify(ctx, r)
|
|
|
+
|
|
|
+ rs := service.Class{}.ClassVipEdit(token, q.ShopID, q.JsonStr, sign)
|
|
|
+ rst := a.toWebFunc(rs)
|
|
|
+ return rst, nil
|
|
|
+}
|