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
reservation-service
Commits
813db703
Commit
813db703
authored
Oct 09, 2020
by
Choi Ga Young
Browse files
채린 머지
parents
6aa8c061
d0f6f520
Changes
20
Expand all
Show whitespace changes
Inline
Side-by-side
server/app.js
View file @
813db703
...
@@ -8,6 +8,7 @@ const indexRouter = require('./routes/index');
...
@@ -8,6 +8,7 @@ const indexRouter = require('./routes/index');
const
usersRouter
=
require
(
'
./routes/users
'
);
const
usersRouter
=
require
(
'
./routes/users
'
);
const
loginRouter
=
require
(
'
./routes/login
'
);
const
loginRouter
=
require
(
'
./routes/login
'
);
const
reserveRouter
=
require
(
'
./routes/reserves
'
);
const
reserveRouter
=
require
(
'
./routes/reserves
'
);
const
noticeRouter
=
require
(
'
./routes/notices
'
);
const
connect
=
require
(
'
./schemas
'
);
const
connect
=
require
(
'
./schemas
'
);
const
app
=
express
();
const
app
=
express
();
...
@@ -33,6 +34,7 @@ app.use('/', indexRouter);
...
@@ -33,6 +34,7 @@ app.use('/', indexRouter);
app
.
use
(
'
/users
'
,
usersRouter
);
app
.
use
(
'
/users
'
,
usersRouter
);
app
.
use
(
'
/login
'
,
loginRouter
);
app
.
use
(
'
/login
'
,
loginRouter
);
app
.
use
(
'
/reserves
'
,
reserveRouter
);
app
.
use
(
'
/reserves
'
,
reserveRouter
);
app
.
use
(
'
/notices
'
,
noticeRouter
);
// catch 404 and forward to error handler
// catch 404 and forward to error handler
app
.
use
(
function
(
req
,
res
,
next
)
{
app
.
use
(
function
(
req
,
res
,
next
)
{
...
...
server/client/src/App.css
deleted
100644 → 0
View file @
6aa8c061
.App
{
text-align
:
center
;
}
.App-logo
{
height
:
40vmin
;
pointer-events
:
none
;
}
@media
(
prefers-reduced-motion
:
no-preference
)
{
.App-logo
{
animation
:
App-logo-spin
infinite
20s
linear
;
}
}
.App-header
{
background-color
:
#282c34
;
min-height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
calc
(
10px
+
2vmin
);
color
:
white
;
}
.App-link
{
color
:
#61dafb
;
}
@keyframes
App-logo-spin
{
from
{
transform
:
rotate
(
0deg
);
}
to
{
transform
:
rotate
(
360deg
);
}
}
server/client/src/App.js
deleted
100644 → 0
View file @
6aa8c061
import
React
from
'
react
'
;
import
logo
from
'
./logo.svg
'
;
import
'
./App.css
'
;
function
App
()
{
return
(
<
div
className
=
"
App
"
>
<
header
className
=
"
App-header
"
>
<
img
src
=
{
logo
}
className
=
"
App-logo
"
alt
=
"
logo
"
/>
<
p
>
Edit
<
code
>
src
/
App
.
js
<
/code> and save to reload
.
<
/p
>
<
a
className
=
"
App-link
"
href
=
"
https://reactjs.org
"
target
=
"
_blank
"
rel
=
"
noopener noreferrer
"
>
Learn
React
<
/a
>
<
/header
>
<
/div
>
);
}
export
default
App
;
server/client/src/Components/List.js
deleted
100644 → 0
View file @
6aa8c061
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Field
,
Formik
}
from
'
formik
'
;
import
axios
from
'
axios
'
;
import
{
render
}
from
'
react-dom
'
;
import
{
Link
,
Redirect
}
from
'
react-router-dom
'
;
import
styled
from
'
styled-components
'
;
function
List
(
props
)
{
function
remove
()
{
console
.
log
(
props
.
_id
)
axios
.
delete
(
`/reserves/
${
props
.
_id
}
`
,
{
data
:
{
_id
:
props
.
_id
,
}})
.
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
alert
(
"
신청이 완료되었습니다!
"
)
})
.
catch
(
err
=>
{
alert
(
err
.
error
)
});
};
return
(
<
div
>
<
div
>
날짜
:
{
props
.
date
}
<
/div
>
<
div
>
이름
:
{
props
.
name
}
<
/div
>
<
div
>
강의실
:
{
props
.
room
}
<
/div
>
<
div
>
시간
:
{
props
.
time
}
<
/div
>
<
div
>
사용인원
:
{
props
.
num
}
<
/div
>
<
div
>
{
props
.
_id
}
<
/div
>
<
form
onSubmit
=
{
remove
}
className
=
"
col-sm-3
"
>
<
button
type
=
"
submit
"
className
=
"
btn btn-dark
"
>
신청
취소
<
/button
>
<
/form
>
<
/div
>
)
}
export
default
List
;
\ No newline at end of file
server/client/src/Components/Menu.js
View file @
813db703
...
@@ -3,7 +3,12 @@ import { Link, Redirect } from 'react-router-dom';
...
@@ -3,7 +3,12 @@ import { Link, Redirect } from 'react-router-dom';
import
styled
from
'
styled-components
'
;
import
styled
from
'
styled-components
'
;
const
Nav
=
styled
.
nav
`
const
Nav
=
styled
.
nav
`
background-color: #981e1e;
background-color: #7B031D;
height: 6vh;
a {
color: #ffffff;
}
`
`
function
Menu
()
{
function
Menu
()
{
...
@@ -20,17 +25,24 @@ function Menu() {
...
@@ -20,17 +25,24 @@ function Menu() {
return
(
return
(
<
Nav
className
=
"
navbar sticky-top navbar-expand-md
"
>
<
Nav
className
=
"
navbar sticky-top navbar-expand-md
"
>
<
Link
to
=
"
/home
"
class
Name
=
"
navbar-brand
"
>
대관
서비스
<
/
Link
>
<
a
class
=
"
navbar-brand
"
href
=
"
#
"
>
대관
서비스
<
/
a
>
<
button
className
=
"
navbar-toggler
"
type
=
"
button
"
data
-
toggle
=
"
collapse
"
data
-
target
=
"
#collapsibleNavbar
"
aria
-
controls
=
"
collapsibleNavbar
"
>
<
button
className
=
"
navbar-toggler
"
type
=
"
button
"
data
-
toggle
=
"
collapse
"
data
-
target
=
"
#collapsibleNavbar
"
aria
-
controls
=
"
collapsibleNavbar
"
>
<
span
className
=
"
navbar-toggler-icon
"
><
/span
>
<
span
className
=
"
navbar-toggler-icon
"
><
/span
>
<
/button
>
<
/button
>
<
div
className
=
"
collapse navbar-collapse justify-content-between
"
id
=
"
collapsibleNavbar
"
>
<
div
className
=
"
collapse navbar-collapse justify-content-between
"
id
=
"
collapsibleNavbar
"
>
<
ul
className
=
"
navbar-nav
"
>
<
ul
className
=
"
navbar-nav
"
>
<
li
className
=
"
nav-item
"
>
<
li
className
=
"
nav-item
"
>
<
Link
to
=
"
/notice
"
className
=
"
nav-link
"
>
공지사항
<
/Link
>
<
/li
>
<
li
className
=
"
nav-item
"
>
{
console
.
log
(
name
)}
<
Link
to
=
"
/home
"
className
=
"
nav-link
"
>
대관
현황
<
/Link
>
<
Link
to
=
"
/home
"
className
=
"
nav-link
"
>
대관
현황
<
/Link
>
<
/li
>
<
/li
>
<
li
className
=
"
nav-item
"
>
<
li
className
=
"
nav-item
"
>
<
Link
to
=
"
/apply
"
className
=
"
nav-link
"
>
대관
신청
<
/Link
>
<
Link
to
=
{{
pathname
:
`/apply/
${
localStorage
.
getItem
(
'
_id
'
)}
`
,
state
:
{
id
:
localStorage
.
getItem
(
'
_id
'
)
},
}}
className
=
"
nav-link
"
>
대관
신청
<
/Link
>
<
/li
>
<
/li
>
<
li
className
=
"
nav-item
"
>
<
li
className
=
"
nav-item
"
>
<
Link
to
=
{{
<
Link
to
=
{{
...
@@ -39,14 +51,10 @@ function Menu() {
...
@@ -39,14 +51,10 @@ function Menu() {
}}
className
=
"
nav-link
"
>
}}
className
=
"
nav-link
"
>
대관
확인
/
취소
<
/Link
>
대관
확인
/
취소
<
/Link
>
<
/li
>
<
/li
>
<
li
className
=
"
nav-item
"
>
<
Link
to
=
"
/notice
"
className
=
"
nav-link
"
>
공지사항
<
/Link
>
<
/li
>
<
/ul
>
<
/ul
>
<
div
>
<
div
>
<
div
>
{
name
}
님
안녕하세요
.
<
/div
>
<
div
>
{
name
}
님
안녕하세요
.
<
/div
>
<
button
onClick
=
{
logout
}
type
=
"
button
"
>
로그아웃
<
/button
>
<
button
onClick
=
{
logout
}
type
=
"
button
"
>
로그아웃
<
/button
>
<
button
><
Link
to
=
"
/signup
"
>
회원가입
<
/Link></
button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/Nav
>
<
/Nav
>
...
...
server/client/src/Pages/ApplyPage.js
View file @
813db703
import
React
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
{
Formik
}
from
'
formik
'
;
import
{
Formik
,
Field
,
ErrorMessage
,
FieldArray
}
from
'
formik
'
;
import
Menu
from
'
../Components/Menu
'
;
import
Menu
from
'
../Components/Menu
'
;
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
*
as
Yup
from
'
yup
'
;
import
*
as
Yup
from
'
yup
'
;
import
{
Redirect
}
from
'
react-router-dom
'
;
function
Apply
(
props
)
{
const
[
state
,
setState
]
=
useState
();
const
[
user
,
setUser
]
=
useState
({
name
:
""
});
useEffect
(()
=>
{
getUser
();
},
[])
if
(
state
)
{
return
<
Redirect
to
=
{{
pathname
:
`/check/
${
props
.
match
.
params
.
id
}
`
,
state
:
{
id
:
props
.
match
.
params
.
id
},
}}
/>
;
}
function
getUser
()
{
axios
.
get
(
`/users/
${
props
.
match
.
params
.
id
}
`
,
{
headers
:
{
authorization
:
localStorage
.
getItem
(
'
token
'
)
},
})
.
then
(
res
=>
{
if
(
res
.
status
!==
201
)
{
alert
(
res
.
data
.
error
);
}
console
.
log
(
res
.
data
);
setUser
(
res
.
data
);
})
.
catch
(
err
=>
{
alert
(
err
.
error
)
});
}
function
Apply
()
{
return
(
return
(
<
div
>
<
div
>
<
Menu
/>
<
Menu
/>
<
div
className
=
"
container
"
>
apply
<
Formik
<
Formik
initialValues
=
{{
initialValues
=
{{
_id
:
`
${
props
.
match
.
params
.
id
}
`
,
date
:
''
,
date
:
''
,
time
:
''
,
time
:
''
,
room
:
''
,
room
:
''
,
name
:
''
,
_id
:
"
5f786720c45bbf6c68899c51
"
,
reason
:
''
,
reason
:
''
,
students
:
[
{
member
:
''
,
member
:
''
,
approve
:
false
,
}
,
num
:
5
,
]
,
}}
}}
validationSchema
=
{
Yup
.
object
({
validationSchema
=
{
Yup
.
object
({
date
:
Yup
.
string
()
date
:
Yup
.
string
()
...
@@ -31,39 +62,42 @@ function Apply() {
...
@@ -31,39 +62,42 @@ function Apply() {
.
required
(
'
강의실 번호를 입력해주세요.
'
),
.
required
(
'
강의실 번호를 입력해주세요.
'
),
reason
:
Yup
.
string
()
reason
:
Yup
.
string
()
.
required
(
'
대관목적을 입력해주세요.
'
),
.
required
(
'
대관목적을 입력해주세요.
'
),
name
:
Yup
.
string
()
.
required
(
'
대표자 성함을 입력해주세요.
'
),
member
:
Yup
.
string
()
.
required
(
'
이용자 성함을 입력해주세요.
'
),
})}
})}
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
onSubmit
=
{(
values
,
{
setSubmitting
})
=>
{
console
.
log
(
values
)
axios
({
axios
({
method
:
'
post
'
,
method
:
'
post
'
,
url
:
'
/reserves
'
,
url
:
'
/reserves
'
,
data
:
values
,
data
:
values
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
alert
(
"
신청이 완료되었습니다!
"
)
alert
(
"
신청이 완료되었습니다!
"
)
;
setState
(
true
);
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
alert
(
err
.
error
)
alert
(
err
.
error
)
});
});
setTimeout
(()
=>
{
//
setTimeout(() => {
setSubmitting
(
false
);
//
setSubmitting(false);
},
400
);
// finish the cycle in handler
//
}, 400); // finish the cycle in handler
}}
}}
>
>
{({
{({
errors
,
errors
,
touched
,
touched
,
values
,
handleSubmit
,
handleSubmit
,
getFieldProps
,
getFieldProps
,
isSubmitting
,
isSubmitting
,
})
=>
(
})
=>
(
<
div
className
=
"
row justify-content-center align-items-center
"
>
<
div
className
=
"
row justify-content-center align-items-center
"
>
{
console
.
log
(
user
)}
<
form
onSubmit
=
{
handleSubmit
}
className
=
"
col-sm-3
"
>
<
form
onSubmit
=
{
handleSubmit
}
className
=
"
col-sm-3
"
>
<
div
className
=
"
form-group mb-4
"
>
<
label
>
대표자
<
/label
>
<
div
>
{
user
.
name
}
<
/div
>
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group mb-4
"
>
<
label
>
신청날짜
<
/label
>
<
label
>
신청날짜
<
/label
>
<
input
<
input
...
@@ -117,30 +151,45 @@ function Apply() {
...
@@ -117,30 +151,45 @@ function Apply() {
)
:
null
}
)
:
null
}
<
/div
>
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group mb-4
"
>
<
label
>
대표자
<
/label
>
<
FieldArray
name
=
"
students
"
>
<
input
{({
insert
,
remove
,
push
})
=>
(
className
=
{(
touched
.
name
&&
errors
.
name
?
'
form-control is-invalid
'
:
"
form-control
"
)}
<
div
>
type
=
"
text
"
name
=
"
name
"
{...
getFieldProps
(
'
name
'
)}
placeholder
=
"
대표자 성함을 입력해 주세요
"
/>
{
touched
.
name
&&
errors
.
name
?
(
<
div
className
=
"
invalid-feedback text-left
"
>
{
errors
.
name
}
<
/div
>
)
:
null
}
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
label
>
이용자
<
/label
>
<
label
>
이용자
<
/label
>
<
input
{
className
=
{(
touched
.
member
&&
errors
.
member
?
'
form-control is-invalid
'
:
"
form-control
"
)}
values
.
students
.
map
((
student
,
index
)
=>
(
<
div
className
=
"
row
"
key
=
{
index
}
>
<
div
className
=
"
col
"
>
<
Field
name
=
{
`students.
${
index
}
.member`
}
placeholder
=
"
이용자 성함을 입력하세요.
"
type
=
"
text
"
type
=
"
text
"
name
=
"
member
"
{...
getFieldProps
(
'
member
'
)}
placeholder
=
"
이용자 성함을 입력해 주세요.
"
/>
/>
{
touched
.
member
&&
errors
.
member
?
(
<
ErrorMessage
<
div
className
=
"
invalid-feedback text-left
"
>
{
errors
.
member
}
<
/div
>
name
=
{
`friends.
${
index
}
.name`
}
)
:
null
}
component
=
"
div
"
className
=
"
field-error
"
/>
<
button
type
=
"
button
"
className
=
"
secondary
"
onClick
=
{()
=>
remove
(
index
)}
>
X
<
/button
>
<
/div
>
<
/div
>
))}
<
button
type
=
"
button
"
className
=
"
btn btn-primary
"
onClick
=
{()
=>
push
({
member
:
''
})}
>
추가
<
/button
>
<
/div
>
)}
<
/FieldArray
>
<
/div
>
<
/div
>
<
button
type
=
"
submit
"
className
=
"
btn btn-dark
"
disabled
=
{
isSubmitting
}
>
<
button
type
=
"
submit
"
className
=
"
btn btn-dark
"
disabled
=
{
isSubmitting
}
>
신청하기
신청하기
...
@@ -150,7 +199,6 @@ function Apply() {
...
@@ -150,7 +199,6 @@ function Apply() {
)}
)}
<
/Formik
>
<
/Formik
>
<
/div
>
<
/div
>
<
/div
>
)
)
}
}
...
...
server/client/src/Pages/CheckPage.js
View file @
813db703
...
@@ -4,6 +4,10 @@ import axios from 'axios';
...
@@ -4,6 +4,10 @@ import axios from 'axios';
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
function
Check
(
props
)
{
function
Check
(
props
)
{
const
[
reserve
,
setReserve
]
=
useState
([]);
useEffect
(()
=>
{
getReserve
();
},
[])
function
getReserve
()
{
function
getReserve
()
{
axios
.
get
(
`/reserves/
${
props
.
match
.
params
.
id
}
`
,
{
axios
.
get
(
`/reserves/
${
props
.
match
.
params
.
id
}
`
,
{
...
@@ -24,7 +28,7 @@ function Check(props) {
...
@@ -24,7 +28,7 @@ function Check(props) {
axios
.
delete
(
`/reserves/
${
reserve
[
index
].
_id
}
`
)
axios
.
delete
(
`/reserves/
${
reserve
[
index
].
_id
}
`
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
alert
(
"
삭제되었습니다!
"
)
alert
(
"
삭제되었습니다!
"
)
;
getReserve
();
getReserve
();
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
...
@@ -32,22 +36,18 @@ function Check(props) {
...
@@ -32,22 +36,18 @@ function Check(props) {
});
});
};
};
const
[
reserve
,
setReserve
]
=
useState
([]);
useEffect
(()
=>
{
getReserve
();
},
[])
return
(
return
(
<
div
>
<
div
>
<
Menu
/>
<
Menu
/>
<
div
className
=
""
>
check
<
div
className
=
""
>
<
table
className
=
"
table
"
>
<
table
className
=
"
table
"
>
<
thead
>
<
thead
>
<
tr
>
<
tr
>
<
th
>
아이디
<
/th
>
<
th
>
이름
<
/th
>
<
th
>
날짜
<
/th
>
<
th
>
날짜
<
/th
>
<
th
>
시간
<
/th
>
<
th
>
강의실
<
/th
>
<
th
>
강의실
<
/th
>
<
th
>
사용인원
<
/th
>
<
th
>
승인여부
<
/th
>
<
th
>
예약취소
<
/th
>
<
th
>
예약취소
<
/th
>
<
/tr
>
<
/tr
>
<
/thead
>
<
/thead
>
...
@@ -55,10 +55,11 @@ function Check(props) {
...
@@ -55,10 +55,11 @@ function Check(props) {
{
reserve
.
map
((
reserve
,
index
)
=>
{
{
reserve
.
map
((
reserve
,
index
)
=>
{
return
(
return
(
<
tr
key
=
{
index
}
>
<
tr
key
=
{
index
}
>
<
td
>
{
props
.
match
.
params
.
id
}
<
/td
>
<
td
>
{
reserve
.
name
}
<
/td
>
<
td
>
{
reserve
.
date
}
<
/td
>
<
td
>
{
reserve
.
date
}
<
/td
>
<
td
>
{
reserve
.
time
}
<
/td
>
<
td
>
{
reserve
.
room
}
<
/td
>
<
td
>
{
reserve
.
room
}
<
/td
>
<
td
>
{
reserve
.
num
}
<
/td
>
<
td
>
{
reserve
.
approve
?
"
사용허가
"
:
"
글쎄...
"
}
<
/td
>
<
td
>
<
td
>
<
button
onClick
=
{()
=>
remove
(
index
)}
className
=
"
btn btn-danger
"
>
<
button
onClick
=
{()
=>
remove
(
index
)}
className
=
"
btn btn-danger
"
>
취소
취소
...
...
server/client/src/Pages/LoginPage.js
View file @
813db703
import
React
,
{
useState
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
styled
from
'
styled-components
'
;
import
styled
from
'
styled-components
'
;
import
{
Link
,
Redirect
}
from
'
react-router-dom
'
;
import
{
Link
,
Redirect
}
from
'
react-router-dom
'
;
import
{
Formik
}
from
'
formik
'
;
import
{
Formik
}
from
'
formik
'
;
import
*
as
Yup
from
'
yup
'
;
import
*
as
Yup
from
'
yup
'
;
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
Logo
from
'
../icon.png
'
;
const
Log
=
styled
.
div
`
const
Asd
=
styled
.
div
`
background-color: #7B031D;
background-color: #7B031D;
&.web {
display : flex;
align-items: center;
}
&.mobile {
height : 20vh;
display : flex;
padding:0;
}
& .mob-head {
display: flex;
flex-direction: row;
height : 100%;
width: 100%;
justify-content: space-evenly;
}
& .mob-img {
max-width: 30vw;
}
`
`
const
Logo
=
styled
.
div
`
const
Asdf
=
styled
.
div
`
background-color: rgb(239, 218, 200);
background-color: rgb(239, 218, 200);
`
a {
color : #7B031D;
}
&.mob-formik {
height : 80vh;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
&.web-formik {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
& .mobb {
height: 35vh;
display: flex;
flex-direction: column;
justify-content: space-around;
}
& .webb {
flex-direction: column;
}
& .qwer {
display: flex;
justify-content: space-between;
height: 12vh;
width: 30vw;
margin-bottom: 25px;
}
& .web-input-form {
width: 80%;
justify-content: space-between;
align-content: space-around;
flex-direction: column;
display: flex;
}
& .mob-input-form {
}
`
function
Login
()
{
function
Login
()
{
const
[
state
,
setState
]
=
useState
(
false
);
const
[
state
,
setState
]
=
useState
(
false
);
const
[
mobile
,
setMobile
]
=
useState
(
false
);
useEffect
(()
=>
{
if
(
window
.
innerWidth
<
960
)
{
setMobile
(
true
)
}
else
{
setMobile
(
false
)
}
},
[]);
if
(
state
)
{
if
(
state
)
{
return
<
Redirect
to
=
"
/home
"
/>
;
return
<
Redirect
to
=
"
/home
"
/>
;
}
}
return
(
return
(
<
div
className
=
"
container-fluid
"
>
<
div
className
=
"
row vw-100 vh-100 m-0
"
>
<
div
className
=
"
row
"
>
<
Asd
className
=
{
"
col-md-4 col-12
"
+
(
mobile
?
"
mobile
"
:
"
web
"
)}
>
<
Logo
className
=
"
col-md-5 col-12
"
>
<
div
className
=
{
mobile
?
"
mob-head
"
:
""
}
>
<
h2
>
고려대학교
<
/h2
>
<
img
className
=
{
mobile
?
"
mob-img
"
:
"
img-fluid
"
}
src
=
{
Logo
}
/
>
<
h4
>
대관
시스템
<
/h4
>
<
div
className
=
{
"
d-flex
"
+
(
mobile
?
"
align-items-center
"
:
"
justify-content-center
"
)}
>
<
/Logo
>
<
h1
className
=
"
font-weight-bold text-white
"
>
고려대학교
<
br
/>
대관
서비스
<
/h1
>
<
Log
className
=
"
col-md-7 col-12
"
>
<
/div
>
<
/div
>
<
/Asd
>
<
Asdf
className
=
{
"
col-md-8 col-12
"
+
(
mobile
?
"
mob-formik p-0
"
:
"
web-formik
"
)}
>
<
Formik
<
Formik
initialValues
=
{{
id
:
''
,
password
:
''
}}
initialValues
=
{{
id
:
''
,
password
:
''
}}
validationSchema
=
{
Yup
.
object
({
validationSchema
=
{
Yup
.
object
({
...
@@ -44,6 +130,7 @@ function Login() {
...
@@ -44,6 +130,7 @@ function Login() {
data
:
values
,
data
:
values
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
if
(
res
.
status
===
404
)
return
alert
(
res
.
data
.
error
)
localStorage
.
setItem
(
'
token
'
,
res
.
data
.
token
);
localStorage
.
setItem
(
'
token
'
,
res
.
data
.
token
);
localStorage
.
setItem
(
'
_id
'
,
res
.
data
.
users
.
_id
);
localStorage
.
setItem
(
'
_id
'
,
res
.
data
.
users
.
_id
);
localStorage
.
setItem
(
'
name
'
,
res
.
data
.
users
.
name
);
localStorage
.
setItem
(
'
name
'
,
res
.
data
.
users
.
name
);
...
@@ -65,9 +152,10 @@ function Login() {
...
@@ -65,9 +152,10 @@ function Login() {
getFieldProps
,
// contain values, handleChange, handleBlur
getFieldProps
,
// contain values, handleChange, handleBlur
isSubmitting
,
isSubmitting
,
})
=>
(
})
=>
(
<
div
className
=
"
row justify-content-center align-items-center
"
>
<
form
onSubmit
=
{
handleSubmit
}
className
=
{
mobile
?
"
w-75 h-50vh
"
:
"
d-flex webb
"
}
>
<
form
onSubmit
=
{
handleSubmit
}
className
=
"
col-sm-3
"
>
<
div
className
=
{
mobile
?
"
mobb
"
:
"
qwer
"
}
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
{(
mobile
?
"
mob-
"
:
"
web-
"
)
+
"
input-form
"
}
>
<
div
className
=
{
"
form-group m-0
"
+
(
mobile
?
"
mb-2
"
:
""
)}
>
<
input
<
input
className
=
{(
touched
.
id
&&
errors
.
id
?
'
form-control is-invalid
'
:
"
form-control
"
)}
className
=
{(
touched
.
id
&&
errors
.
id
?
'
form-control is-invalid
'
:
"
form-control
"
)}
type
=
"
number
"
type
=
"
number
"
...
@@ -75,11 +163,8 @@ function Login() {
...
@@ -75,11 +163,8 @@ function Login() {
{...
getFieldProps
(
'
id
'
)}
{...
getFieldProps
(
'
id
'
)}
placeholder
=
"
Input Student Id
"
placeholder
=
"
Input Student Id
"
/>
/>
{
touched
.
id
&&
errors
.
id
?
(
<
div
className
=
"
invalid-feedback text-left
"
>
{
errors
.
id
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
div
className
=
"
form-group m
b-4
"
>
<
div
className
=
"
form-group m
-0
"
>
<
input
<
input
className
=
{(
touched
.
password
&&
errors
.
password
?
'
form-control is-invalid
'
:
"
form-control
"
)}
className
=
{(
touched
.
password
&&
errors
.
password
?
'
form-control is-invalid
'
:
"
form-control
"
)}
type
=
"
password
"
type
=
"
password
"
...
@@ -87,26 +172,20 @@ function Login() {
...
@@ -87,26 +172,20 @@ function Login() {
{...
getFieldProps
(
'
password
'
)}
{...
getFieldProps
(
'
password
'
)}
placeholder
=
"
Input Password
"
placeholder
=
"
Input Password
"
/>
/>
{
touched
.
password
&&
errors
.
password
?
(
<
div
className
=
"
invalid-feedback text-left
"
>
{
errors
.
password
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
button
type
=
"
submit
"
className
=
"
btn btn-dark
"
disabled
=
{
isSubmitting
}
>
Login
<
/button
>
<
button
><
Link
to
=
"
/home
"
>
홈
<
/Link></
button
>
<
div
><
/div
>
<
Link
to
=
"
/find
"
>
비밀번호를
잊으셨나요
?
<
/Link
>
<
div
><
/div
>
<
Link
to
=
"
/signup
"
>
회원이
아니신가요
?
<
/Link
>
<
/form
>
<
/div
>
<
/div
>
<
button
type
=
"
submit
"
className
=
{
"
btn btn-dark
"
+
(
mobile
?
"
w-100
"
:
"
w-20
"
)}
disabled
=
{
isSubmitting
}
>
Login
<
/button
>
<
/div
>
<
div
><
Link
to
=
"
/find
"
>
비밀번호를
잊으셨나요
?
<
/Link></
div
>
<
div
><
Link
to
=
"
/signup
"
>
회원이
아니신가요
?
<
/Link></
div
>
<
/form
>
)}
)}
<
/Formik
>
<
/
Log
>
<
/
Formik
>
<
/
div
>
<
/
Asdf
>
<
/div
>
<
/div
>
)
)
}
}
...
...
server/client/src/Pages/NoticePage.js
View file @
813db703
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
Menu
from
'
../Components/Menu
'
;
import
Menu
from
'
../Components/Menu
'
;
import
axios
from
'
axios
'
;
function
Notice
()
{
function
Notice
()
{
const
[
notices
,
setNotices
]
=
useState
([]);
useEffect
(()
=>
{
getNotice
();
},
[]);
function
getNotice
()
{
axios
.
get
(
`/notices`
)
.
then
(
res
=>
{
if
(
res
.
status
!==
201
)
{
alert
(
res
.
data
.
error
);
}
console
.
log
(
res
.
data
);
setNotices
(
res
.
data
);
})
.
catch
(
err
=>
{
alert
(
err
.
error
)
});
}
return
(
return
(
<
div
>
<
div
>
<
Menu
/>
<
Menu
/>
<
div
className
=
"
container
"
>
notice
<
div
className
=
"
container
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
{
notices
.
map
((
notice
)
=>
<
div
>
{
notice
.
notice_title
}
<
/div>
)
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
)
...
...
server/client/src/Pages/SignupPage.js
View file @
813db703
...
@@ -4,16 +4,51 @@ import * as Yup from 'yup';
...
@@ -4,16 +4,51 @@ import * as Yup from 'yup';
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
import
{
Link
,
Redirect
}
from
'
react-router-dom
'
;
import
{
Link
,
Redirect
}
from
'
react-router-dom
'
;
import
styled
from
'
styled-components
'
;
const
Nav
=
styled
.
nav
`
background-color: #7B031D;
height: 10vh;
a {
color: #ffffff;
}
`
const
Wow
=
styled
.
div
`
height: 90vh;
& #reCheck::after {
content: '비밀번호를 다시 입력하세요';
}
& #reCheck:not(.right) {
content: '비밀번호가 다릅니다.';
color: red;
}
& .asd {
display: flex;
flex-direction: column;
}
`
function
Signup
()
{
function
Signup
()
{
const
[
state
,
setState
]
=
useState
(
false
);
const
[
state
,
setState
]
=
useState
(
false
);
const
[
checkPw
,
setCheckPw
]
=
useState
(
true
);
if
(
state
)
{
if
(
state
)
{
return
<
Redirect
to
=
"
/login
"
/>
;
return
<
Redirect
to
=
"
/login
"
/>
;
}
}
return
(
return
(
<
div
className
=
"
d-flex flex-column justify-content-between vh-100
"
>
<
div
className
=
"
vh-100
"
>
<
Nav
className
=
"
navbar sticky-top navbar-expand-md
"
>
<
a
class
=
"
navbar-brand
"
href
=
"
#
"
>
회원가입
<
/a
>
<
/Nav
>
<
div
className
=
"
container-fluid
"
>
<
Wow
className
=
"
row justify-content-center rrooww
"
>
<
div
className
=
"
col-md-4 col-12 d-flex align-items-center h-100
"
>
<
Formik
<
Formik
initialValues
=
{{
name
:
''
,
id
:
''
,
password
:
''
,
password2
:
''
,
question
:
''
,
answer
:
''
}}
initialValues
=
{{
name
:
''
,
id
:
''
,
password
:
''
,
password2
:
''
,
question
:
''
,
answer
:
''
}}
validationSchema
=
{
Yup
.
object
({
validationSchema
=
{
Yup
.
object
({
...
@@ -58,20 +93,23 @@ function Signup() {
...
@@ -58,20 +93,23 @@ function Signup() {
getFieldProps
,
// contain values, handleChange, handleBlur
getFieldProps
,
// contain values, handleChange, handleBlur
isSubmitting
,
isSubmitting
,
})
=>
(
})
=>
(
<
div
className
=
"
row justify-content-center align-items-center
"
>
<
form
onSubmit
=
{
handleSubmit
}
className
=
"
asd
"
>
<
form
onSubmit
=
{
handleSubmit
}
className
=
"
col-sm-3
"
>
{
/* col-sm-3 */
}
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group
"
>
{
/* mb-4 */
}
<
div
className
=
{
touched
.
name
&&
errors
.
name
?
"
text-danger
"
:
""
}
>
이름을
입력하세요
<
/div
>
<
input
<
input
className
=
{(
touched
.
name
&&
errors
.
name
?
'
form-control is-invalid
'
:
"
form-control
"
)}
className
=
{(
touched
.
name
&&
errors
.
name
?
'
form-control is-invalid
'
:
"
form-control
"
)}
type
=
"
text
"
type
=
"
text
"
name
=
"
name
"
name
=
"
name
"
{...
getFieldProps
(
'
name
'
)}
{...
getFieldProps
(
'
name
'
)}
placeholder
=
"
이름
"
/>
placeholder
=
"
이름
"
/>
{
touched
.
name
&&
errors
.
name
?
(
<
div
className
=
"
invalid-feedback text-left
"
>
{
errors
.
name
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group
"
>
{
/* mb-4 */
}
<
div
className
=
{
touched
.
id
&&
errors
.
id
?
"
text-danger
"
:
""
}
>
학번을
입력하세요
<
/div
>
<
input
<
input
className
=
{(
touched
.
id
&&
errors
.
id
?
'
form-control is-invalid
'
:
"
form-control
"
)}
className
=
{(
touched
.
id
&&
errors
.
id
?
'
form-control is-invalid
'
:
"
form-control
"
)}
type
=
"
text
"
type
=
"
text
"
...
@@ -79,11 +117,14 @@ function Signup() {
...
@@ -79,11 +117,14 @@ function Signup() {
{...
getFieldProps
(
'
id
'
)}
{...
getFieldProps
(
'
id
'
)}
placeholder
=
"
학번/교번
"
placeholder
=
"
학번/교번
"
/>
/>
{
touched
.
id
&&
errors
.
id
?
(
{
/*
{touched.id && errors.id ? (
<div className="invalid-feedback text-left">{errors.id}</div>
<div className="invalid-feedback text-left">{errors.id}</div>
)
:
null
}
) : null}
*/
}
<
/div
>
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group
"
>
{
/* mb-4 */
}
<
div
className
=
{
touched
.
password
&&
errors
.
password
?
"
text-danger
"
:
""
}
>
비밀번호를
입력하세요
(
8
자리
이상
)
<
/div
>
<
input
<
input
className
=
{(
touched
.
password
&&
errors
.
password
?
'
form-control is-invalid
'
:
"
form-control
"
)}
className
=
{(
touched
.
password
&&
errors
.
password
?
'
form-control is-invalid
'
:
"
form-control
"
)}
type
=
"
password
"
type
=
"
password
"
...
@@ -91,23 +132,25 @@ function Signup() {
...
@@ -91,23 +132,25 @@ function Signup() {
{...
getFieldProps
(
'
password
'
)}
{...
getFieldProps
(
'
password
'
)}
placeholder
=
"
비밀번호
"
placeholder
=
"
비밀번호
"
/>
/>
{
touched
.
password
&&
errors
.
password
?
(
{
/*
{touched.password && errors.password ? (
<div className="invalid-feedback text-left">{errors.password}</div>
<div className="invalid-feedback text-left">{errors.password}</div>
)
:
null
}
) : null}
*/
}
<
/div
>
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group
"
>
{
/* mb-4 */
}
{
touched
.
password2
&&
errors
.
password2
?
setCheckPw
(
false
)
:
null
}
<
div
id
=
"
reCheck
"
className
=
{
checkPw
?
"
right
"
:
"
err
"
}
><
/div
>
<
input
<
input
className
=
{
(
touched
.
password2
&&
errors
.
password2
?
'
form-control is-invalid
'
:
"
form-control
"
)
}
className
=
{
touched
.
password2
&&
errors
.
password2
?
"
form-control is-invalid
"
:
"
form-control
"
}
type
=
"
password
"
type
=
"
password
"
name
=
"
password2
"
name
=
"
password2
"
{...
getFieldProps
(
'
password2
'
)}
{...
getFieldProps
(
'
password2
'
)}
placeholder
=
"
비밀번호 확인
"
placeholder
=
"
비밀번호 확인
"
/>
/>
{
touched
.
password2
&&
errors
.
password2
?
(
<
div
className
=
"
invalid-feedback text-left
"
>
{
errors
.
password2
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group
"
>
{
/* mb-4 */
}
<
label
>
본인
확인
질문
<
/label
>
<
label
>
본인
확인
질문
<
/label
>
<
Field
as
=
"
select
"
name
=
"
question
"
>
<
Field
as
=
"
select
"
name
=
"
question
"
>
<
option
value
=
""
>
질문을
선택하세요
<
/option
>
<
option
value
=
""
>
질문을
선택하세요
<
/option
>
...
@@ -116,27 +159,28 @@ function Signup() {
...
@@ -116,27 +159,28 @@ function Signup() {
<
option
value
=
"
place
"
>
기억에
남는
추억의
장소는
?
<
/option
>
<
option
value
=
"
place
"
>
기억에
남는
추억의
장소는
?
<
/option
>
<
/Field
>
<
/Field
>
<
/div
>
<
/div
>
<
div
className
=
"
form-group mb-4
"
>
<
div
className
=
"
form-group
"
>
{
/* mb-4 */
}
<
div
className
=
{
touched
.
answer
&&
errors
.
answer
?
"
text-danger
"
:
""
}
>
답변을
입력해주세요
.
<
/div
>
<
input
<
input
className
=
{(
touched
.
answer
&&
errors
.
answer
?
'
form-control is-invalid
'
:
"
form-control
"
)}
className
=
{(
touched
.
answer
&&
errors
.
answer
?
'
form-control is-invalid
'
:
"
form-control
"
)}
type
=
"
text
"
type
=
"
text
"
name
=
"
answer
"
name
=
"
answer
"
{...
getFieldProps
(
'
answer
'
)}
{...
getFieldProps
(
'
answer
'
)}
placeholder
=
"
Input answer
"
/>
placeholder
=
"
Input answer
"
/>
{
touched
.
answer
&&
errors
.
answer
?
(
<
div
className
=
"
invalid-feedback text-left
"
>
{
errors
.
answer
}
<
/div
>
)
:
null
}
<
/div
>
<
/div
>
<
button
type
=
"
submit
"
className
=
"
btn btn-dark
"
disabled
=
{
isSubmitting
}
>
<
button
type
=
"
submit
"
className
=
"
btn btn-dark
"
disabled
=
{
isSubmitting
}
>
회원가입
<
/button
>
Sign
Up
<
/button
>
<
button
class
=
"
btn btn-light
"
><
Link
to
=
"
/login
"
>
로그인
<
/Link></
button
>
<
button
class
=
"
btn btn-light
"
><
Link
to
=
"
/login
"
>
로그인
<
/Link></
button
>
<
button
class
=
"
btn btn-light
"
><
Link
to
=
"
/
"
>
홈
<
/Link></
button
>
<
button
class
=
"
btn btn-light
"
><
Link
to
=
"
/
"
>
홈
<
/Link></
button
>
<
/form
>
<
/form
>
<
/div
>
)}
)}
<
/Formik
>
<
/Formik
>
<
/div
>
<
/div
>
<
/Wow
>
<
/div
>
<
/div
>
);
);
}
}
...
...
server/client/src/icon.png
0 → 100644
View file @
813db703
2.44 MB
server/client/src/index.css
deleted
100644 → 0
View file @
6aa8c061
body
{
margin
:
0
;
font-family
:
-apple-system
,
BlinkMacSystemFont
,
'Segoe UI'
,
'Roboto'
,
'Oxygen'
,
'Ubuntu'
,
'Cantarell'
,
'Fira Sans'
,
'Droid Sans'
,
'Helvetica Neue'
,
sans-serif
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
}
code
{
font-family
:
source-code-pro
,
Menlo
,
Monaco
,
Consolas
,
'Courier New'
,
monospace
;
}
server/client/src/index.js
View file @
813db703
...
@@ -2,7 +2,8 @@ import React from 'react';
...
@@ -2,7 +2,8 @@ import React from 'react';
import
ReactDOM
from
'
react-dom
'
;
import
ReactDOM
from
'
react-dom
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
import
{
BrowserRouter
as
Router
,
Route
,
Redirect
,
Switch
}
from
'
react-router-dom
'
;
import
{
BrowserRouter
as
Router
,
Route
,
Redirect
,
Switch
}
from
'
react-router-dom
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
// import 'bootstrap';
// import 'bootstrap/dist/css/bootstrap.css';
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
{
PrivateRoute
}
from
'
./Components/PrivateRoute
'
;
import
{
PrivateRoute
}
from
'
./Components/PrivateRoute
'
;
...
@@ -28,7 +29,7 @@ ReactDOM.render(
...
@@ -28,7 +29,7 @@ ReactDOM.render(
<
Route
path
=
"
/signup
"
component
=
{
Signup
}
/
>
<
Route
path
=
"
/signup
"
component
=
{
Signup
}
/
>
<
Route
path
=
"
/find
"
component
=
{
Find
}
/
>
<
Route
path
=
"
/find
"
component
=
{
Find
}
/
>
<
Route
path
=
"
/change
"
component
=
{
Change
}
/
>
<
Route
path
=
"
/change
"
component
=
{
Change
}
/
>
<
Route
path
=
"
/apply
"
component
=
{
Apply
}
/
>
<
Route
path
=
"
/apply
/:id
"
component
=
{
Apply
}
/
>
<
Route
path
=
"
/check/:id
"
component
=
{
Check
}
/
>
<
Route
path
=
"
/check/:id
"
component
=
{
Check
}
/
>
<
Route
path
=
"
/notice
"
component
=
{
Notice
}
/
>
<
Route
path
=
"
/notice
"
component
=
{
Notice
}
/
>
<
Redirect
path
=
"
/
"
to
=
"
/
"
/>
<
Redirect
path
=
"
/
"
to
=
"
/
"
/>
...
...
server/client/src/logo.svg
deleted
100644 → 0
View file @
6aa8c061
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 841.9 595.3"
>
<g
fill=
"#61DAFB"
>
<path
d=
"M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"
/>
<circle
cx=
"420.9"
cy=
"296.5"
r=
"45.7"
/>
<path
d=
"M520.5 78.1z"
/>
</g>
</svg>
server/package-lock.json
View file @
813db703
This diff is collapsed.
Click to expand it.
server/routes/notices.js
0 → 100644
View file @
813db703
const
express
=
require
(
'
express
'
);
const
Notice
=
require
(
'
../schemas/notice
'
);
const
router
=
express
.
Router
();
router
.
get
(
'
/
'
,
function
(
req
,
res
,
next
)
{
Notice
.
find
({}).
sort
({
post_date
:
-
1
})
.
then
((
notices
)
=>
{
res
.
json
(
notices
);
})
.
catch
((
err
)
=>
{
console
.
error
(
err
);
next
(
err
);
});
});
module
.
exports
=
router
;
\ No newline at end of file
server/routes/reserves.js
View file @
813db703
...
@@ -8,15 +8,15 @@ router.post('/', function (req, res, next) {
...
@@ -8,15 +8,15 @@ router.post('/', function (req, res, next) {
console
.
log
(
'
/reserve post req.body
'
,
req
.
body
)
console
.
log
(
'
/reserve post req.body
'
,
req
.
body
)
const
reserve
=
new
Reserve
({
const
reserve
=
new
Reserve
({
id
:
req
.
body
.
_id
,
date
:
req
.
body
.
date
,
date
:
req
.
body
.
date
,
time
:
req
.
body
.
time
,
time
:
req
.
body
.
time
,
room
:
req
.
body
.
room
,
room
:
req
.
body
.
room
,
name
:
req
.
body
.
name
,
name
:
req
.
body
.
name
,
id
:
req
.
body
.
_id
,
reason
:
req
.
body
.
reason
,
reason
:
req
.
body
.
reason
,
member
:
req
.
body
.
member
,
students
:
req
.
body
.
students
,
approve
:
req
.
body
.
approve
,
approve
:
req
.
body
.
approve
,
num
:
req
.
body
.
num
,
num
:
req
.
body
.
students
.
length
+
1
,
});
});
reserve
.
save
()
reserve
.
save
()
...
...
server/routes/users.js
View file @
813db703
...
@@ -34,6 +34,15 @@ router.post('/', function (req, res, next) {
...
@@ -34,6 +34,15 @@ router.post('/', function (req, res, next) {
})
})
});
});
router
.
get
(
'
/:_id
'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
'
/users get req.params
'
,
req
.
params
)
User
.
findOne
({
_id
:
req
.
params
.
_id
},
function
(
err
,
user
)
{
if
(
err
)
return
res
.
status
(
500
).
json
({
error
:
err
});
res
.
status
(
201
).
json
(
user
);
})
})
router
.
put
(
'
/change/:id
'
,
function
(
req
,
res
,
next
)
{
router
.
put
(
'
/change/:id
'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
'
/change put req.body
'
,
req
.
params
)
console
.
log
(
'
/change put req.body
'
,
req
.
params
)
User
.
findOne
({
_id
:
req
.
params
.
id
},
'
password
'
,
function
(
err
,
user
)
{
User
.
findOne
({
_id
:
req
.
params
.
id
},
'
password
'
,
function
(
err
,
user
)
{
...
...
server/schemas/notice.js
0 → 100644
View file @
813db703
const
mongoose
=
require
(
'
mongoose
'
);
const
{
Schema
}
=
mongoose
;
const
noticeSchema
=
new
Schema
({
notice_img
:
{
type
:
Array
,
},
notice_title
:
{
type
:
String
,
required
:
true
,
},
notice_author
:
{
type
:
String
,
// default: "나야나"
required
:
true
,
},
post_date
:
{
type
:
Date
,
default
:
Date
.
now
,
required
:
true
,
},
notice_content
:
{
type
:
String
,
required
:
true
,
},
});
module
.
exports
=
mongoose
.
model
(
'
Notice
'
,
noticeSchema
);
server/schemas/reserve.js
View file @
813db703
...
@@ -27,8 +27,8 @@ const reserveSchema = new Schema({
...
@@ -27,8 +27,8 @@ const reserveSchema = new Schema({
type
:
String
,
type
:
String
,
},
},
member
:
{
students
:
{
type
:
String
,
type
:
Array
,
},
},
approve
:
{
approve
:
{
...
...
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