Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sportsschoolserver
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
node_server
sportsschoolserver
Commits
f2ac902f
Commit
f2ac902f
authored
Nov 10, 2021
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
fe5676ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
26 deletions
+47
-26
xsxxfx.ts
src/biz/xsxxfx.ts
+24
-15
ydygl.ts
src/biz/ydygl.ts
+0
-1
xsxxfxData.ts
src/data/xsxxfxData.ts
+18
-5
ydyglData.ts
src/data/ydyglData.ts
+4
-4
serverConfig.ts
src/serverConfig.ts
+1
-1
No files found.
src/biz/xsxxfx.ts
View file @
f2ac902f
...
...
@@ -22,7 +22,7 @@ export async function getData(req, res) {
ret
[
"bsjbxx"
]
=
bsjbxxInfo
[
"基本信息"
];
ret
[
"videourl"
]
=
bsjbxxInfo
[
"url"
];
let
{
attackData
,
defenceData
,
selfHeat
,
opponentHeat
}
=
await
右侧数据
(
mid
);
let
{
attackData
,
defenceData
,
selfHeat
,
opponentHeat
}
=
await
右侧数据
(
mid
,
bsjbxxInfo
.
selfName
,
bsjbxxInfo
.
opponentName
);
ret
[
"attack"
]
=
attackData
;
ret
[
"defence"
]
=
defenceData
;
ret
[
"selfheat"
]
=
selfHeat
;
...
...
@@ -56,7 +56,7 @@ export async function getbsglxq(req, res) {
ret
[
"bsjbxx"
]
=
bsjbxxInfo
[
"基本信息"
];
ret
[
"videourl"
]
=
bsjbxxInfo
[
"url"
];
let
{
attackData
,
defenceData
,
selfHeat
,
opponentHeat
}
=
await
右侧数据
(
mid
);
let
{
attackData
,
defenceData
,
selfHeat
,
opponentHeat
}
=
await
右侧数据
(
mid
,
bsjbxxInfo
.
selfName
,
bsjbxxInfo
.
opponentName
);
ret
[
"attack"
]
=
attackData
;
ret
[
"defence"
]
=
defenceData
;
ret
[
"selfheat"
]
=
selfHeat
;
...
...
@@ -92,12 +92,11 @@ export async function get图表数据(req, res) {
async
function
近期比赛概览
(
pid
,
inTime
)
{
let
time
=
inTime
||
new
Date
();
let
近期比赛概览数据
=
await
get
近期比赛概览
(
pid
,
time
);
let
subTitle
=
近期比赛概览数据
.
length
>
0
?
近期比赛概览数据
[
0
].
date
:
""
;
let
{
dataList
,
firstDate
}
=
await
get
近期比赛概览
(
pid
,
time
);
return
{
title
:
"近期比赛概览"
,
subTitle
,
list
:
近期比赛概览数据
subTitle
:
firstDate
,
list
:
dataList
}
}
...
...
@@ -108,7 +107,9 @@ async function 比赛信息(mid) {
return
{
"基本信息"
:[[
selfPic
,
selfName
,
result
],[
selfScore
,
date
,
opponentScore
],[
opponentPic
,
opponentName
,
opponentResult
]],
"url"
:
videoUrl
"url"
:
videoUrl
,
selfName
,
opponentName
}
}
...
...
@@ -147,21 +148,30 @@ enum heatAreaEnum {
里
}
async
function
右侧数据
(
mid
)
{
async
function
右侧数据
(
mid
,
selfName
,
opponentName
)
{
let
{
attackData
,
defenceData
,
stationData
}
=
await
get
右侧数据
(
mid
);
attackData
.
sort
(
(
a
,
b
)
=>
{
return
a
.
area
-
b
.
area
}
);
defenceData
.
sort
(
(
a
,
b
)
=>
{
return
a
.
area
-
b
.
area
}
);
let
selfHeat
=
[];
let
opponentHeat
=
[];
let
selfHeat
Rank
=
[];
let
opponentHeat
Rank
=
[];
stationData
.
forEach
(
info
=>
{
let
{
area
,
self
,
opponent
}
=
info
;
selfHeat
.
push
({
key
:
area
,
value
:
self
});
opponentHeat
.
push
({
key
:
area
,
value
:
opponent
});
selfHeatRank
.
push
({
key
:
area
,
value
:
self
});
opponentHeatRank
.
push
({
key
:
area
,
value
:
opponent
});
});
selfHeatRank
.
sort
(
(
a
,
b
)
=>
{
return
a
.
key
-
b
.
key
});
opponentHeatRank
.
sort
(
(
a
,
b
)
=>
{
return
b
.
key
-
a
.
key
});
let
selfHeat
=
[];
selfHeatRank
.
forEach
(
info
=>
{
selfHeat
.
push
({
key
:
selfName
,
value
:
info
.
value
});
});
let
opponentHeat
=
[];
opponentHeatRank
.
forEach
(
info
=>
{
opponentHeat
.
push
({
key
:
opponentName
,
value
:
info
.
value
});
});
selfHeat
.
sort
(
(
a
,
b
)
=>
{
return
a
.
key
-
b
.
key
});
opponentHeat
.
sort
(
(
a
,
b
)
=>
{
return
b
.
key
-
a
.
key
});
return
{
attackData
,
defenceData
,
selfHeat
,
opponentHeat
};
}
\ No newline at end of file
src/biz/ydygl.ts
View file @
f2ac902f
...
...
@@ -50,7 +50,6 @@ export async function getData(req, res) {
ret
[
"api12"
]
=
await
基础数据
();
res
.
send
(
ret
);
}
...
...
src/data/xsxxfxData.ts
View file @
f2ac902f
...
...
@@ -43,10 +43,12 @@ export async function get近期比赛概览(PID, checkDate) {
let
sql
=
"select * from recent_match where self_pid = Placeholder1 and m_date < Placeholder2"
;
let
selectResult
=
await
selectData
(
sql
,
PID
,
checkDate
);
let
result
=
[];
let
firstDate
=
""
;
selectResult
.
forEach
(
info
=>
{
let
selfScore
=
info
.
SELF_SCORE
||
0
;
let
opponentScore
=
info
.
OPPONENT_SCORE
||
0
;
let
matchResult
=
selfScore
>
opponentScore
?
"胜"
:
"负"
;
firstDate
=
dataFormatInSubKey
(
info
.
M_DATE
);
result
.
push
({
selfName
:
info
.
SELF_NAME
,
selfPic
:
info
.
SELF_PIC
,
...
...
@@ -60,7 +62,7 @@ export async function get近期比赛概览(PID, checkDate) {
});
});
return
result
;
return
{
dataList
:
result
,
firstDate
}
;
}
function
dataFormat
(
time
)
{
...
...
@@ -76,6 +78,13 @@ function dataFormat(time) {
return
`
${
matchStr
}
/
${
dayStr
}
${
hoursStr
}
:
${
MinutesStr
}
`
;
}
function
dataFormatInSubKey
(
time
)
{
let
date
=
new
Date
(
time
);
let
match
=
date
.
getMonth
()
+
1
;
let
matchStr
=
match
>
9
?
`
${
match
}
`
:
`0
${
match
}
`
;
return
`
${
date
.
getFullYear
()}
-
${
matchStr
}
`
;
}
export
async
function
get
比赛详情
(
mid
)
{
let
sql
=
"select * from match_information where m_id = Placeholder1"
;
let
subSql
=
"select m_date from recent_match where m_id = Placeholder1 "
...
...
@@ -100,7 +109,7 @@ export async function get比赛详情(mid) {
}
export
async
function
get
单前比赛对局时间节点
(
mid
)
{
let
sql
=
"select * from match_video where Placeholder1"
;
let
sql
=
"select * from match_video where
m_id =
Placeholder1"
;
let
selectInfo
=
await
selectData
(
sql
,
mid
);
...
...
@@ -111,12 +120,16 @@ export async function get单前比赛对局时间节点(mid) {
rankMap
[
R_ID
][
G_ID
]
=
{
start
:
START_T
,
end
:
END_T
,
gName
:
`第
${
G_ID
}
轮`
,
gId
:
G_ID
};
});
let
result
Map
=
{};
let
result
List
=
[]
for
(
let
key
in
rankMap
)
{
resultMap
[
key
]
=
Object
.
keys
(
rankMap
[
key
]);
resultList
.
push
({
key
:
`第
${
key
}
局`
,
rid
:
parseInt
(
key
),
value
:
Object
.
values
(
rankMap
[
key
])
});
}
return
result
Map
;
return
result
List
;
}
export
async
function
get
图表
(
mid
,
rid
,
gid
)
{
...
...
src/data/ydyglData.ts
View file @
f2ac902f
...
...
@@ -165,9 +165,9 @@ export async function 基础数据() {
let
result
=
[];
//[{... list:[{}, {}, {}] }]
let
distinctMap
=
{};
selectList
.
forEach
(
info
=>
{
let
{
p_id
,
BIRTH
,
HABITUAL_HAND
,
MATCH_COUNT
,
WIN_COUNT
,
WIN_RATE
,
SELF_NAME
,
SELF_SCORE
,
OPPONENT_SCORE
,
OPPONENT_NAME
,
M_ID
,
SELF_PIC
}
=
info
;
if
(
!
distinctMap
[
p_id
])
{
distinctMap
[
p_id
]
=
{
let
{
P_ID
,
BIRTH
,
HABITUAL_HAND
,
MATCH_COUNT
,
WIN_COUNT
,
WIN_RATE
,
SELF_NAME
,
SELF_SCORE
,
OPPONENT_SCORE
,
OPPONENT_NAME
,
M_ID
,
SELF_PIC
}
=
info
;
if
(
!
distinctMap
[
P_ID
])
{
distinctMap
[
P_ID
]
=
{
"出生日期"
:
BIRTH
,
"惯用手"
:
HABITUAL_HAND
,
"比赛场次"
:
MATCH_COUNT
,
...
...
@@ -180,7 +180,7 @@ export async function 基础数据() {
list
:[]
};
}
distinctMap
[
p_id
].
list
.
push
({
distinctMap
[
P_ID
].
list
.
push
({
selfName
:
SELF_NAME
,
selfScore
:
SELF_SCORE
,
opponentScore
:
OPPONENT_SCORE
,
...
...
src/serverConfig.ts
View file @
f2ac902f
...
...
@@ -7,7 +7,7 @@ export function getPort() : number {
// sit 测试环境 prod 生产环境 dem 演示环境(测试数据,前端无密码访问)
export
function
getEnv
()
:
string
{
return
process
.
argv
[
2
]
||
"sit"
;
}
}
5
//mongo数据库连接字符
export
const
mongoServerConstVal
=
{
...
...
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