You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/internal/rpc/msg/msg_status.go

30 lines
865 B

2 years ago
package msg
import (
2 years ago
"Open_IM/pkg/common/constant"
2 years ago
"Open_IM/pkg/common/tracelog"
2 years ago
pbMsg "Open_IM/pkg/proto/msg"
"context"
)
2 years ago
func (s *msgServer) SetSendMsgStatus(ctx context.Context, req *pbMsg.SetSendMsgStatusReq) (*pbMsg.SetSendMsgStatusResp, error) {
resp := &pbMsg.SetSendMsgStatusResp{}
if err := s.MsgInterface.SetSendMsgStatus(ctx, tracelog.GetOperationID(ctx), req.Status); err != nil {
return nil, err
2 years ago
}
return resp, nil
}
2 years ago
func (s *msgServer) GetSendMsgStatus(ctx context.Context, req *pbMsg.GetSendMsgStatusReq) (*pbMsg.GetSendMsgStatusResp, error) {
resp := &pbMsg.GetSendMsgStatusResp{}
status, err := s.MsgInterface.GetSendMsgStatus(ctx, tracelog.GetOperationID(ctx))
if IsNotFound(err) {
resp.Status = constant.MsgStatusNotExist
return resp, nil
} else if err != nil {
2 years ago
return nil, err
2 years ago
}
2 years ago
resp.Status = status
2 years ago
return resp, nil
}