| 123456789101112131415161718192021222324252627 |
- package bidflow.auction.persistence.controller;
- import bidflow.auction.persistence.domain.Auction;
- import bidflow.auction.persistence.service.AuctionService;
- import java.util.List;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- @RestController
- @RequestMapping("/auctions")
- public class AuctionController {
- @Autowired
- private AuctionService auctionService;
- @GetMapping
- public List<Auction> findAll() {
- return auctionService.findAll();
- }
- @PostMapping
- public Auction save(@RequestBody Auction auction) {
- return auctionService.save(auction);
- }
- }
|