Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
butter-studio
Commits
6d08d71f
Commit
6d08d71f
authored
Aug 09, 2021
by
한규민
Browse files
예매 확인
parent
eacc9ce9
Changes
25
Show whitespace changes
Inline
Side-by-side
server/db/index.js
View file @
6d08d71f
...
@@ -6,7 +6,7 @@ import CinemaModel from "../models/cinema.model.js";
...
@@ -6,7 +6,7 @@ import CinemaModel from "../models/cinema.model.js";
import
TheaterModel
from
"
../models/theater.model.js
"
;
import
TheaterModel
from
"
../models/theater.model.js
"
;
import
TheaterTypeModel
from
"
../models/theatertype.model.js
"
;
import
TheaterTypeModel
from
"
../models/theatertype.model.js
"
;
import
TicketFeeModel
from
"
../models/ticketfee.model.js
"
;
import
TicketFeeModel
from
"
../models/ticketfee.model.js
"
;
import
TimeTableModel
from
'
../models/
ro
le.model.js
'
;
import
TimeTableModel
from
'
../models/
timetab
le.model.js
'
;
import
ReservationModel
from
'
../models/reservation.model.js
'
;
import
ReservationModel
from
'
../models/reservation.model.js
'
;
import
GuestModel
from
'
../models/guest.model.js
'
import
GuestModel
from
'
../models/guest.model.js
'
import
ConfirmNumModel
from
'
../models/confirmnum.model.js
'
import
ConfirmNumModel
from
'
../models/confirmnum.model.js
'
...
@@ -43,10 +43,16 @@ const ConfirmNum = ConfirmNumModel(sequelize)
...
@@ -43,10 +43,16 @@ const ConfirmNum = ConfirmNumModel(sequelize)
User
.
belongsTo
(
Role
);
User
.
belongsTo
(
Role
);
Role
.
hasOne
(
User
);
Role
.
hasOne
(
User
);
Guest
.
belongsTo
(
Role
);
Role
.
hasOne
(
Guest
);
Theater
.
belongsTo
(
TheaterType
,
{
onDelete
:
'
CASCADE
'
});
Theater
.
belongsTo
(
TheaterType
,
{
onDelete
:
'
CASCADE
'
});
TicketFee
.
belongsTo
(
TheaterType
,
{
onDelete
:
'
CASCADE
'
});
TicketFee
.
belongsTo
(
TheaterType
,
{
onDelete
:
'
CASCADE
'
});
Reservation
.
belongsTo
(
Theater
);
Reservation
.
belongsTo
(
TimeTable
);
export
{
export
{
sequelize
,
sequelize
,
User
,
User
,
...
...
server/models/reservation.model.js
View file @
6d08d71f
...
@@ -14,18 +14,18 @@ const ReservationModel = (sequelize) => {
...
@@ -14,18 +14,18 @@ const ReservationModel = (sequelize) => {
movieId
:
{
movieId
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
},
},
theater
:
{
//
theater: {
type
:
DataTypes
.
INTEGER
,
//
type: DataTypes.INTEGER,
},
//
},
row
:
{
row
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
},
},
col
:
{
col
:
{
type
:
DataTypes
.
INTEGER
,
type
:
DataTypes
.
INTEGER
,
},
},
timetable
:{
//
timetable:{
type
:
DataTypes
.
INTEGER
,
//
type: DataTypes.INTEGER,
},
//
},
userType
:{
userType
:{
type
:
DataTypes
.
STRING
,
type
:
DataTypes
.
STRING
,
},
},
...
...
server/routes/movie.route.js
View file @
6d08d71f
...
@@ -18,7 +18,6 @@ router
...
@@ -18,7 +18,6 @@ router
movieCtrl
.
getAllMovie
,
movieCtrl
.
getAllMovie
,
movieCtrl
.
movieforAdmin
movieCtrl
.
movieforAdmin
)
)
router
router
.
route
(
"
/search/home
"
)
.
route
(
"
/search/home
"
)
.
get
(
movieCtrl
.
findonlyTitle
)
.
get
(
movieCtrl
.
findonlyTitle
)
...
@@ -34,6 +33,7 @@ router
...
@@ -34,6 +33,7 @@ router
.
route
(
"
/:movieId
"
)
.
route
(
"
/:movieId
"
)
.
post
(
movieCtrl
.
create
)
.
post
(
movieCtrl
.
create
)
.
delete
(
movieCtrl
.
remove
)
.
delete
(
movieCtrl
.
remove
)
.
get
(
movieCtrl
.
getMovieById
)
export
default
router
;
export
default
router
;
\ No newline at end of file
server/routes/reservation.route.js
View file @
6d08d71f
import
express
from
"
express
"
;
import
express
from
"
express
"
;
import
ReservationCtrl
from
"
../controllers/reservation.controller.js
"
;
import
movieCtrl
from
"
../controllers/movie.controller.js
"
;
import
reservationCtrl
from
"
../controllers/reservation.controller.js
"
;
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
router
.
route
(
'
/findreservation
'
)
router
.
route
(
'
/findreservation
'
)
.
post
(
R
eservationCtrl
.
findReservedSeats
)
.
post
(
r
eservationCtrl
.
findReservedSeats
)
.
get
(
R
eservationCtrl
.
findReservation
)
.
get
(
r
eservationCtrl
.
findReservation
)
router
.
route
(
'
/findonereservation
'
)
router
.
route
(
'
/findonereservation
'
)
.
pos
t
(
R
eservationCtrl
.
findOneReservation
)
.
ge
t
(
r
eservationCtrl
.
findOneReservation
,
movieCtrl
.
getMovieById
)
router
.
route
(
'
/save
'
)
router
.
route
(
'
/save
'
)
.
post
(
R
eservationCtrl
.
saveReservation
)
.
post
(
r
eservationCtrl
.
saveReservation
)
export
default
router
;
export
default
router
;
\ No newline at end of file
server/routes/user.route.js
View file @
6d08d71f
...
@@ -19,6 +19,10 @@ router
...
@@ -19,6 +19,10 @@ router
.
route
(
"
/logout
"
)
.
route
(
"
/logout
"
)
.
get
(
userCtrl
.
logout
)
.
get
(
userCtrl
.
logout
)
router
.
route
(
"
/guest
"
)
.
post
(
userCtrl
.
guestLogin
)
router
router
.
route
(
"
/signup
"
)
.
route
(
"
/signup
"
)
.
post
(
userCtrl
.
signup
)
.
post
(
userCtrl
.
signup
)
...
@@ -55,8 +59,4 @@ router.route('/guest/save')
...
@@ -55,8 +59,4 @@ router.route('/guest/save')
router
.
route
(
'
/guestinfo/:guestId
'
)
router
.
route
(
'
/guestinfo/:guestId
'
)
.
get
(
userCtrl
.
getGuestInfo
)
.
get
(
userCtrl
.
getGuestInfo
)
router
.
route
(
"
/:userId
"
)
.
get
(
userCtrl
.
compareId
)
export
default
router
;
export
default
router
;
\ No newline at end of file
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment