TradeController.java 765 B

123456789101112131415161718192021222324
  1. package com.nju.edu.pay.controller.api;
  2. import com.nju.edu.pay.service.TradeService;
  3. import com.nju.edu.pay.web.annotation.RootAllowed;
  4. import com.nju.edu.pay.web.response.Response;
  5. import com.nju.edu.pay.web.response.SuccessResponse;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. @RestController
  11. @RequestMapping("/api/trade")
  12. public class TradeController {
  13. @Autowired
  14. TradeService tradeService;
  15. @GetMapping("/tradeList")
  16. @RootAllowed
  17. public Response getTradeList(){
  18. return new SuccessResponse(tradeService.retrieveAll());
  19. }
  20. }