|
|
|
|
|
|
<!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"> package cn.edu.ecnu.stu.bookstore.controller;
|
|
|
|
import cn.edu.ecnu.stu.bookstore.component.Result;
|
|
import cn.edu.ecnu.stu.bookstore.config.RabbitMqConfig;
|
|
import com.rabbitmq.client.Channel;
|
|
import org.springframework.amqp.core.Message;
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController
|
|
<b class="fc"> public class TestController {</b>
|
|
|
|
@Autowired
|
|
private RabbitTemplate rabbitTemplate;
|
|
|
|
@GetMapping("/test")
|
|
public Result test() {
|
|
<b class="fc"> return Result.success("hello, test");</b>
|
|
}
|
|
|
|
@GetMapping("/testmq")
|
|
public Result testmq(@RequestParam("message") String message) {
|
|
<b class="nc"> rabbitTemplate.convertAndSend(RabbitMqConfig.EXPIRED_ORDER_EXCHANGE, RabbitMqConfig.EXPIRED_ORDER_ROUTING_KEY,</b>
|
|
message, message1 -> {
|
|
<b class="nc"> message1.getMessageProperties().setDelay(5000);</b>
|
|
<b class="nc"> return message1;</b>
|
|
});
|
|
<b class="nc"> return Result.success();</b>
|
|
}
|
|
|
|
// @RabbitListener(queues = RabbitMqConfig.EXPIRED_ORDER_QUEUE)
|
|
// public void processExpiredOrder(String msg, Channel channel, Message message) {
|
|
// System.out.println(msg);
|
|
// }
|
|
}
|
|
</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>
|