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
!29
Time dependence
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Time dependence
time-dependence
into
collab_front
Overview
0
Commits
17
Pipelines
6
Changes
3
Merged
Aymeric Chaumont
requested to merge
time-dependence
into
collab_front
2 years ago
Overview
0
Commits
17
Pipelines
6
Changes
3
Expand
0
0
Merge request reports
Viewing commit
620c514f
Prev
Next
Show latest version
3 files
+
21
−
32
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
620c514f
move opening_hours routes to stats
· 620c514f
Aymeric Chaumont
authored
2 years ago
backend/routers/opening_hours.py deleted
100644 → 0
+
0
−
29
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
"
,
tags
=
[
"
opening_hours
"
])
@router.get
(
'
/{place}/opening_hours
'
,
response_model
=
List
[
schemas
.
OpeningHours
])
async
def
get_opening_hours
(
place
:
str
,
page
:
int
=
1
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_opening_hours
(
place
,
page
,
db
)
@router.get
(
'
/{place}/opening_hours/{day}/{timeslot}
'
,
response_model
=
List
[
schemas
.
OpeningHours
])
async
def
get_timeslot
(
place
:
str
,
day
:
int
,
timeslot
:
bool
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_timeslot
(
place
,
day
,
timeslot
,
db
)
@router.post
(
'
/opening_hours
'
,
response_model
=
schemas
.
OpeningHours
)
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
)
async
def
delete_opening_hours
(
id
:
int
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
delete_opening_hours
(
id
,
db
)
Loading