数据库第二次大作业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.
 
 
 

143 lines
3.6 KiB

<!DOCTYPE html>
<html id="htmlId">
<head>
<title>Coverage Report > TestController</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.controller</a>
</div>
<h1>Coverage Summary for Class: TestController (cn.edu.ecnu.stu.bookstore.controller)</h1>
<table class="coverageStats">
<tr>
<th class="name">Class</th>
<th class="coverageStat
">
Class, %
</th>
<th class="coverageStat
">
Method, %
</th>
<th class="coverageStat
">
Line, %
</th>
</tr>
<tr>
<td class="name">TestController</td>
<td class="coverageStat">
<span class="percent">
100%
</span>
<span class="absValue">
(1/1)
</span>
</td>
<td class="coverageStat">
<span class="percent">
50%
</span>
<span class="absValue">
(2/4)
</span>
</td>
<td class="coverageStat">
<span class="percent">
33.3%
</span>
<span class="absValue">
(2/6)
</span>
</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package cn.edu.ecnu.stu.bookstore.controller;
&nbsp;
&nbsp;import cn.edu.ecnu.stu.bookstore.component.Result;
&nbsp;import cn.edu.ecnu.stu.bookstore.config.RabbitMqConfig;
&nbsp;import com.rabbitmq.client.Channel;
&nbsp;import org.springframework.amqp.core.Message;
&nbsp;import org.springframework.amqp.rabbit.annotation.RabbitListener;
&nbsp;import org.springframework.amqp.rabbit.core.RabbitTemplate;
&nbsp;import org.springframework.beans.factory.annotation.Autowired;
&nbsp;import org.springframework.stereotype.Controller;
&nbsp;import org.springframework.web.bind.annotation.GetMapping;
&nbsp;import org.springframework.web.bind.annotation.RequestParam;
&nbsp;import org.springframework.web.bind.annotation.RestController;
&nbsp;
&nbsp;@RestController
<b class="fc">&nbsp;public class TestController {</b>
&nbsp;
&nbsp; @Autowired
&nbsp; private RabbitTemplate rabbitTemplate;
&nbsp;
&nbsp; @GetMapping(&quot;/test&quot;)
&nbsp; public Result test() {
<b class="fc">&nbsp; return Result.success(&quot;hello, test&quot;);</b>
&nbsp; }
&nbsp;
&nbsp; @GetMapping(&quot;/testmq&quot;)
&nbsp; public Result testmq(@RequestParam(&quot;message&quot;) String message) {
<b class="nc">&nbsp; rabbitTemplate.convertAndSend(RabbitMqConfig.EXPIRED_ORDER_EXCHANGE, RabbitMqConfig.EXPIRED_ORDER_ROUTING_KEY,</b>
&nbsp; message, message1 -&gt; {
<b class="nc">&nbsp; message1.getMessageProperties().setDelay(5000);</b>
<b class="nc">&nbsp; return message1;</b>
&nbsp; });
<b class="nc">&nbsp; return Result.success();</b>
&nbsp; }
&nbsp;
&nbsp;// @RabbitListener(queues = RabbitMqConfig.EXPIRED_ORDER_QUEUE)
&nbsp;// public void processExpiredOrder(String msg, Channel channel, Message message) {
&nbsp;// System.out.println(msg);
&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>