|
10 | 10 |
|
11 | 11 | @router.post("/", response_model=SiteOut, status_code=201, summary="Create a new site")
|
12 | 12 | async def create_site(payload: SiteIn):
|
13 |
| -<<<<<<< HEAD |
14 |
| - """Creates a new site based on the given information: |
| 13 | + """Creates a new site based on the given information |
15 | 14 |
|
16 |
| - - **lon**: Longitude of the site |
17 |
| - - **lat**: Latitude of the site |
18 |
| - - **name**: Site name |
19 |
| - - **type**: Type of the site chosen in the following set {"tower", "station"} |
20 |
| -
|
21 |
| - Below, click on "Schema" for more detailed information about fields |
22 |
| - or "Example Value" to get a concrete idea of inputs fields |
| 15 | + Below, click on "Schema" for more detailed information about arguments |
| 16 | + or "Example Value" to get a concrete idea of arguments |
23 | 17 | """
|
24 |
| - return await routing.create_entry(sites, payload) |
25 |
| -======= |
26 | 18 | return await crud.create_entry(sites, payload)
|
27 |
| ->>>>>>> master |
28 | 19 |
|
29 | 20 |
|
30 | 21 | @router.get("/{site_id}/", response_model=SiteOut, summary="Get information about a specific site")
|
31 | 22 | async def get_site(site_id: int = Path(..., gt=0)):
|
32 |
| -<<<<<<< HEAD |
33 | 23 | """
|
34 | 24 | Based on a site_id, retrieves information about the given site
|
35 | 25 | """
|
36 |
| - return await routing.get_entry(sites, site_id) |
37 |
| -======= |
38 | 26 | return await crud.get_entry(sites, site_id)
|
39 |
| ->>>>>>> master |
40 | 27 |
|
41 | 28 |
|
42 | 29 | @router.get("/", response_model=List[SiteOut], summary="Get the list of all sites")
|
43 | 30 | async def fetch_sites():
|
44 |
| -<<<<<<< HEAD |
45 | 31 | """
|
46 | 32 | Retrieves the list of all sites with each related information
|
47 | 33 | """
|
48 |
| - return await routing.fetch_entries(sites) |
49 |
| -======= |
50 | 34 | return await crud.fetch_all(sites)
|
51 |
| ->>>>>>> master |
52 | 35 |
|
53 | 36 |
|
54 | 37 | @router.put("/{site_id}/", response_model=SiteOut, summary="Update information about a specific site")
|
55 | 38 | async def update_site(payload: SiteIn, site_id: int = Path(..., gt=0)):
|
56 |
| -<<<<<<< HEAD |
57 | 39 | """
|
58 | 40 | Based on a site_id, updates information about the given site
|
59 | 41 | """
|
60 |
| - return await routing.update_entry(sites, payload, site_id) |
61 |
| -======= |
62 | 42 | return await crud.update_entry(sites, payload, site_id)
|
63 |
| ->>>>>>> master |
64 | 43 |
|
65 | 44 |
|
66 | 45 | @router.delete("/{site_id}/", response_model=SiteOut, summary="Delete a specific site")
|
67 | 46 | async def delete_site(site_id: int = Path(..., gt=0)):
|
68 |
| -<<<<<<< HEAD |
69 | 47 | """
|
70 | 48 | Based on a site_id, deletes the given site
|
71 | 49 | """
|
72 |
| - return await routing.delete_entry(sites, site_id) |
73 |
| -======= |
74 | 50 | return await crud.delete_entry(sites, site_id)
|
75 |
| ->>>>>>> master |
0 commit comments