Skip to content

Commit

Permalink
Fix: conflict 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sw0501 committed Nov 27, 2023
2 parents f4b4712 + c74f652 commit 176239a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
14 changes: 9 additions & 5 deletions BackendJS/BackendTS/routes/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,23 @@ router.get('/bybusNsubway/:startX/:startY/:endX/:endY', (req, res) => __awaiter(
router.get('/odsaytest/:startX/:startY/:endX/:endY', (req, res) => __awaiter(void 0, void 0, void 0, function* () {
try {
const startX = req.params.startX;
const startY = req.params.startX;
const startY = req.params.startY;
const endX = req.params.endX;
const endY = req.params.endY;
const url = 'https://api.odsay.com/v1/api/searchPubTransPathT';
const queryParams = '?SX=' + startX + '&SY=' + startY + '&EX=' + endX + '&EY=' + endY + '&apiKey=' + encodeURIComponent(serviceKey_json_1.default.OdsayKey);
console.log(url + queryParams);
let queryParams = '?' + encodeURIComponent('lang') + '=' + encodeURIComponent('0');
queryParams += '&' + encodeURIComponent('SX') + '=' + startX;
queryParams += '&' + encodeURIComponent('SY') + '=' + startY;
queryParams += '&' + encodeURIComponent('EX') + '=' + endX;
queryParams += '&' + encodeURIComponent('EY') + '=' + endY;
queryParams += '&' + encodeURIComponent('apiKey') + '=' + encodeURI(serviceKey_json_1.default.OdsayKey);
(0, request_1.default)({
url: url + queryParams,
method: 'GET'
}, function (error, response, body) {
return __awaiter(this, void 0, void 0, function* () {
console.log(body);
return res.status(200).json(body);
console.log(JSON.parse(body));
return res.status(200).json(JSON.parse(body));
});
});
}
Expand Down
26 changes: 16 additions & 10 deletions BackendTS/routes/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,24 +393,30 @@ router.get('/bybusNsubway/:startX/:startY/:endX/:endY', async(req:Request,res:Re

router.get('/odsaytest/:startX/:startY/:endX/:endY',async(req:Request,res:Response)=>{
try{
const startX = req.params.startX;
const startY = req.params.startX;
const endX = req.params.endX;
const endY = req.params.endY;
const startX:number = req.params.startX;
const startY:number = req.params.startY;
const endX:number = req.params.endX;
const endY:number = req.params.endY;

const url:string = 'https://api.odsay.com/v1/api/searchPubTransPathT';
const queryParams:string = '?SX=' + startX + '&SY=' + startY + '&EX=' + endX + '&EY=' + endY + '&apiKey=' + encodeURIComponent(serviceKey.OdsayKey);

console.log(url+queryParams);


const url:string = 'https://api.odsay.com/v1/api/searchPubTransPathT';
let queryParams:string = '?' + encodeURIComponent('lang') + '=' + encodeURIComponent('0');
queryParams += '&' + encodeURIComponent('SX') + '=' + startX;
queryParams += '&' + encodeURIComponent('SY') + '=' + startY;
queryParams += '&' + encodeURIComponent('EX') + '=' + endX;
queryParams += '&' + encodeURIComponent('EY') + '=' + endY;
queryParams += '&' + encodeURIComponent('apiKey') + '=' + encodeURI(serviceKey.OdsayKey);

request({
url: url + queryParams,
method: 'GET'
}, async function (error:Error, response:any, body:string) {

console.log(body);
return res.status(200).json(body);
console.log(JSON.parse(body));
return res.status(200).json(JSON.parse(body));
});

}
catch(e){
console.error(e);
Expand Down

0 comments on commit 176239a

Please sign in to comment.