forked from Big-Data-Lab/CET-cmd-2.0
数据进行缓存
This commit is contained in:
parent
182f2913c6
commit
78c1a6a44a
|
@ -8,6 +8,7 @@ import org.jeecg.modules.service.CenterService;
|
|||
import org.jeecg.modules.service.ICet_4Service;
|
||||
import org.jeecg.modules.service.ICet_6Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -59,17 +60,16 @@ public class CenterController {
|
|||
* 依据学院和年级获取四级和六级通过数据
|
||||
*/
|
||||
@GetMapping(value = "/getData")
|
||||
// @Cacheable(value = "getData", key = "'getData'+#college+#grade")
|
||||
@Cacheable(value = "getData", key = "'getData' + #college+#major+#entrydate")
|
||||
public Result<JSONObject> getData(@RequestParam("college") String college, @RequestParam("major") String major, @RequestParam("entrydate") String entrydate) {
|
||||
return centerService.getData(college, major, entrydate);
|
||||
}
|
||||
|
||||
@PostMapping("/getAllRate")
|
||||
@Cacheable(value = "getAllRate", key = "'getAllRate' + #webData")
|
||||
public Result<JSONObject> getAllRate(@RequestBody JSONObject webData) {
|
||||
String level= webData.getString("level");
|
||||
|
||||
//四六级分开查询
|
||||
|
||||
if (level.equals("cet4")) {
|
||||
|
||||
return cet4Service.getAllRate(webData);
|
||||
|
@ -87,6 +87,7 @@ public class CenterController {
|
|||
}
|
||||
|
||||
@GetMapping("/getRateByAllBatch")
|
||||
@Cacheable(value = "getRateByAllBatch", key = "'getRateByAllBatch' + #college+#major+#level")
|
||||
public Result<JSONObject> getRateByAllBatch(@RequestParam("college") String college,@RequestParam("major") String major, @RequestParam("level") String level) {
|
||||
// System.out.println(college + " " + level);
|
||||
if (level.equals("cet4")) {
|
||||
|
@ -100,6 +101,7 @@ public class CenterController {
|
|||
}
|
||||
}
|
||||
@GetMapping("/getRateByBatch")
|
||||
@Cacheable(value = "getRateByBatch", key = "'getRateByBatch' + #batch+#college+#level")
|
||||
public Result<JSONObject> getRateByBatch(@RequestParam("batch")String batch, @RequestParam("college") String college, @RequestParam("level")String level){
|
||||
if (level.equals("cet4")){
|
||||
return cet4Service.getRateByBatch(college,batch);
|
||||
|
|
Loading…
Reference in New Issue