1 Star 0 Fork 216

Jiangbang_rao / redisson-spring-boot-starter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
binary.md 879 Bytes
一键复制 编辑 原始数据 按行查看 历史
zengtengpeng 提交于 2019-04-01 16:13 . 增加元素存储模板
@Controller
public class BinaryController {

    @Resource
    private RedissonBinary redissonBinary;

    /**
     * 存放图片
     * @param user
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @RequestMapping("/binary1")
    @ResponseBody
    public String binary1(User user, HttpServletRequest request, HttpServletResponse response) throws Exception {
        redissonBinary.setValue("binary",new FileInputStream(new File("f:/1.png")));
        return "11";
    }

    /**
     * 获取图片
     * @param user
     * @param request
     * @param response
     * @throws Exception
     */
    @RequestMapping("/binary2")
    public void binary2(User user, HttpServletRequest request, HttpServletResponse response) throws Exception {
        redissonBinary.getValue("binary",response.getOutputStream());

    }
}
Java
1
https://gitee.com/jiangbang_rao/redisson-spring-boot-starter.git
git@gitee.com:jiangbang_rao/redisson-spring-boot-starter.git
jiangbang_rao
redisson-spring-boot-starter
redisson-spring-boot-starter
master

搜索帮助