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
b9687379
Commit
b9687379
authored
Sep 25, 2020
by
Lee Jin Ju
Browse files
신경쓰지 마세요
parent
e619c1ef
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
server/app.js
View file @
b9687379
...
...
@@ -6,7 +6,7 @@ var logger = require('morgan');
var
indexRouter
=
require
(
'
./routes/index
'
);
var
usersRouter
=
require
(
'
./routes/users
'
);
const
{
connect
}
=
require
(
'
http2
'
);
const
connect
=
require
(
'
./schemas
'
);
var
app
=
express
();
connect
();
...
...
server/client/src/Pages/HomePage.js
View file @
b9687379
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
Menu
from
'
../Components/Menu
'
;
import
styled
from
'
styled-components
'
;
const
Schedule
=
styled
.
div
`
& ul {
list-style-type: none;
}
& .cd-schedule__events {
width: 100%;
> ul {
display: flex;
flex-wrap: nowrap;
}
}
& .cd-schedule__group {
flex-basis: 0;
flex-grow: 1;
}
& .cd-schedule__event {
position: absolute;
z-index: 3;
width: calc(100% + 2px); // top position and height will be set using js
left: -1px;
}
`
function
Home
()
{
return
(
<
div
>
<
Menu
/>
<
div
className
=
"
container
"
>
home
<
Schedule
className
=
"
row cd-schedule cd-schedule--loading margin-top-lg margin-bottom-lg js-cd-schedule
"
>
<
div
className
=
"
col-1 cd-schedule__timeline
"
>
<
ul
>
<
li
><
span
>
09
:
00
<
/span></
li
>
<
li
><
span
>
10
:
00
<
/span></
li
>
<
li
><
span
>
11
:
00
<
/span></
li
>
<
li
><
span
>
12
:
00
<
/span></
li
>
<
li
><
span
>
13
:
00
<
/span></
li
>
<
li
><
span
>
14
:
00
<
/span></
li
>
<
li
><
span
>
15
:
00
<
/span></
li
>
<
li
><
span
>
16
:
00
<
/span></
li
>
<
li
><
span
>
17
:
00
<
/span></
li
>
<
li
><
span
>
18
:
00
<
/span></
li
>
<
li
><
span
>
19
:
00
<
/span></
li
>
<
li
><
span
>
20
:
00
<
/span></
li
>
<
li
><
span
>
21
:
00
<
/span></
li
>
<
li
><
span
>
22
:
00
<
/span></
li
>
<
/ul
>
<
/div
>
<
div
className
=
"
col-6 cd-schedule__events
"
>
<
ul
>
<
li
className
=
"
cd-schedule__group
"
>
<
div
className
=
"
cd-schedule__top-info
"
><
span
>
월
<
/span></
div
>
<
ul
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
10:00
"
data
-
end
=
"
12:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
확률론
<
/em
>
<
/a
>
<
/li
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
17:00
"
data
-
end
=
"
18:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
수치해석학
<
/em
>
<
/a
>
<
/li
>
<
/ul
>
<
/li
>
<
li
className
=
"
cd-schedule__group
"
>
<
div
className
=
"
cd-schedule__top-info
"
><
span
>
화
<
/span></
div
>
<
ul
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
11:00
"
data
-
end
=
"
12:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
해석학
<
/em
>
<
/a
>
<
/li
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
16:00
"
data
-
end
=
"
18:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
수치해석학
<
/em
>
<
/a
>
<
/li
>
<
/ul
>
<
/li
>
<
li
className
=
"
cd-schedule__group
"
>
<
div
className
=
"
cd-schedule__top-info
"
><
span
>
수
<
/span></
div
>
<
ul
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
9:00
"
data
-
end
=
"
10:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
산업수학
<
/em
>
<
/a
>
<
/li
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
18:00
"
data
-
end
=
"
19:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
해석학
<
/em
>
<
/a
>
<
/li
>
<
/ul
>
<
/li
>
<
li
className
=
"
cd-schedule__group
"
>
<
div
className
=
"
cd-schedule__top-info
"
><
span
>
목
<
/span></
div
>
<
ul
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
9:00
"
data
-
end
=
"
11:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
해석학
<
/em
>
<
/a
>
<
/li
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
11:00
"
data
-
end
=
"
12:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
확률론
<
/em
>
<
/a
>
<
/li
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
16:00
"
data
-
end
=
"
17:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
수치해석학
<
/em
>
<
/a
>
<
/li
>
<
/ul
>
<
/li
>
<
li
className
=
"
cd-schedule__group
"
>
<
div
className
=
"
cd-schedule__top-info
"
><
span
>
금
<
/span></
div
>
<
ul
>
<
li
className
=
"
cd-schedule__event
"
>
<
a
data
-
start
=
"
13:00
"
data
-
end
=
"
15:00
"
data
-
content
=
"
event-abs-circuit
"
data
-
event
=
"
event-1
"
href
=
"
#0
"
>
<
em
className
=
"
cd-schedule__name
"
>
산업수학
<
/em
>
<
/a
>
<
/li
>
<
/ul
>
<
/li
>
<
/ul
>
<
/div
>
{
/* <div class="cd-schedule-modal">
<header class="cd-schedule-modal__header">
<div class="cd-schedule-modal__content">
<span class="cd-schedule-modal__date"></span>
<h3 class="cd-schedule-modal__name"></h3>
</div>
<div class="cd-schedule-modal__header-bg"></div>
</header>
<div class="cd-schedule-modal__body">
<div class="cd-schedule-modal__event-info"></div>
<div class="cd-schedule-modal__body-bg"></div>
</div>
<a href="#0" class="cd-schedule-modal__close text-replace">Close</a>
</div> */
}
<
/Schedule
>
<
/div
>
<
/div
>
)
...
...
server/client/src/Schemas/index.js
deleted
100644 → 0
View file @
e619c1ef
const
mongoose
=
require
(
'
mongoose
'
);
module
.
exports
=
()
=>
{
const
connect
=
()
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
mongoose
.
set
(
'
debug
'
,
true
);
}
mongoose
.
connect
(
'
mongodb://hijinju:highlight@localhost:27017/admin
'
,
{
dbName
:
'
KU_Rental
'
,
},
(
error
)
=>
{
if
(
error
)
{
console
.
log
(
'
몽고디비 연결 에러
'
,
error
);
}
else
{
console
.
log
(
'
몽고디비 연결 성공
'
);
}
});
};
connect
();
mongoose
.
connection
.
on
(
'
error
'
,
(
error
)
=>
{
console
.
error
(
'
몽고디비 연결 에러
'
,
error
);
});
mongoose
.
connection
.
on
(
'
disconnected
'
,
()
=>
{
console
.
error
(
'
몽고디비 연결이 끊겼습니다. 연결을 재시도합니다.
'
);
connect
();
});
require
(
'
./user
'
);
require
(
'
./reserve
'
);
};
server/client/src/Schemas/reserve.js
deleted
100644 → 0
View file @
e619c1ef
const
mongoose
=
require
(
'
mongoose
'
);
const
{
Schema
}
=
mongoose
;
const
reserveSchema
=
new
Schema
({
date
:
{
type
:
String
,
},
time
:
{
type
:
String
,
},
room
:{
type
:
String
,
},
name
:
{
//대표자 이름
type
:
String
,
},
id
:{
type
:
Number
,
},
reason
:
{
type
:
String
,
},
member
:
{
type
:
String
,
},
approve
:
{
type
:
Boolean
,
},
num
:
{
type
:
Number
,
},
});
module
.
exports
=
mongoose
.
model
(
'
Reserve
'
,
reserveSchema
);
\ No newline at end of file
server/client/src/Schemas/user.js
deleted
100644 → 0
View file @
e619c1ef
const
mongoose
=
require
(
'
mongoose
'
);
const
bcrypt
=
require
(
"
bcrypt
"
);
const
saltRounds
=
10
;
const
{
Schema
}
=
mongoose
;
const
userSchema
=
new
Schema
({
name
:
{
type
:
String
,
required
:
true
,
},
password
:
{
type
:
String
,
},
id
:
{
type
:
Number
,
required
:
true
,
},
});
userSchema
.
pre
(
"
save
"
,
function
(
next
)
{
let
user
=
this
;
//User모델 자체를 가르킴.
//model 안의 paswsword가 변경 또는 생성될 때 암호화
if
(
user
.
isModified
(
"
password
"
))
{
bcrypt
.
genSalt
(
saltRounds
,
function
(
err
,
salt
)
{
if
(
err
)
return
next
(
err
);
bcrypt
.
hash
(
user
.
password
,
salt
,
function
(
err
,
hash
)
{
if
(
err
)
return
next
(
err
);
user
.
password
=
hash
;
next
();
});
});
}
else
{
next
();
}
});
module
.
exports
=
mongoose
.
model
(
'
User
'
,
userSchema
);
\ No newline at end of file
server/client/src/index.js
View file @
b9687379
...
...
@@ -4,30 +4,22 @@ import * as serviceWorker from './serviceWorker';
import
{
BrowserRouter
as
Router
,
Route
,
Redirect
,
Switch
}
from
'
react-router-dom
'
;
import
'
bootstrap/dist/css/bootstrap.css
'
;
<<<<<<<
HEAD
import
Login
from
'
./Pages/LoginPage
'
;
import
Home
from
'
./Pages/HomePage
'
;
import
Signup
from
'
./Pages/SignupPage
'
;
import
Apply
from
'
./Pages/ApplyPage
'
;
import
Check
from
'
./Pages/CheckPage
'
;
import
Notice
from
'
./Pages/NoticePage
'
;
=======
import
Login
from
'
./Pages/Login
'
;
import
Home
from
'
./Pages/Home
'
;
>>>>>>>
origin
/
rkyoung7
ReactDOM
.
render
(
<
Router
>
<
Switch
>
<
Route
exact
path
=
"
/
"
component
=
{
Login
}
/
>
<
Route
path
=
"
/home
"
component
=
{
Home
}
/
>
<<<<<<<
HEAD
<
Route
path
=
"
/signup
"
component
=
{
Signup
}
/
>
<
Route
path
=
"
/apply
"
component
=
{
Apply
}
/
>
<
Route
path
=
"
/check
"
component
=
{
Check
}
/
>
<
Route
path
=
"
/notice
"
component
=
{
Notice
}
/
>
=======
>>>>>>>
origin
/
rkyoung7
<
/Switch
>
<
/Router>
,
document
.
getElementById
(
'
root
'
)
...
...
@@ -37,7 +29,3 @@ ReactDOM.render(
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker
.
unregister
();
\ No newline at end of file
<<<<<<<
HEAD
=======
>>>>>>>
origin
/
rkyoung7
server/package-lock.json
View file @
b9687379
This diff is collapsed.
Click to expand it.
server/package.json
View file @
b9687379
...
...
@@ -12,10 +12,7 @@
"dotenv"
:
"^8.2.0"
,
"express"
:
"~4.16.1"
,
"http-errors"
:
"~1.6.3"
,
<<<<<<<
HEAD
"jsonwebtoken"
:
"^8.5.1"
,
=======
>>>>>>>
origin/rkyoung
7
"mongoose"
:
"^5.10.5"
,
"morgan"
:
"~1.9.1"
,
"pug"
:
"2.0.0-beta11"
...
...
server/schemas/index.js
View file @
b9687379
...
...
@@ -5,11 +5,7 @@ module.exports = () => {
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
mongoose
.
set
(
'
debug
'
,
true
);
}
<<<<<<<
HEAD
mongoose
.
connect
(
'
mongodb://hijinju:highlight@localhost:27017/admin
'
,
{
=======
mongoose
.
connect
(
'
mongodb://rkyoung7:rkdud127@localhost:27017/admin
'
,
{
>>>>>>>
origin
/
rkyoung7
dbName
:
'
KU_Rental
'
,
},
(
error
)
=>
{
if
(
error
)
{
...
...
@@ -29,9 +25,4 @@ module.exports = () => {
});
require
(
'
./user
'
);
require
(
'
./reserve
'
);
<<<<<<<
HEAD
};
=======
};
\ No newline at end of file
>>>>>>>
origin
/
rkyoung7
server/schemas/reserve.js
View file @
b9687379
...
...
@@ -41,8 +41,4 @@ const reserveSchema = new Schema({
});
<<<<<<<
HEAD
module
.
exports
=
mongoose
.
model
(
'
Reserve
'
,
reserveSchema
);
=======
module
.
exports
=
mongoose
.
model
(
'
Reserve
'
,
reserveSchema
);
>>>>>>>
origin
/
rkyoung7
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