12.25
This commit is contained in:
parent
54e8ad8b45
commit
f27c160e2e
|
@ -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:";
|
||||
}
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue