This commit is contained in:
wangchuxiao
2022-03-16 20:37:37 +08:00
parent 17fad47ca1
commit 8fef1f975a
9 changed files with 47 additions and 407 deletions
+32
View File
@@ -0,0 +1,32 @@
package apiChat
//
//import (
// apiStruct "Open_IM/pkg/base_info"
// "Open_IM/pkg/common/config"
// "Open_IM/pkg/common/log"
// "Open_IM/pkg/common/token_verify"
// "Open_IM/pkg/grpc-etcdv3/getcdv3"
// pbChat "Open_IM/pkg/proto/chat"
// "Open_IM/pkg/utils"
// "github.com/gin-gonic/gin"
// "net/http"
// "strings"
//)
//
//func DelMsg(c *gin.Context) {
// var (
// req apiStruct.DelMsgReq
// resp apiStruct.DelMsgResp
// reqPb pbChat.
// )
// ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
// if !ok {
// log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
// return
// }
// grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
// msgClient := pbChat.NewChatClient(grpcConn)
// //respPb, err := msgClient.DelMsgList()
//}
+5 -1
View File
@@ -7,6 +7,7 @@ import (
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/chat"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"
@@ -39,7 +40,10 @@ func PullMsgBySeqList(c *gin.Context) {
token := c.Request.Header.Get("token")
if ok, err := token_verify.VerifyToken(token, params.SendID); !ok {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err" + err.Error()})
if err != nil {
log.NewError(params.OperationID, utils.GetSelfFuncName(), err.Error(), token, params.SendID)
}
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"})
return
}
pbData := open_im_sdk.PullMessageBySeqListReq{}