ソースを参照

fix:app push 推送rpc添加

duxin 1 年間 前
コミット
4ed3ca3d35

+ 1 - 1
rpc/internal/common/sendWxTmplMsg.go

@@ -36,7 +36,7 @@ const CacheDb = "msgCount"
 
 func MessageType() (func() map[string]WxTmplConfig, []map[string]interface{}) {
 	var data []map[string]interface{}
-	rData := entity.Mysql.SelectBySql(`SELECT * FROM message_column where switch != "" ORDER BY sequence ASC`)
+	rData := entity.Mysql.SelectBySql(`SELECT * FROM message_column ORDER BY sequence ASC`)
 	switchName := map[string]WxTmplConfig{}
 	if rData != nil && len(*rData) > 0 {
 		data = *rData

+ 8 - 11
rpc/internal/logic/appletterpushlogic.go

@@ -62,15 +62,14 @@ func (l *AppLetterPushLogic) AppLetterPush(in *message.WxTmplMsgRequest) (*messa
 				userData = *rData
 			}
 		}
-
-		AppPushMsg(userData, pushConfig.Switch, in.Url, in.Title, in.Detail)
+		AppPushMsg(userData, pushConfig.Switch, in.Url, in.Title)
 	}
 	return &message.SendMsgResponse{
 		Total: 1,
 	}, nil
 }
 
-func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title string, detail string) {
+func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title string) {
 	userId := mongodb.BsonIdToSId(userInfo["_id"])
 	if pushSetMap := qutil.ObjToMap(userInfo["o_pushset"]); pushSetMap != nil && len(*pushSetMap) > 0 {
 		if pushKeyMap := qutil.ObjToMap((*pushSetMap)[stm]); pushKeyMap != nil && len(*pushKeyMap) > 0 {
@@ -86,13 +85,12 @@ func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title string,
 				dt := map[string]interface{}{
 					"receiveUserId": userId,
 					"receiveName":   name,
-					//"sendName":      loginUserName,
-					"title":    title,
-					"content":  detail,
-					"msgType":  "messagecenter",
-					"link":     appPushUrl,
-					"appid":    "10000",
-					"menuName": "message",
+					"title":         "剑鱼标讯",
+					"content":       fmt.Sprintf("您收到一条来自%s私信", title),
+					"msgType":       "messagecenter",
+					"link":          appPushUrl,
+					"appid":         "10000",
+					"menuName":      "message",
 				}
 				//推送消息
 				if appVersion > "3.0.3" {
@@ -102,7 +100,6 @@ func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title string,
 			}
 		}
 	}
-	//log.Println("用户未打开app推送", msgType, userId)
 }
 
 func AppGrpcPush(pushData map[string]interface{}, otherPushId, jgPushId, phoneType, appPushUrl string) {