Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
publicIntelligence
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
publicIntelligence
Commits
654a48d6
Commit
654a48d6
authored
May 18, 2026
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
d920324d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
3 deletions
+111
-3
serverConfig.xml
serverConfig.xml
+1
-1
throwMethod.ts
src/biz/throwMethod.ts
+0
-0
main.ts
src/main.ts
+2
-1
router.ts
src/routers/router.ts
+2
-0
throwMethod.ts
src/routers/throwMethod.ts
+101
-0
tsconfig.json
tsconfig.json
+5
-1
No files found.
serverConfig.xml
View file @
654a48d6
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<dbServer>
http://127.0.0.1:13276
</dbServer>
<dbServer>
http://127.0.0.1:13276
</dbServer>
<mysqldb>
<mysqldb>
<!-- 本地mysql配置 -->
<!-- 本地mysql配置 -->
<mysqlHost>
localhost
</mysqlHost>
<mysqlHost>
127.0.0.1
</mysqlHost>
<mysqlPort>
3306
</mysqlPort>
<mysqlPort>
3306
</mysqlPort>
<mysqlUser>
root
</mysqlUser>
<mysqlUser>
root
</mysqlUser>
<mysqlPwd>
123456
</mysqlPwd>
<mysqlPwd>
123456
</mysqlPwd>
...
...
src/biz/throwMethod.ts
0 → 100644
View file @
654a48d6
This diff is collapsed.
Click to expand it.
src/main.ts
View file @
654a48d6
...
@@ -20,7 +20,7 @@ async function lanuch() {
...
@@ -20,7 +20,7 @@ async function lanuch() {
console
.
log
(
'This indicates that the server is started successfully.'
);
console
.
log
(
'This indicates that the server is started successfully.'
);
backup
();
//
backup();
// 应用启动时初始化UAC集成
// 应用启动时初始化UAC集成
const
xmlRpcServer
=
await
initUACIntegration
();
const
xmlRpcServer
=
await
initUACIntegration
();
...
@@ -29,6 +29,7 @@ async function lanuch() {
...
@@ -29,6 +29,7 @@ async function lanuch() {
}
else
{
}
else
{
console
.
error
(
'🔴 XML-RPC服务器启动失败'
);
console
.
error
(
'🔴 XML-RPC服务器启动失败'
);
}
}
}
}
lanuch
();
lanuch
();
...
...
src/routers/router.ts
View file @
654a48d6
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
*/
*/
import
*
as
questionRouter
from
'./question'
;
import
*
as
questionRouter
from
'./question'
;
import
*
as
throwMethodRouter
from
'./throwMethod'
;
export
function
setRouter
(
httpServer
){
export
function
setRouter
(
httpServer
){
questionRouter
.
setRouter
(
httpServer
);
questionRouter
.
setRouter
(
httpServer
);
throwMethodRouter
.
setRouter
(
httpServer
);
}
}
src/routers/throwMethod.ts
0 → 100644
View file @
654a48d6
/**
* 公智能评价答题 - 能力同比分析路由
*/
import
asyncHandler
from
'express-async-handler'
;
import
*
as
throwMethodBiz
from
'../biz/throwMethod'
;
import
{
checkUser
}
from
'../middleware/user'
;
export
function
setRouter
(
httpServer
)
{
/**学生能力同比分析接口 */
// 获取学生九大能力得分及同比数据(完整版)
httpServer
.
post
(
'/gzn/throwmethod/abilitycomparison'
,
asyncHandler
(
getStudentAbilityComparison
));
// 获取学生九大能力得分及同比数据(简化版,用于图表)
httpServer
.
post
(
'/gzn/throwmethod/abilitycomparisonsimple'
,
asyncHandler
(
getStudentAbilityComparisonSimple
));
// 批量获取多个学生的能力同比数据
httpServer
.
post
(
'/gzn/throwmethod/batchabilitycomparison'
,
asyncHandler
(
getBatchStudentAbilityComparison
));
}
/**
* 获取学生九大能力得分及同比数据(完整版)
* @param req - 请求对象
* @param res - 响应对象
*
* 请求参数:
* - student_id?: string - 学生ID(可选,不传则使用当前登录用户)
*/
async
function
getStudentAbilityComparison
(
req
,
res
)
{
const
UserInfo
=
req
.
userInfo
;
let
{
student_id
}
=
req
.
body
;
// 如果没有传student_id,使用当前登录用户的ID
const
targetStudentId
=
student_id
||
UserInfo
.
studentId
;
let
result
=
await
throwMethodBiz
.
getStudentAbilityScoresWithComparison
(
targetStudentId
);
res
.
success
(
result
);
}
/**
* 获取学生九大能力得分及同比数据(简化版,仅返回数值数组,用于图表展示)
* @param req - 请求对象
* @param res - 响应对象
*
* 请求参数:
* - student_id?: string - 学生ID(可选,不传则使用当前登录用户)
*/
async
function
getStudentAbilityComparisonSimple
(
req
,
res
)
{
const
UserInfo
=
req
.
userInfo
;
let
{
student_id
}
=
req
.
body
;
// 如果没有传student_id,使用当前登录用户的ID
const
targetStudentId
=
student_id
||
UserInfo
.
studentId
;
let
result
=
await
throwMethodBiz
.
getStudentAbilityScoresSimple
(
targetStudentId
);
res
.
success
(
result
);
}
/**
* 批量获取多个学生的九大能力得分及同比数据
* @param req - 请求对象
* @param res - 响应对象
*
* 请求参数:
* - student_ids: string[] - 学生ID数组(必填)
*/
async
function
getBatchStudentAbilityComparison
(
req
,
res
)
{
const
UserInfo
=
req
.
userInfo
;
let
{
student_ids
}
=
req
.
body
;
if
(
!
student_ids
||
!
Array
.
isArray
(
student_ids
)
||
student_ids
.
length
===
0
)
{
throw
new
Error
(
'学生ID列表不能为空'
);
}
const
results
=
[];
for
(
const
student_id
of
student_ids
)
{
try
{
const
result
=
await
throwMethodBiz
.
getStudentAbilityScoresWithComparison
(
student_id
);
results
.
push
(
result
);
}
catch
(
error
)
{
results
.
push
({
student_id
,
hasData
:
false
,
message
:
error
.
message
||
'获取数据失败'
});
}
}
res
.
success
({
total
:
results
.
length
,
list
:
results
});
}
tsconfig.json
View file @
654a48d6
...
@@ -6,7 +6,11 @@
...
@@ -6,7 +6,11 @@
"rootDir"
:
"./src"
,
"rootDir"
:
"./src"
,
"outDir"
:
"./out"
,
"outDir"
:
"./out"
,
"esModuleInterop"
:
true
,
"esModuleInterop"
:
true
,
//
"strict"
:
true
,
"allowSyntheticDefaultImports"
:
true
,
"strict"
:
false
,
"noImplicitAny"
:
false
,
"strictNullChecks"
:
false
,
"types"
:
[
"node"
]
},
},
"exclude"
:
[
"exclude"
:
[
"node_modules"
,
"node_modules"
,
...
...
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