浏览代码

增改 whatsapp 记录时亦清空缓存

boweniac 4 月之前
父节点
当前提交
d620ae5d49
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 2 0
      internal/logic/whatsapp/create_whatsapp_logic.go
  2. 2 0
      internal/logic/whatsapp/update_whatsapp_logic.go

+ 2 - 0
internal/logic/whatsapp/create_whatsapp_logic.go

@@ -50,5 +50,7 @@ func (l *CreateWhatsappLogic) CreateWhatsapp(req *types.WhatsappInfo) (*types.Ba
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 	}
 
+	_ = l.svcCtx.Rds.Del(l.ctx, "wa_info")
+
 	return &types.BaseMsgResp{Msg: errormsg.CreateSuccess}, nil
 }

+ 2 - 0
internal/logic/whatsapp/update_whatsapp_logic.go

@@ -43,5 +43,7 @@ func (l *UpdateWhatsappLogic) UpdateWhatsapp(req *types.WhatsappInfo) (*types.Ba
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 	}
 
+	_ = l.svcCtx.Rds.Del(l.ctx, "wa_info")
+
 	return &types.BaseMsgResp{Msg: errormsg.UpdateSuccess}, nil
 }