Przeglądaj źródła

调整发送消息参数

fuwencai 3 lat temu
rodzic
commit
7900d1d30c

+ 0 - 3
api/internal/logic/messagedetaillogic.go

@@ -26,10 +26,7 @@ func NewMessageDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) Mess
 }
 
 func (l *MessageDetailLogic) MessageDetail(req types.MessageDetailReq) (*types.MessageDetailResp, error) {
-<<<<<<< HEAD
-=======
 
->>>>>>> 6f28afb30f4f6a2d23106a4b3b3ade24e733f2c0
 	result := &types.MessageDetailResp{}
 	log.Println(req)
 	lsi := l.svcCtx.MessageCenter

+ 1 - 1
api/internal/logic/messageunreadclasscountlogic.go

@@ -24,7 +24,7 @@ func NewMessageUnreadClassCountLogic(ctx context.Context, svcCtx *svc.ServiceCon
 		svcCtx: svcCtx,
 	}
 }
-
+// 获取用户收到的分类及未读消息数量
 func (l *MessageUnreadClassCountLogic) MessageUnreadClassCount(req types.MessageUnreadClassCountReq) (*types.MessageUnreadClassCountRes, error) {
 	// todo: add your logic here and delete this line
 	result := &types.MessageUnreadClassCountRes{}

+ 9 - 9
api/internal/types/types.go

@@ -108,15 +108,15 @@ type MarkReadRes struct {
 }
 
 type SendMsgReq struct {
-	ReceiveUserId string `form:"receiveUserId"`   //接收方的用户id
-	ReceiveName   string `form:"receiveName"`     //接收方的用户名
-	SendUserId    string `form:"sendUserId"`      //发送方的用户id
-	SendName      string `form:"sendName"`        //发送方的用户名
-	Title         string `form:"title"`           //标题
-	Content       string `form:"content"`         //内容
-	MsgType       int64  `form:"msgType"`         // 消息类型
-	Link          string `form:"link"`            //连接
-	CiteId        int64  `form:"citeId,optional"` //应用id
+	ReceiveUserId string `form:"receiveUserId"`        //接收方的用户id
+	ReceiveName   string `form:"receiveName,optional"` //接收方的用户名
+	SendUserId    string `form:"sendUserId"`           //发送方的用户id
+	SendName      string `form:"sendName"`             //发送方的用户名
+	Title         string `form:"title"`                //标题
+	Content       string `form:"content"`              //内容
+	MsgType       int64  `form:"msgType"`              // 消息类型
+	Link          string `form:"link,optional"`        //连接
+	CiteId        int64  `form:"citeId,optional"`      //应用id
 	Appid         string `form:"appid"`
 }
 

+ 12 - 12
api/message.api

@@ -106,15 +106,15 @@ type MarkReadRes {
 
 //给指定用户发送消息
 type SendMsgReq {
-	ReceiveUserId string `form:"receiveUserId"`   //接收方的用户id
-	ReceiveName   string `form:"receiveName"`     //接收方的用户名
-	SendUserId    string `form:"sendUserId"`      //发送方的用户id
-	SendName      string `form:"sendName"`        //发送方的用户名
-	Title         string `form:"title"`           //标题
-	Content       string `form:"content"`         //内容
-	MsgType       int64  `form:"msgType"`         // 消息类型
-	Link          string `form:"link"`            //连接
-	CiteId        int64  `form:"citeId,optional"` //应用id
+	ReceiveUserId string `form:"receiveUserId"`        //接收方的用户id
+	ReceiveName   string `form:"receiveName,optional"` //接收方的用户名
+	SendUserId    string `form:"sendUserId"`           //发送方的用户id
+	SendName      string `form:"sendName"`             //发送方的用户名
+	Title         string `form:"title"`                //标题
+	Content       string `form:"content"`              //内容
+	MsgType       int64  `form:"msgType"`              // 消息类型
+	Link          string `form:"link,optional"`        //连接
+	CiteId        int64  `form:"citeId,optional"`      //应用id
 	Appid         string `form:"appid"`
 }
 type SendMsgResp {
@@ -136,13 +136,13 @@ service message-api {
 	// 获取指定用户的历史消息  条件可选 消息类型 是否未读
 	@handler MessageFindHandler
 	post /message/messageFind (MessageFindReq) returns (MessageFindRes)
-	// 获取用户未读消息分类及数量
+	// 获取用户收到的消息分类及未读消息数量
 	@handler MessageUnreadClassCountHandler
 	post /message/messageUnreadClassCount (MessageUnreadClassCountReq) returns (MessageUnreadClassCountRes)
-	// 获取用户未读消息
+	// 获取用户未读消息
 	@handler MessageUnreadCountHandler
 	post /message/messageUnreadCount (MessageUnreadCountReq) returns (MessageUnreadCountRes)
-	// 获取用户未读消息数量
+	// 获取用户接收到的消息分类
 	@handler MessageTypeHandler
 	get /message/messageType (MessageTypeReq) returns (MessageTypeRes)
 	// 修改指定用户的某个分类的消息为已读

+ 1 - 1
rpc/internal/logic/getunreadclasscountlogic.go

@@ -24,7 +24,7 @@ func NewGetUnreadClassCountLogic(ctx context.Context, svcCtx *svc.ServiceContext
 	}
 }
 
-//   获取指定用户的未读消息分类及数量 及分类的最新消息
+//   获取指定用户的分类及未读消息的数量
 func (l *GetUnreadClassCountLogic) GetUnreadClassCount(in *message.GetUnreadClassCountReq) (*message.GetUnreadClassCountRes, error) {
 	// todo: add your logic here and delete this line
 	m := service.MessageService{}

+ 0 - 5
rpc/internal/logic/updatemessagereadlogic.go

@@ -29,13 +29,8 @@ func NewUpdateMessageReadLogic(ctx context.Context, svcCtx *svc.ServiceContext)
 // 修改用户指定分类下的消息已读未读
 func (l *UpdateMessageReadLogic) UpdateMessageRead(in *message.UpdateMessageReadReq) (*message.UpdateMessageReadResp, error) {
 	// todo: add your logic here and delete this line
-<<<<<<< HEAD
-	service := &service.MessageService{}
-	status, err := service.UpdateMessageReadStatus(int(in.MsgType), in.ReceiveUserid, in.AppId)
-=======
 	m := service.MessageService{}
 	status, err := m.UpdateMessageReadStatus(int(in.MsgType), in.ReceiveUserid, in.AppId)
->>>>>>> 6f28afb30f4f6a2d23106a4b3b3ade24e733f2c0
 	if status == 0 && err != nil {
 		return &message.UpdateMessageReadResp{
 			Code:    1,