Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LLM-Filter
Project
Project
Details
Activity
Releases
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
2026_NGIT
LLM-Filter
Commits
fddd97e3
Commit
fddd97e3
authored
Nov 14, 2025
by
uuo00_n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(persons): 添加按类型统计的功能并返回分项计数
在获取人员列表时,现在会额外统计每种类型的人数并返回
parent
f1739a61
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
persons.cpython-39.pyc
app/api/v1/__pycache__/persons.cpython-39.pyc
+0
-0
persons.py
app/api/v1/persons.py
+5
-1
No files found.
app/api/v1/__pycache__/persons.cpython-39.pyc
View file @
fddd97e3
No preview for this file type
app/api/v1/persons.py
View file @
fddd97e3
...
...
@@ -31,8 +31,12 @@ async def bulk_create(persons: List[PersonCreate], current_user: dict = Depends(
)
async
def
list_persons
(
current_user
:
dict
=
Depends
(
require_role
(
3
))):
res
=
[]
counts
=
{}
cursor
=
db
.
db
.
persons
.
find
({})
.
sort
(
"person_id"
,
1
)
async
for
d
in
cursor
:
d
[
"_id"
]
=
str
(
d
[
"_id"
])
res
.
append
(
d
)
return
res
\ No newline at end of file
t
=
d
.
get
(
"type"
)
if
t
:
counts
[
t
]
=
counts
.
get
(
t
,
0
)
+
1
return
{
"items"
:
res
,
"counts_by_type"
:
counts
}
\ No newline at end of file
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