AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
~~~ package com.nobb.util.cache; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Component; @Component public class RedisCache { //jdk 序列化 @Autowired private RedisTemplate redisTemplate; //string 序列化,推荐这个 @Autowired private StringRedisTemplate stringRedisTemplate; public Integer set(String key,String value){ stringRedisTemplate.opsForValue().set(key,value); return 1; } public String get(String key){ return stringRedisTemplate.opsForValue().get(key); } } ~~~