當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
SpringBoot集成Redis和配置Redis做缓存
生活随笔
收集整理的這篇文章主要介紹了
SpringBoot集成Redis和配置Redis做缓存
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Redis介紹
Redis是一個開源的、高性能的、基于鍵值對的緩存與存儲系統(tǒng),通過提供多種鍵值數(shù)據(jù)類型來適應不同場景下的緩存與存儲需求,直觀的存儲結構使得通過程序交互十分簡單。
Redis數(shù)據(jù)庫中所有數(shù)據(jù)都存儲在內(nèi)存中,由于內(nèi)存的讀寫速度遠快于硬盤,因此Redis在性能上對比其他基于硬盤存儲的數(shù)據(jù)庫有非常明顯的優(yōu)勢,而且Redis提供了對持久化的支持,即可以將內(nèi)存中的數(shù)據(jù)異步寫入到硬盤中,且不影響繼續(xù)提供服務。
Redis提供了豐富的功能,越來愈多的人將其用作緩存、隊列系統(tǒng)等。
Redis是開源的,良好的開發(fā)氛圍和嚴謹?shù)陌姹景l(fā)布機制使得Redis的版本非常穩(wěn)定可靠,如此多的公司在項目中使用了Redis也可以印證這一點。
本文內(nèi)容分兩塊,配置文件分別單獨記錄
- SpringBoot 2.x版本項目配置Redis數(shù)據(jù)庫及使用
- SpringBoot項目使用Redis做緩存
SpringBoot 2.x版本項目配置Redis數(shù)據(jù)庫及使用
1.項目pom文件引入Redis依賴
<!-- kaptcha --> <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId> </dependency>2.配置application.properties
# Redis數(shù)據(jù)庫索引(默認為0) spring.redis.database=0 # Redis服務器地址 spring.redis.host=106.14.72.179 # Redis服務器連接端口 spring.redis.port=6379 # Redis服務器連接密碼(默認為空) spring.redis.password= # 連接池最大連接數(shù)(使用負值表示沒有限制) spring.redis.jedis.pool.max-active=8 # 連接池最大阻塞等待時間(使用負值表示沒有限制) spring.redis.jedis.pool.max-wait=-1ms # 連接池中的最大空閑連接 spring.redis.jedis.pool.max-idle=8 # 連接池中的最小空閑連接 spring.redis.jedis.pool.min-idle=0 # 連接超時時間(毫秒) spring.redis.timeout=50003.配置 RedisConfig
package com.example.demo.config;import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer;@Configuration public class RedisConfig {@Bean@SuppressWarnings("all")public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();template.setConnectionFactory(factory);Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);ObjectMapper om = new ObjectMapper();om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);jackson2JsonRedisSerializer.setObjectMapper(om);StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();// key采用String的序列化方式template.setKeySerializer(stringRedisSerializer);// hash的key也采用String的序列化方式template.setHashKeySerializer(stringRedisSerializer);// value序列化方式采用jacksontemplate.setValueSerializer(jackson2JsonRedisSerializer);// hash的value序列化方式采用jacksontemplate.setHashValueSerializer(jackson2JsonRedisSerializer);template.afterPropertiesSet();return template;} }4.配置 RedisService
package com.example.demo.service;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils;import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit;@Service public class RedisService {@Autowiredprivate RedisTemplate<String, Object> redisTemplate;// =============================common============================/*** 指定緩存失效時間* @param key 鍵* @param time 時間(秒)* @return*/public boolean expire(String key, long time) {try {if (time > 0) {redisTemplate.expire(key, time, TimeUnit.SECONDS);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 根據(jù)key 獲取過期時間* @param key 鍵 不能為null* @return 時間(秒) 返回0代表為永久有效*/public long getExpire(String key) {return redisTemplate.getExpire(key, TimeUnit.SECONDS);}/*** 判斷key是否存在* @param key 鍵* @return true 存在 false不存在*/public boolean hasKey(String key) {try {return redisTemplate.hasKey(key);} catch (Exception e) {e.printStackTrace();return false;}}/*** 刪除緩存* @param key 可以傳一個值 或多個*/@SuppressWarnings("unchecked")public void del(String... key) {if (key != null && key.length > 0) {if (key.length == 1) {redisTemplate.delete(key[0]);} else {redisTemplate.delete(CollectionUtils.arrayToList(key));}}}/*** 刪除緩存* @param keys 可以傳一個值 或多個*/@SuppressWarnings("unchecked")public void del(Collection keys) {if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(keys)) {redisTemplate.delete(keys);}}// ============================String=============================/*** 普通緩存獲取* @param key 鍵* @return 值*/public Object get(String key) {return key == null ? null : redisTemplate.opsForValue().get(key);}/*** 普通緩存放入* @param key 鍵* @param value 值* @return true成功 false失敗*/public boolean set(String key, Object value) {try {redisTemplate.opsForValue().set(key, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 普通緩存放入并設置時間* @param key 鍵* @param value 值* @param time 時間(秒) time要大于0 如果time小于等于0 將設置無限期* @return true成功 false 失敗*/public boolean set(String key, Object value, long time) {try {if (time > 0) {redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);} else {set(key, value);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 遞增* @param key 鍵* @param delta 要增加幾(大于0)* @return*/public long incr(String key, long delta) {if (delta < 0) {throw new RuntimeException("遞增因子必須大于0");}return redisTemplate.opsForValue().increment(key, delta);}/*** 遞減* @param key 鍵* @param delta 要減少幾(小于0)* @return*/public long decr(String key, long delta) {if (delta < 0) {throw new RuntimeException("遞減因子必須大于0");}return redisTemplate.opsForValue().increment(key, -delta);}// ================================Map=================================/*** HashGet* @param key 鍵 不能為null* @param item 項 不能為null* @return 值*/public Object hget(String key, String item) {return redisTemplate.opsForHash().get(key, item);}/*** 獲取hashKey對應的所有鍵值* @param key 鍵* @return 對應的多個鍵值*/public Map<Object, Object> hmget(String key) {return redisTemplate.opsForHash().entries(key);}/*** HashSet* @param key 鍵* @param map 對應多個鍵值* @return true 成功 false 失敗*/public boolean hmset(String key, Map<String, Object> map) {try {redisTemplate.opsForHash().putAll(key, map);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** HashSet 并設置時間* @param key 鍵* @param map 對應多個鍵值* @param time 時間(秒)* @return true成功 false失敗*/public boolean hmset(String key, Map<String, Object> map, long time) {try {redisTemplate.opsForHash().putAll(key, map);if (time > 0) {expire(key, time);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 向一張hash表中放入數(shù)據(jù),如果不存在將創(chuàng)建* @param key 鍵* @param item 項* @param value 值* @return true 成功 false失敗*/public boolean hset(String key, String item, Object value) {try {redisTemplate.opsForHash().put(key, item, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 向一張hash表中放入數(shù)據(jù),如果不存在將創(chuàng)建* @param key 鍵* @param item 項* @param value 值* @param time 時間(秒) 注意:如果已存在的hash表有時間,這里將會替換原有的時間* @return true 成功 false失敗*/public boolean hset(String key, String item, Object value, long time) {try {redisTemplate.opsForHash().put(key, item, value);if (time > 0) {expire(key, time);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 刪除hash表中的值* @param key 鍵 不能為null* @param item 項 可以使多個 不能為null*/public void hdel(String key, Object... item) {redisTemplate.opsForHash().delete(key, item);}/*** 刪除hash表中的值* @param key 鍵 不能為null* @param items 項 可以使多個 不能為null*/public void hdel(String key, Collection items) {redisTemplate.opsForHash().delete(key, items.toArray());}/*** 判斷hash表中是否有該項的值* @param key 鍵 不能為null* @param item 項 不能為null* @return true 存在 false不存在*/public boolean hHasKey(String key, String item) {return redisTemplate.opsForHash().hasKey(key, item);}/*** hash遞增 如果不存在,就會創(chuàng)建一個 并把新增后的值返回* @param key 鍵* @param item 項* @param delta 要增加幾(大于0)* @return*/public double hincr(String key, String item, double delta) {if (delta < 0) {throw new RuntimeException("遞增因子必須大于0");}return redisTemplate.opsForHash().increment(key, item, delta);}/*** hash遞減* @param key 鍵* @param item 項* @param delta 要減少記(小于0)* @return*/public double hdecr(String key, String item, double delta) {if (delta < 0) {throw new RuntimeException("遞減因子必須大于0");}return redisTemplate.opsForHash().increment(key, item, -delta);}// ============================set=============================/*** 根據(jù)key獲取Set中的所有值* @param key 鍵* @return*/public Set<Object> sGet(String key) {try {return redisTemplate.opsForSet().members(key);} catch (Exception e) {e.printStackTrace();return null;}}/*** 根據(jù)value從一個set中查詢,是否存在* @param key 鍵* @param value 值* @return true 存在 false不存在*/public boolean sHasKey(String key, Object value) {try {return redisTemplate.opsForSet().isMember(key, value);} catch (Exception e) {e.printStackTrace();return false;}}/*** 將數(shù)據(jù)放入set緩存* @param key 鍵* @param values 值 可以是多個* @return 成功個數(shù)*/public long sSet(String key, Object... values) {try {return redisTemplate.opsForSet().add(key, values);} catch (Exception e) {e.printStackTrace();return 0;}}/*** 將數(shù)據(jù)放入set緩存* @param key 鍵* @param values 值 可以是多個* @return 成功個數(shù)*/public long sSet(String key, Collection values) {try {return redisTemplate.opsForSet().add(key, values.toArray());} catch (Exception e) {e.printStackTrace();return 0;}}/*** 將set數(shù)據(jù)放入緩存* @param key 鍵* @param time 時間(秒)* @param values 值 可以是多個* @return 成功個數(shù)*/public long sSetAndTime(String key, long time, Object... values) {try {Long count = redisTemplate.opsForSet().add(key, values);if (time > 0)expire(key, time);return count;} catch (Exception e) {e.printStackTrace();return 0;}}/*** 獲取set緩存的長度* @param key 鍵* @return*/public long sGetSetSize(String key) {try {return redisTemplate.opsForSet().size(key);} catch (Exception e) {e.printStackTrace();return 0;}}/*** 移除值為value的* @param key 鍵* @param values 值 可以是多個* @return 移除的個數(shù)*/public long setRemove(String key, Object... values) {try {Long count = redisTemplate.opsForSet().remove(key, values);return count;} catch (Exception e) {e.printStackTrace();return 0;}}// ===============================list=================================/*** 獲取list緩存的內(nèi)容* @param key 鍵* @param start 開始* @param end 結束 0 到 -1代表所有值* @return*/public List<Object> lGet(String key, long start, long end) {try {return redisTemplate.opsForList().range(key, start, end);} catch (Exception e) {e.printStackTrace();return null;}}/*** 獲取list緩存的長度* @param key 鍵* @return*/public long lGetListSize(String key) {try {return redisTemplate.opsForList().size(key);} catch (Exception e) {e.printStackTrace();return 0;}}/*** 通過索引 獲取list中的值* @param key 鍵* @param index 索引 index>=0時, 0 表頭,1 第二個元素,依次類推;index<0時,-1,表尾,-2倒數(shù)第二個元素,依次類推* @return*/public Object lGetIndex(String key, long index) {try {return redisTemplate.opsForList().index(key, index);} catch (Exception e) {e.printStackTrace();return null;}}/*** 將list放入緩存* @param key 鍵* @param value 值* @return*/public boolean lSet(String key, Object value) {try {redisTemplate.opsForList().rightPush(key, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 將list放入緩存* @param key 鍵* @param value 值* @param time 時間(秒)* @return*/public boolean lSet(String key, Object value, long time) {try {redisTemplate.opsForList().rightPush(key, value);if (time > 0)expire(key, time);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 將list放入緩存* @param key 鍵* @param value 值* @return*/public boolean lSet(String key, List<Object> value) {try {redisTemplate.opsForList().rightPushAll(key, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 將list放入緩存** @param key 鍵* @param value 值* @param time 時間(秒)* @return*/public boolean lSet(String key, List<Object> value, long time) {try {redisTemplate.opsForList().rightPushAll(key, value);if (time > 0)expire(key, time);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 根據(jù)索引修改list中的某條數(shù)據(jù)* @param key 鍵* @param index 索引* @param value 值* @return*/public boolean lUpdateIndex(String key, long index, Object value) {try {redisTemplate.opsForList().set(key, index, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 移除N個值為value* @param key 鍵* @param count 移除多少個* @param value 值* @return 移除的個數(shù)*/public long lRemove(String key, long count, Object value) {try {Long remove = redisTemplate.opsForList().remove(key, count, value);return remove;} catch (Exception e) {e.printStackTrace();return 0;}} }5.至此,Redis已經(jīng)配置好了,接下來是具體調(diào)用測試
package com.example.demo.controller;import com.example.demo.converter.UserConverter; import com.example.demo.domain.Blog; import com.example.demo.service.BlogService; import com.example.demo.service.RedisService; import com.example.demo.support.ApiResponse; import com.example.demo.support.UserHolder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView;import java.util.Map;@Controller @RequestMapping("/blogs") public class BlogController {@Autowiredprivate BlogService blogService;@Autowiredprivate RedisService redisService;@RequestMapping("/{id}")public ModelAndView blog(@PathVariable("id") Long blogId) {ModelAndView view = new ModelAndView("blog-detail");//查看博客信息,先根據(jù)id從Redis中找Blog blog = (Blog) redisService.get("blog_" + blogId);//如果Redis中沒有,查詢Mysqlif (blog == null) {blog = blogService.getBlogById(blogId);//將博客信息放入Redis,并且設置失效時間redisService.set("blog_" + blogId, blog,60);}Map modelMap = view.getModelMap();modelMap.put("userVO", UserConverter.toUserVO(UserHolder.get()));modelMap.put("blogVO", blog);modelMap.put("isArchives",true);return view;}@RequestMapping(value = "/save",method = RequestMethod.POST)@ResponseBodypublic ApiResponse edit(Blog blogVO) {int num = blogService.save(blogVO);if (num == 0) {return ApiResponse.fail().error("保存失敗");}//新增、修改博客后,將最新的博客信息放入Redis,并且設置失效時間redisService.set("blog_" + blogVO.getBlogId(), blogVO,60);return ApiResponse.success().and("msg", "保存成功").and("blogId",blogVO.getBlogId());} }6.完成
SpringBoot項目使用Redis做緩存
1.項目pom文件引入Cache和Redis依賴
<!-- kaptcha --> <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-cache</artifactId> </dependency> <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId> </dependency>2.配置application.properties
## Redis部分 # Redis數(shù)據(jù)庫索引(默認為0) spring.redis.database=0 # Redis服務器地址 spring.redis.host=106.14.72.179 # Redis服務器連接端口 spring.redis.port=6379 # Redis服務器連接密碼(默認為空) spring.redis.password= # 連接池最大連接數(shù)(使用負值表示沒有限制) spring.redis.jedis.pool.max-active=8 # 連接池最大阻塞等待時間(使用負值表示沒有限制) spring.redis.jedis.pool.max-wait=-1ms # 連接池中的最大空閑連接 spring.redis.jedis.pool.max-idle=8 # 連接池中的最小空閑連接 spring.redis.jedis.pool.min-idle=0 # 連接超時時間(毫秒) spring.redis.timeout=5000## Cache部分 #緩存的名稱集合,多個采用逗號分割 spring.cache.cache-names= #緩存的類型,官方提供了很多,這里我們填寫redis spring.cache.type=redis #是否緩存null數(shù)據(jù),默認是false spring.cache.redis.cache-null-values=false #redis中緩存超時的時間,默認60000ms spring.cache.redis.time-to-live=60000 #緩存數(shù)據(jù)key是否使用前綴,默認是true spring.cache.redis.use-key-prefix=true #緩存數(shù)據(jù)key的前綴,在上面的配置為true時有效, spring.cache.redis.key-prefix=3.配置Configuration
package com.example.demo.config;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.cache.RedisCacheConfiguration; import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.RedisSerializationContext; import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;import java.time.Duration; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set;@Configuration public class CacheConfig {@BeanCacheManager cacheManager(RedisConnectionFactory connectionFactory) {RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig();//common信息緩存配置RedisCacheConfiguration userCacheConfiguration = defaultCacheConfig// 設置 key為string序列化.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))// 設置value為json序列化.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer())).disableCachingNullValues();Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>();//entryTtl設置緩存失效時間,單位是秒redisCacheConfigurationMap.put("common", userCacheConfiguration.entryTtl(Duration.ofSeconds(30)));//設置CacheManager的值序列化方式為JdkSerializationRedisSerializer,但其實RedisCacheConfiguration默認就是使用StringRedisSerializer序列化key,JdkSerializationRedisSerializer序列化value,所以以下注釋代碼為默認實現(xiàn)//ClassLoader loader = this.getClass().getClassLoader();//JdkSerializationRedisSerializer jdkSerializer = new JdkSerializationRedisSerializer(loader);//RedisSerializationContext.SerializationPair<Object> pair = RedisSerializationContext.SerializationPair.fromSerializer(jdkSerializer);//RedisCacheConfiguration defaultCacheConfig=RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair);Set<String> cacheNames = new HashSet<>();cacheNames.add("common");//初始化RedisCacheManagerRedisCacheManager cacheManager = RedisCacheManager.builder(connectionFactory).cacheDefaults(defaultCacheConfig).initialCacheNames(cacheNames).withInitialCacheConfigurations(redisCacheConfigurationMap).build();return cacheManager;} }4.啟動類Application或App加@EnableCaching注解
package com.example.demo;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cache.annotation.EnableCaching;@SpringBootApplication @EnableCaching public class DemoApplication {public static void main(String[] args) {SpringApplication.run(DemoApplication.class, args);}}5.緩存注解的使用
- Cacheable:調(diào)用方法時先從緩存中查詢有沒有對應key的數(shù)據(jù),如果有直接從緩存獲取返回,如果沒有則執(zhí)行方法,將返回值存入緩存中。
- CacheEvict:調(diào)用方法后從緩存中刪除對應key的數(shù)據(jù)
- Caching:當一個方法需要查詢多個緩存或者刪除多個緩存時使用
6.注意
Spring @Cacheable、@CacheEvict、@Caching是基于Spring AOP代理類,內(nèi)部方法調(diào)用時,注解是失效的。
舉例子,Controller接收請求調(diào)用BlogService.save方法
緩存相關注解不生效
@Transactionalpublic int save (Blog blog) {if (blog == null) return 0;if (blog.getBlogId() == null) {return insert(blog);}return update(blog);}@Caching(evict={@CacheEvict(value = "common", key="'blog_by_page'",condition="#blog!=null"), @CacheEvict(value = "common", key="'blog_all'",condition="#blog!=null"), @CacheEvict(value = "common", key="'blog_'+#blog.blogId",condition="#blog.blogId!=null")})public int insert (Blog blog) {if (StringUtils.isBlank(blog.getAuthor()))blog.setAuthor("Cocoivan");if (blog.getBlogType() == null)blog.setBlogType(EnumBlogType.MISCELLANEOUS.getValue());return blogMapper.insertSelective(blog);}@Caching(evict={@CacheEvict(value = "common", key="'blog_by_page'",condition="#blog!=null"), @CacheEvict(value = "common", key="'blog_all'",condition="#blog!=null"), @CacheEvict(value = "common", key="'blog_'+#blog.blogId",condition="#blog.blogId!=null")})public int update (Blog blog) {return blogMapper.updateByPrimaryKeySelective(blog);}緩存相關注解生效
@Transactional@Caching(evict={@CacheEvict(value = "common", key="'blog_by_page'",condition="#blog!=null"), @CacheEvict(value = "common", key="'blog_all'",condition="#blog!=null"), @CacheEvict(value = "common", key="'blog_'+#blog.blogId",condition="#blog.blogId!=null")})public int save (Blog blog) {if (blog == null) return 0;if (blog.getBlogId() == null) {return insert(blog);}return update(blog);}public int insert (Blog blog) {if (StringUtils.isBlank(blog.getAuthor()))blog.setAuthor("Cocoivan");if (blog.getBlogType() == null)blog.setBlogType(EnumBlogType.MISCELLANEOUS.getValue());return blogMapper.insertSelective(blog);}public int update (Blog blog) {return blogMapper.updateByPrimaryKeySelective(blog);}7.完成
總結
以上是生活随笔為你收集整理的SpringBoot集成Redis和配置Redis做缓存的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Oracle TRUNC 函数详解
- 下一篇: 批量图片转换成矩阵matlab