数据库第二次大作业boostore
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

144 lines
3.5 KiB

<!DOCTYPE html>
<html id="htmlId">
<head>
<title>Coverage Report > RedisConfig</title>
<style type="text/css">
@import "../../css/coverage.css";
@import "../../css/idea.min.css";
</style>
<script type="text/javascript" src="../../js/highlight.min.js"></script>
<script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>
<body>
<div class="content">
<div class="breadCrumbs">
Current scope: <a href="../../index.html">all classes</a>
<span class="separator">|</span>
<a href="../index.html">cn.edu.ecnu.stu.bookstore.config</a>
</div>
<h1>Coverage Summary for Class: RedisConfig (cn.edu.ecnu.stu.bookstore.config)</h1>
<table class="coverageStats">
<tr>
<th class="name">Class</th>
<th class="coverageStat
">
Method, %
</th>
<th class="coverageStat
">
Line, %
</th>
</tr>
<tr>
<td class="name">RedisConfig</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(2/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(7/7)
</span>
</td>
</tr>
<tr>
<td class="name">RedisConfig$$EnhancerBySpringCGLIB$$12c5044f</td>
</tr>
<tr>
<td class="name"><strong>Total</strong></td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(2/2)
</span>
</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(7/7)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package cn.edu.ecnu.stu.bookstore.config;
&nbsp;
&nbsp;import org.springframework.beans.factory.InitializingBean;
&nbsp;import org.springframework.beans.factory.annotation.Autowired;
&nbsp;import org.springframework.context.annotation.Bean;
&nbsp;import org.springframework.context.annotation.Configuration;
&nbsp;import org.springframework.data.redis.core.RedisTemplate;
&nbsp;import org.springframework.data.redis.serializer.RedisSerializer;
&nbsp;import org.springframework.data.redis.serializer.StringRedisSerializer;
&nbsp;
&nbsp;@Configuration
<b class="fc">&nbsp;public class RedisConfig implements InitializingBean {</b>
&nbsp;
&nbsp; @Autowired
&nbsp; private RedisTemplate&lt;Object, Object&gt; redisTemplate;
&nbsp;
&nbsp; @Override
&nbsp; public void afterPropertiesSet(){
<b class="fc">&nbsp; RedisSerializer stringSerializer = new StringRedisSerializer();</b>
&nbsp; //key序列化方式
<b class="fc">&nbsp; redisTemplate.setKeySerializer(stringSerializer);</b>
&nbsp; //String的序列化方式
<b class="fc">&nbsp; redisTemplate.setStringSerializer(stringSerializer);</b>
&nbsp; //value序列化方式
<b class="fc">&nbsp; redisTemplate.setValueSerializer(stringSerializer);</b>
&nbsp; //hash key序列化方式
<b class="fc">&nbsp; redisTemplate.setHashKeySerializer(stringSerializer);</b>
&nbsp; //hash value序列化方式
<b class="fc">&nbsp; redisTemplate.setHashValueSerializer(stringSerializer);</b>
&nbsp; }
&nbsp;}
</code>
</pre>
</div>
<script type="text/javascript">
(function() {
var msie = false, msie9 = false;
/*@cc_on
msie = true;
@if (@_jscript_version >= 9)
msie9 = true;
@end
@*/
if (!msie || msie && msie9) {
hljs.highlightAll()
hljs.initLineNumbersOnLoad();
}
})();
</script>
<div class="footer">
<div style="float:right;">generated on 2023-12-12 18:32</div>
</div>
</body>
</html>