File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33from flask import g
44from lin import permission_meta
5- from lin .apidoc import api , DocResponse
5+ from lin .apidoc import DocResponse , api
66from lin .db import db
77from lin .jwt import group_required
88from lin .logger import Log
1313 AuthorizationSchema ,
1414 LogPageSchema ,
1515 LogQuerySearchSchema ,
16- StringList ,
16+ UsernameListSchema ,
1717)
1818
1919log_api = Redprint ("log" )
@@ -59,7 +59,7 @@ def get_logs():
5959@group_required
6060@api .validate (
6161 headers = AuthorizationSchema ,
62- resp = DocResponse (r = StringList ),
62+ resp = DocResponse (r = UsernameListSchema ),
6363 tags = ["日志" ],
6464)
6565def get_users_for_log ():
@@ -73,4 +73,4 @@ def get_users_for_log():
7373 .having (text ("count(username) > 0" ))
7474 .all ()
7575 )
76- return [u .username for u in usernames ]
76+ return UsernameListSchema ( items = [u .username for u in usernames ])
Original file line number Diff line number Diff line change 77
88from flask import g , request
99from lin import permission_meta
10- from lin .apidoc import api , DocResponse
10+ from lin .apidoc import DocResponse , api
1111from lin .exception import Success
1212from lin .jwt import group_required , login_required
1313from lin .redprint import Redprint
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ class BookQuerySearchSchema(BaseModel):
1717 q : Optional [str ] = str ()
1818
1919
20- class StringList (BaseModel ):
21- __root__ : List [str ]
20+ class UsernameListSchema (BaseModel ):
21+ items : List [str ]
2222
2323
2424class LogQuerySearchSchema (BaseModel ):
You can’t perform that action at this time.
0 commit comments