This commit is contained in:
laodaming
2023-11-07 16:44:58 +08:00
parent 071526f7a7
commit cc2f1489f3
2 changed files with 19 additions and 16 deletions

View File

@@ -105,7 +105,8 @@ func (l *WebhookLogic) Webhook(w http.ResponseWriter, r *http.Request) {
}
httpHeaderBytes, _ := json.Marshal(r.Header)
httpHeaderStr := string(httpHeaderBytes)
httpBodyStr := string(realMsgBytes)
//解密后的数据
decryptMsgStr := string(realMsgBytes)
feiShuMsgCreateTimeInt64, err := strconv.ParseInt(msgHeader.CreateTime, 10, 64)
if err != nil {
logx.Error("解析消息时间错误:", err)
@@ -115,13 +116,14 @@ func (l *WebhookLogic) Webhook(w http.ResponseWriter, r *http.Request) {
now := time.Now().UTC()
//把事件加入日志
err = l.svcCtx.AllModels.FsFeishuWebhookLog.Create(&gmodel.FsFeishuWebhookLog{
AppId: &msgHeader.AppId,
EventId: &msgHeader.EventId,
EventType: &msgHeader.EventType,
HttpHeader: &httpHeaderStr,
HttpBody: &httpBodyStr,
MsgCtime: &feiShuMsgCreateTime,
Ctime: &now,
AppId: &msgHeader.AppId,
EventId: &msgHeader.EventId,
EventType: &msgHeader.EventType,
HttpHeader: &httpHeaderStr,
Data: &encryptMsg.Encrypt,
DecryptData: &decryptMsgStr,
MsgCtime: &feiShuMsgCreateTime,
Ctime: &now,
})
if err != nil {
logx.Error("保存webhook消息日志失败:", err)