|
|
|
|
|
|
<!DOCTYPE html>
|
|
<html id="htmlId">
|
|
<head>
|
|
<title>Coverage Report > SellerController</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: SellerController (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">SellerController</td>
|
|
<td class="coverageStat">
|
|
<span class="percent">
|
|
100%
|
|
</span>
|
|
<span class="absValue">
|
|
(1/1)
|
|
</span>
|
|
</td>
|
|
<td class="coverageStat">
|
|
<span class="percent">
|
|
100%
|
|
</span>
|
|
<span class="absValue">
|
|
(5/5)
|
|
</span>
|
|
</td>
|
|
<td class="coverageStat">
|
|
<span class="percent">
|
|
93.3%
|
|
</span>
|
|
<span class="absValue">
|
|
(14/15)
|
|
</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.AppException;
|
|
import cn.edu.ecnu.stu.bookstore.component.Constants;
|
|
import cn.edu.ecnu.stu.bookstore.component.Result;
|
|
import cn.edu.ecnu.stu.bookstore.pojo.Book;
|
|
import cn.edu.ecnu.stu.bookstore.pojo.Store;
|
|
import cn.edu.ecnu.stu.bookstore.service.SellerService;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import java.util.Map;
|
|
|
|
@RestController
|
|
@RequestMapping("/seller")
|
|
<b class="fc"> public class SellerController {</b>
|
|
|
|
@Autowired
|
|
public SellerService sellerService;
|
|
|
|
@PostMapping("/create_store")
|
|
public Result createStore(@RequestBody Store store) {
|
|
<b class="fc"> sellerService.createStore(store);</b>
|
|
<b class="fc"> return Result.success();</b>
|
|
}
|
|
|
|
@PostMapping("add_book")
|
|
public Result addBook(@RequestBody Book book) {
|
|
<b class="fc"> sellerService.addBook(book);</b>
|
|
<b class="fc"> return Result.success();</b>
|
|
}
|
|
|
|
@PostMapping("add_stock_level")
|
|
public Result addStockLevel(@RequestBody JSONObject body) {
|
|
<b class="fc"> String storeId = body.getString("storeId");</b>
|
|
<b class="fc"> String bookId = body.getString("bookId");</b>
|
|
<b class="fc"> int addStockLevel = body.getIntValue("addStockLevel");</b>
|
|
<b class="fc"> sellerService.addStockLevel(storeId, bookId, addStockLevel);</b>
|
|
<b class="fc"> return Result.success();</b>
|
|
}
|
|
|
|
@PostMapping("send_goods")
|
|
public Result sendGoods(@RequestBody Map<String, String> body) {
|
|
<b class="fc"> String orderId = body.get("orderId");</b>
|
|
<b class="fc"> if(!StringUtils.hasText(orderId))</b>
|
|
<b class="nc"> throw new AppException(Constants.CLIENT_ERROR, Constants.PARAMETER_ERROR_MESSAGE);</b>
|
|
<b class="fc"> sellerService.sendGoods(orderId);</b>
|
|
<b class="fc"> return Result.success();</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 18:32</div>
|
|
</div>
|
|
</body>
|
|
</html>
|