diff --git a/client/.eslintcache b/client/.eslintcache
index 8eea89876854b3c6da2ffc7d5c6b05bd6e460c01..cd3d8e307e9bca935765063f5b52c99012317882 100644
--- a/client/.eslintcache
+++ b/client/.eslintcache
@@ -1 +1 @@
-[{"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\index.js":"1","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\reportWebVitals.js":"2","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Place.js":"3","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js":"4","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js":"5","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js":"6"},{"size":939,"mtime":1611497444385,"results":"7","hashOfConfig":"8"},{"size":375,"mtime":1611254909401,"results":"9","hashOfConfig":"8"},{"size":1650,"mtime":1611504929008,"results":"10","hashOfConfig":"8"},{"size":2199,"mtime":1611254909395,"results":"11","hashOfConfig":"8"},{"size":8492,"mtime":1611514455100,"results":"12","hashOfConfig":"8"},{"size":1474,"mtime":1611504101870,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"16"},"13y9yvi",{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"19","messages":"20","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\index.js",["27"],"import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport 'bootstrap/dist/css/bootstrap.min.css';\r\nimport App from './Pages/App';\r\nimport Search from './Pages/Search';\r\nimport axios from 'axios';\r\nimport reportWebVitals from './reportWebVitals';\r\nimport {\r\n BrowserRouter as Router,\r\n Switch,\r\n Route,\r\n Redirect,\r\n} from \"react-router-dom\";\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\reportWebVitals.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Place.js",["28","29"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js",["30"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js",[],{"ruleId":"31","severity":1,"message":"32","line":7,"column":8,"nodeType":"33","messageId":"34","endLine":7,"endColumn":13},{"ruleId":"31","severity":1,"message":"35","line":7,"column":14,"nodeType":"33","messageId":"34","endLine":7,"endColumn":19},{"ruleId":"36","severity":1,"message":"37","line":21,"column":6,"nodeType":"38","endLine":21,"endColumn":8,"suggestions":"39"},{"ruleId":null,"fatal":true,"severity":2,"message":"40","line":21,"column":4},"no-unused-vars","'axios' is defined but never used.","Identifier","unusedVar","'setDb' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getReview'. Either include it or remove the dependency array.","ArrayExpression",["41"],"Parsing error: Unexpected token\n\n 19 | const [association, setAssociation] = useState([])\n 20 | \n> 21 | <<<<<<< HEAD\n | ^\n 22 | // console.log(\"search###############\", search)\n 23 | const getPlace = () => {\n 24 | axios.get(`/api/search/places?keyword=${search}`)",{"desc":"42","fix":"43"},"Update the dependencies array to be: [getReview]",{"range":"44","text":"45"},[605,607],"[getReview]"]
\ No newline at end of file
+[{"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\index.js":"1","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\reportWebVitals.js":"2","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Place.js":"3","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js":"4","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js":"5","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js":"6"},{"size":939,"mtime":1611497444385,"results":"7","hashOfConfig":"8"},{"size":375,"mtime":1611254909401,"results":"9","hashOfConfig":"8"},{"size":1650,"mtime":1611504929008,"results":"10","hashOfConfig":"8"},{"size":2199,"mtime":1611254909395,"results":"11","hashOfConfig":"8"},{"size":8320,"mtime":1611549647705,"results":"12","hashOfConfig":"8"},{"size":1474,"mtime":1611504101870,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"16"},"13y9yvi",{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"19","messages":"20","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"21"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","errorCount":0,"warningCount":7,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\index.js",["28"],"import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport 'bootstrap/dist/css/bootstrap.min.css';\r\nimport App from './Pages/App';\r\nimport Search from './Pages/Search';\r\nimport axios from 'axios';\r\nimport reportWebVitals from './reportWebVitals';\r\nimport {\r\n BrowserRouter as Router,\r\n Switch,\r\n Route,\r\n Redirect,\r\n} from \"react-router-dom\";\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\reportWebVitals.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Place.js",["29","30"],"import axios from 'axios';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Modal, Container, Row, Button, } from 'react-bootstrap';\r\n\r\nfunction Place(props) {\r\n const [reviews, setReviews] = useState()\r\n const [db, setDb] = useState(false)\r\n const getReview = () => {\r\n axios({ url: `/api/review?keyword=${props.place.name}`, method: 'post', data: { db: db } })\r\n .then(res => {\r\n console.log(\"place res.data\", res.data)\r\n setReviews(res.data)\r\n })\r\n .catch(err => {\r\n console.log(err)\r\n })\r\n }\r\n\r\n useEffect(() => {\r\n getReview();\r\n }, [])\r\n\r\n return (\r\n \r\n \r\n \r\n {props.index + 1}. {props.place.name}\r\n \r\n \r\n \r\n \r\n {Array.isArray(reviews) ? reviews.map((review, index) => {\r\n return (\r\n \r\n {review.title} \r\n {review.summary}
\r\n {review.content}
\r\n
\r\n )\r\n })\r\n : \"리뷰가 없습니다.\"}\r\n \r\n\r\n \r\n \r\n Close \r\n \r\n \r\n );\r\n}\r\n\r\nexport default Place;\r\n","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js",["31","32","33","34","35","36","37"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js",[],{"ruleId":"38","severity":1,"message":"39","line":7,"column":8,"nodeType":"40","messageId":"41","endLine":7,"endColumn":13},{"ruleId":"38","severity":1,"message":"42","line":7,"column":14,"nodeType":"40","messageId":"41","endLine":7,"endColumn":19},{"ruleId":"43","severity":1,"message":"44","line":21,"column":6,"nodeType":"45","endLine":21,"endColumn":8,"suggestions":"46"},{"ruleId":"38","severity":1,"message":"47","line":2,"column":16,"nodeType":"40","messageId":"41","endLine":2,"endColumn":24},{"ruleId":"38","severity":1,"message":"48","line":16,"column":12,"nodeType":"40","messageId":"41","endLine":16,"endColumn":18},{"ruleId":"43","severity":1,"message":"49","line":70,"column":8,"nodeType":"45","endLine":70,"endColumn":10,"suggestions":"50"},{"ruleId":"43","severity":1,"message":"51","line":76,"column":8,"nodeType":"45","endLine":76,"endColumn":21,"suggestions":"52"},{"ruleId":"43","severity":1,"message":"53","line":88,"column":8,"nodeType":"45","endLine":88,"endColumn":15,"suggestions":"54"},{"ruleId":"38","severity":1,"message":"55","line":91,"column":11,"nodeType":"40","messageId":"41","endLine":91,"endColumn":17},{"ruleId":"56","severity":1,"message":"57","line":155,"column":35,"nodeType":"58","endLine":155,"endColumn":76},"no-unused-vars","'axios' is defined but never used.","Identifier","unusedVar","'setDb' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getReview'. Either include it or remove the dependency array.","ArrayExpression",["59"],"'Redirect' is defined but never used.","'mobile' is assigned a value but never used.","React Hook useEffect has a missing dependency: 'getAssociation'. Either include it or remove the dependency array.",["60"],"React Hook useEffect has a missing dependency: 'index'. Either include it or remove the dependency array. You can also replace multiple useState variables with useReducer if 'setPagePlace' needs the current value of 'index'.",["61"],"React Hook useEffect has missing dependencies: 'getAssociation', 'props.history', and 'search'. Either include them or remove the dependency array.",["62"],"'places' is assigned a value but never used.","react/jsx-no-duplicate-props","No duplicate props allowed","JSXAttribute",{"desc":"63","fix":"64"},{"desc":"65","fix":"66"},{"desc":"67","fix":"68"},{"desc":"69","fix":"70"},"Update the dependencies array to be: [getReview]",{"range":"71","text":"72"},"Update the dependencies array to be: [getAssociation]",{"range":"73","text":"74"},"Update the dependencies array to be: [association, index]",{"range":"75","text":"76"},"Update the dependencies array to be: [getAssociation, props.history, search, state]",{"range":"77","text":"78"},[605,607],"[getReview]",[2392,2394],"[getAssociation]",[2552,2565],"[association, index]",[2839,2846],"[getAssociation, props.history, search, state]"]
\ No newline at end of file
diff --git a/client/debug.log b/client/debug.log
index ee8e8fe50e5b1138688a63daaceee1586c93cf78..5d1133ac53924c0d96966c869894aa624f4f80c2 100644
--- a/client/debug.log
+++ b/client/debug.log
@@ -1,2 +1,3 @@
[0122/091810.668:ERROR:directory_reader_win.cc(43)] FindFirstFile: θ ã ϴ. (0x3)
[0125/001732.960:ERROR:directory_reader_win.cc(43)] FindFirstFile: θ ã ϴ. (0x3)
+[0125/093515.306:ERROR:directory_reader_win.cc(43)] FindFirstFile: θ ã ϴ. (0x3)
diff --git a/client/src/Pages/Search.js b/client/src/Pages/Search.js
index 49b847716c1eee666e347e9bfc5762c3782d9c69..eba8a956e63bd99d9f45057e7cc71a0a8a575205 100644
--- a/client/src/Pages/Search.js
+++ b/client/src/Pages/Search.js
@@ -14,32 +14,33 @@ function Search(props) {
const [showSet, setShowSet] = useState([false, false, false, false]);
const [search, setSearch] = useState(queryString.parse(props.location.search).keyword);
const [mobile, setMobile] = useState();
- const [place, setPlace] = useState([{ name: "", category: "", address: "" }])
- const [imgUrl, setImgUrl] = useState([])
+ // const [place, setPlace] = useState([{ name: "", category: "", address: "" }])
+ // const [imgUrl, setImgUrl] = useState([])
const [association, setAssociation] = useState([])
+ const [pagePlace, setPagePlace] = useState([])
// console.log("search###############", search)
- const getPlace = () => {
- axios.get(`/api/search/places?keyword=${search}`)
- .then(res => {
- console.log("places=", res.data)
- setPlace(res.data)
- })
- .catch(err => {
- console.log('search.places 에러 발생', err)
- })
- }
-
- const getImg = () => {
- axios.get(`/api/search/imges?keyword=${search}`)
- .then(res => {
- console.log("images=", res.data)
- setImgUrl(res.data)
- })
- .catch(err => {
- console.log('search.images 에러 발생', err)
- })
- }
+ // const getPlace = () => {
+ // axios.get(`/api/search/places?keyword=${search}`)
+ // .then(res => {
+ // console.log("places=", res.data)
+ // // setPlace(res.data)
+ // })
+ // .catch(err => {
+ // console.log('search.places 에러 발생', err)
+ // })
+ // }
+
+ // const getImg = () => {
+ // axios.get(`/api/search/imges?keyword=${search}`)
+ // .then(res => {
+ // console.log("images=", res.data)
+ // // setImgUrl(res.data)
+ // })
+ // .catch(err => {
+ // console.log('search.images 에러 발생', err)
+ // })
+ // }
@@ -57,8 +58,8 @@ function Search(props) {
useEffect(() => {
- getPlace()
- getImg()
+ // getPlace()
+ // getImg()
getAssociation()
if (window.innerWidth < 960) {
setMobile(true)
@@ -66,12 +67,25 @@ function Search(props) {
setMobile(false)
}
+ }, []);
+
+ useEffect(() => {
+ // getImg()
+ // getAssociation()
+ setPagePlace(paginate(association, index, association.length))
+ }, [association])
+
+ useEffect(() => {
+ // getPlace()
+ // getImg()
+ getAssociation()
if (state) {
props.history.push('/search?keyword=' + search)
setState(false)
console.log("search야", search)
}
- }, [search]);
+
+ }, [state])
const places = [{
@@ -117,7 +131,7 @@ function Search(props) {
}
const handleSubmit = (e) => {
- // e.preventDefault()
+ e.preventDefault()
setState(true);
}
@@ -130,7 +144,8 @@ function Search(props) {
return page
}
- const pagePlace = paginate(association, index, association.length)
+
+
let time = new Date()
diff --git a/googleReview b/googleReview
deleted file mode 100644
index aed07b257b8b66ce7a8f9abafeb2b35e0c4c318b..0000000000000000000000000000000000000000
--- a/googleReview
+++ /dev/null
@@ -1,804 +0,0 @@
-<<<<<<< HEAD
-
금오산 : 네이버 통합검색
금오산 통합검색 결과 경상북도 구미시·칠곡군·김천시의 경계에 있는 산. 높이는 976.5 m이다. 주봉인 현월봉(懸月峯)과 약사봉(藥師峰), 영남8경 중의 하나인 보봉(普峰)이 소백산맥 지맥에 솟아 있으며, 시생대(始生代)와 원생대(原生代)에 속하는 화강편마암과 화강암이 주를 이루고 있다. 산 정상은 비교적 평탄하나 산세가 높고 기이하며, 고려시대에 자연 암벽을 이용해 축성된 길이 2km의...
두산백과
2 경상남도 하동군 진교면 및 금남면에 걸쳐 있는 산. 제법 높은 산임에도 불구하고 아직 잘 알려지지 않은 산으로 말굽 모양의 산릉이 빙 두르고 정상 바로 아래의 달바위 전망이 일품이다. 그동안 군사시설 때문에 정상을 오를 수 없어 등산객의 발길이 뜸했지만 현재는 군사시설이 거의 철수되어 산행에 불편한 점은 없다. 진주시에서 하동군으로 남해고속도로를 타고 달릴 때...
두산백과
5 전라남도 여수시 돌산읍에 있는 산. 여수반도에서 돌산대교로 이어진 전라남도 남단의 돌산도에는 여수 사람들이 우리나라에서 일출 풍경이 가장 뛰어나다고 자랑하는 향일암이 있다. 이는 해를 향해 있다는 뜻으로 이 산에 있는 암자이지만 산보다 유명하다. 향일암은 낙산사의 홍연암, 남해 금산 보리암, 강화도 보문암과 함께 우리나라 4대 관음기도처 가운데 하나로 금바위의...
두산백과
금오산 다른 뜻
이 정보가 표시된 이유 다른 뜻 정보 여러 뜻을 갖고 있는 검색어를 입력하면 많이 찾아보는 뜻 기준으로 지식백과 정보를 노출합니다. 다만 문서에서 자동으로 추출하여 의미를 구분한 것으로 틀린 정보가 제공될 수 있습니다.
정보확인 레이어 닫기 정보를 가져오는 중입니다.
검색결과가 없습니다. 옵션을 재선택 하시거나 초기화 해보시기 바랍니다.
초기화 죄송합니다. 일시적인 오류입니다. 잠시 후 다시 시도해주십시오.
재시도
-
-
-
-
054-480-4601 경북 구미시 남통동 288-2
054-450-6063 경북 구미시 남통동 249
-
-
-
이미지 신고할 이미지를 선택 후 확인 버튼을 눌러주세요. 확인 취소 선택한 이미지가 없습니다. 신고할 이미지를 선택해 주세요.
닫기
학술정보 동향/연구보고서 목차 구미 금오산 (金烏山) : 구미, 두 얼굴의 도시 / 정종원 1 [본문] 1 금오산 , 대본산, 대혜폭포, 오
사회과학 정종원 외 1명 / With 휴양 : 국립자연휴양림 매거
학위논문(석사) 표제지 국문초록 목차 I. 머리말 6 1) 연구목적 6 2) 연구범위 및 방법 6 II. 금오산 입지적 특징과 마
학술논문 Song of Trekking Geumo Mountain and the Meaning of Touring the Hometown <금오산 유산가>는 학계에 처음 소개하는 가사로
학술논문 학술논문 Song of Trekking Geumo Mountain and the Meaning of Touring the Hometown <금오산 유산가>는 학계에 처음 소개하는 가사로
-
-
-
-
-
-
-=======
-
한라산 : 네이버 통합검색
한라산 통합검색 결과 업체정보 제주특별자치도 중앙부에 솟아 있는 산. 높이 1,947.269m로 남한에서 가장 높은 산이다. 제3기 말∼제4기 초 용암이 분출하여 형성되었다. 현무암으로 이루어져 있으며 줄기는 제주도 중앙에서 동서로 뻗는다. 남쪽은 경사가 심한 반면 북쪽은 완만하고, 동서쪽은 비...
더보기
->>>>>>> origin/cherry
-
-
-
-
-
파워링크
-
-
-<<<<<<< HEAD
-
‘ 금오산 ‘ 한라산 >>>>>> origin/cherry
- class="dsc_ncaution_quotation">’
-
관련 광고입니다.
-
이 광고가 표시된 이유
-
-
-
-
광고 노출기준은 검색어에 대한 연관성과 광고주의 입찰가이며,
- 이미지 등 추가 링크는 등록한 경우에만 기준에 따라 노출됩니다. 도움말
-
안내 레이어 닫기
-
-
-
등록 안내
-
-<<<<<<< HEAD
-
-
-
-
- >>>>>> origin/cherry
- onmouseover="jindo.$Element(this).addClass('ad_hover');"
- onmouseout="jindo.$Element(this).removeClass('ad_hover');" num="0">
-
-
-
-
- 금오산 옥션
-
-
-
-
-
- 쇼핑이 생각날땐, 어서옥션! 금오산 , ALLKILL특가+스마일클럽 최대12%할인
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
정보를 가져오는 중입니다.
검색결과가 없습니다. 옵션을 재선택 하시거나 초기화 해보시기 바랍니다.
초기화 죄송합니다. 일시적인 오류입니다. 잠시 후 다시 시도해주십시오.
재시도
-
-
-
-
-
-
-
-
-
인물정보 라산 (한라산) 가수 학력 홍익대학교 기계시스템디자인학 학사 데뷔 2007년 화이팅 대디 1집 앨범 [for Diva] 경력 그룹 '화이팅 대디' 멤버 밴드 'MUS' 보컬 사이트 블로그 , 인스타그램 , 페이스북 , 유튜브
-
-
비즈사이트
-
-
‘
- 한라산
- ’
-
-
관련 광고입니다.
-
이 광고가 표시된 이유
-
-
광고 노출기준은 검색어에 대한 연관성과 광고주의 입찰가입니다.
-
안내 레이어 닫기
-
-
-
등록 안내
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 한라산 옥션
-
-
-
-
-
-
- 쇼핑이 생각날땐, 어서옥션! 한라산 , ALLKILL특가+스마일클럽 최대12%할인
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
테마키워드 분위기 이국적 , 깨끗한 , 화려한 , 편안한 , 웅장한
인기토픽 둘레길 , 오름 , 등반코스 , 철쭉 , 국립공원
찾는목적 휴식 , 경치 , 산행 , 등산 , 가족여행
1월, 12월 에 많이 찾는 곳1월, 12월에 많이 찾는 곳 표 월 최저/최고기온 강수확률 맑은날 인기도 1월 최저기온 4.6° / 최고기온 11.3° 10% 3일 2월 최저기온 6.2° / 최고기온 12.8° 40% 6일 3월 최저기온 8.5° / 최고기온 15.5° 40% 10일
연령/성별 검색 인기도 정보를 가져오는 중입니다.
남성 여성
66.66666666666666%0 10
66.66666666666666%0 20
66.66666666666666%0 30
66.66666666666666%0 40
66.66666666666666%2 50
66.66666666666666%1 60
뉴스토픽 2021.01.24. 17:30 ~ 20:30 기준
-
-
-
-<<<<<<< HEAD
-
-
뉴스토픽 2021.01.24. 17:30 ~ 20:30 기준
-=======
-
->>>>>>> origin/cherry
diff --git a/googleSearch b/googleSearch
deleted file mode 100644
index 8f14e6855d0537b3ae9241e8dd9a998456201058..0000000000000000000000000000000000000000
--- a/googleSearch
+++ /dev/null
@@ -1,20 +0,0 @@
-
성산일출봉(sungsan) site:tistory.com - Google 검색 몇 초 안에 이동하지 않는 경우
여기 를 클릭하세요.
2020. 5. 17. � 제주 최고의 관광지 중 하나인 성산일출봉이다.(서귀포시 성산읍) 제주도의 다른 오름이 육지출신(?)인데 반해 성산일출봉은 바다출신이라고 한다.
2019. 6. 20. � 성산일출봉(Seongsan Ilchulbong) 성산일출봉은 외국인들이 가장 많이 찾는 제주의 필수 코스입니다. 성산일출봉도 제주의 수많은 오름 중 하나�...
2015. 2. 20. � 성산일출봉! 이건 하나의 상징이다...우리만의 상징 아무도 모르겠지?-ㅠ- 저 모자는 성산일출봉을 의미하고 그거에 신난 나의 모습? ;Maybe nobody�...
제주도 여행 추천 장소 「성산일출봉 편」 +Scroll down:English version ... 성산 일출봉 앞에는 넓~은 주차장이 있으니 걱정 마시고요. ... Sungsan is the same.
2017. 10. 24. � 170503 Rep. Korea / Jeju Island Seongsan Ilchulbong Peak 성산일출봉 제주도 여행에서 빠질 수 없는 곳 성산일출봉 오랫동안 제주도의 상징적�...
2008. 10. 15. � 자세히 보니 구름이 가득한 것 같다. 일출을 못 볼것 같다는 불길한 예감이 들기는 했지만 그래도 일찍 일어났으니 성산일출봉에 올라갈 채비를 했다.
2010. 9. 1. � 성산일출봉 입구 옆에 있는 동암사에 들러야 해서 그리로 갔다가 이렇게 맑은 날 일출봉 올라가야지 나중에 언제 맑을 때까지 기다리다 오겠어?
2018. 5. 30. � 6월 제주도 가볼만한곳! 성산일출봉 Seongsan Ilchulbong Tuff Cone 티스토리 첫 여행 포스팅은 제주도입니다 :) 제주도는 가도가도 정말 또 가고�...
2020. 6. 2. � 제주 서귀포시 성산읍에 위치한 성산일출봉입니다. 성산일출봉은 제주도를 대표하는 여행지로 많은 관광객들이 찾는곳으로 유명합니다. 세계자연�...
\ No newline at end of file
diff --git a/server/controllers/place.controller.js b/server/controllers/place.controller.js
index 0db04b357337f9a0a111ce51c053bbc220438e0c..566846efd71b0b2bc809f3a388415d2af4be0543 100644
--- a/server/controllers/place.controller.js
+++ b/server/controllers/place.controller.js
@@ -2,13 +2,13 @@ import Places from '../models/Place.js'
import cheerio from 'cheerio'
import fs from 'fs'
import axios from 'axios';
+import { nextTick } from 'process';
-const searchPlace = async (req, res) => {
+const searchPlace = async (req, res, next,) => {
let DuplicateCheckPlace = await Places.findOne({ name: req.query.keyword })
-
+ req.places = DuplicateCheckPlace
if (DuplicateCheckPlace) {
- res.send(DuplicateCheckPlace)
console.log("11111111111111111111111Place################ 기존플레이스줄력중")
}
else {
@@ -23,70 +23,115 @@ const searchPlace = async (req, res) => {
let places = {}
$1('.ct_box_area').each(function (i) {
- places[i] = { name: $1('.biz_name').text(), category: $1('.category').text(), address: $1('.addr').text() }
+ places={
+ name: $1('.biz_name').text(), category: $1('.category').text(), address: $1('.addr').text()
+ }
})
+
// 값이 비어있거나 에러가 생겼을 때를 대비해 try catch를 해야함
- const newPlaces = await new Places(places[0]
- ).save()
- res.send(places)
+ // const newPlaces = await new Places(places[0]
+ // ).save()
+ // res.send(places)
+ req.places = places[0]
+ console.log("62168748172", req.places)
+
})
}
-}
-const searchImg = async (req, res) => {
+ next()
- let DuplicateCheckImg = await Places.findOne({ name: req.query.keyword })
-
- if (DuplicateCheckImg) {
- if (DuplicateCheckImg.img !== "https://t1.daumcdn.net/thumb/R600x0/?fname=http%3A%2F%2Ft1.daumcdn.net%2Fqna%2Fimage%2F4b035cdf8372d67108f7e8d339660479dfb41bbd") {
- res.send(DuplicateCheckImg)
- console.log("333333333333333333333333333IMG@@@@@@@@@@@@@@@@@@@ 기존이미지줄력중")
- }
- else if (DuplicateCheckImg.img === "https://t1.daumcdn.net/thumb/R600x0/?fname=http%3A%2F%2Ft1.daumcdn.net%2Fqna%2Fimage%2F4b035cdf8372d67108f7e8d339660479dfb41bbd") {
- console.log("4444444444444444444444444444444444444444444444444")
- const imgUrl = "https://www.google.com/search?q=" + encodeURI(req.query.keyword) + "+site:tistory.com/&sxsrf=ALeKk023Dv08KQDodRmpB5222lQuzw2Vaw:1610612821100&source=lnms&tbm=isch"
+}
- axios.get(imgUrl)
- .then(async (response) => {
- const html = response.data
- let name = req.query.keyword
- let $1 = cheerio.load(html);
+const searchImg = async (req, res, next) => {
- let images = $1('.RAyV4b').find('img').attr('src')
+ console.log("d213532513212osfnlagm2214124", req.places)
- //사진만 업데이트
- let Place = await Places.findOne({ name: req.query.keyword })
- Place.times.push(new Date().toLocaleString())
- await Places.updateOne({ name: req.query.keyword }, { img: images, times: Place.times })
+ if (req.places.img) {
+ console.log("333333333333333333333333333IMG@@@@@@@@@@@@@@@@@@@ 기존이미지줄력중")
+ req.places.times.push(new Date().toLocaleString())
+ console.log("세이브 전 111111111111111111", req.places)
+ const newPlaces = await new Places(req.places).save()
+ next()
+ } else {
+ const imgUrl = "https://www.google.com/search?q=" + encodeURI(req.query.keyword) + "+site:tistory.com/&sxsrf=ALeKk023Dv08KQDodRmpB5222lQuzw2Vaw:1610612821100&source=lnms&tbm=isch"
- res.send(images)
- })
+ axios.get(imgUrl)
+ .then(async (response) => {
+ console.log("4444444444444444444444444444444444444444444444444새로운 이미지 출력중")
+ const html = response.data
+ let name = req.query.keyword
+ let $1 = cheerio.load(html);
- } else {
- console.log("IMG에러")
- }
- }
+ let images = $1('.RAyV4b').find('img').attr('src')
+ req.places.img = images
+ //사진만 업데이트
+ // let Place2 = await Places.findOne({ name: req.query.keyword })
+ req.places.times.push(new Date().toLocaleString())
+ // await Places.updateOne({ name: req.query.keyword }, { img: images, times: Place2.times })
+ // res.send(images)
+ console.log("세이브 전 222222222222222", req.places)
+ const newPlaces = await new Places(req.places).save()
+ next()
+ })
+ }
}
+// if (DuplicateCheckImg !== "https://t1.daumcdn.net/thumb/R600x0/?fname=http%3A%2F%2Ft1.daumcdn.net%2Fqna%2Fimage%2F4b035cdf8372d67108f7e8d339660479dfb41bbd") {
+// console.log("333333333333333333333333333IMG@@@@@@@@@@@@@@@@@@@ 기존이미지줄력중")
+// }
+// else if (DuplicateCheckImg === "https://t1.daumcdn.net/thumb/R600x0/?fname=http%3A%2F%2Ft1.daumcdn.net%2Fqna%2Fimage%2F4b035cdf8372d67108f7e8d339660479dfb41bbd") {
+// console.log("4444444444444444444444444444444444444444444444444")
+// const imgUrl = "https://www.google.com/search?q=" + encodeURI(req.query.keyword) + "+site:tistory.com/&sxsrf=ALeKk023Dv08KQDodRmpB5222lQuzw2Vaw:1610612821100&source=lnms&tbm=isch"
+
+// axios.get(imgUrl)
+// .then(async (response) => {
+// const html = response.data
+// let name = req.query.keyword
+// let $1 = cheerio.load(html);
+
+// let images = $1('.RAyV4b').find('img').attr('src')
+
+// req.places.img = images
+// //사진만 업데이트
+// // let Place2 = await Places.findOne({ name: req.query.keyword })
+// req.places.times.push(new Date().toLocaleString())
+// // await Places.updateOne({ name: req.query.keyword }, { img: images, times: Place2.times })
+// // res.send(images)
+// console.log("세이브 전 111111111111111111", req.places)
+// const newPlaces = await new Places(req.places).save()
+// next()
+// })
+
+// } else {
+// console.log("IMG에러")
+// }
+// req.places.times.push(new Date().toLocaleString())
+// console.log("세이브 전222222222222222222222")
+// next()
+
+// }
+//맨 처음 검색하는 지역의 관광지의 경우 association을 받아올 수 없다.
const searchAssociation = async (req, res) => {
- let Place = await Places.findOne({ name: req.query.keyword })
-
+ // let Place3 = await Places.findOne({ name: req.query.keyword })
+ let Place3 = req.places.address
// if (!Place) {
// res.send([])
// }
- if (!Place) {
- res.status(404).send({ error: "Place.address is null" })
+ if (!Place3) {
+ console.log("asdfasdfasdf222222222222222222dsaf2222222222214123q5", Place3)
+
+ res.send({ error: "Place.address is null" })
}
else {
- let addresse = Place.address.split(' ')[0]
+ let addresse = Place3.split(' ')[0]
let AssociationsId = []
let addressPlaces = new RegExp(`${addresse}`)
- console.log("여기보세요", addressPlaces)
let responsePlaces = await Places.find({ address: addressPlaces })
+ // const newPlaces = await new Places(places[0]).save()
res.send(responsePlaces)
}
// responsePlaces.map(Association => {
diff --git a/server/routes/place.routes.js b/server/routes/place.routes.js
index 745a154a499bd5157736d0519494b94108ae5422..4b6612c7977dbcfe896feab09db4153dfef1bdc3 100644
--- a/server/routes/place.routes.js
+++ b/server/routes/place.routes.js
@@ -3,13 +3,14 @@ import place from '../controllers/place.controller.js'
const router = express.Router()
-router.route('/api/search/imges')
- .get(place.searchImg)
+// router.route('/api/search/places')
+// .get(place.searchPlace, place.searchImg, place.searchAssociation)
+
+// router.route('/api/search/imges')
+// .get(place.searchImg)
-router.route('/api/search/places')
- .get(place.searchPlace)
router.route('/api/search/association')
- .get(place.searchAssociation)
+ .get(place.searchPlace, place.searchImg, place.searchAssociation)
export default router
\ No newline at end of file