Bläddra i källkod

Merge branch 'dev/v1.2.7_dx' of moapp/MessageCenter into feature/v1.2.7

duxin 1 år sedan
förälder
incheckning
a28c435265

+ 93 - 0
rpc/internal/common/appPush.go

@@ -0,0 +1,93 @@
+package common
+
+import (
+	"app.yhyue.com/moapp/MessageCenter/rpc/internal/config"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"errors"
+	"fmt"
+	"k8s.io/apimachinery/pkg/util/json"
+	"log"
+	"net/rpc"
+)
+
+func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title, detail string) error {
+	//限制
+	//校验发送间隔
+	userId := mongodb.BsonIdToSId(userInfo["_id"])
+	userKey := fmt.Sprintf("appPush_letter_%s", userId)
+	if sendWait, _ := redis.Exists(CacheDb, userKey); sendWait {
+		return fmt.Errorf("发送模版消息频繁,稍后重试")
+	}
+	if pushSetMap := qutil.ObjToMap(userInfo["o_pushset"]); pushSetMap != nil && len(*pushSetMap) > 0 {
+		if pushKeyMap := qutil.ObjToMap((*pushSetMap)[stm]); pushKeyMap != nil && len(*pushKeyMap) > 0 {
+			if qutil.Int64All((*pushKeyMap)["i_apppush"]) == 1 {
+				//用户信息
+				var otherPushId, jgPushId, phoneType, name, appVersion = "", "", "", "", ""
+				otherPushId = qutil.ObjToString(userInfo["s_opushid"])
+				jgPushId = qutil.ObjToString(userInfo["s_jpushid"])
+				phoneType = qutil.ObjToString(userInfo["s_appponetype"])
+				name = qutil.ObjToString(userInfo["s_name"])
+				appVersion = qutil.ObjToString(userInfo["s_appversion"])
+
+				dt := map[string]interface{}{
+					"receiveUserId": userId,
+					"receiveName":   name,
+					"title":         title,
+					"content":       detail,
+					"msgType":       "messagecenter",
+					"link":          appPushUrl,
+					"appid":         "10000",
+					"menuName":      "message",
+				}
+				//推送消息
+				if appVersion > "3.0.3" {
+					if err := AppGrpcPush(dt, otherPushId, jgPushId, phoneType, appPushUrl); err != nil {
+						return err
+					}
+					redis.Put(CacheDb, userKey, 1, config.ConfigJson.WxTmplConfig.Limit.DuringMine*60)
+				}
+			}
+		}
+	}
+	return nil
+}
+
+func AppGrpcPush(pushData map[string]interface{}, otherPushId, jgPushId, phoneType, appPushUrl string) error {
+	menuName := "message"
+	if value, ok := pushData["menuName"]; ok {
+		menuName = qutil.ObjToString(value)
+	}
+	var repl string
+	client, err := rpc.DialHTTP("tcp", config.ConfigJson.PushGrpcServer)
+	if err != nil {
+		log.Println(err.Error())
+		return err
+	}
+	defer client.Close()
+	push := map[string]interface{}{
+		"title":       pushData["title"],         //标题
+		"descript":    pushData["content"],       //副标题
+		"otherPushId": otherPushId,               //mongodb库user表中s_opushid
+		"jgPushId":    jgPushId,                  //mongodb库user表中s_jpushid
+		"userId":      pushData["receiveUserId"], //mongodb库user表中_id转string
+		"phoneType":   phoneType,                 //mongodb库user表中s_appponetype
+		"type":        "messagecenter",           //消息类型,消息中心推送的消息使用messagecenter
+		"url":         appPushUrl,                //点了消息以后,跳转的链接地址,不需要带域名
+		"menuName":    menuName,                  //在哪个webview打开链接,search:搜索 subscribe:订阅 box:百宝箱 me:我的 other:新的webview  消息中心 message
+		"redDot":      "",                        //在哪个底部菜单显示小红点,空值则不显示小红点,search:搜索 subscribe:订阅 box:百宝箱 me:我的
+	}
+	log.Println("push推送内容====", push)
+	b, _ := json.Marshal(push)
+	err = client.Call("Rpc.Push", b, &repl)
+	if err != nil {
+		log.Println(err.Error())
+		return err
+	}
+	if repl != "y" {
+		log.Println("推送失败!", repl, pushData["receiveUserId"])
+		return errors.New("推送失败")
+	}
+	return nil
+}

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

@@ -79,7 +79,7 @@ func ClearUnreadMsg(in *message.ClearUnreadMsgReq) error {
 			log.Println("更新服务未读数失败")
 		}
 		for _, v := range entity.MessageColumn {
-			go MsgCountZero(in.Userid, in.AppId, qutil.Int64All(v["msg_type"]))
+			go MsgCountZero(in.Userid, in.AppId, qutil.Int64All(v["group_id"]))
 		}
 	}
 

+ 5 - 5
rpc/internal/common/messageService.go

@@ -24,7 +24,7 @@ func (service *MessageService) ChangeReadStatus(data *message.ChangeReadStatusRe
 	if !b {
 		return 0, "修改消息阅读状态失败"
 	}
-	MsgCountMinusOne(qutil.ObjToString((*msg)["receive_userid"]), data.Appid, qutil.Int64All((*msg)["msg_type"]))
+	MsgCountMinusOne(qutil.ObjToString((*msg)["receive_userid"]), data.Appid, qutil.Int64All((*msg)["group_id"]))
 	return 1, "修改消息阅读状态成功"
 }
 
@@ -62,10 +62,10 @@ func (service *MessageService) DeleteMessage(id []string, appId string) (int64,
 // 未读消息合计
 func (service *MessageService) CountUnread(userId string, appId string) (int64, string, int) {
 	count := 0
-	types := entity.Mysql.Find("message_column", map[string]interface{}{}, `"msg_type"`, "", -1, -1)
+	types := entity.Mysql.Find("message_group", map[string]interface{}{}, `"msg_type"`, "", -1, -1)
 	if types != nil && len(*types) > 0 {
 		for _, v := range *types {
-			key := fmt.Sprintf(MsgCountKey, userId, qutil.IntAll(v["msg_type"]))
+			key := fmt.Sprintf(MsgCountKey, userId, qutil.IntAll(v["group_id"]))
 			if exists, _ := redis.Exists(redisModule, key); exists {
 				count += redis.GetInt(redisModule, key)
 			}
@@ -90,11 +90,11 @@ func FindMessageDetail(id, msgLogId int64, userId string) (msg *map[string]inter
 
 // GetMsgType 消息的分类
 func (service *MessageService) GetMsgType() (data []*message.MsgTypes, err error) {
-	types := entity.Mysql.SelectBySql("SELECT * FROM `message_column` WHERE msg_type > 0 ORDER BY sequence ASC")
+	types := entity.Mysql.SelectBySql("SELECT * FROM `message_group` WHERE group_id > 0 ORDER BY sequence ASC")
 	if types != nil && len(*types) > 0 {
 		for _, val := range *types {
 			data = append(data, &message.MsgTypes{
-				MsgType:         qutil.Int64All(val["msg_type"]),
+				MsgType:         qutil.Int64All(val["group_id"]),
 				Name:            qutil.ObjToString(val["name"]),
 				Img:             qutil.ObjToString(val["img"]),
 				Code:            qutil.ObjToString(val["switch"]),

+ 32 - 22
rpc/internal/common/sendMsg.go

@@ -30,7 +30,7 @@ func FindUserMsg(this message.FindUserMsgReq, isClean bool) message.FindUserMsgR
 		"appid":          this.Appid,
 	}
 	if this.MsgType != -1 {
-		cquery["msg_type"] = this.MsgType
+		cquery["group_id"] = this.MsgType
 	}
 	if this.Read != -1 {
 		cquery["isRead"] = this.Read
@@ -68,7 +68,7 @@ func FindUserMsg(this message.FindUserMsgReq, isClean bool) message.FindUserMsgR
 					SendName:      util.ObjToString(v["send_name"]),
 					Createtime:    util.ObjToString(v["createtime"]),
 					Title:         util.ObjToString(v["title"]),
-					MsgType:       int64(util.IntAll(v["msg_type"])),
+					MsgType:       int64(util.IntAll(v["group_id"])),
 					Link:          util.ObjToString(v["link"]),
 					CiteId:        util.Int64All(v["cite_id"]),
 					Content:       util.ObjToString(v["content"]),
@@ -106,7 +106,7 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 		"appid":          this.Appid,
 	}
 	if this.MsgType > 0 {
-		cquery["msg_type"] = this.MsgType
+		cquery["group_id"] = this.MsgType
 	}
 	if this.Read != -1 {
 		cquery["isRead"] = this.Read
@@ -114,13 +114,15 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 	data := new(message.UserMsgList)
 	//获取栏目下的数据
 	sData := make(map[string][]*message.Messages)
+	t := time.Now()
 	if this.IsColumnNewMsg && this.SortSize > 0 {
 		sortData := entity.Mysql.SelectBySql(fmt.Sprintf(`SELECT * FROM (
-  			SELECT *, ROW_NUMBER() OVER (PARTITION BY msg_type, receive_userid ORDER BY createtime DESC) AS row_num
+  			SELECT *, ROW_NUMBER() OVER (PARTITION BY group_id, receive_userid ORDER BY createtime DESC) AS row_num
   			FROM message
   			WHERE receive_userid = '%s' and isdel = 1 and  appid = %s
 		) AS message_ranked
 		WHERE row_num <=%d;`, this.UserId, this.Appid, this.SortSize))
+		log.Println("消息列表耗时1:", time.Since(t))
 		if sortData != nil {
 			for _, v := range *sortData {
 				_id := util.Int64All(v["id"])
@@ -134,17 +136,17 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 					SendName:      common.InterfaceToStr(v["send_name"]),
 					Createtime:    common.InterfaceToStr(v["createtime"]),
 					Title:         common.InterfaceToStr(v["title"]),
-					MsgType:       int64(util.IntAll(v["msg_type"])),
+					MsgType:       int64(util.IntAll(v["group_id"])),
 					Link:          common.InterfaceToStr(v["link"]),
 					CiteId:        util.Int64All(v["cite_id"]),
 					Content:       common.InterfaceToStr(v["content"]),
 					IsRead:        util.Int64All(v["isRead"]),
 					MsgLogId:      util.Int64All(v["msg_log_id"]),
 				}
-				if sData[common.InterfaceToStr(v["msg_type"])] == nil {
-					sData[common.InterfaceToStr(v["msg_type"])] = []*message.Messages{&msg}
+				if sData[common.InterfaceToStr(v["group_id"])] == nil {
+					sData[common.InterfaceToStr(v["group_id"])] = []*message.Messages{&msg}
 				} else {
-					sData[common.InterfaceToStr(v["msg_type"])] = append(sData[common.InterfaceToStr(v["msg_type"])], &msg)
+					sData[common.InterfaceToStr(v["group_id"])] = append(sData[common.InterfaceToStr(v["group_id"])], &msg)
 				}
 			}
 		}
@@ -154,28 +156,29 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 	var columnData []*message.AllSortData
 	var msgTypes []string
 	for _, v := range entity.MessageColumn {
-		if common.IntAll(v["msg_type"]) > 0 {
-			msgTypes = append(msgTypes, fmt.Sprintf(`"%s"`, common.InterfaceToStr(v["msg_type"])))
+		if common.IntAll(v["group_id"]) > 0 {
+			msgTypes = append(msgTypes, fmt.Sprintf(`"%s"`, common.InterfaceToStr(v["group_id"])))
 		}
 	}
 	if this.IsColumn {
 		columnUnread := make(map[string]int64)
-		query := entity.Mysql.SelectBySql(fmt.Sprintf("SELECT msg_type,COUNT(CASE WHEN isRead=0 THEN 1 END) as count  FROM message where receive_userid=? and isdel=1 and appid=? GROUP BY msg_type  ORDER BY FIELD(`msg_type`,%s)", strings.Join(msgTypes, ",")), this.UserId, this.Appid)
+		query := entity.Mysql.SelectBySql(fmt.Sprintf("SELECT group_id,COUNT(CASE WHEN isRead=0 THEN 1 END) as count  FROM message where receive_userid=? and isdel=1 and appid=? GROUP BY group_id  ORDER BY FIELD(`group_id`,%s)", strings.Join(msgTypes, ",")), this.UserId, this.Appid)
+		log.Println("消息列表耗时2:", time.Since(t))
 		if query != nil && len(*query) > 0 {
 			for _, v := range *query {
-				columnUnread[common.InterfaceToStr(v["msg_type"])] = common.Int64All(v["count"])
+				columnUnread[common.InterfaceToStr(v["group_id"])] = common.Int64All(v["count"])
 			}
 		}
 		for _, v := range entity.MessageColumn {
 			var column message.AllSortData
 			column.Name = common.InterfaceToStr(v["name"])
 			column.Img = fmt.Sprintf("/common-module/msgCenter/%s.png", common.InterfaceToStr(v["img"]))
-			column.MsgType = common.Int64All(v["msg_type"])
+			column.MsgType = common.Int64All(v["group_id"])
 			if column.Name == "私信" {
 				column.UnreadMessages = unreadMsg(this)
 			} else {
 				//消息未读数
-				msgType := common.InterfaceToStr(v["msg_type"])
+				msgType := common.InterfaceToStr(v["group_id"])
 				column.UnreadMessages = columnUnread[msgType]
 				column.Data = sData[msgType]
 			}
@@ -191,6 +194,7 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 				this.OffSet = 1
 			}
 			res := entity.Mysql.Find("message", cquery, "", "createtime desc", (int(this.OffSet)-1)*int(this.PageSize), int(this.PageSize))
+			log.Println("消息列表耗时3:", time.Since(t))
 			if res != nil && len(*res) > 0 {
 				for _, v := range *res {
 					_id := util.Int64All(v["id"])
@@ -204,7 +208,7 @@ func UserMsgList(this *message.UserMsgListReq) *message.UserMsgList {
 						SendName:      common.InterfaceToStr(v["send_name"]),
 						Createtime:    common.InterfaceToStr(v["createtime"]),
 						Title:         common.InterfaceToStr(v["title"]),
-						MsgType:       int64(util.IntAll(v["msg_type"])),
+						MsgType:       int64(util.IntAll(v["group_id"])),
 						Link:          common.InterfaceToStr(v["link"]),
 						CiteId:        util.Int64All(v["cite_id"]),
 						Content:       common.InterfaceToStr(v["content"]),
@@ -251,10 +255,10 @@ func unreadMsg(this *message.UserMsgListReq) int64 {
 func UserUnreadMsgList(this *message.UserUnreadMsgListReq) (int64, []*message.Messages) {
 	count := 0
 	data := []*message.Messages{}
-	types := entity.Mysql.Find("message_column", map[string]interface{}{}, `"msg_type"`, "", -1, -1)
+	types := entity.Mysql.Find("message_group", map[string]interface{}{}, `"group_id"`, "", -1, -1)
 	if types != nil && len(*types) > 0 {
 		for _, v := range *types {
-			key := fmt.Sprintf(MsgCountKey, this.UserId, util.IntAll(v["msg_type"]))
+			key := fmt.Sprintf(MsgCountKey, this.UserId, util.IntAll(v["group_id"]))
 			if exists, _ := redis.Exists(redisModule, key); exists {
 				count += redis.GetInt(redisModule, key)
 			}
@@ -289,7 +293,7 @@ func UserUnreadMsgList(this *message.UserUnreadMsgListReq) (int64, []*message.Me
 					SendName:      common.InterfaceToStr(val["send_name"]),
 					Createtime:    common.InterfaceToStr(val["createtime"]),
 					Title:         common.InterfaceToStr(val["title"]),
-					MsgType:       common.Int64All(val["msg_type"]),
+					MsgType:       common.Int64All(val["group_id"]),
 					Link:          link4,
 					CiteId:        common.Int64All(val["cite_id"]),
 					Content:       common.InterfaceToStr(val["content"]),
@@ -309,7 +313,7 @@ func MessageGetLast(this *message.UserMsgListReq) *message.Messages {
 		"isdel":          1,
 		"appid":          this.Appid,
 		"isRead":         0,
-		"msg_type":       1,
+		"group_id":       1,
 	}
 	lastMsg := entity.Mysql.FindOne("message", query, "", "createtime desc")
 	if lastMsg != nil && len(*lastMsg) > 0 {
@@ -324,7 +328,7 @@ func MessageGetLast(this *message.UserMsgListReq) *message.Messages {
 			SendName:      common.InterfaceToStr((*lastMsg)["send_name"]),
 			Createtime:    common.InterfaceToStr((*lastMsg)["createtime"]),
 			Title:         common.InterfaceToStr((*lastMsg)["title"]),
-			MsgType:       common.Int64All((*lastMsg)["msg_type"]),
+			MsgType:       common.Int64All((*lastMsg)["group_id"]),
 			Link:          common.InterfaceToStr((*lastMsg)["link"]),
 			CiteId:        common.Int64All((*lastMsg)["cite_id"]),
 			Content:       common.InterfaceToStr((*lastMsg)["content"]),
@@ -393,6 +397,11 @@ func MultSave(this message.MultipleSaveMsgReq) (int64, string) {
 		return 0, "无效的用户id"
 	}
 	wg := &sync.WaitGroup{}
+	var group_id int
+	class := entity.Mysql.FindOne("message_class", map[string]interface{}{"msg_type": this.MsgType}, "group_id", "")
+	if class != nil && len(*class) > 0 {
+		group_id = util.IntAll((*class)["group_id"])
+	}
 	for i := 0; i < len(userIdArr); i++ {
 		if userIdArr[i] == "" {
 			continue
@@ -404,6 +413,7 @@ func MultSave(this message.MultipleSaveMsgReq) (int64, string) {
 		if len(positionIdArr) == len(userIdArr) {
 			positionId = common.Int64All(positionIdArr[i])
 		}
+
 		go func(v, userName string, positionId int64) {
 			defer func() {
 				<-entity.SaveConcurrencyChan
@@ -411,8 +421,8 @@ func MultSave(this message.MultipleSaveMsgReq) (int64, string) {
 			}()
 			//消息数组
 			c := entity.Mysql.Count("conversation", map[string]interface{}{"receive_id": v, "send_id": this.SendUserId})
-			sql3 := `INSERT INTO message(appid,receive_userid,receive_name,send_userid,send_name,title,content,msg_type,link,cite_id,createtime,isRead,isdel,msg_log_id,show_buoy,show_content,position_id) values ("%s",'%s','%s','%s','%s','%s','%s',%d,'%s',0,'%s',0,1,%d,%d,'%s',?);`
-			sql3 = fmt.Sprintf(sql3, this.Appid, v, userName, this.SendUserId, this.SendName, this.Title, this.Content, this.MsgType, this.Link, time.Now().Format("2006-01-02 15:04:05"), this.MsgLogId, this.ShowBuoy, this.ShowContent)
+			sql3 := `INSERT INTO message(appid,receive_userid,receive_name,send_userid,send_name,title,content,msg_type,link,cite_id,createtime,isRead,isdel,msg_log_id,show_buoy,show_content,position_id,group_id) values ("%s",'%s','%s','%s','%s','%s','%s',%d,'%s',0,'%s',0,1,%d,%d,'%s',%d,?);`
+			sql3 = fmt.Sprintf(sql3, this.Appid, v, userName, this.SendUserId, this.SendName, this.Title, this.Content, this.MsgType, this.Link, time.Now().Format("2006-01-02 15:04:05"), this.MsgLogId, this.ShowBuoy, this.ShowContent, group_id)
 			if c <= 0 {
 				sql1 := `INSERT INTO conversation(appid,secret_key,user_id,receive_id,receive_name,send_id,send_name,sort,createtime) values ('%s','','%s','%s','%s','%s','%s',0,'%s');`
 				sql1 = fmt.Sprintf(sql1, this.Appid, this.SendUserId, v, userName, this.SendUserId, this.SendName, time.Now().Format("2006-01-02 15:04:05"))

+ 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 ORDER BY sequence ASC`)
+	rData := entity.Mysql.SelectBySql(`SELECT * FROM message_group ORDER BY sequence ASC`)
 	switchName := map[string]WxTmplConfig{}
 	if rData != nil && len(*rData) > 0 {
 		data = *rData

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

@@ -3,16 +3,12 @@ package logic
 import (
 	"app.yhyue.com/moapp/MessageCenter/entity"
 	"app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
-	"app.yhyue.com/moapp/MessageCenter/rpc/internal/config"
 	"app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
 	"app.yhyue.com/moapp/MessageCenter/rpc/type/message"
 	qutil "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/go-xweb/log"
-	"app.yhyue.com/moapp/jybase/mongodb"
 	"context"
-	"encoding/json"
 	"fmt"
-	"net/rpc"
 	"strings"
 
 	"github.com/zeromicro/go-zero/core/logx"
@@ -56,88 +52,21 @@ func (l *AppLetterPushLogic) AppLetterPush(in *message.WxTmplMsgRequest) (*messa
 				query["base_user_id"] = baseUserId
 			}
 		}
-		userData := make(map[string]interface{})
 		if len(query) > 0 {
-			rData, _ := entity.MQFW.FindOneByField("user", query, fmt.Sprintf(`{"s_appversion":1,"s_nmae":1,"s_nmae":1,"s_jpushid":1,"s_opushid":1,"s_m_openid":1,"o_pushset.%s.i_apppush":1}`, pushConfig.Switch))
+			userData := make(map[string]interface{})
+			rData, _ := entity.MQFW.FindOneByField("user", query, fmt.Sprintf(`{"_id":1,"s_appversion":1,"s_nmae":1,"s_nmae":1,"s_jpushid":1,"s_opushid":1,"s_m_openid":1,"o_pushset.%s.i_apppush":1}`, pushConfig.Switch))
 			if rData != nil && len(*rData) > 0 {
 				userData = *rData
 			}
+
+			if err = common.AppPushMsg(userData, pushConfig.Switch, in.Url, in.Title, in.Detail); err != nil {
+				return &message.SendMsgResponse{
+					Total: 1,
+				}, err
+			}
 		}
-		AppPushMsg(userData, pushConfig.Switch, in.Url, in.Title, in.Detail)
 	}
 	return &message.SendMsgResponse{
 		Total: 1,
 	}, nil
 }
-
-func AppPushMsg(userInfo map[string]interface{}, stm, appPushUrl, title, detail 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 {
-			if qutil.Int64All((*pushKeyMap)["i_apppush"]) == 1 {
-				//用户信息
-				var otherPushId, jgPushId, phoneType, name, appVersion = "", "", "", "", ""
-				otherPushId = qutil.ObjToString(userInfo["s_opushid"])
-				jgPushId = qutil.ObjToString(userInfo["s_jpushid"])
-				phoneType = qutil.ObjToString(userInfo["s_appponetype"])
-				name = qutil.ObjToString(userInfo["s_name"])
-				appVersion = qutil.ObjToString(userInfo["s_appversion"])
-
-				dt := map[string]interface{}{
-					"receiveUserId": userId,
-					"receiveName":   name,
-					"title":         title,
-					"content":       detail,
-					"msgType":       "messagecenter",
-					"link":          appPushUrl,
-					"appid":         "10000",
-					"menuName":      "message",
-				}
-				//推送消息
-				if appVersion > "3.0.3" {
-					go AppGrpcPush(dt, otherPushId, jgPushId, phoneType, appPushUrl)
-				}
-				return
-			}
-		}
-	}
-}
-
-func AppGrpcPush(pushData map[string]interface{}, otherPushId, jgPushId, phoneType, appPushUrl string) {
-	menuName := "message"
-	if value, ok := pushData["menuName"]; ok {
-		menuName = qutil.ObjToString(value)
-	}
-	var repl string
-	client, err := rpc.DialHTTP("tcp", config.ConfigJson.PushGrpcServer)
-	if err != nil {
-		log.Println(err.Error())
-		return
-	}
-	defer client.Close()
-	push := map[string]interface{}{
-		"title":       pushData["title"],         //标题
-		"descript":    pushData["content"],       //副标题
-		"otherPushId": otherPushId,               //mongodb库user表中s_opushid
-		"jgPushId":    jgPushId,                  //mongodb库user表中s_jpushid
-		"userId":      pushData["receiveUserId"], //mongodb库user表中_id转string
-		"phoneType":   phoneType,                 //mongodb库user表中s_appponetype
-		"type":        "messagecenter",           //消息类型,消息中心推送的消息使用messagecenter
-		"url":         appPushUrl,                //点了消息以后,跳转的链接地址,不需要带域名
-		"menuName":    menuName,                  //在哪个webview打开链接,search:搜索 subscribe:订阅 box:百宝箱 me:我的 other:新的webview  消息中心 message
-		"redDot":      "",                        //在哪个底部菜单显示小红点,空值则不显示小红点,search:搜索 subscribe:订阅 box:百宝箱 me:我的
-	}
-	log.Println("push推送内容====", push)
-	b, _ := json.Marshal(push)
-	err = client.Call("Rpc.Push", b, &repl)
-	if err != nil {
-		log.Println(err.Error())
-		return
-	}
-	if repl == "y" {
-		log.Println("推送成功!", pushData["receiveUserId"])
-	} else {
-		log.Println("推送失败!", repl, pushData["receiveUserId"])
-	}
-
-}

+ 2 - 2
rpc/internal/logic/findmessagedetaillogic.go

@@ -40,12 +40,12 @@ func (l *FindMessageDetailLogic) FindMessageDetail(in *messageclient.MessageDeta
 			SendUserId:    qutil.ObjToString((*msg)["send_userid"]),
 			Title:         qutil.ObjToString((*msg)["title"]),
 			Content:       qutil.ObjToString((*msg)["content"]),
-			MsgType:       qutil.Int64All((*msg)["msg_type"]),
+			MsgType:       qutil.Int64All((*msg)["group_id"]),
 			Link:          qutil.ObjToString((*msg)["link"]),
 			CiteId:        qutil.Int64All((*msg)["cite_id"]),
 			IsRead:        qutil.Int64All((*msg)["isRead"]),
 			Createtime:    qutil.ObjToString((*msg)["createtime"]),
-			MsgLogId:      qutil.Int64All((*msg)["msg_type"]),
+			MsgLogId:      qutil.Int64All((*msg)["msg_log_id"]),
 		}
 		result.Code = 0
 		result.Message = "请求成功"