Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김원진
/
Expresswayinfo24
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
최현영
2020-06-06 23:23:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1a5946789460f6ae34c36fbd9d17494342343964
1a594678
1 parent
e6bdede5
Highway congest function fixed..
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
whereur/app.js
whereur/app.js
View file @
1a59467
...
...
@@ -187,12 +187,6 @@ function inputroadnumber(typetext){
}
function
pushmsg
(
eventObj
,
roadnumberstring
,
roadnumberstringLength
){
for
(
var
i
=
0
;
i
<
5
;
i
++
){
if
(
roadnumberstringLength
==
count
+
i
){
raodnumberstringlength
[
count
+
i
]
=
""
;
}
}
request
.
post
(
{
url
:
TARGET_URL
,
...
...
@@ -245,7 +239,7 @@ app.post('/hook', function (req, res) {
var
eventObj
=
req
.
body
.
events
[
0
];
var
source
=
eventObj
.
source
;
var
message
=
eventObj
.
message
;
var
isnext
=
false
;
var
isnext
;
// request log
console
.
log
(
'======================'
,
new
Date
()
,
'======================'
);
console
.
log
(
'[request]'
,
req
.
body
);
...
...
@@ -322,8 +316,10 @@ app.post('/hook', function (req, res) {
}
isnext
=
nexttext
(
message
.
text
);
if
(
isnext
=
true
){
if
(
isnext
=
=
true
){
pushmsg
(
eventObj
,
roadnumberstring
,
roadnumberstringLength
);
console
.
log
(
roadnumberstring
);
console
.
log
(
roadnumberstringLength
);
}
res
.
sendStatus
(
200
);
...
...
@@ -753,6 +749,11 @@ function roadcongest(eventObj, msg){
var
iscount
=
0
;
console
.
log
(
number
);
count
=
0
;
console
.
log
(
count
);
roadnumberstringLength
=
0
;
roadnumberstring
=
new
Array
();
console
.
log
(
roadnumberstring
);
if
(
number
.
length
==
1
){
//노선번호가 한자수일 경우, 노선을 찾을 때 두자리 혹은 세자리 번호와 겹칠 수 있으므로.
number
=
"00"
+
number
;
}
...
...
@@ -764,12 +765,19 @@ function roadcongest(eventObj, msg){
if
(
jsonForcongest
.
list
[
i
].
routeNo
.
indexOf
(
number
)
>=
0
){
roadnumberstring
[
iscount
]
=
(
"# 노선이름: "
+
jsonForcongest
.
list
[
i
].
routeName
+
", 정체구간: "
+
jsonForcongest
.
list
[
i
].
conzoneName
+
', 기점종점방향: '
+
jsonForcongest
.
list
[
i
].
updownTypeCode
+
', 교통량: '
+
jsonForcongest
.
list
[
i
].
trafficAmout
+
', 평균속도: '
+
jsonForcongest
.
list
[
i
].
speed
);
iscount
+=
1
;
}
iscount
+=
1
;
}
roadnumberstringLength
=
roadnumberstring
.
length
;
if
(
iscount
==
0
){
if
(
roadnumberstringLength
!=
0
){
iscount
=
(
roadnumberstringLength
%
5
);
for
(
var
i
=
0
;
i
<
(
5
-
iscount
);
i
++
){
roadnumberstring
[
roadnumberstringLength
+
i
]
=
"Out of range"
;
}
}
if
(
roadnumberstringLength
==
0
){
var
Notfoundroadnumberstring
=
"검색하신 노선에서 발견된 정체구간은 없습니다."
;
request
.
post
(
{
...
...
Please
register
or
login
to post a comment