Commit 6d08d71f authored by 한규민's avatar 한규민
Browse files

예매 확인

parent eacc9ce9
......@@ -6,7 +6,7 @@ import CinemaModel from "../models/cinema.model.js";
import TheaterModel from "../models/theater.model.js";
import TheaterTypeModel from "../models/theatertype.model.js";
import TicketFeeModel from "../models/ticketfee.model.js";
import TimeTableModel from '../models/role.model.js';
import TimeTableModel from '../models/timetable.model.js';
import ReservationModel from '../models/reservation.model.js';
import GuestModel from '../models/guest.model.js'
import ConfirmNumModel from '../models/confirmnum.model.js'
......@@ -43,10 +43,16 @@ const ConfirmNum = ConfirmNumModel(sequelize)
User.belongsTo(Role);
Role.hasOne(User);
Guest.belongsTo(Role);
Role.hasOne(Guest);
Theater.belongsTo(TheaterType, { onDelete: 'CASCADE' });
TicketFee.belongsTo(TheaterType, { onDelete: 'CASCADE' });
Reservation.belongsTo(Theater);
Reservation.belongsTo(TimeTable);
export {
sequelize,
User,
......
......@@ -14,18 +14,18 @@ const ReservationModel = (sequelize) => {
movieId: {
type: DataTypes.INTEGER,
},
theater: {
type: DataTypes.INTEGER,
},
// theater: {
// type: DataTypes.INTEGER,
// },
row: {
type: DataTypes.INTEGER,
},
col: {
type: DataTypes.INTEGER,
},
timetable:{
type: DataTypes.INTEGER,
},
// timetable:{
// type: DataTypes.INTEGER,
// },
userType:{
type: DataTypes.STRING,
},
......
......@@ -18,7 +18,6 @@ router
movieCtrl.getAllMovie,
movieCtrl.movieforAdmin
)
router
.route("/search/home")
.get(movieCtrl.findonlyTitle)
......@@ -34,6 +33,7 @@ router
.route("/:movieId")
.post(movieCtrl.create)
.delete(movieCtrl.remove)
.get(movieCtrl.getMovieById)
export default router;
\ No newline at end of file
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();
router.route('/findreservation')
.post(ReservationCtrl.findReservedSeats)
.get(ReservationCtrl.findReservation)
.post(reservationCtrl.findReservedSeats)
.get(reservationCtrl.findReservation)
router.route('/findonereservation')
.post(ReservationCtrl.findOneReservation)
.get(reservationCtrl.findOneReservation, movieCtrl.getMovieById)
router.route('/save')
.post(ReservationCtrl.saveReservation)
.post(reservationCtrl.saveReservation)
export default router;
\ No newline at end of file
......@@ -19,6 +19,10 @@ router
.route("/logout")
.get(userCtrl.logout)
router
.route("/guest")
.post(userCtrl.guestLogin)
router
.route("/signup")
.post(userCtrl.signup)
......@@ -55,8 +59,4 @@ router.route('/guest/save')
router.route('/guestinfo/:guestId')
.get(userCtrl.getGuestInfo)
router
.route("/:userId")
.get(userCtrl.compareId)
export default router;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment