Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shouzhouServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjinjing
shouzhouServer
Commits
d19d8fe0
Commit
d19d8fe0
authored
Jul 04, 2024
by
Leo Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开始编写 README.md
parent
256f4a09
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
5 deletions
+38
-5
README.md
README.md
+33
-0
getData.ts
src/biz/getData.ts
+0
-1
abstractDataStrategyLeft.ts
src/biz/strategies/left/abstractDataStrategyLeft.ts
+0
-1
strategyFactory.ts
src/biz/strategies/strategyFactory.ts
+4
-1
httpErrorHandler.ts
src/middleware/httpErrorHandler.ts
+0
-1
router.ts
src/routers/router.ts
+1
-1
No files found.
README.md
0 → 100644
View file @
d19d8fe0
# 寿州古城数据接口
[
中文
](
#中文
)
[
English
]
(#English)
# 中文
## 端点:`/szgc/getdata`
## 参数:
-
`content`
:
-
左侧API:
-
sightVisitorFlowByDay
-
gateStatus
-
sightVisitorFlowPerHour
-
guchengLoad
-
totalVisitorFlow
-
totalVisitorFlowByDay
-
中间API:
-
currentEventStrategy
-
totalEventCount
-
allEvents
-
右侧API:
-
getEventCountByYear
-
getEventTimeDistribution
-
getEventMonthDistribution
-
getEventCategoryCount
-
getEventSubCategoryCount
-
getEventSourceCount
-
getGridEventCount
-
getEventProcessingTime
src/biz/getData.ts
View file @
d19d8fe0
...
@@ -7,7 +7,6 @@ import { strategyFactory } from "./strategies/strategyFactory";
...
@@ -7,7 +7,6 @@ import { strategyFactory } from "./strategies/strategyFactory";
* @param res
* @param res
*/
*/
export
function
getData
(
req
,
res
)
{
export
function
getData
(
req
,
res
)
{
/**填充数据格式处理 */
const
strategy
=
strategyFactory
.
createStrategy
(
req
.
query
.
content
)
const
strategy
=
strategyFactory
.
createStrategy
(
req
.
query
.
content
)
let
ret
=
strategy
.
execute
(
req
);
let
ret
=
strategy
.
execute
(
req
);
res
.
send
(
ret
);
res
.
send
(
ret
);
...
...
src/biz/strategies/left/abstractDataStrategyLeft.ts
View file @
d19d8fe0
...
@@ -7,7 +7,6 @@ export abstract class abstractDataStrategyLeft implements dataStrategy {
...
@@ -7,7 +7,6 @@ export abstract class abstractDataStrategyLeft implements dataStrategy {
static
readonly
SHEETNAME
=
'票务系统-订单主表'
;
static
readonly
SHEETNAME
=
'票务系统-订单主表'
;
static
readonly
TIMEDIFFERENCE
=
8
;
static
readonly
TIMEDIFFERENCE
=
8
;
execute
(
params
?:
any
):
any
{
execute
(
params
?:
any
):
any
{
}
}
...
...
src/biz/strategies/strategyFactory.ts
View file @
d19d8fe0
import
{
dataStrategy
}
from
"./dataStrategy"
;
import
{
dataStrategy
}
from
"./dataStrategy"
;
import
{
allEventDataStrategy
}
from
"./middle/eventDataStrategy"
;
import
{
sightVisitorFlowByDayStrategy
}
from
"./left/sightVisitorFlowByDayStrategy"
;
import
{
sightVisitorFlowByDayStrategy
}
from
"./left/sightVisitorFlowByDayStrategy"
;
import
{
gateStatusStrategy
}
from
"./left/gateStatusStrategy"
;
import
{
gateStatusStrategy
}
from
"./left/gateStatusStrategy"
;
import
{
sightVisitorFlowByHourStrategy
}
from
"./left/sightVisitorFlowPerHourStrategy"
;
import
{
sightVisitorFlowByHourStrategy
}
from
"./left/sightVisitorFlowPerHourStrategy"
;
import
{
guchengLoadStrategy
}
from
"./left/guchengLoadStrategy"
;
import
{
guchengLoadStrategy
}
from
"./left/guchengLoadStrategy"
;
import
{
totalVisitorFlowStrategy
}
from
"./left/totalVisitorFlowStrategy"
;
import
{
totalVisitorFlowStrategy
}
from
"./left/totalVisitorFlowStrategy"
;
import
{
totalVisitorFlowByHourStrategy
}
from
"./left/totalVisitorFlowByHourStrategy"
;
import
{
totalVisitorFlowByHourStrategy
}
from
"./left/totalVisitorFlowByHourStrategy"
;
import
{
currentEventStrategy
}
from
"./middle/currentEventStrategy"
;
import
{
currentEventStrategy
}
from
"./middle/currentEventStrategy"
;
import
{
totalEventCountStrategy
}
from
"./middle/totalEventCountStrategy"
;
import
{
totalEventCountStrategy
}
from
"./middle/totalEventCountStrategy"
;
import
{
allEventDataStrategy
}
from
"./middle/eventDataStrategy"
;
import
{
getEventCountByYearStrategy
}
from
"./right/getEventCountByYearStrategy"
;
import
{
getEventCountByYearStrategy
}
from
"./right/getEventCountByYearStrategy"
;
import
{
eventTimeDistributionStrategy
}
from
"./right/eventTimeDistributionStrategy"
;
import
{
eventTimeDistributionStrategy
}
from
"./right/eventTimeDistributionStrategy"
;
import
{
eventMonthDistributionStrategy
}
from
"./right/eventMonthDistributionStrategy"
;
import
{
eventMonthDistributionStrategy
}
from
"./right/eventMonthDistributionStrategy"
;
...
...
src/middleware/httpErrorHandler.ts
View file @
d19d8fe0
export
function
httpErrorHandler
(
err
,
req
,
res
,
next
)
{
export
function
httpErrorHandler
(
err
,
req
,
res
,
next
)
{
console
.
log
(
"in httpErrorHandler"
);
console
.
log
(
"in httpErrorHandler"
);
console
.
log
(
err
);
console
.
log
(
err
);
//TODO 自定义错误编码
if
(
err
)
{
if
(
err
)
{
if
(
err
.
message
==
"Excel文件不存在"
)
{
if
(
err
.
message
==
"Excel文件不存在"
)
{
res
.
success
({
success
:
false
,
msg
:
err
.
message
,
code
:
501
});
res
.
success
({
success
:
false
,
msg
:
err
.
message
,
code
:
501
});
...
...
src/routers/router.ts
View file @
d19d8fe0
...
@@ -7,7 +7,7 @@ import * as szgcBiz from '../biz/getData';
...
@@ -7,7 +7,7 @@ import * as szgcBiz from '../biz/getData';
export
function
setRouter
(
httpServer
){
export
function
setRouter
(
httpServer
){
httpServer
.
get
(
'/getdata'
,
asyncHandler
(
szgcBiz
.
getData
));
httpServer
.
get
(
'/
szgc/
getdata'
,
asyncHandler
(
szgcBiz
.
getData
));
httpServer
.
get
(
'/test'
,
szgcBiz
.
test
);
httpServer
.
get
(
'/test'
,
szgcBiz
.
test
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment