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
Today KU
Commits
6db177d9
Commit
6db177d9
authored
Nov 02, 2021
by
Kim, Subin
Browse files
schedule router 및 controller 작성 및 적용
parent
20930c8b
Changes
4
Show whitespace changes
Inline
Side-by-side
server/controllers/ku.controller.js
0 → 100644
View file @
6db177d9
import
{
KU
}
from
"
../db/index.js
"
;
const
create
=
async
(
req
,
res
)
=>
{
try
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
일정 등록 중 에러 발생
"
)
}
}
const
edit
=
async
(
req
,
res
)
=>
{
try
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
일정 수정 중 에러 발생
"
)
}
}
const
remove
=
async
(
req
,
res
)
=>
{
try
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
일정 삭제 중 에러 발생
"
)
}
}
export
default
{
create
,
edit
,
remove
}
\ No newline at end of file
server/controllers/schedule.controller.js
0 → 100644
View file @
6db177d9
import
{
Schedule
}
from
"
../db/index.js
"
;
const
create
=
async
(
req
,
res
)
=>
{
try
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
일정 등록 중 에러 발생
"
)
}
}
const
edit
=
async
(
req
,
res
)
=>
{
try
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
일정 수정 중 에러 발생
"
)
}
}
const
remove
=
async
(
req
,
res
)
=>
{
try
{
}
catch
(
error
)
{
return
res
.
status
(
500
).
send
(
error
.
message
||
"
일정 삭제 중 에러 발생
"
)
}
}
export
default
{
create
,
edit
,
remove
}
\ No newline at end of file
server/routes/index.js
View file @
6db177d9
import
express
from
"
express
"
;
import
express
from
"
express
"
;
import
userRouter
from
'
./user.route.js
'
;
import
userRouter
from
'
./user.route.js
'
;
import
scheduleRouter
from
"
./schedule.route.js
"
;
import
subjectRouter
from
'
./subject.route.js
'
;
import
subjectRouter
from
'
./subject.route.js
'
;
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
router
.
use
(
'
/auth
'
,
userRouter
)
router
.
use
(
'
/auth
'
,
userRouter
)
router
.
use
(
'
/schedule
'
,
scheduleRouter
)
router
.
use
(
'
/subject
'
,
subjectRouter
)
router
.
use
(
'
/subject
'
,
subjectRouter
)
export
default
router
;
export
default
router
;
\ No newline at end of file
server/routes/schedule.route.js
0 → 100644
View file @
6db177d9
import
express
from
'
express
'
;
import
kuCtrl
from
"
../controllers/ku.controller.js
"
;
import
scheduleCtrl
from
"
../controllers/schedule.controller.js
"
;
const
router
=
express
.
Router
();
router
.
route
(
"
/ku
"
)
.
post
(
kuCtrl
.
create
)
.
put
(
kuCtrl
.
edit
)
.
delete
(
kuCtrl
.
remove
)
router
.
route
(
"
/:userId
"
)
.
post
(
scheduleCtrl
.
create
)
.
put
(
scheduleCtrl
.
edit
)
.
delete
(
scheduleCtrl
.
remove
)
export
default
router
;
\ No newline at end of file
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