package com.cn.hnust.controller;
import com.cn.hnust.model.City;
import com.cn.hnust.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class CityController {
@Autowired
private CityService cityService;
@RequestMapping(value = "/test")
@ResponseBody
public void getCity(@RequestParam("id")Integer id){
City city=new City();
city.setId(id);
City cityResult = cityService.selectByPrimaryKey(city);
System.out.println("执行结果:"+cityResult);
}
@RequestMapping(value = "/clear")
@ResponseBody
public void clear(Integer id){
System.out.println("清除缓存...");
City city=new City();
city.setId(id);
cityService.clear(city);
}
@RequestMapping(value = "/really")
@ResponseBody
public void really(Integer id){
City city=new City();
city.setId(id);
City cityResult= cityService.reallyRad(city);
System.out.println("执行结果:"+cityResult);
}
}