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 \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대 관음기도처 가운데 하나로 금바위의...
두산백과
금오산 다른 뜻이 정보가 표시된 이유
- -
-
- - -
-

이미지

이미지 신고하기

선택한 이미지가 없습니다.
신고할 이미지를 선택해 주세요.

닫기

학술정보

- - - - - - -======= - 한라산 : 네이버 통합검색

한라산 통합검색 결과

업체정보

전화
064-713-9950
주소
요금
  • 무료
  • 600원
  • 400원
  • 300원
  • 500원
편의시설
주차
제주특별자치도 중앙부에 솟아 있는 산. 높이 1,947.269m로 남한에서 가장 높은 산이다. 제3기 말∼제4기 초 용암이 분출하여 형성되었다. 현무암으로 이루어져 있으며 줄기는 제주도 중앙에서 동서로 뻗는다. 남쪽은 경사가 심한 반면 북쪽은 완만하고, 동서쪽은 비...더보기

방문자 리뷰130

4.5 / 5
  • 5
    정주리2021.01.16 방문
  • 5
    RiRa2021.01.04 방문
더보기
->>>>>>> origin/cherry - - - -
-

파워링크

- -
-<<<<<<< HEAD - 금오산한라산>>>>>> origin/cherry - class="dsc_ncaution_quotation">’ - 관련 광고입니다. - 이 광고가 표시된 이유 - - -
- 등록 안내 -
-<<<<<<< HEAD - - - -
- - - - - - -
- - - - - - - - -

실시간검색도움말

인물정보

라산 (한라산) 가수
학력
홍익대학교 기계시스템디자인학 학사
데뷔
2007년 화이팅 대디 1집 앨범 [for Diva]
경력
그룹 '화이팅 대디' 멤버
밴드 'MUS' 보컬
사이트
블로그, 인스타그램, 페이스북, 유튜브
본인참여 2019.09.02. 네이버 인물정보 도움말
가수 라산인물정보 더보기

앨범

앨범 더보기
-
-

비즈사이트

-
- - 한라산 - - - 관련 광고입니다. - 이 광고가 표시된 이유 - -
- 등록 안내 -
-
- - -
- - -
- - -

한라산 찾아가는 길

1. 제주시 - 제주종합시외버스터미날에서 중문행 완행버스 이용, 어리목 40분 소요, 영실 입구 60분 소요. -2. 제주시 - 종합시외버스터미날에서 서귀포행 직, 완행버스 이용, 성판악 하차, 30분 소요. -3. 제주시 - 종합시외버스터미날에서 관음사입구까지 버스 이용, 관음사입구, 20분 소요. -4. 제주시 - 종합시외버스터미날에서 서귀포행 직, 완행버스 이용, 법호촌 돈내코스 입구 하차, 돈내코 50분 소요. -5. 제주시 - 관음사, 성판악, 돈내코 - 11번 국도 - 제1횡단도로, 성판악, 서귀포 방향 - 관음사입구, 산천당 왼쪽 삼거리에서 우회전 - 성판악 - 법호촌, 제주청소년야영장입구, 우회전 - 상법호촌.

주변 대중교통 (지하철, 버스)

데이터랩

테마키워드

  • 분위기
    이국적, 깨끗한, 화려한, 편안한, 웅장한
  • 인기토픽
    둘레길, 오름, 등반코스, 철쭉, 국립공원
  • 찾는목적
    휴식, 경치, 산행, 등산, 가족여행

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
- - - -<<<<<<< HEAD - -
-======= -
->>>>>>> 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 검색
다음 검색어에 대한 결과 포함: 성산일출봉(seongsan) site:tistory.com
다음 검색어에 대한 결과만 표시: 성산일출봉(sungsan) site:tistory.com
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