//例:10S后释放此锁
//timeOutKey:Redis锁唯一索引;patientMobile:缓存的值;Duration.ofSeconds(10):10S
String timeOutKey = "InsertUserEsKey"+":"+patientMobile;
//按照用户手机号加锁,存在正在处理的,返回操作频繁提醒,注意后面处理结束(正常结束、异常结束)解锁
if (!redisCache.setIfAbsent(timeOutKey, patientMobile, Duration.ofSeconds(10))) {
return Result.error("操作频繁");
}