11# coding=utf-8
22"""
3- @project: MaxKB
4- @Author:MaxKB
5- @file: portal.py
6- @date:2026/8/3
7- @desc: 门户API文档
3+ @project: MaxKB
4+ @Author:MaxKB
5+ @file: portal.py
6+ @date:2026/8/3
7+ @desc: 门户API文档
88"""
9+
910from drf_spectacular .types import OpenApiTypes
1011from drf_spectacular .utils import OpenApiParameter
1112
1516
1617
1718class PortalAPI (APIMixin ):
18-
1919 class Get (APIMixin ):
2020 @staticmethod
2121 def get_response ():
@@ -25,20 +25,20 @@ class Save(APIMixin):
2525 @staticmethod
2626 def get_request ():
2727 return {
28- ' multipart/form-data' : {
29- ' type' : ' object' ,
30- ' properties' : {
31- ' name' : {' type' : ' string' , ' description' : ' 门户名称' },
32- ' description' : {' type' : ' string' , ' description' : ' 门户描述' },
33- ' logo' : {' type' : ' string' , ' format' : ' binary' , ' description' : ' 门户Logo' },
34- ' tab_logo' : {' type' : ' string' , ' format' : ' binary' , ' description' : ' 浏览器Tab Logo' },
35- ' enable_public_access' : {' type' : ' boolean' , ' description' : ' 是否开启公开访问' },
36- ' enable_api' : {' type' : ' boolean' , ' description' : ' 是否开启API服务' },
37- ' enable_auth' : {' type' : ' boolean' , ' description' : ' 是否开启身份认证' },
38- ' auth_config' : {' type' : ' object' , ' description' : ' 身份认证配置' },
39- ' enable_cors' : {' type' : ' boolean' , ' description' : ' 是否开启跨域设置' },
40- ' cors_config' : {' type' : ' object' , ' description' : ' 跨域配置' },
41- }
28+ " multipart/form-data" : {
29+ " type" : " object" ,
30+ " properties" : {
31+ " name" : {" type" : " string" , " description" : " 门户名称" },
32+ " description" : {" type" : " string" , " description" : " 门户描述" },
33+ " logo" : {" type" : " string" , " format" : " binary" , " description" : " 门户Logo" },
34+ " tab_logo" : {" type" : " string" , " format" : " binary" , " description" : " 浏览器Tab Logo" },
35+ " enable_public_access" : {" type" : " boolean" , " description" : " 是否开启公开访问" },
36+ " enable_api" : {" type" : " boolean" , " description" : " 是否开启API服务" },
37+ " enable_auth" : {" type" : " boolean" , " description" : " 是否开启身份认证" },
38+ " auth_config" : {" type" : " object" , " description" : " 身份认证配置" },
39+ " enable_cors" : {" type" : " boolean" , " description" : " 是否开启跨域设置" },
40+ " cors_config" : {" type" : " object" , " description" : " 跨域配置" },
41+ },
4242 }
4343 }
4444
@@ -51,24 +51,24 @@ class Application(APIMixin):
5151 def get_parameters ():
5252 return [
5353 OpenApiParameter (
54- name = ' current_page' ,
55- description = ' 当前页码' ,
54+ name = " current_page" ,
55+ description = " 当前页码" ,
5656 type = OpenApiTypes .INT ,
57- location = ' path' ,
57+ location = " path" ,
5858 required = True ,
5959 ),
6060 OpenApiParameter (
61- name = ' page_size' ,
62- description = ' 每页数量' ,
61+ name = " page_size" ,
62+ description = " 每页数量" ,
6363 type = OpenApiTypes .INT ,
64- location = ' path' ,
64+ location = " path" ,
6565 required = True ,
6666 ),
6767 OpenApiParameter (
68- name = ' name' ,
69- description = ' 应用名称搜索' ,
68+ name = " name" ,
69+ description = " 应用名称搜索" ,
7070 type = OpenApiTypes .STR ,
71- location = ' query' ,
71+ location = " query" ,
7272 required = False ,
7373 ),
7474 ]
@@ -101,24 +101,24 @@ class Conversation(APIMixin):
101101 def get_parameters ():
102102 return [
103103 OpenApiParameter (
104- name = ' current_page' ,
105- description = ' 当前页码' ,
104+ name = " current_page" ,
105+ description = " 当前页码" ,
106106 type = OpenApiTypes .INT ,
107- location = ' path' ,
107+ location = " path" ,
108108 required = True ,
109109 ),
110110 OpenApiParameter (
111- name = ' page_size' ,
112- description = ' 每页数量' ,
111+ name = " page_size" ,
112+ description = " 每页数量" ,
113113 type = OpenApiTypes .INT ,
114- location = ' path' ,
114+ location = " path" ,
115115 required = True ,
116116 ),
117117 OpenApiParameter (
118- name = ' name' ,
119- description = ' 应用名称搜索' ,
118+ name = " name" ,
119+ description = " 应用名称搜索" ,
120120 type = OpenApiTypes .STR ,
121- location = ' query' ,
121+ location = " query" ,
122122 required = False ,
123123 ),
124124 ]
0 commit comments