新增接口缓存
This commit is contained in:
parent
5b4f68a44b
commit
5c19ee200d
|
@ -96,6 +96,10 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<JSONObject> getRateByBatch(String college, String batchStr) {
|
public Result<JSONObject> getRateByBatch(String college, String batchStr) {
|
||||||
|
|
||||||
|
if (redisTemplate.opsForValue().get("getRateByBatch" + college + batchStr) != null) {
|
||||||
|
return Result.ok((JSONObject) redisTemplate.opsForValue().get("getRateByBatch" + college + batchStr));
|
||||||
|
}
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
DecimalFormat decimalFormat = new DecimalFormat("#.#");
|
DecimalFormat decimalFormat = new DecimalFormat("#.#");
|
||||||
Date batch;
|
Date batch;
|
||||||
|
@ -176,6 +180,7 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
|
||||||
resultData.put("data", jsonObject);
|
resultData.put("data", jsonObject);
|
||||||
resultData.put("gradeData", gradeByBatch);
|
resultData.put("gradeData", gradeByBatch);
|
||||||
System.out.println(resultData);
|
System.out.println(resultData);
|
||||||
|
redisTemplate.opsForValue().set("getRateByBatch" + college + batchStr, resultData);
|
||||||
return Result.OK(resultData);
|
return Result.OK(resultData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue