spring+ehcache demo

  • R9_352672
    了解作者
  • 33.7KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-23 20:04
    上传日期
spring+ehcache 的demo,包含sql文件,修改jdbc.properties为对应的账号密码
ehcache.zip
内容介绍
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); } }
评论
    相关推荐