|
|
|
|
|
|
<!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$$da592ceb</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"> package cn.edu.ecnu.stu.bookstore.config;
|
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.serializer.RedisSerializer;
|
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
|
|
|
@Configuration
|
|
<b class="fc"> public class RedisConfig implements InitializingBean {</b>
|
|
|
|
@Autowired
|
|
private RedisTemplate<Object, Object> redisTemplate;
|
|
|
|
@Override
|
|
public void afterPropertiesSet(){
|
|
<b class="fc"> RedisSerializer stringSerializer = new StringRedisSerializer();</b>
|
|
//key序列化方式
|
|
<b class="fc"> redisTemplate.setKeySerializer(stringSerializer);</b>
|
|
//String的序列化方式
|
|
<b class="fc"> redisTemplate.setStringSerializer(stringSerializer);</b>
|
|
//value序列化方式
|
|
<b class="fc"> redisTemplate.setValueSerializer(stringSerializer);</b>
|
|
//hash key序列化方式
|
|
<b class="fc"> redisTemplate.setHashKeySerializer(stringSerializer);</b>
|
|
//hash value序列化方式
|
|
<b class="fc"> redisTemplate.setHashValueSerializer(stringSerializer);</b>
|
|
}
|
|
}
|
|
</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 14:34</div>
|
|
</div>
|
|
</body>
|
|
</html>
|