Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
Project
Project
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
chaonan
unify_api2
Commits
356a1478
Commit
356a1478
authored
Aug 05, 2024
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init session mgr 2024-08-5
parent
2a3c8f1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
session_mgr_cps.py
unify_api/modules/inv_eval/components/session_mgr_cps.py
+26
-0
session_mgr.py
unify_api/modules/inv_eval/views/session_mgr.py
+12
-2
No files found.
unify_api/modules/inv_eval/components/session_mgr_cps.py
0 → 100644
View file @
356a1478
# -*- coding:utf-8 -*-
"""
DATE:2024/8/5 17:41
"""
from
dataclasses
import
dataclass
from
pot_libs.sanic_api
import
Model
from
pot_libs.sanic_api.column
import
Opt
,
Int
,
List
,
Str
@
dataclass
class
SessionHisReq
(
Model
):
page_num
:
int
=
Opt
(
Int
(
"页码"
)
.
eg
(
1
))
page_size
:
int
=
Opt
(
Int
(
"条数"
)
.
eg
(
10
))
@
dataclass
class
SessionInfo
(
Model
):
id
:
int
=
Opt
(
Int
(
"会话ID"
)
.
eg
(
1
))
title
:
str
=
Opt
(
Str
(
"会话标题"
)
.
eg
(
"未命名会话"
))
create_time
:
str
=
Opt
(
Str
(
"创建时间"
)
.
eg
(
"2023-12-08 00:54"
))
@
dataclass
class
SessionHisRsp
(
Model
):
sessions
:
list
=
List
(
"会话列表"
)
.
items
(
SessionInfo
)
unify_api/modules/inv_eval/views/session_mgr.py
View file @
356a1478
...
...
@@ -4,8 +4,18 @@ DATE:2024/8/5 16:56
"""
from
pot_libs.sanic_api
import
summary
from
unify_api.modules.inv_eval.components.session_mgr_cps
import
(
SessionHisReq
,
SessionHisRsp
)
@
summary
(
"历史会话"
)
async
def
post_session_his
(
req
,
body
):
pass
async
def
post_session_his
(
req
,
body
:
SessionHisReq
)
->
SessionHisRsp
:
try
:
pg_num
=
int
(
body
.
page_num
)
pg_size
=
int
(
body
.
page_size
)
except
Exception
as
e
:
pg_num
,
pg_size
=
1
,
10
rsp_sessions
=
[]
return
SessionHisRsp
(
sessions
=
rsp_sessions
)
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