feat: 优化swagger

This commit is contained in:
caoqianming 2024-10-11 16:34:53 +08:00
parent 635805f041
commit a70ac00bd9
1 changed files with 16 additions and 17 deletions

33
main.py
View File

@ -178,32 +178,31 @@ patent_patterns = [
"description": "成功示例", "description": "成功示例",
"content": { "content": {
"application/json": { "application/json": {
"example": { "example": {
"标准号": "GB/T 1234-2020", "标准号": "GB/T 1234-2020",
"中文名称": "低热矿渣硅酸盐水泥", "中文名称": "低热矿渣硅酸盐水泥",
"英文名称": "Low-heat portland slag cement", "英文名称": "Low-heat portland slag cement",
"发布部门": "国家质量监督检验检疫总局", "发布部门": "国家质量监督检验检疫总局",
"发布日期": "2020-01-01", "发布日期": "2020-01-01",
"实施日期": "2020-07-01", "实施日期": "2020-07-01",
"提出单位": "中国建筑材料联合会", "提出单位": "中国建筑材料联合会",
"归口单位": "国家建筑材料工业技术监督研究中心", "归口单位": "国家建筑材料工业技术监督研究中心",
"起草单位": "中国建筑材料科学研究总院", "起草单位": "中国建筑材料科学研究总院",
"起草人": "张三、李四", "起草人": "张三、李四",
} }
},
}, },
}
}, },
400: { 400: {
'description': '错误示例', "description": "错误示例",
"content": { "content": {
"application/json": { "application/json": {
"example": { "example": {
"detail": "Invalid file type. Please choose 'standard' or 'patent'.", "detail": "Invalid file type. Please choose 'standard' or 'patent'.",
} }
} }
} },
} },
}, },
) )
async def extract_info( async def extract_info(