分享一个网上搜不到的「Redis」实现「聊天回合制」的方案

Java70

前言

为什么说网上搜不到,因为关于聊天回合制的方案作者本人快把百度搜秃噜了也没找到,好在最终是公司一个关系不错的大佬帮提供了点思路,最终作者将其完整实现了出来。

分享它,你可以收集它。万一有一天你遇到这样的需求,这会节省很多时间。

[En]

Share it and you can collect it. In case you encounter such a demand one day, it will save a lot of time.

场景

先说下我这边的场景,读过我文章的同好都知道,我是做互联网医疗行业的,我们的项目中是包含聊天功能的,我们服务的对象主要是医院的医生,患者在网上找医生问诊时,往往会出现不停问的情况。

目前,医生唯一的办法是自己结束会诊或等待系统自动结束,这带来了一个问题。无论是系统结束还是医生手动结束,患者都喜欢抱怨和发表不好的评论。因此,医生不敢擅自终止会诊。如果他们厌倦了提问,他们不会回答;如果他们不回答,他们会被投诉。

[En]

At present, the only way for doctors is to end the consultation by themselves or wait for the system to automatically end, which brings a problem. Whether the system ends or the doctors manually end, patients like to complain and make bad comments. As a result, doctors dare not end the consultation without authorization. If they are tired of asking, they will not reply, and if they do not reply, they will be complained.

最后,提出了对轮流聊天系统的需求。我们主动告诉患者,我们的聊天有回合,所以你应该一次清楚地提问。轮到满员时,我们将不再回复。如果患者坚持抱怨,医生也可以说这是由生产这种产品的公司设定的。

[En]

In the end, the demand for chat round system was put forward. We took the initiative to tell the patients that our chat has rounds, so you should ask clearly at one time. When the rounds are full, we will not reply again. If the patients insist on complaining, the doctors can also say that this is set by the company that makes this product.

结下来就是,我们要把锅端好。

输入验证码查看隐藏内容

扫描二维码关注本站微信公众号 Johngo学长
或者在微信里搜索 Johngo学长
回复 svip 获取验证码
wechat Johngo学长