-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathBagelRepository.java
More file actions
35 lines (28 loc) · 892 Bytes
/
BagelRepository.java
File metadata and controls
35 lines (28 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.booleanuk.api.bagels;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
//@RestController
//@RequestMapping("authors")
public class BagelRepository {
private int idCounter = 1;
private List<Bagel> data = new ArrayList<>();
// @PostMapping
// @ResponseStatus(HttpStatus.CREATED)
// public void create(@RequestBody String type,@RequestBody int price) {
// Bagel bagel = new Bagel(this.idCounter++, type, price);
// this.data.add(bagel);
// }
// public List<Bagel> findAll() {
// return this.data;
// }
//
// @GetMapping("/{id}")
// public Bagel find(int id) {
// return this.data.stream()
// .filter(bagel -> bagel.getId() == id)
// .findFirst()
// .orElseThrow();
// }
}