This commit is contained in:
BLRTTX 2024-12-25 23:09:25 +08:00
parent 54e8ad8b45
commit f27c160e2e
4 changed files with 3 additions and 5 deletions

View File

@ -9,6 +9,4 @@ public class RedisConstant {
public static final String APP_DOCTOR_INFO = "app:doctorInfo:";
public static final String APP_HOSPITAL_INFO = "app:hospitalInfo:";
public static final String APP_CONSULT = "app:consult:";
public static final String ADMIN_DOCTOR_INFO = "admin:doctorInfo:";
public static final String ADMIN_HOSPITAL_INFO = "admin:hospitalInfo:";
}

View File

@ -98,7 +98,7 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
//删除缓存
if (isUpdate) {
redisTemplate.delete(RedisConstant.ADMIN_DOCTOR_INFO + doctorInfoVo.getId());
redisTemplate.delete(RedisConstant.APP_DOCTOR_INFO + doctorInfoVo.getId());
}
}

View File

@ -111,7 +111,7 @@ public class HospitalInfoServiceImpl extends ServiceImpl<HospitalInfoMapper, Hos
//删除缓存
if (isUpdate) {
redisTemplate.delete(RedisConstant.ADMIN_HOSPITAL_INFO + hospitalInfoVo.getId());
redisTemplate.delete(RedisConstant.APP_HOSPITAL_INFO + hospitalInfoVo.getId());
}
}

View File

@ -73,7 +73,7 @@ public class ConsultServiceImpl extends ServiceImpl<ConsultMapper, ConsultInfo>
public List<ConsultInfoVo> getConsultByNumber(Long userId, Integer number) {
String key = RedisConstant.APP_CONSULT + userId + "-" + number;
List<ConsultInfoVo> consultInfoVoList = (List<ConsultInfoVo>) redisTemplate.opsForValue().get(key);
if (consultInfoVoList != null) {
if (consultInfoVoList == null) {
consultInfoVoList = consultMapper.getConsultByNumber(userId, number);
redisTemplate.opsForValue().set(key, consultInfoVoList);
}