-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
57 lines (54 loc) · 1.04 KB
/
main.py
File metadata and controls
57 lines (54 loc) · 1.04 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from fastapi import FastAPI
app = FastAPI()
inventory = {
1: {
"name": "Goat Cheese",
"price": "£12.00 per Kilogram",
"discount": "No",
},
2: {
"name": "Sausage Roll",
"price": "£1.99",
"discount": "No",
},
3: {
"name": "Hotdog",
"price": "99p",
"discount": "No",
},
4: {
"name": "Lucozade Sport Orange",
"price": "£2.00",
"discount": "No",
},
5: {
"name": "Lucozade Sport Raspberry",
"price": "£2.00",
"discount": "No",
},
6: {
"name": "Coca Cola Can",
"price": "£1.50",
"discount": "No",
},
7: {
"name": "Pepsi Max Can",
"price": "£1.50",
"discount": "No",
},
8: {
"MEAL": "DEAL",
"food_name": "Sausage Roll",
"food_price": "£1.00",
"food_discount": "Yes",
"----": "----",
"drink_name": "Any Drink of Choice",
"drink_price": "£1.00",
"drink_discount": "Yes",
"---": "---",
"Total Price": "£2.00",
},
}
@app.get("/get-info/{item_id}")
def get_info(item_id: int):
return inventory[item_id]