From 7971695305e2975aae80d9f10b3e2a4b04a58ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B7=9C=ED=83=9C?= <79373803+KyuTae98@users.noreply.github.com> Date: Thu, 7 Dec 2023 01:27:08 +0900 Subject: [PATCH 1/8] Frontend (#202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat. 새로 고침 버튼 개발[#46] * 새로 고침 버튼을 개발하여 클릭 시 다시 해당 정류장의 버스를 받는 기능을 개발하였다. Resolves #46 * feat. map component 리팩토링 * 지하철 기능을 위해 map component 리팩토링 하였습니다. * feat. 버스페이지 css작업 완료 * 버스페이지 css작업 완료 * feat. 입력 폼 변경 * 입력 부분에서 검색어 바뀔 때마다 서버에 요청 * feat. 지하철 page생성 지하철 page 뼈대를 만들었습니다. * feat. map-slice수정 * feat. subway page개발(v1.1) * feat. main화면 bus화면 디자인 변경 * 변경 했지만 반응형 추가 필요 * feat. 디자인 폰트, 버스 페이지 어느 정도 완성 * 디자인 폰트, 버스 페이지 80% 완성, 반응형으로 만들기 수정 * feat. 지하철 페이지 디자인에 맞춰 개발 * feat. 지하철 메뉴 * 지하철 메뉴에 해당하는 페이지 설정 * feat. 모바일 반응형 * 모바일 반응형 완료 아직 지하철 페이지는 개발 필요함 * feat. 환승 page개발 * feat. HashRouter로 변경 * BrowserRouter에서 HashRouter로 변경 * feat. 이모지 + 서버 * feat.지하철 수정 * feat. map focusing 수정 * feat. 휠체어 기능 하기 전 저장 * 휠체어 기능 하기 전 저장 * feat. 휠체어 수정 완료 * 휠체어 수정 완료 * feat. 디테일한 수정 * 디테일한 수정 * Update Api.js * feat. 약간의 수정 * 약간의 수정 * feat.폰트, 맵 초기화 수정 * 폰트, 맵 초기화 수정 * feat. 최종 수정 * 최종 수정 * Update StationItem.js * refac: typescript로 Refectoring중 * feat(front): ts변경 오류 다수 발견 * feat(front): gps기반 지도 중심 개발 * fix(front): Api 수정 * fix(front): map 변경 * feat: 간단 퍼블리싱(1) * feat:menuBar 수정(SVG로 표현) * feat(front): 모바일 환경에 맞게 수정 * feat(): busmode 완성 * feat: busmode 수정 * feat: 지하철 수정 * feat: 지하철 마무리 * feat: map Marker 클릭이벤트 등록 완료 * feat: 길찾기 솔루션 개발중 * feat: 수정 * fix: 위도 경도 수정 * fix: api 수정 * fix: api변경 * feat: 환승역 개발 * feat: 지하철 환승 페이지 완료 * fix: 지도 위치 변경 * fix: page 높이 수정 --- Backend/Frontend/creative/src/page/BusPage.module.css | 3 ++- Backend/Frontend/creative/src/page/SignPage.module.css | 3 ++- .../creative/src/page/subwaypage/SubwayPage.module.css | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Backend/Frontend/creative/src/page/BusPage.module.css b/Backend/Frontend/creative/src/page/BusPage.module.css index bdb3012..107da7d 100644 --- a/Backend/Frontend/creative/src/page/BusPage.module.css +++ b/Backend/Frontend/creative/src/page/BusPage.module.css @@ -1,6 +1,7 @@ .buspage { display: flex; flex-direction: column; + align-items: center; justify-content: start; - height: 100vh; + height: 85vh; } diff --git a/Backend/Frontend/creative/src/page/SignPage.module.css b/Backend/Frontend/creative/src/page/SignPage.module.css index af3af6f..77be4cd 100644 --- a/Backend/Frontend/creative/src/page/SignPage.module.css +++ b/Backend/Frontend/creative/src/page/SignPage.module.css @@ -1,6 +1,7 @@ .signpage { display: flex; flex-direction: column; + align-items: center; justify-content: start; - height: 100vh; + height: 85vh; } diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css index 2267e12..d5d1ae1 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css @@ -1,6 +1,7 @@ .subwaypage { display: flex; flex-direction: column; + align-items: center; justify-content: start; - height: 100vh; + height: 85vh; } \ No newline at end of file From 9cd476ca0f5d66831fa432b8322ec1b5fa0252b0 Mon Sep 17 00:00:00 2001 From: Sangwook Park <41150708+sw0501@users.noreply.github.com> Date: Thu, 7 Dec 2023 02:05:23 +0900 Subject: [PATCH 2/8] Feature/backend (#203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modify: CI/CD 수정 * Feat: navigation API 개발 완료 * Modify: navigation API 수정 * Fix: navigation API 예외처리 * Feat: CORS http 포트 추가 * Modify: CORS 옵션 수정 * Modify: CORS 옵션 수정 * Feat: https 서버 업데이트 * HTTPS 적용 * Feat: COSR 옵션 https 추가 * Feat: 없는 지하철역 예외처리 * Feat: 없는 지하철역 예외처리 * Modify: 예외처리 진행 * Modify: https 서버 수정 * Feat: 길찾기 기능 가중치 추가 --- BackendJS/BackendTS/routes/navigation.js | 22 +++++++++++++++----- BackendJS/BackendTS/server.js | 2 +- BackendTS/routes/navigation.ts | 26 ++++++++++++++++++------ BackendTS/server.ts | 2 +- 4 files changed, 39 insertions(+), 13 deletions(-) diff --git a/BackendJS/BackendTS/routes/navigation.js b/BackendJS/BackendTS/routes/navigation.js index 45f92ca..5fb7eea 100644 --- a/BackendJS/BackendTS/routes/navigation.js +++ b/BackendJS/BackendTS/routes/navigation.js @@ -427,18 +427,30 @@ router.get('/:startX/:startY/:endX/:endY/:type', (req, res) => __awaiter(void 0, const NavigationList = JSON.parse(body).result; //console.log(error); //console.log(response); + //275 -> 10분 + //10분 -> + //버스 환승 -> + // //1. 도보 시간, 2. 환승 개수, 3. 총 이동 시간 NavigationList.path.sort((a, b) => { - if (a.info.totalWalk === b.info.totalWalk) { - if (a.info.busTransitCount + a.info.subwayTransitCount === b.info.busTransitCount + b.info.subwayTransitCount) { - return a.info.totalTime - b.info.totalTime; + //가중치 계산 + const weight_A = a.info.totalWalk / 300 * 30 + a.info.totalTime + a.info.busTransitCount * 10 + a.info.subwayTransitCount * 5; + const weight_B = b.info.totalWalk / 300 * 30 + b.info.totalTime + b.info.busTransitCount * 10 + b.info.subwayTransitCount * 5; + if (weight_A === weight_B) { + if (a.info.totalWalkTime === b.info.totalWalkTime) { + if (a.info.busTransitCount + a.info.subwayTransitCount === b.info.busTransitCount + b.info.busTransitCount) { + return a.info.totalTime - b.info.totalTime; + } + else { + return a.info.busTransitCount + a.info.subwayTransitCount - b.info.busTransitCount + b.info.busTransitCount; + } } else { - return a.info.busTransitCount + a.info.subwayTransitCount - b.info.busTransitCount + b.info.subwayTransitCount; + return a.info.totalWalkTime - b.info.totalWalkTime; } } else { - return a.info.totalWalk - b.info.totalWalk; + return weight_A - weight_B; } }); //상위 5개 경로만 반환 diff --git a/BackendJS/BackendTS/server.js b/BackendJS/BackendTS/server.js index 5a569fb..d3b9eb2 100644 --- a/BackendJS/BackendTS/server.js +++ b/BackendJS/BackendTS/server.js @@ -42,7 +42,7 @@ const httpsOptions = { cert: fs_1.default.readFileSync('./KEY/rootca.crt') }; let corsOptions = { - origin: ['http://localhost:3000/#/', 'http://localhost:3000', 'http://localhost:3005', 'http://34.168.80.42:3000', 'http://172.30.1.35:5000', 'http://localhost:5000', 'http://localhost:80', 'http://localhost:80/#/', 'https://www.easy-taza.site'], + origin: ['http://localhost:3000/#/', 'http://localhost:3000', 'http://localhost:3005', 'http://34.168.80.42:3000', 'http://172.30.1.35:5000', 'http://localhost:5000', 'http://localhost:80', 'http://localhost:80/#/', 'https://www.easy-taza.site', 'https://.easy-taza.site'], credentials: true }; app.use((0, cors_1.default)(corsOptions)); diff --git a/BackendTS/routes/navigation.ts b/BackendTS/routes/navigation.ts index 43ea2cd..25ccfb7 100644 --- a/BackendTS/routes/navigation.ts +++ b/BackendTS/routes/navigation.ts @@ -429,19 +429,33 @@ router.get('/:startX/:startY/:endX/:endY/:type',async(req:Request,res:Response)= //console.log(error); //console.log(response); - + //275 -> 10분 + //10분 -> + //버스 환승 -> + // //1. 도보 시간, 2. 환승 개수, 3. 총 이동 시간 NavigationList.path.sort((a:NavigationPath, b:NavigationPath)=>{ - if(a.info.totalWalk === b.info.totalWalk){ - if(a.info.busTransitCount + a.info.subwayTransitCount === b.info.busTransitCount + b.info.subwayTransitCount){ - return a.info.totalTime - b.info.totalTime; + + //가중치 계산 + const weight_A:number = a.info.totalWalk/300 * 30 + a.info.totalTime + a.info.busTransitCount*10 + a.info.subwayTransitCount*5; + const weight_B:number = b.info.totalWalk/300 * 30 + b.info.totalTime + b.info.busTransitCount*10 + b.info.subwayTransitCount*5; + + if(weight_A === weight_B){ + if(a.info.totalWalkTime === b.info.totalWalkTime){ + if(a.info.busTransitCount + a.info.subwayTransitCount === b.info.busTransitCount + b.info.busTransitCount){ + return a.info.totalTime - b.info.totalTime; + } + else{ + return a.info.busTransitCount + a.info.subwayTransitCount - b.info.busTransitCount + b.info.busTransitCount; + } + } else{ - return a.info.busTransitCount + a.info.subwayTransitCount - b.info.busTransitCount + b.info.subwayTransitCount; + return a.info.totalWalkTime - b.info.totalWalkTime; } } else { - return a.info.totalWalk - b.info.totalWalk; + return weight_A - weight_B; } }) diff --git a/BackendTS/server.ts b/BackendTS/server.ts index 668d54e..24221b4 100644 --- a/BackendTS/server.ts +++ b/BackendTS/server.ts @@ -20,7 +20,7 @@ const httpsOptions = { }; let corsOptions: cors.CorsOptions = { - origin: ['http://localhost:3000/#/', 'http://localhost:3000', 'http://localhost:3005', 'http://34.168.80.42:3000', 'http://172.30.1.35:5000', 'http://localhost:5000', 'http://localhost:80', 'http://localhost:80/#/', 'https://www.easy-taza.site'], + origin: ['http://localhost:3000/#/', 'http://localhost:3000', 'http://localhost:3005', 'http://34.168.80.42:3000', 'http://172.30.1.35:5000', 'http://localhost:5000', 'http://localhost:80', 'http://localhost:80/#/', 'https://www.easy-taza.site', 'https://.easy-taza.site'], credentials: true } From d7a61c1d5b98ba30eca2ddc1700f40e1f76d317d Mon Sep 17 00:00:00 2001 From: Sangwook Park <41150708+sw0501@users.noreply.github.com> Date: Thu, 7 Dec 2023 16:54:41 +0900 Subject: [PATCH 3/8] Feature/backend (#204) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modify: CI/CD 수정 * Feat: navigation API 개발 완료 * Modify: navigation API 수정 * Fix: navigation API 예외처리 * Feat: CORS http 포트 추가 * Modify: CORS 옵션 수정 * Modify: CORS 옵션 수정 * Feat: https 서버 업데이트 * HTTPS 적용 * Feat: COSR 옵션 https 추가 * Feat: 없는 지하철역 예외처리 * Feat: 없는 지하철역 예외처리 * Modify: 예외처리 진행 * Modify: https 서버 수정 * Feat: 길찾기 기능 가중치 추가 * Feat: 길찾기 필요 정보 추가, 인터페이스 수정 --- BackendJS/BackendTS/routes/navigation.js | 70 +++++++++++++++++-- BackendTS/routes/navigation.ts | 48 ++++++++++++- BackendTS/routes/subwaydata.ts | 1 - interfaces/Navigation/navigation.interface.ts | 6 +- 4 files changed, 115 insertions(+), 10 deletions(-) diff --git a/BackendJS/BackendTS/routes/navigation.js b/BackendJS/BackendTS/routes/navigation.js index 5fb7eea..73bf96d 100644 --- a/BackendJS/BackendTS/routes/navigation.js +++ b/BackendJS/BackendTS/routes/navigation.js @@ -1,4 +1,27 @@ "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -14,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { const express_1 = __importDefault(require("express")); const request_1 = __importDefault(require("request")); const serviceKey_json_1 = __importDefault(require("../KEY/serviceKey.json")); +const db = __importStar(require("../db")); const router = express_1.default.Router(); const velocity = 46.8; function deg2rad(deg) { @@ -455,7 +479,7 @@ router.get('/:startX/:startY/:endX/:endY/:type', (req, res) => __awaiter(void 0, }); //상위 5개 경로만 반환 NavigationList.path = NavigationList.path.slice(0, 5); - NavigationList.path.forEach(element => { + NavigationList.path.forEach((element) => __awaiter(this, void 0, void 0, function* () { //일반인 기준 이동시간 저장 const t = element.info.totalWalkTime; //도보 이동 시간 계산 @@ -471,7 +495,7 @@ router.get('/:startX/:startY/:endX/:endY/:type', (req, res) => __awaiter(void 0, delete element.info.checkIntervalTime; delete element.info.checkIntervalTimeOverYn; //subPath 정리 - element.subPath.forEach(element => { + yield element.subPath.forEach((element) => __awaiter(this, void 0, void 0, function* () { //도보인 경우 if (element.trafficType === 3) { //교통약자 평균 이동속도에 맞게 이동시간 조정 @@ -497,10 +521,46 @@ router.get('/:startX/:startY/:endX/:endY/:type', (req, res) => __awaiter(void 0, //지하철인 경우 else if (element.trafficType === 1) { delete element.lane[0].subwayCityCode; + if (element.lane[0].name === "수도권 분당선(급행)") { + element.lane[0].subwayCode = 10; + } + else if (element.lane[0].name === "수도권 신분당선") { + element.lane[0].subwayCode = 11; + } + const getSationInfo = (name, subwayCode) => new Promise((res, rej) => { + const SQL = "Select * from subcode_1 where STIN_NM LIKE ? and LN_CD = ?;"; + const connection = db.return_connection(); + connection.query(SQL, ['%' + name + '%', subwayCode], function (err, results, fields) { + if (err) { + console.log(err); + return rej(err); + } + else { + return res({ + stCd: results[0].STIN_CD, + lnCd: results[0].LN_CD, + railCd: results[0].RAIL_OPR_ISTT_CD, + stNm: results[0].STIN_NM + }); + } + }); + }); + const startInfo = yield getSationInfo(element.passStopList.stations[0].stationName, element.lane[0].subwayCode); + const endInfo = yield getSationInfo(element.passStopList.stations[element.passStopList.stations.length - 1].stationName, element.lane[0].subwayCode); + element.passStopList.stations[0].stNm = startInfo.stNm; + element.passStopList.stations[0].stCd = startInfo.stCd; + element.passStopList.stations[0].lnCd = startInfo.lnCd; + element.passStopList.stations[0].railCd = startInfo.railCd; + element.passStopList.stations[element.passStopList.stations.length - 1].stNm = endInfo.stNm; + element.passStopList.stations[element.passStopList.stations.length - 1].stCd = endInfo.stCd; + element.passStopList.stations[element.passStopList.stations.length - 1].lnCd = endInfo.lnCd; + element.passStopList.stations[element.passStopList.stations.length - 1].railCd = endInfo.railCd; + console.log(element.passStopList.stations[0]); + console.log(element.passStopList.stations[element.passStopList.stations.length - 1]); } - }); - }); - return res.status(200).json(NavigationList.path); + })); + })); + return setTimeout(() => res.status(200).json(NavigationList.path), 1000); }); }); } diff --git a/BackendTS/routes/navigation.ts b/BackendTS/routes/navigation.ts index 25ccfb7..2b04511 100644 --- a/BackendTS/routes/navigation.ts +++ b/BackendTS/routes/navigation.ts @@ -3,6 +3,7 @@ import request from 'request' import convert from 'xml-js' import serviceKey from '../KEY/serviceKey.json' import { NavigationResult, NavigationPath, RecommendPathList } from '../../interfaces/Navigation/navigation.interface' +import * as db from '../db' const router:Router = express.Router(); @@ -462,7 +463,7 @@ router.get('/:startX/:startY/:endX/:endY/:type',async(req:Request,res:Response)= //상위 5개 경로만 반환 NavigationList.path = NavigationList.path.slice(0,5); - NavigationList.path.forEach(element => { + NavigationList.path.forEach(async (element) => { //일반인 기준 이동시간 저장 const t = element.info.totalWalkTime; //도보 이동 시간 계산 @@ -480,7 +481,7 @@ router.get('/:startX/:startY/:endX/:endY/:type',async(req:Request,res:Response)= delete element.info.checkIntervalTimeOverYn; //subPath 정리 - element.subPath.forEach(element=>{ + await element.subPath.forEach(async(element)=>{ //도보인 경우 if(element.trafficType === 3){ //교통약자 평균 이동속도에 맞게 이동시간 조정 @@ -507,11 +508,52 @@ router.get('/:startX/:startY/:endX/:endY/:type',async(req:Request,res:Response)= //지하철인 경우 else if(element.trafficType === 1){ delete element.lane[0].subwayCityCode; + if(element.lane[0].name === "수도권 분당선(급행)"){ + element.lane[0].subwayCode = 10; + } + else if(element.lane[0].name === "수도권 신분당선"){ + element.lane[0].subwayCode = 11; + } + + const getSationInfo = (name:string, subwayCode:number) => new Promise((res,rej)=>{ + const SQL:string = "Select * from subcode_1 where STIN_NM LIKE ? and LN_CD = ?;"; + const connection:any = db.return_connection(); + + connection.query(SQL, ['%' + name + '%',subwayCode],function(err:Error,results:any,fields:any){ + if (err) { + console.log(err); + return rej(err); + } + else{ + return res({ + stCd: results[0].STIN_CD, + lnCd: results[0].LN_CD, + railCd: results[0].RAIL_OPR_ISTT_CD, + stNm: results[0].STIN_NM + }) + } + }) + }) + + const startInfo:any = await getSationInfo(element.passStopList.stations[0].stationName, element.lane[0].subwayCode); + const endInfo:any = await getSationInfo(element.passStopList.stations[element.passStopList.stations.length-1].stationName, element.lane[0].subwayCode); + + element.passStopList.stations[0].stNm = startInfo.stNm; + element.passStopList.stations[0].stCd = startInfo.stCd; + element.passStopList.stations[0].lnCd = startInfo.lnCd; + element.passStopList.stations[0].railCd = startInfo.railCd; + + element.passStopList.stations[element.passStopList.stations.length-1].stNm = endInfo.stNm; + element.passStopList.stations[element.passStopList.stations.length-1].stCd = endInfo.stCd; + element.passStopList.stations[element.passStopList.stations.length-1].lnCd = endInfo.lnCd; + element.passStopList.stations[element.passStopList.stations.length-1].railCd = endInfo.railCd; + } }) }); - return res.status(200).json(NavigationList.path); + return setTimeout(() => res.status(200).json(NavigationList.path), 1000); + }); } diff --git a/BackendTS/routes/subwaydata.ts b/BackendTS/routes/subwaydata.ts index 7281ce6..c80962a 100644 --- a/BackendTS/routes/subwaydata.ts +++ b/BackendTS/routes/subwaydata.ts @@ -801,7 +801,6 @@ router.get('/convenience/:stCd/:stNm/:railCd/:lnCd', async (req:Request, res:Res } }); - } catch (e) { console.error(e); diff --git a/interfaces/Navigation/navigation.interface.ts b/interfaces/Navigation/navigation.interface.ts index 4399b00..6f2f47e 100644 --- a/interfaces/Navigation/navigation.interface.ts +++ b/interfaces/Navigation/navigation.interface.ts @@ -73,7 +73,11 @@ interface StationList{ arsID?: string, x: string, y: string, - isNonStop?: string + isNonStop?: string, + stCd?: string, + lnCd?: string, + railCd?: string, + stNm?: string } interface NavigationPassStopList{ From edff6da03b21d2f973fa6afc21511ab3755f5673 Mon Sep 17 00:00:00 2001 From: Sangwook Park <41150708+sw0501@users.noreply.github.com> Date: Thu, 7 Dec 2023 16:58:47 +0900 Subject: [PATCH 4/8] Feature/backend (#205) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modify: CI/CD 수정 * Feat: navigation API 개발 완료 * Modify: navigation API 수정 * Fix: navigation API 예외처리 * Feat: CORS http 포트 추가 * Modify: CORS 옵션 수정 * Modify: CORS 옵션 수정 * Feat: https 서버 업데이트 * HTTPS 적용 * Feat: COSR 옵션 https 추가 * Feat: 없는 지하철역 예외처리 * Feat: 없는 지하철역 예외처리 * Modify: 예외처리 진행 * Modify: https 서버 수정 * Feat: 길찾기 기능 가중치 추가 * Feat: 길찾기 필요 정보 추가, 인터페이스 수정 * Feat: CI/CD 수정 --- .github/workflows/main.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5b01bad..bb5826f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: git pull origin main cd ${{ secrets.PWD }}/BackendJS/BackendTS npm install - pm2 restart Traffic + pm2 reload Traffic --time - if: github.event.pull_request.merged == true && github.head_ref == 'Frontend' uses: appleboy/ssh-action@master with: @@ -34,9 +34,5 @@ jobs: cd ${{ secrets.PWD }} git pull origin main cd ${{ secrets.PWD }}/Backend/Frontend/creative - pm2 stop Traffic npm install - npm run build - cd ${{ secrets.PWD }}/BackendJS/BackendTS - npm install - pm2 restart Traffic \ No newline at end of file + npm run build \ No newline at end of file From 634609f768b14ebd6072a0779d2d051ac5fb8d23 Mon Sep 17 00:00:00 2001 From: Sangwook Park <41150708+sw0501@users.noreply.github.com> Date: Thu, 7 Dec 2023 17:48:32 +0900 Subject: [PATCH 5/8] Feature/backend (#206) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modify: CI/CD 수정 * Feat: navigation API 개발 완료 * Modify: navigation API 수정 * Fix: navigation API 예외처리 * Feat: CORS http 포트 추가 * Modify: CORS 옵션 수정 * Modify: CORS 옵션 수정 * Feat: https 서버 업데이트 * HTTPS 적용 * Feat: COSR 옵션 https 추가 * Feat: 없는 지하철역 예외처리 * Feat: 없는 지하철역 예외처리 * Modify: 예외처리 진행 * Modify: https 서버 수정 * Feat: 길찾기 기능 가중치 추가 * Feat: 길찾기 필요 정보 추가, 인터페이스 수정 * Feat: CI/CD 수정 * Modify: 교통약자 도우미번호 추가 --- BackendJS/BackendTS/routes/navigation.js | 2 -- BackendJS/BackendTS/routes/subwaydata.js | 5 +++-- BackendTS/routes/subwaydata.ts | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/BackendJS/BackendTS/routes/navigation.js b/BackendJS/BackendTS/routes/navigation.js index 73bf96d..67b87f3 100644 --- a/BackendJS/BackendTS/routes/navigation.js +++ b/BackendJS/BackendTS/routes/navigation.js @@ -555,8 +555,6 @@ router.get('/:startX/:startY/:endX/:endY/:type', (req, res) => __awaiter(void 0, element.passStopList.stations[element.passStopList.stations.length - 1].stCd = endInfo.stCd; element.passStopList.stations[element.passStopList.stations.length - 1].lnCd = endInfo.lnCd; element.passStopList.stations[element.passStopList.stations.length - 1].railCd = endInfo.railCd; - console.log(element.passStopList.stations[0]); - console.log(element.passStopList.stations[element.passStopList.stations.length - 1]); } })); })); diff --git a/BackendJS/BackendTS/routes/subwaydata.js b/BackendJS/BackendTS/routes/subwaydata.js index b1205ad..6bf5b39 100644 --- a/BackendJS/BackendTS/routes/subwaydata.js +++ b/BackendJS/BackendTS/routes/subwaydata.js @@ -69,7 +69,7 @@ function getSubwayStationName(stNm, callback) { function getSubwayStationInfo(stCd, stNm, callback) { try { const connection = db.return_connection(); - let sql = "Select * FROM subcode_1 a, 도우미번호 b WHERE (a.stin_nm = b.역명 and a.ln_cd = b.운영노선명) and a.stin_cd = ? and a.stin_nm = ?"; + let sql = "Select RAIL_OPR_ISTT_CD, LN_CD, STIN_CD, STIN_NM, `교통약자도우미 전화번호` as wNum, en_name, f_code FROM subcode_1 a, 도우미번호 b WHERE (a.stin_nm = b.역명 and a.ln_cd = b.운영노선명) and a.stin_cd = ? and a.stin_nm = ?"; connection.query(sql, [stCd, stNm], function (err, results, fields) { if (err) { console.log(err); @@ -99,6 +99,7 @@ function getSubwayStationInfo(stCd, stNm, callback) { if (stationinfo === undefined) { return callback(null); } + console.log(results[0]); callback({ railCd: stationinfo.railOprIsttCd, lnCd: stationinfo.lnCd, @@ -107,7 +108,7 @@ function getSubwayStationInfo(stCd, stNm, callback) { roadNm: stationinfo.roadNmAdr, tmX: stationinfo.stinLocLon, tmY: stationinfo.stinLocLat, - wNum: results[0].wnum, + wNum: results[0].wNum, eName: results[0].en_name, fCode: results[0].f_code }); diff --git a/BackendTS/routes/subwaydata.ts b/BackendTS/routes/subwaydata.ts index c80962a..b23357c 100644 --- a/BackendTS/routes/subwaydata.ts +++ b/BackendTS/routes/subwaydata.ts @@ -50,7 +50,7 @@ function getSubwayStationInfo(stCd:string, stNm:string, callback:(stationInfo:Su const connection:mysql.connection = db.return_connection(); - let sql:string = "Select * FROM subcode_1 a, 도우미번호 b WHERE (a.stin_nm = b.역명 and a.ln_cd = b.운영노선명) and a.stin_cd = ? and a.stin_nm = ?"; + let sql:string = "Select RAIL_OPR_ISTT_CD, LN_CD, STIN_CD, STIN_NM, `교통약자도우미 전화번호` as wNum, en_name, f_code FROM subcode_1 a, 도우미번호 b WHERE (a.stin_nm = b.역명 and a.ln_cd = b.운영노선명) and a.stin_cd = ? and a.stin_nm = ?"; connection.query(sql, [stCd, stNm], function (err:Error, results:any, fields:any) { if (err) { @@ -95,7 +95,7 @@ function getSubwayStationInfo(stCd:string, stNm:string, callback:(stationInfo:Su roadNm: stationinfo.roadNmAdr, tmX: stationinfo.stinLocLon, tmY: stationinfo.stinLocLat, - wNum: results[0].wnum, + wNum: results[0].wNum, eName: results[0].en_name, fCode: results[0].f_code }); From 299bfa520941905f4cbe20cd89a1de4346662bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B7=9C=ED=83=9C?= <79373803+KyuTae98@users.noreply.github.com> Date: Mon, 11 Dec 2023 23:54:42 +0900 Subject: [PATCH 6/8] Frontend (#207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat. 새로 고침 버튼 개발[#46] * 새로 고침 버튼을 개발하여 클릭 시 다시 해당 정류장의 버스를 받는 기능을 개발하였다. Resolves #46 * feat. map component 리팩토링 * 지하철 기능을 위해 map component 리팩토링 하였습니다. * feat. 버스페이지 css작업 완료 * 버스페이지 css작업 완료 * feat. 입력 폼 변경 * 입력 부분에서 검색어 바뀔 때마다 서버에 요청 * feat. 지하철 page생성 지하철 page 뼈대를 만들었습니다. * feat. map-slice수정 * feat. subway page개발(v1.1) * feat. main화면 bus화면 디자인 변경 * 변경 했지만 반응형 추가 필요 * feat. 디자인 폰트, 버스 페이지 어느 정도 완성 * 디자인 폰트, 버스 페이지 80% 완성, 반응형으로 만들기 수정 * feat. 지하철 페이지 디자인에 맞춰 개발 * feat. 지하철 메뉴 * 지하철 메뉴에 해당하는 페이지 설정 * feat. 모바일 반응형 * 모바일 반응형 완료 아직 지하철 페이지는 개발 필요함 * feat. 환승 page개발 * feat. HashRouter로 변경 * BrowserRouter에서 HashRouter로 변경 * feat. 이모지 + 서버 * feat.지하철 수정 * feat. map focusing 수정 * feat. 휠체어 기능 하기 전 저장 * 휠체어 기능 하기 전 저장 * feat. 휠체어 수정 완료 * 휠체어 수정 완료 * feat. 디테일한 수정 * 디테일한 수정 * Update Api.js * feat. 약간의 수정 * 약간의 수정 * feat.폰트, 맵 초기화 수정 * 폰트, 맵 초기화 수정 * feat. 최종 수정 * 최종 수정 * Update StationItem.js * refac: typescript로 Refectoring중 * feat(front): ts변경 오류 다수 발견 * feat(front): gps기반 지도 중심 개발 * fix(front): Api 수정 * fix(front): map 변경 * feat: 간단 퍼블리싱(1) * feat:menuBar 수정(SVG로 표현) * feat(front): 모바일 환경에 맞게 수정 * feat(): busmode 완성 * feat: busmode 수정 * feat: 지하철 수정 * feat: 지하철 마무리 * feat: map Marker 클릭이벤트 등록 완료 * feat: 길찾기 솔루션 개발중 * feat: 수정 * fix: 위도 경도 수정 * fix: api 수정 * fix: api변경 * feat: 환승역 개발 * feat: 지하철 환승 페이지 완료 * fix: 지도 위치 변경 * fix: page 높이 수정 * feat: 길찾기 페이지 설명 자세히 * fix: refresh 버튼 이미지 추가 * fix: 로딩 환경 완료 * feat: loding component 구축 * feat: subway elevator loding 적용 * feat: Subway 휠체어 관련 위치 loding 완료 * feat: 환승 이동 경로 loding --- .../creative/public/image/refresh.png | Bin 0 -> 11336 bytes Backend/Frontend/creative/src/App.tsx | 2 +- .../bus-component/buslist/BusItem.tsx | 4 +- .../bus-component/buslist/BusTimer.tsx | 5 +- .../bus-component/busnumber/BusNumber.tsx | 2 +- .../creative/src/component/loding/Loding.css | 8 ++ .../creative/src/component/loding/Loding.tsx | 8 +- .../src/component/loding/lodingSvg.svg | 1 + .../src/component/map/Mapping.module.css | 3 +- .../src/component/map/SignMapping.tsx | 6 +- .../sign-component/SignDetailInfo.tsx | 6 +- .../sign-component/SignDetailInfoLIst.tsx | 56 +++++++++ .../component/sign-component/signSvg/BUS.svg | 1 - .../sign-component/signSvg/SUBWAY.svg | 1 - .../src/component/sign-component/signUtil.tsx | 7 +- .../subwaydetail/SubwayDetail.tsx | 81 ------------- .../subwaydetail/SubwayDetailMain.tsx | 34 ++++++ .../subwaydetail/SubwayMain.tsx | 114 ++++++++++++++++++ .../subwayelebator/SubwayElebatorImg.tsx | 15 +++ .../subwayinfo/SubwayInfo.tsx | 3 +- .../subwaylist/SubwayList.tsx | 2 +- .../subwaymenubar/SubwayBar.tsx | 2 +- .../subwaytransfer/SubwayTransferDetail.tsx | 31 +---- .../subwaytransfer/SubwayTransferLIst.tsx | 39 ++---- .../creative/src/hook/useBusTImer.tsx | 27 +++++ .../subwaypage/SubwayBathchair.module.css | 3 + .../src/page/subwaypage/SubwayBathchair.tsx | 42 ++----- .../src/page/subwaypage/SubwayDetailPage.tsx | 37 +----- .../src/page/subwaypage/SubwayElevator.tsx | 49 -------- ...dule.css => SubwayElevatorPage.module.css} | 7 +- .../page/subwaypage/SubwayElevatorPage.tsx | 37 ++++++ .../subwaypage/SubwayTransferDetailPage.tsx | 19 ++- .../subwaypage/SubwayTransferPage.module.css | 4 + .../page/subwaypage/SubwayTransferPage.tsx | 13 +- .../creative/src/utils/getSubwayApi.ts | 82 +++++++++++++ 35 files changed, 472 insertions(+), 279 deletions(-) create mode 100644 Backend/Frontend/creative/public/image/refresh.png create mode 100644 Backend/Frontend/creative/src/component/loding/Loding.css create mode 100644 Backend/Frontend/creative/src/component/loding/lodingSvg.svg create mode 100644 Backend/Frontend/creative/src/component/sign-component/SignDetailInfoLIst.tsx delete mode 100644 Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg delete mode 100644 Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg delete mode 100644 Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx create mode 100644 Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetailMain.tsx create mode 100644 Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayMain.tsx create mode 100644 Backend/Frontend/creative/src/component/subway-component/subwayelebator/SubwayElebatorImg.tsx create mode 100644 Backend/Frontend/creative/src/hook/useBusTImer.tsx delete mode 100644 Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx rename Backend/Frontend/creative/src/page/subwaypage/{SubwayElevator.module.css => SubwayElevatorPage.module.css} (79%) create mode 100644 Backend/Frontend/creative/src/page/subwaypage/SubwayElevatorPage.tsx create mode 100644 Backend/Frontend/creative/src/utils/getSubwayApi.ts diff --git a/Backend/Frontend/creative/public/image/refresh.png b/Backend/Frontend/creative/public/image/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..16de61d47f59d15a4253194ff5b1d20bf06a9899 GIT binary patch literal 11336 zcmd6NXH-*9(DzLO0i}sZ?+`#idaprhLRE?)T@j=g=~5E@HV|o{3P=zF8dN|j0)j-P zSg4UEAVyHCKmrJ%KNp|#etf?_=OpJQcXnoeyE{8OGrKA0ZOqw@3mgXkfDMf@u>$}o z_!9~+!@ApS*Mz^5d$%YfG2UCaUn14O&5dWgyY_&NHjXUl(@yL;>3`vbj+7o>;$X0xZ%f` z8;4FZz2ed`bJ2+bhi~JS_Y?K|=d_b|^nTR!xyNBJyRSFL#n3p!|GCe2{o8pc0&U9A z@rS{RNgCD<>4&CbJCh=b#u@;Q@beG55J#(!)~PWzzBdmKm#|;!Jo}dDl5NNy7m!w#N?SiBG-o4p;Qj$LXI|5CXwvv<|S{lBC@y&xhaX6H-z!4rt zG0bv?(>(C%q&LqFOr_9vD%^DKm%N96`GKhm3n6l79H0438|2P=q}ns=C5LTGOWaTt zUgF@tcA}om_?7ee(>7SUZ_+STxN10cu8|PrEW>sX(kT66V?|Pa2U?)?t6kI|i1DZ5 zFJ(5yCLDJ{gLU)+0wlTu%HD$>S@r|FL=JoJp15`^{p=0YuK&{?<+9NqW9RERcMCa}8Qd?Ia2U6n*&`XmGn0C4t$?{lMt|qhe_K#|hCJ;5x<{hccWE_{PLfa3EkX|oPq!`To+a&{irk@k>Ek(OGUeUbJs0+L$jah z+9dSo%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udYE(;#loIvNk;fvv|-Uw00 z9~-@ypRM86ta|kJGHg%VU{oo`Oj6DU*Q z$rd{vI^dg7v|+F%$~Y?C@J)rHPa=}Qdl?RVtH4viFQ^G7B>HAPi9U9NaB5T_W<+6Ch`TNO1f(Vah9^KJXgVzo~d%!33w_t>Y)P2GH<% z5B!Wo#PmlM(WYAPrVM)a6XgmYdE|8gFt0*)0-Ni~@z8ro1kL6>xgoT4O6+~!)e zy(qe~&~!XoZ-*;aIkI1pV47%9DNnqR&X{;^4?R-Q;;l^$^9(=`A9n#yvfb5%63FV6 z?Ar>pg1DiRUs3p&izhHp4QYwjSsH^l!o~6I`f`fEwC%^P4T&viNayOd)G=%ViiI(V z!OFf4TTkkjxr*@P+GJ9Amv-AKeCUyBj&S=1DWr7=eDVenT zQy5}zBLeSZY&60RHMC(_Q2mzXcuLwghhUk6?p2vYbQLLz6iedjz*EyMGfe`;w?mwA z2_*%n@$>Wf9Ug$y?kilq*>7e9T6`zTJ}DsV5te9>0TG2onc*A+NMUH_C6xw>NzW4715024>!(k!a6+8TkY4~Wy5cNe`%Zc`@UlX z8W}1SDiEroB-to5{1NbzI+P++kY--~Mh(|N&b$1Dg`@FnQ_vpp&eFLR_*+I-REsfq zh>-PniBSOxZYezVM2+aI&8#slVrMH%O#g=oSoTjL9V7i2@Xz@WPKqRLC4EWS2Ic() z3xRAQ(d6$**>FrtX8`{!>=MW9amoT{GCSZIzFF`|>J5!a;V}>i8|^GrlKf;(4(oC6 zq9iwHmjZ3VNgtBRvE^u&_vsujp6ZJ*C0aN)V`eDG8rBym*#~Uc9I%djLPL$g9P-sz z&Od#dz_P!?a`2tNn1D0;1UIa*LDnKePlS>v{n{j(EYso1<7C-=UAQVo6Pwe?%Q-_P z;0?UhUQc8DP#{#SR#8dn)l(5cKm_4NS>;<>Pb9zH#mV}>z%V$1Y|r#2d*$RGtzXDh z { - const [Timer] = useState(props.timer); + const [timer,setTimer] = useState(props.timer); + console.log(props.timer) setInterval(() => {}, 1000); - return {Timer}; + return {timer}; }; export default BusTimer; diff --git a/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx b/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx index 2613da0..3d5ed8f 100644 --- a/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx +++ b/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx @@ -4,7 +4,7 @@ import RefreshButton from "../buslist/RefreshButton.tsx"; import { useSelector } from "react-redux"; import { RootState } from "../../../store/index"; -const StyledBusNumber = styled.header` +const StyledBusNumber = styled.div` display:flex; justify-content: space-between; line-height: 60px; diff --git a/Backend/Frontend/creative/src/component/loding/Loding.css b/Backend/Frontend/creative/src/component/loding/Loding.css new file mode 100644 index 0000000..38132e5 --- /dev/null +++ b/Backend/Frontend/creative/src/component/loding/Loding.css @@ -0,0 +1,8 @@ +.loding{ + animation: rotate_image 6s linear infinite; +} +@keyframes rotate_image{ + 100% { + transform: rotate(360deg); + } +} \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/loding/Loding.tsx b/Backend/Frontend/creative/src/component/loding/Loding.tsx index fe2728f..7c5028d 100644 --- a/Backend/Frontend/creative/src/component/loding/Loding.tsx +++ b/Backend/Frontend/creative/src/component/loding/Loding.tsx @@ -1,13 +1,11 @@ import React from "react"; - - +import {ReactComponent as LODING} from "./lodingSvg.svg"; +import "./Loding.css"; const Loding = () => { return ( -
- Loding... -
+ ) } diff --git a/Backend/Frontend/creative/src/component/loding/lodingSvg.svg b/Backend/Frontend/creative/src/component/loding/lodingSvg.svg new file mode 100644 index 0000000..48b44a7 --- /dev/null +++ b/Backend/Frontend/creative/src/component/loding/lodingSvg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/map/Mapping.module.css b/Backend/Frontend/creative/src/component/map/Mapping.module.css index 488641d..fff2669 100644 --- a/Backend/Frontend/creative/src/component/map/Mapping.module.css +++ b/Backend/Frontend/creative/src/component/map/Mapping.module.css @@ -1,4 +1,5 @@ .busmap, .subwaymap, .signmap { width: 100vw; - height: 85vh; + height: 90%; + } diff --git a/Backend/Frontend/creative/src/component/map/SignMapping.tsx b/Backend/Frontend/creative/src/component/map/SignMapping.tsx index 91537c1..822b747 100644 --- a/Backend/Frontend/creative/src/component/map/SignMapping.tsx +++ b/Backend/Frontend/creative/src/component/map/SignMapping.tsx @@ -34,11 +34,13 @@ const Mapping = () => { setMap(map); const Startmarker = new window.kakao.maps.Marker({ position:map.getCenter() - }) + }) Startmarker.setMap(map); const Endmarker = new window.kakao.maps.Marker({ position:map.getCenter() - }) + }) + dispatch(SignActions.initializationStart(map.getCenter())) + dispatch(SignActions.initializationEnd(map.getCenter())) Endmarker.setMap(map); setStart(Startmarker) setEnd(Endmarker); diff --git a/Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx b/Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx index cc5a01a..8cc4360 100644 --- a/Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx +++ b/Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx @@ -1,5 +1,6 @@ import React from "react"; import styled from "styled-components"; +import SignDetailInfoList from "./SignDetailInfoLIst.tsx"; const StyledSignDetailInfo = styled.div` display: flex; @@ -28,9 +29,10 @@ const SignDetailInfo = ({graph}:any) => { {name}
- {ele.endName} - - {ele.startName} + {ele.startName} - + {ele.endName}
+
) } diff --git a/Backend/Frontend/creative/src/component/sign-component/SignDetailInfoLIst.tsx b/Backend/Frontend/creative/src/component/sign-component/SignDetailInfoLIst.tsx new file mode 100644 index 0000000..42072d7 --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/SignDetailInfoLIst.tsx @@ -0,0 +1,56 @@ +import React from "react"; +import styled from "styled-components"; + +import {moveSubway} from "./signUtil.tsx" +import BusTimer from "../bus-component/buslist/BusTimer.tsx" +import useBusTimer from "../../hook/useBusTImer.tsx"; + +const StyledSignInfoList = styled.ul` + display: flex; + flex-direction: column; + padding: 0; +` + +const StyledSignInfoListDetail = styled.li` + font-size: 0.8em; +` + +const StyledSignInfoSubway = styled.button` + display: flex; + border: none; + font-family: "Pretendard-Regular"; + font-style: normal; + background-color: white; + font-size: 1em; + padding: 0; + margin: 1em 0; +` + + +const SignDetailInfoList = ({info}:any) => { + const timer = useBusTimer(info.startArsID,info.lane[0].busNo) + if(info.trafficType===2){//버스 + return ( + + {info.startName} + + {info.passStopList.stations.map((ele:any)=>( + {ele.stationName} + ))} + + ) + } + else if(info.trafficType===1){//지하철 + return ( + + moveSubway(info.passStopList.stations[0].stationID,info.passStopList.stations[0].stationName)}>{info.startName} 편의시설 + {info.passStopList.stations.map((ele:any)=>( + {ele.stationName} + ))} + moveSubway(info.passStopList.stations.at(-1).stationID,info.passStopList.stations.at(-1).stationName)}>{info.endName} 편의시설 + + ) + } +} + +export default SignDetailInfoList \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg b/Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg deleted file mode 100644 index 3866ca4..0000000 --- a/Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg b/Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg deleted file mode 100644 index c2a2ec9..0000000 --- a/Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx b/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx index 701fd52..39c3530 100644 --- a/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx +++ b/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx @@ -9,4 +9,9 @@ interface coordinate { export const submitStartAndEnd = (start:coordinate,end:coordinate) =>{ window.location.href = `/#/sign/detail/${start.tmY}/${start.tmX}/${end.tmY}/${end.tmX}` -} \ No newline at end of file +} + + +export const moveSubway = (stationID:number,stationName:string) => { + window.location.href = `/#/subway/detail/${stationID}/${stationName}` +} diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx deleted file mode 100644 index e78daa7..0000000 --- a/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import React from "react"; -import styled from "styled-components"; - -interface subDetail { - idColor:string[]; - line:number; -} - -const SubwayDetail = (props:any) => { - const {info} = props; - const idColor = ["#0052A4", "#00A84D", "#EF7C1C", "#00A5DE", "#996CAC", "#CD7C2F", "#747F00", "#E6186C"]; - return ( - -
- {info.lnCd} - {info.stNm} -
-
- info-images{info.roadNm} - 교통약자 도우미 전화번호
{info.wNum}
- 지하철역 영문명: {info.eName} - 지하철역 FR_CODE: {info.fCode} -
-
- ) -} - -const StyledDetail = styled.div` -display:flex; -flex-direction:column; -width: 98vw; -height: 40vh; -background-color:white; -border: 4px solid #FFD12D; -.info-image{ - width: 1em; - height: 1em; -} -.name{ - font-family: 'Pretendard-Regular'; - display:flex; - align-items:center; - width:96%; - height:200%; - font-weight: 600; - font-size: 1em; - padding-left:4%; - border-bottom: 4px solid #FFD12D; -} -.line{ - display:flex; - justify-content:center; - align-items:center; - color:#FFFFFF; - font-style: normal; - font-size: 100%; - font-weight: 600; - width: 1.4em; - height: 1.4em; - background-color:${props => (props.idColor[props.line - 1])}; - border-radius:20px; -} -.info{ - font-family: 'Pretendard-Regular'; - width:96%; - height: 800%; - display:flex; - flex-direction:column; - font-weight: 600; - font-size: 100%; - padding-left:4%; - padding-top:4%; -} -.info span{ - width:100%; - margin-bottom: 1em; -} -` - - -export default SubwayDetail; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetailMain.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetailMain.tsx new file mode 100644 index 0000000..942986c --- /dev/null +++ b/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetailMain.tsx @@ -0,0 +1,34 @@ +import React,{Suspense} from "react"; +import styled from "styled-components"; +import SubwayMain from "./SubwayMain"; +import Loding from "../../loding/Loding.tsx"; + +import {getSubwayDetail} from "../../../utils/getSubwayApi.ts" +import { useParams } from "react-router-dom" + +const StyledDetailMain = styled.main` +display:flex; +flex-direction:column; +justify-content: center; +align-items: center; +width: 98vw; +height: 36vh; +background-color:white; +border: 4px solid #FFD12D; +` + +const SubwayDetailMain = () => { + const params = useParams() + const stCd = params.stCd; + const stNm = params.stNm; + return ( + + }> + + + + ) +} + + +export default SubwayDetailMain; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayMain.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayMain.tsx new file mode 100644 index 0000000..f05841b --- /dev/null +++ b/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayMain.tsx @@ -0,0 +1,114 @@ +import React from "react"; +import styled from "styled-components"; +import { useDispatch } from "react-redux"; +import { SubwayActions } from "../../../store/Subway-slice.ts"; + +interface subDetail { + idColor:string[]; + line:number; +} + +const SubwayMain = (props:any) => { + const dispatch = useDispatch(); + const {info}:any = props; + const { + lnCd, + stNm, + roadNm, + wNum, + eName, + fCode, + railCd, + stCd + } = info.detail.read(); + dispatch(SubwayActions.saveSubway({ + lnCd, + stNm, + roadNm, + wNum, + eName, + fCode, + railCd, + stCd + })) + const idColor = [ + "#0052A4", + "#00A84D", + "#EF7C1C", + "#00A5DE", + "#996CAC", + "#CD7C2F", + "#747F00", + "#E6186C", + ]; + return ( + +
+ {lnCd} + {stNm} +
+
+ + info-images + {roadNm} + + + 교통약자 도우미 전화번호 +
+ {wNum} +
+ 지하철역 영문명: {eName} + 지하철역 FR_CODE: {fCode} +
+
+ ); +}; + +const StyledSubwayDeatil = styled.div` + width: 100%; + .info-image { + width: 1em; + height: 1em; + } + .name { + font-family: 'Pretendard-Regular'; + display: flex; + align-items: center; + width: 96%; + min-height: 20%; + font-weight: 600; + font-size: 1em; + padding-left: 4%; + border-bottom: 4px solid #ffd12d; + } + .line { + display: flex; + justify-content: center; + align-items: center; + color: #ffffff; + font-style: normal; + font-size: 100%; + font-weight: 600; + width: 1.4em; + height: 1.4em; + background-color: ${(props) => props.idColor[props.line - 1]}; + border-radius: 20px; + } + .info { + font-family: 'Pretendard-Regular'; + width: 96%; + + display: flex; + flex-direction: column; + font-weight: 600; + font-size: 100%; + padding-left: 4%; + padding-top: 4%; + } + .info span { + width: 100%; + margin-bottom: 1em; + } +`; + +export default SubwayMain; diff --git a/Backend/Frontend/creative/src/component/subway-component/subwayelebator/SubwayElebatorImg.tsx b/Backend/Frontend/creative/src/component/subway-component/subwayelebator/SubwayElebatorImg.tsx new file mode 100644 index 0000000..a875826 --- /dev/null +++ b/Backend/Frontend/creative/src/component/subway-component/subwayelebator/SubwayElebatorImg.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import styled from 'styled-components'; + +const StyledElevatorImg = styled.img` + width: 100vw; +`; + +const SubwayElebatorImg = (props:any) => { + const {elevator} = props; + return ( + + ); +}; + +export default SubwayElebatorImg; diff --git a/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx b/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx index 5231980..1dae08d 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx @@ -26,7 +26,8 @@ overflow:auto; ` const SubwayInfo = (props:any) => { - const {info} = props; + const {bath} = props; + const info = bath.liftMove.read(); return ( {info.map((element:any) => { diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx index 4bcde16..794bc08 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx @@ -11,7 +11,7 @@ flex-direction:column; align-items: center; box-sizing: border-box; width: 100%; -max-height:40%; +max-height:40vh; padding: 0; margin:0; margin-bottom:18%; diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx index 56c6753..0b9dd7f 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx @@ -49,7 +49,7 @@ const SubwayBar = () => { const si:any = useSelector((state:RootState) => state.subway.subwayInfo) return ( -
  • 편의시설 위치
  • +
  • 엘리베이터 위치
  • 환승 이동 경로
  • 휠체어 관련 위치
  • diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferDetail.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferDetail.tsx index d5ef0a6..89682ab 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferDetail.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferDetail.tsx @@ -19,35 +19,16 @@ const StyledTransferDetailLi = styled.span` font-size: 1em; ` -const SubwayTranferDetail = ({param,setImage}:any) => { - const [tranferInfo,setTransferInfo] = useState(); - useEffect(() => { - const stCd = param.stCd; - const stNm = param.stNm; - const railCd = param.railCd; - const lnCd = param.lnCd; - const prevStinCd = param.prevStinCd; - const chthTgtLn = param.chthTgtLn; - const chtnNextStinCd = param.chtnNextStinCd; - const getDetail = async () => { - await api.get(`/subway/transferMove/transferInfo/${stCd}/${stNm}/${railCd}/${lnCd}/${prevStinCd}/${chthTgtLn}/${chtnNextStinCd}`) - .then(res => { - const { data } = res; - setTransferInfo(data) - setImage(data[0].imgPath) - }).catch(error=>{ - console.log(error) - }) - } - getDetail() - }, [param]) +const SubwayTranferDetail = (props:any) => { + const {tranferdetail, setImage} = props; + const tranferInfo = tranferdetail.transferinfo.read(); + setImage(tranferInfo[0].imgPath) return( - {tranferInfo&&( {tranferInfo[0].stMovePath} {">>"} {tranferInfo[0].edMovePath} - )} - {tranferInfo&&tranferInfo.map((ele:any,index:number)=>( + + {tranferInfo.map((ele:any,index:number)=>( {ele.mvContDtl} diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferLIst.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferLIst.tsx index a570acc..532cac2 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferLIst.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaytransfer/SubwayTransferLIst.tsx @@ -1,8 +1,8 @@ -import React,{useEffect, useState} from "react"; +import React from "react"; import styled from "styled-components"; -import { api } from "../../auth/Api.ts" import { Link } from "react-router-dom"; +import { useParams } from "react-router-dom"; const StyledSubwayTransferDetail = styled.main` display:flex; flex-direction:column; @@ -28,37 +28,14 @@ const StyledTransferDetailLi = styled.span` border-bottom: 1px solid; font-size: 1em; ` -/* -/subway/transferMove/transferInfo/:stCd/:stNm/:railCd/:lnCd/:prevStinCd/:chthTgtLn/:chtnNextStinCd - -*/ - -const SubwayTranferDetail = ({param}:any) => { - const [source,setSource] = useState<[]>() - const [transfer,setTransfer] = useState<[]>() - useEffect(() => { - const stCd = param.stCd; - const stNm = param.stNm; - const railCd = param.railCd; - const lnCd = param.lnCd; - const getDetail = async () => { - await api.get(`/subway/transferMove/transferList/${stCd}/${stNm}/${railCd}/${lnCd}`) - .then(res => { - const { data } = res; - const {sourceStation,transferStation} = data - setSource(sourceStation); - setTransfer(transferStation); - }).catch(error=>{ - alert("환승역이 아닙니다!") - window.location.href = `/#/subway/detail/${stCd}/${stNm}` - }) - } - getDetail() - }, [param]) +const SubwayTranferDetail = (props:any) => { + const param = useParams(); + const {tranfer} = props; + const {sourceStation, transferStation} = tranfer.transferDetail.read(); return( - {source&&source.map((sor:any)=>( - (transfer&&transfer.map((tran:any)=>( + {sourceStation.map((sor:any)=>( + (transferStation.map((tran:any)=>( {sor.stNm} - {tran.stNm} diff --git a/Backend/Frontend/creative/src/hook/useBusTImer.tsx b/Backend/Frontend/creative/src/hook/useBusTImer.tsx new file mode 100644 index 0000000..def0bea --- /dev/null +++ b/Backend/Frontend/creative/src/hook/useBusTImer.tsx @@ -0,0 +1,27 @@ +import React, {useState,useEffect} from "react" +import { api } from "../component/auth/Api.ts" + + + +const useBusTimer = (BusArsID:string,BusNo:number) => { + const [timer,setTimer] = useState(["0","0"]) + useEffect(()=> { + const getBusTime = async () => { + let arsId = BusArsID.split("-").join(""); + await api(`/bus/arsId/${arsId}`).then((res)=>{ + const {data} = res; + data.forEach((ele:any)=>{ + if(ele.busrouteAbrv===BusNo) + setTimer(()=>[ele.min,ele.sec]); + }) + }).catch((error)=>{ + setTimer(()=>["5","10"]) + }) + } + if(typeof BusArsID==="string") + getBusTime(); + },[]) + return timer +} + +export default useBusTimer; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css index 2f582c4..f18d7ce 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css @@ -1,4 +1,7 @@ .main { + display: flex; + flex-direction: column; + align-items: center; width: 100vw; margin-top: 10vh; } diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx index 54c5f93..f157302 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx @@ -1,51 +1,35 @@ -import React from "react"; +import React, {Suspense} from "react"; import classes from "./SubwayBathchair.module.css" import Header from "../../component/header/Header.tsx" import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" import SubwayInfo from "../../component/subway-component/subwayinfo/SubwayInfo.tsx" import MenuBar from "../../component/menu/MenuBar.tsx"; +import SubwayElebatorImg from "../../component/subway-component/subwayelebator/SubwayElebatorImg.tsx"; +import Loding from "../../component/loding/Loding.tsx"; import { useParams } from "react-router-dom" -import { api } from "../../component/auth/Api.ts" -import { useEffect, useState } from "react" import { useDispatch } from "react-redux" import { SubwayActions } from "../../store/Subway-slice.ts" - +import {getBathChair, getBathChairConvinence} from "../../utils/getSubwayApi.ts" const SubwayBathchair = () => { const params = useParams(); - const [bath, setBath] = useState([]); - const [image, setimage] = useState(""); const dispatch = useDispatch() - useEffect(() => { - const stCd = params.stCd; - const stNm = params.stNm; - const railCd = params.railCd; - const lnCd = params.lnCd; - dispatch(SubwayActions.saveSubway({ stCd, stNm, railCd, lnCd })) - const getBathChair = async () => { - await api.get(`/subway/liftMove/${stCd}/${stNm}/${railCd}/${lnCd}`) - .then(res => { - const { data } = res; - setBath(data) - }) - await api.get(`/subway/convenience/${stCd}/${stNm}/${railCd}/${lnCd}`) - .then(res => { - const { data } = res; - setimage(data[0].imgPath) - }) - } - getBathChair() - }, [dispatch,params.lnCd,params.railCd,params.stCd,params.stNm]) - + const stCd = params.stCd; + const stNm = params.stNm; + const railCd = params.railCd; + const lnCd = params.lnCd; + dispatch(SubwayActions.saveSubway({ stCd, stNm, railCd, lnCd })) return (
    } /> - - subwayImage + }> + + +
    diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx index 348e896..2f0cbe5 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx @@ -1,44 +1,19 @@ -import React, { useEffect, useState } from "react" - +import React from "react" import classes from "./SubwayDetailPage.module.css" import Header from "../../component/header/Header.tsx" import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" -import SubwayDetail from "../../component/subway-component/subwaydetail/SubwayDetail.tsx" +import SubwayDetailMain from "../../component/subway-component/subwaydetail/SubwayDetailMain.tsx" import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" import MenuBar from "../../component/menu/MenuBar.tsx" -import { useDispatch } from "react-redux" -import { SubwayActions } from "../../store/Subway-slice.ts" -import { api } from "../../component/auth/Api.ts" -import { useParams } from "react-router-dom" - const SubwayDetailPage = () => { - const params = useParams() - const dispatch = useDispatch() - const [info, setInfo] = useState({}) - - useEffect(() => { - const stCd = params.stCd; - const stNm = params.stNm; - const getDetail = async () => { - await api.get(`/subway/stationInfo/${stCd}/${stNm}`) - .then(res => { - const { data } = res; - const { stationinfo } = data; - setInfo(stationinfo); - dispatch(SubwayActions.saveSubway(stationinfo)) - }) - } - getDetail() - }, [dispatch,params.stCd,params.stNm]) - return (
    -
    - } /> - -
    +
    + } /> + +
    ) diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx deleted file mode 100644 index 43f7837..0000000 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import React from "react"; -import classes from "./SubwayElevator.module.css" -import Header from "../../component/header/Header.tsx" -import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" -import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" -import MenuBar from "../../component/menu/MenuBar.tsx"; - -import { useParams } from "react-router-dom" -import { api } from "../../component/auth/Api.ts" -import { useEffect, useState } from "react" -import { useDispatch } from "react-redux" -import { SubwayActions } from "../../store/Subway-slice.ts" - -interface subEle { - imgPath:string; -} - -const SubwayElevator = () => { - const params = useParams(); - const dispatch = useDispatch(); - const [ElePos, setElePos] = useState([{imgPath:""}]); - useEffect(() => { - const stCd = params.stCd; - const stNm = params.stNm; - const railCd = params.railCd; - const lnCd = params.lnCd; - dispatch(SubwayActions.saveSubway({ stCd, stNm, railCd, lnCd })) - const getBathChair = async () => { - await api.get(`/subway/convenience/${stCd}/${stNm}/${railCd}/${lnCd}`) - .then(res => { - const { data } = res; - setElePos(()=>data); - }) - } - getBathChair() - }, [dispatch, params.lnCd,params.railCd,params.stCd,params.stNm]) - - return ( -
    -
    -
    - } /> - elevator -
    - -
    - ) -} -export default SubwayElevator diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevatorPage.module.css similarity index 79% rename from Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.module.css rename to Backend/Frontend/creative/src/page/subwaypage/SubwayElevatorPage.module.css index 9a0f768..f41b88c 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevatorPage.module.css @@ -1,12 +1,11 @@ .main { + display: flex; + flex-direction: column; + align-items: center; width: 100vw; margin: 10vh; } -.elevator { - width: 100vw; -} - .subwaypage { display: flex; flex-direction: column; diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevatorPage.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevatorPage.tsx new file mode 100644 index 0000000..b259dc8 --- /dev/null +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevatorPage.tsx @@ -0,0 +1,37 @@ +import React, {Suspense} from "react"; +import classes from "./SubwayElevatorPage.module.css" +import Header from "../../component/header/Header.tsx" +import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" +import SubwayElebatorImg from "../../component/subway-component/subwayelebator/SubwayElebatorImg.tsx" +import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" +import MenuBar from "../../component/menu/MenuBar.tsx"; +import Loding from "../../component/loding/Loding.tsx"; + +import { useParams } from "react-router-dom" +import { getBathChair } from "../../utils/getSubwayApi.ts"; +import { useDispatch } from "react-redux" +import { SubwayActions } from "../../store/Subway-slice.ts" + + +const SubwayElevatorPage = () => { + const dispatch = useDispatch(); + const params = useParams(); + const stCd = params.stCd; + const stNm = params.stNm; + const railCd = params.railCd; + const lnCd = params.lnCd; + dispatch(SubwayActions.saveSubway({ stCd, stNm, railCd, lnCd })) + return ( +
    +
    +
    + } /> + }> + + +
    + +
    + ) +} +export default SubwayElevatorPage diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferDetailPage.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferDetailPage.tsx index 06a2c77..76a523a 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferDetailPage.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferDetailPage.tsx @@ -1,4 +1,4 @@ -import React,{useState} from "react" +import React,{useState,Suspense} from "react" import classes from "./SubwayTransferPage.module.css" import Header from "../../component/header/Header.tsx" @@ -6,21 +6,32 @@ import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPane import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" import SubwayTransferDetail from "../../component/subway-component/subwaytransfer/SubwayTransferDetail.tsx" import MenuBar from "../../component/menu/MenuBar.tsx" +import Loding from "../../component/loding/Loding.tsx" +import {getTransferInfo} from "../../utils/getSubwayApi.ts" import { useParams } from "react-router-dom" const SubwayTranferPage = () => { const param = useParams(); + const stCd = param.stCd; + const stNm = param.stNm; + const railCd = param.railCd; + const lnCd = param.lnCd; + const prevStinCd = param.prevStinCd; + const chthTgtLn = param.chthTgtLn; + const chtnNextStinCd = param.chtnNextStinCd; const [image,setImage] = useState() - console.log(image) return (
    } /> - + }> + + {image} +
    - {image} +
    ) diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.module.css index 586a7e9..d91350d 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.module.css @@ -6,6 +6,10 @@ } .main { + display: flex; + flex-direction: column; + align-items: center; + width: 100vw; margin-top: 10vh; } diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.tsx index e8a341e..14798ea 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayTransferPage.tsx @@ -1,5 +1,4 @@ - -import React from "react" +import React,{Suspense} from "react" import classes from "./SubwayTransferPage.module.css" import Header from "../../component/header/Header.tsx" @@ -7,17 +6,25 @@ import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPane import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" import SubwayTranferList from "../../component/subway-component/subwaytransfer/SubwayTransferLIst.tsx" import MenuBar from "../../component/menu/MenuBar.tsx" +import Loding from "../../component/loding/Loding.tsx" +import {getTransferDetail} from "../../utils/getSubwayApi.ts" import { useParams } from "react-router-dom" const SubwayTranferPage = () => { const param = useParams(); + const stCd = param.stCd; + const stNm = param.stNm; + const railCd = param.railCd; + const lnCd = param.lnCd; return (
    } /> - + }> + +
    diff --git a/Backend/Frontend/creative/src/utils/getSubwayApi.ts b/Backend/Frontend/creative/src/utils/getSubwayApi.ts new file mode 100644 index 0000000..f52ebb7 --- /dev/null +++ b/Backend/Frontend/creative/src/utils/getSubwayApi.ts @@ -0,0 +1,82 @@ +import { wrapPromise } from "../promise/warmPromise.ts"; + +import { api } from "../component/auth/Api.ts"; + +export const getSubwayDetail = (stCd:any,stNm:any) =>{ + const getDetail = async () => { + const asyncDetail = await api.get(`/subway/stationInfo/${stCd}/${stNm}`) + .then(res => { + const { data } = res; + const { stationinfo } = data; + return stationinfo + }) + return asyncDetail; + } + return { + detail:wrapPromise(getDetail()) + } +} + +export const getBathChair = (stCd: any, stNm: any, railCd: any, lnCd: any) => { + const getBathChairDetail = async () => { + const asyncBathChair = await api.get(`/subway/convenience/${stCd}/${stNm}/${railCd}/${lnCd}`) + .then(res => { + const { data } = res; + return data; + }); + return asyncBathChair; + }; + + return { + ele: wrapPromise(getBathChairDetail()) + }; +}; + + +export const getBathChairConvinence = (stCd: any, stNm: any, railCd: any, lnCd: any) => { + const getliftMoveData = async () => { + const liftMoveData = await api.get(`/subway/liftMove/${stCd}/${stNm}/${railCd}/${lnCd}`) + .then(res => res.data); + return liftMoveData + }; + + return { + liftMove: wrapPromise(getliftMoveData()) + }; +}; + + +export const getTransferDetail = (stCd: any, stNm: any, railCd: any, lnCd: any) => { + const getTransferDetailData = async () => { + const subwaytransfer = await api.get(`/subway/transferMove/transferList/${stCd}/${stNm}/${railCd}/${lnCd}`) + .then(res=>{ + const { data } = res; + const { sourceStation, transferStation } = data; + return { sourceStation, transferStation }; + }).catch (error => { + alert("환승역이 아닙니다!"); + window.location.href = `/#/subway/detail/${stCd}/${stNm}`; + }) + return subwaytransfer; + }; + + return { + transferDetail: wrapPromise(getTransferDetailData()) + }; +}; + + +export const getTransferInfo = (stCd: any, stNm: any, railCd: any, lnCd: any, prevStinCd: any, chthTgtLn: any, chtnNextStinCd: any) => { + const getTransferInfoAPI = async () => { + const transferDetail = await api.get(`/subway/transferMove/transferInfo/${stCd}/${stNm}/${railCd}/${lnCd}/${prevStinCd}/${chthTgtLn}/${chtnNextStinCd}`) + .then(res => res.data) + .catch(error=>{ + console.log(error) + }) + return transferDetail + } + + return { + transferinfo : wrapPromise(getTransferInfoAPI()) + }; +}; From 6fc5877fd4dc19fa90b00f6044b6b269177b57be Mon Sep 17 00:00:00 2001 From: Sangwook Park <41150708+sw0501@users.noreply.github.com> Date: Tue, 12 Dec 2023 00:22:38 +0900 Subject: [PATCH 7/8] Feature/backend (#208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modify: CI/CD 수정 * Feat: navigation API 개발 완료 * Modify: navigation API 수정 * Fix: navigation API 예외처리 * Feat: CORS http 포트 추가 * Modify: CORS 옵션 수정 * Modify: CORS 옵션 수정 * Feat: https 서버 업데이트 * HTTPS 적용 * Feat: COSR 옵션 https 추가 * Feat: 없는 지하철역 예외처리 * Feat: 없는 지하철역 예외처리 * Modify: 예외처리 진행 * Modify: https 서버 수정 * Feat: 길찾기 기능 가중치 추가 * Feat: 길찾기 필요 정보 추가, 인터페이스 수정 * Feat: CI/CD 수정 * Modify: 교통약자 도우미번호 추가 * Feat: 지하철 이름 검색 시 주소 같이 제공 --- BackendJS/BackendTS/routes/subwaydata.js | 60 ++++++++++++++++++------ 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/BackendJS/BackendTS/routes/subwaydata.js b/BackendJS/BackendTS/routes/subwaydata.js index 6bf5b39..8188481 100644 --- a/BackendJS/BackendTS/routes/subwaydata.js +++ b/BackendJS/BackendTS/routes/subwaydata.js @@ -45,20 +45,53 @@ function getSubwayStationName(stNm, callback) { const connection = db.return_connection(); let SQL = "Select * FROM subcode_1 a, 도우미번호 b WHERE (a.stin_nm = b.역명 and a.ln_cd = b.운영노선명) and a.STIN_NM like ?; "; let nameList = []; - connection.query(SQL, ["%" + stNm + "%"], function (err, results, fields) { - if (err) { - console.log(err); - } - for (let i = 0; i < results.length; i++) { - nameList.push({ - railCd: results[i].RAIL_OPR_ISTT_CD, - lnCd: results[i].LN_CD, - lnNm: results[i].LN_CD, - stCd: results[i].STIN_CD, - stNm: results[i].STIN_NM, + const getGPS = (STIN_NM, STIN_CD, LN_CD, RAIL_OPR_ISTT_CD) => new Promise((req, rej) => { + const url = 'https://openapi.kric.go.kr/openapi/convenientInfo/stationInfo'; + let queryParams = '?' + encodeURI('serviceKey'); + queryParams += '=' + serviceKey_json_1.default.subwayRailKey; + queryParams += '&' + encodeURI('format') + '=' + encodeURI('json'); + queryParams += '&' + encodeURI('railOprIsttCd'); + queryParams += '=' + encodeURI(RAIL_OPR_ISTT_CD); + queryParams += '&' + encodeURI('lnCd'); + queryParams += '=' + encodeURI(LN_CD); + queryParams += '&' + encodeURI('stinCd'); + queryParams += '=' + encodeURI(STIN_CD); + queryParams += '&' + encodeURI('stinNm'); + queryParams += '=' + encodeURI(STIN_NM); + (0, request_1.default)({ + url: url + queryParams, + method: 'GET' + }, function (error, response, body) { + const stationinfo = JSON.parse(body).body[0]; + //NULL error + if (stationinfo === undefined) { + return callback(null); + } + req({ + tmX: stationinfo.stinLocLon, + tmY: stationinfo.stinLocLat, }); - } - callback(nameList); + }); + }); + connection.query(SQL, ["%" + stNm + "%"], function (err, results, fields) { + return __awaiter(this, void 0, void 0, function* () { + if (err) { + console.log(err); + } + for (let i = 0; i < results.length; i++) { + const tm = yield getGPS(results[0].STIN_NM, results[0].STIN_CD, results[0].LN_CD, results[0].RAIL_OPR_ISTT_CD); + nameList.push({ + railCd: results[i].RAIL_OPR_ISTT_CD, + lnCd: results[i].LN_CD, + lnNm: results[i].LN_CD, + stCd: results[i].STIN_CD, + stNm: results[i].STIN_NM, + tmX: tm.tmX, + tmY: tm.tmY + }); + } + callback(nameList); + }); }); } catch (e) { @@ -99,7 +132,6 @@ function getSubwayStationInfo(stCd, stNm, callback) { if (stationinfo === undefined) { return callback(null); } - console.log(results[0]); callback({ railCd: stationinfo.railOprIsttCd, lnCd: stationinfo.lnCd, From 607c622b31bf8e397b067c09eafb4c7e847b1422 Mon Sep 17 00:00:00 2001 From: Sangwook Park <41150708+sw0501@users.noreply.github.com> Date: Tue, 12 Dec 2023 00:24:49 +0900 Subject: [PATCH 8/8] Feature/backend (#209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modify: CI/CD 수정 * Feat: navigation API 개발 완료 * Modify: navigation API 수정 * Fix: navigation API 예외처리 * Feat: CORS http 포트 추가 * Modify: CORS 옵션 수정 * Modify: CORS 옵션 수정 * Feat: https 서버 업데이트 * HTTPS 적용 * Feat: COSR 옵션 https 추가 * Feat: 없는 지하철역 예외처리 * Feat: 없는 지하철역 예외처리 * Modify: 예외처리 진행 * Modify: https 서버 수정 * Feat: 길찾기 기능 가중치 추가 * Feat: 길찾기 필요 정보 추가, 인터페이스 수정 * Feat: CI/CD 수정 * Modify: 교통약자 도우미번호 추가 * Feat: 지하철 이름 검색 시 주소 같이 제공 * Feat: 지하철 이름 검색 시 주소 같이 제공 --- BackendTS/routes/subwaydata.ts | 42 +++++++++++++++++++++++++-- interfaces/Subway/subway.interface.ts | 4 ++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/BackendTS/routes/subwaydata.ts b/BackendTS/routes/subwaydata.ts index b23357c..874cc4b 100644 --- a/BackendTS/routes/subwaydata.ts +++ b/BackendTS/routes/subwaydata.ts @@ -19,19 +19,57 @@ function getSubwayStationName(stNm:string, callback:(nameList:Array = []; - connection.query(SQL, ["%"+stNm+"%"], function (err:Error, results:any, fields:any) { + const getGPS = (STIN_NM:string, STIN_CD:string, LN_CD:string, RAIL_OPR_ISTT_CD:string) => new Promise((req:any,rej)=>{ + const url:string = 'https://openapi.kric.go.kr/openapi/convenientInfo/stationInfo'; + let queryParams:string = '?' + encodeURI('serviceKey'); + queryParams += '=' + serviceKey.subwayRailKey; + queryParams += '&' + encodeURI('format') + '=' + encodeURI('json'); + queryParams += '&' + encodeURI('railOprIsttCd'); + queryParams += '=' + encodeURI(RAIL_OPR_ISTT_CD); + queryParams += '&' + encodeURI('lnCd'); + queryParams += '=' + encodeURI(LN_CD); + queryParams += '&' + encodeURI('stinCd'); + queryParams += '=' + encodeURI(STIN_CD); + queryParams += '&' + encodeURI('stinNm'); + queryParams += '=' + encodeURI(STIN_NM); + + request({ + url: url + queryParams, + method: 'GET' + }, function (error:Error, response:any, body:string) { + + const stationinfo:SubwayStationInfoRequest = JSON.parse(body).body[0]; + + //NULL error + if (stationinfo === undefined) { + return callback(null); + } + + req({ + tmX: stationinfo.stinLocLon, + tmY: stationinfo.stinLocLat, + }); + + }); + }) + + connection.query(SQL, ["%"+stNm+"%"], async function (err:Error, results:any, fields:any) { if (err) { console.log(err); } for (let i = 0; i < results.length; i++) { - + + const tm:any = await getGPS(results[0].STIN_NM,results[0].STIN_CD,results[0].LN_CD,results[0].RAIL_OPR_ISTT_CD); + nameList.push({ railCd: results[i].RAIL_OPR_ISTT_CD, lnCd: results[i].LN_CD, lnNm: results[i].LN_CD, stCd: results[i].STIN_CD, stNm: results[i].STIN_NM, + tmX: tm.tmX, + tmY: tm.tmY }) } diff --git a/interfaces/Subway/subway.interface.ts b/interfaces/Subway/subway.interface.ts index 49839d3..0342394 100644 --- a/interfaces/Subway/subway.interface.ts +++ b/interfaces/Subway/subway.interface.ts @@ -3,7 +3,9 @@ export interface SubwayStationNameList { lnCd: string, lnNm?: string, stCd: string, - stNm: string + stNm: string, + tmX: string, + tmY: string } export interface SubwayStationInfo {