Blumonilr 6 лет назад
Родитель
Сommit
6825f3ec90
1 измененных файлов с 18 добавлено и 0 удалено
  1. 18 0
      src/main/java/com/nju/edu/pay/controller/api/TradeController.java

+ 18 - 0
src/main/java/com/nju/edu/pay/controller/api/TradeController.java

@@ -1,4 +1,22 @@
 package com.nju.edu.pay.controller.api;
 
+import com.nju.edu.pay.service.TradeService;
+import com.nju.edu.pay.web.response.Response;
+import com.nju.edu.pay.web.response.SuccessResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/api/trade")
 public class TradeController {
+
+    @Autowired
+    TradeService tradeService;
+
+    @GetMapping("/tradeList")
+    public Response getTradeList(){
+        return new SuccessResponse(tradeService.retrieveAll());
+    }
 }