Kaynağa Gözat

push tradeController

Blumonilr 6 yıl önce
ebeveyn
işleme
6825f3ec90

+ 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());
+    }
 }