Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
db_gpt
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
linyangyang
db_gpt
Commits
02a290c0
Commit
02a290c0
authored
Aug 15, 2024
by
于飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询修改
parent
7dd82c26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
views.py
dbgpt/app/apps/vadmin/word/views.py
+4
-2
No files found.
dbgpt/app/apps/vadmin/word/views.py
View file @
02a290c0
...
@@ -21,8 +21,8 @@ router = APIRouter()
...
@@ -21,8 +21,8 @@ router = APIRouter()
###########################################################
###########################################################
# 同义词管理
# 同义词管理
###########################################################
###########################################################
@
router
.
get
(
"/get_
test"
,
summary
=
"获取测试
列表"
)
@
router
.
get
(
"/get_
similars"
,
summary
=
"获取同义词
列表"
)
async
def
get_
test
(
para
:
SimilarParams
=
Depends
(),
auth
:
Auth
=
Depends
(
OpenAuth
())):
async
def
get_
similars
(
para
:
SimilarParams
=
Depends
(),
auth
:
Auth
=
Depends
(
OpenAuth
())):
#datas = await crud.SimilarDal(auth.db).get_data(para)
#datas = await crud.SimilarDal(auth.db).get_data(para)
#model = models.similar.VadminWordSimilar #不需要关联查询
#model = models.similar.VadminWordSimilar #不需要关联查询
...
@@ -35,6 +35,7 @@ async def get_test(para: SimilarParams = Depends(), auth: Auth = Depends(OpenAut
...
@@ -35,6 +35,7 @@ async def get_test(para: SimilarParams = Depends(), auth: Auth = Depends(OpenAut
)
)
return
SuccessResponse
(
datas
,
count
=
count
)
return
SuccessResponse
(
datas
,
count
=
count
)
"""
@router.get("/get_similars", summary="获取同义词列表")
@router.get("/get_similars", summary="获取同义词列表")
async def get_similars(auth: Auth = Depends(OpenAuth())):
async def get_similars(auth: Auth = Depends(OpenAuth())):
model = VadminWordSimilar
model = VadminWordSimilar
...
@@ -46,6 +47,7 @@ async def get_similars(auth: Auth = Depends(OpenAuth())):
...
@@ -46,6 +47,7 @@ async def get_similars(auth: Auth = Depends(OpenAuth())):
for row in datas:
for row in datas:
print(f"编号:{row.id} 词条:{row.word_name} 近义词:{row.similar_name} ")
print(f"编号:{row.id} 词条:{row.word_name} 近义词:{row.similar_name} ")
return SuccessResponse(jsondatas, count=1)
return SuccessResponse(jsondatas, count=1)
"""
@
router
.
post
(
"/create_similar"
,
summary
=
"创建同义词"
)
@
router
.
post
(
"/create_similar"
,
summary
=
"创建同义词"
)
async
def
create_similar
(
data
:
Request
,
auth
:
Auth
=
Depends
(
OpenAuth
())):
async
def
create_similar
(
data
:
Request
,
auth
:
Auth
=
Depends
(
OpenAuth
())):
...
...
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