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
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
Merged
add staging deployment to CI
staging-ci
into
main
Overview
0
Commits
11
Pipelines
10
Changes
2
Merged
Aymeric Chaumont
requested to merge
staging-ci
into
main
2 years ago
Overview
0
Commits
11
Pipelines
10
Changes
2
Expand
0
0
Merge request reports
Compare
main
version 5
3a762276
2 years ago
version 4
3a762276
2 years ago
version 3
cb5bc2f5
2 years ago
version 2
074fc7c4
2 years ago
version 1
0cff03c4
2 years ago
main (base)
and
version 5
latest version
8f6074cf
11 commits,
2 years ago
version 5
3a762276
10 commits,
2 years ago
version 4
3a762276
14 commits,
2 years ago
version 3
cb5bc2f5
5 commits,
2 years ago
version 2
074fc7c4
4 commits,
2 years ago
version 1
0cff03c4
1 commit,
2 years ago
2 files
+
77
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
backend/stats.py
0 → 100644
+
45
−
0
Options
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