Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ViaResto-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aymeric Chaumont
ViaResto-website
Merge requests
!34
add staging deployment to CI
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
add staging deployment to CI
staging-ci
into
main
Overview
0
Commits
11
Pipelines
10
Changes
1
Merged
Aymeric Chaumont
requested to merge
staging-ci
into
main
3 years ago
Overview
0
Commits
11
Pipelines
10
Changes
1
0
0
Merge request reports
Viewing commit
8f6074cf
Prev
Next
Show latest version
1 file
+
0
−
45
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
8f6074cf
removed accidently gitted file
· 8f6074cf
Aymeric Chaumont
authored
2 years ago
backend/stats.py deleted
100644 → 0
+
0
−
45
View file @ 3a762276
from
fastapi
import
APIRouter
,
Depends
from
sqlalchemy.orm
import
Session
from
typing
import
List
from
db
import
schemas
,
crud
from
db.database
import
get_db
router
=
APIRouter
(
prefix
=
"
/api
"
)
@router.get
(
'
/{place}/waiting_time
'
,
response_model
=
schemas
.
WaitingTime
,
tags
=
[
"
stats
"
])
async
def
waiting_time
(
place
:
str
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_waiting_time
(
place
,
db
)
@router.get
(
'
/{place}/stats/avg_graph
'
,
response_model
=
list
,
tags
=
[
"
stats
"
])
async
def
stats
(
place
:
str
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_avg_graph
(
place
,
db
)
@router.get
(
'
/{place}/stats/current_graph
'
,
response_model
=
schemas
.
Graph
,
tags
=
[
"
stats
"
])
async
def
stats
(
place
:
str
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_current_graph
(
place
,
db
)
@router.get
(
'
/{place}/opening_hours
'
,
response_model
=
List
[
schemas
.
OpeningHours
],
tags
=
[
"
timetable
"
])
async
def
get_opening_hours
(
place
:
str
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_opening_hours
(
place
,
db
)
@router.post
(
'
/opening_hours
'
,
response_model
=
schemas
.
OpeningHours
,
tags
=
[
"
timetable
"
])
async
def
create_opening_hours
(
opening_hours
:
schemas
.
OpeningHoursBase
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
create_opening_hours
(
opening_hours
,
db
)
@router.delete
(
'
/opening_hours/{id}
'
,
response_model
=
None
,
tags
=
[
"
timetable
"
])
async
def
delete_opening_hours
(
id
:
int
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
delete_opening_hours
(
id
,
db
)
@router.get
(
'
/restaurants
'
,
response_model
=
List
[
schemas
.
Restaurant
],
tags
=
[
"
timetable
"
])
async
def
get_restaurants
(
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_restaurants
(
db
)
Loading