|
@@ -1,18 +1,19 @@
|
|
package common
|
|
package common
|
|
|
|
|
|
import (
|
|
import (
|
|
- "app.yhyue.com/moapp/MessageCenter/rpc/internal/config"
|
|
|
|
- qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
|
- "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
|
"errors"
|
|
"errors"
|
|
"fmt"
|
|
"fmt"
|
|
- "k8s.io/apimachinery/pkg/util/json"
|
|
|
|
"log"
|
|
"log"
|
|
"net/rpc"
|
|
"net/rpc"
|
|
"strings"
|
|
"strings"
|
|
|
|
+
|
|
|
|
+ "app.yhyue.com/moapp/MessageCenter/rpc/internal/config"
|
|
|
|
+ qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
|
+ "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
|
+ "k8s.io/apimachinery/pkg/util/json"
|
|
)
|
|
)
|
|
|
|
|
|
-func AppPushMsg(userInfo map[string]interface{}, sth, appPushUrl, title, detail string, msgType int64) error {
|
|
|
|
|
|
+func AppPushMsg(userInfo map[string]interface{}, sth, appPushUrl, title, detail string, msgType int64, category string) error {
|
|
if userInfo == nil {
|
|
if userInfo == nil {
|
|
return fmt.Errorf("为查询到用户信息")
|
|
return fmt.Errorf("为查询到用户信息")
|
|
}
|
|
}
|
|
@@ -44,7 +45,10 @@ func AppPushMsg(userInfo map[string]interface{}, sth, appPushUrl, title, detail
|
|
}
|
|
}
|
|
//推送消息
|
|
//推送消息
|
|
if appVersion > "3.0.3" {
|
|
if appVersion > "3.0.3" {
|
|
- if err := AppGrpcPush(dt, otherPushId, jgPushId, phoneType, appPushUrl); err != nil {
|
|
|
|
|
|
+ if sth == "o_msg_privateletter" {
|
|
|
|
+ category = "私信"
|
|
|
|
+ }
|
|
|
|
+ if err := AppGrpcPush(dt, otherPushId, jgPushId, phoneType, appPushUrl, category); err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
//redis.Put(CacheDb, userKey, 1, config.ConfigJson.WxTmplConfig.Limit.DuringMine*60)
|
|
//redis.Put(CacheDb, userKey, 1, config.ConfigJson.WxTmplConfig.Limit.DuringMine*60)
|
|
@@ -56,7 +60,7 @@ func AppPushMsg(userInfo map[string]interface{}, sth, appPushUrl, title, detail
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
-func AppGrpcPush(pushData map[string]interface{}, otherPushId, jgPushId, phoneType, appPushUrl string) error {
|
|
|
|
|
|
+func AppGrpcPush(pushData map[string]interface{}, otherPushId, jgPushId, phoneType, appPushUrl, category string) error {
|
|
menuName := "message"
|
|
menuName := "message"
|
|
if value, ok := pushData["menuName"]; ok {
|
|
if value, ok := pushData["menuName"]; ok {
|
|
menuName = qutil.ObjToString(value)
|
|
menuName = qutil.ObjToString(value)
|
|
@@ -91,6 +95,7 @@ func AppGrpcPush(pushData map[string]interface{}, otherPushId, jgPushId, phoneTy
|
|
"url": appPushUrl, //点了消息以后,跳转的链接地址,不需要带域名
|
|
"url": appPushUrl, //点了消息以后,跳转的链接地址,不需要带域名
|
|
"menuName": menuName, //在哪个webview打开链接,search:搜索 subscribe:订阅 box:百宝箱 me:我的 other:新的webview 消息中心 message
|
|
"menuName": menuName, //在哪个webview打开链接,search:搜索 subscribe:订阅 box:百宝箱 me:我的 other:新的webview 消息中心 message
|
|
"redDot": "", //在哪个底部菜单显示小红点,空值则不显示小红点,search:搜索 subscribe:订阅 box:百宝箱 me:我的
|
|
"redDot": "", //在哪个底部菜单显示小红点,空值则不显示小红点,search:搜索 subscribe:订阅 box:百宝箱 me:我的
|
|
|
|
+ "category": category,
|
|
}
|
|
}
|
|
log.Println("push推送内容====", push)
|
|
log.Println("push推送内容====", push)
|
|
b, _ := json.Marshal(push)
|
|
b, _ := json.Marshal(push)
|