Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대철
/
CafeRecommend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
최정민
2021-06-01 18:52:11 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
318e9d9ba7a6b92d059e6730d9b8cd3a87865cb2
318e9d9b
1 parent
edd215f2
FEAT : 추천 api 로직 추가
-
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
3 deletions
routes/index.js
sessions/Zw_s5YkYvvjFW51ZNMNj6buHGaYiQ5Ks.json
sessions/buWW5Fx08ygLwn2SzJPC5dAtYd9h4Moy.json
sessions/is5MA-mJkT3d4GwInJepYgseAKN9HnUd.json
sessions/tbg8ejYW80RsSgS8AydKQN4v1HdbjBUn.json
views/map.ejs
routes/index.js
View file @
318e9d9
...
...
@@ -242,5 +242,30 @@ router.post("/review", function (req, res) {
);
});
router
.
get
(
"/recommend"
,
function
(
req
,
res
){
var
sql
=
"SELECT CAFE_ID FROM REVIEW WHERE PRICE >= ? AND KINDNESS >= ? AND NOISE >= ? AND ACCESSIBILITY >= ?"
;
var
parameter
=
[
5
-
req
.
session
.
user
.
price
,
5
-
req
.
session
.
user
.
kindness
,
5
-
req
.
session
.
user
.
noise
,
5
-
req
.
session
.
user
.
accessibility
];
connection
.
query
(
sql
,
parameter
,
function
(
err
,
row
)
{
if
(
err
){
console
.
log
(
err
);
}
else
if
(
row
.
length
>
0
)
{
//만족하는 조건이 한개도없을때
var
parameter2
=
[
4
-
req
.
session
.
user
.
price
,
4
-
req
.
session
.
user
.
kindness
,
4
-
req
.
session
.
user
.
noise
,
4
-
req
.
session
.
user
.
accessibility
];
connection
.
query
(
sql
,
parameter2
,
function
(
err
,
row
)
{
if
(
err
){
console
.
log
(
err
);
}
else
{
console
.
log
(
row
);
res
.
render
(
"map"
,
{
user
:
req
.
session
.
user
});
}
});
}
else
{
console
.
log
(
row
);
res
.
render
(
"map"
,
{
user
:
req
.
session
.
user
});
}
});
});
module
.
exports
=
router
;
...
...
sessions/Zw_s5YkYvvjFW51ZNMNj6buHGaYiQ5Ks.json
deleted
100644 → 0
View file @
edd215f
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622135767964
,
"user"
:{
"email"
:
"kdc9619@khu.ac.kr"
,
"picture"
:
"https://lh3.googleusercontent.com/a/AATXAJyP14ipRboJZ8T5-oNS3sRp4CG8wKCEwVABQ5G_=s96-c"
,
"nickname"
:
"Meerkat"
,
"age"
:
"26"
,
"gender"
:
"male"
}}
\ No newline at end of file
sessions/buWW5Fx08ygLwn2SzJPC5dAtYd9h4Moy.json
deleted
100644 → 0
View file @
edd215f
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622125471625
,
"user"
:{
"name"
:
"최정민[학생](소프트웨어융합대학 컴퓨터공학과)"
,
"email"
:
"cjm2021401@khu.ac.kr"
,
"picture"
:
"https://lh3.googleusercontent.com/a/AATXAJzFD3R6CaL2NpysVrfvdGqcQ83vh_wpbN_5hj-0=s96-c"
}}
\ No newline at end of file
sessions/is5MA-mJkT3d4GwInJepYgseAKN9HnUd.json
0 → 100644
View file @
318e9d9
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622539560784
,
"user"
:{
"email"
:
"cjm2021401@khu.ac.kr"
,
"picture"
:
"https://lh3.googleusercontent.com/a/AATXAJzFD3R6CaL2NpysVrfvdGqcQ83vh_wpbN_5hj-0=s96-c"
,
"nickname"
:
"초보베이시스트"
,
"age"
:
"16"
,
"gender"
:
"male"
,
"price"
:
"2"
,
"kindness"
:
"3"
,
"noise"
:
"1"
,
"accessibility"
:
"4"
}}
\ No newline at end of file
sessions/tbg8ejYW80RsSgS8AydKQN4v1HdbjBUn.json
deleted
100644 → 0
View file @
edd215f
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622139888672
,
"user"
:{
"email"
:
"cjm104174@gmail.com"
,
"picture"
:
"https://lh3.googleusercontent.com/a-/AOh14Gh3nytGsPbviGhkznR8HIwrL6o7xBIoFL08nIeU=s96-c"
,
"nickname"
:
"Mayf"
,
"age"
:
25
,
"gender"
:
"male"
}}
\ No newline at end of file
views/map.ejs
View file @
318e9d9
...
...
@@ -136,6 +136,11 @@
>
Logout
<span
class=
"sr-only"
>
(current)
</span></a
>
</li>
<li
class=
"nav-item active"
>
<a
class=
"nav-link"
style=
"color: #ffffff"
href=
"/recommend"
>
Recommend
<span
class=
"sr-only"
>
(current)
</span>
</a>
</li>
</ul>
</div>
</nav>
...
...
Please
register
or
login
to post a comment