{"openapi":"3.1.0","info":{"title":"sv.ai2016.com Demo API","description":"sv.ai2016.com 的演示接口：健康检查、服务器信息、PostgreSQL 增删查改。","version":"2.0.0"},"paths":{"/api/health":{"get":{"tags":["系统"],"summary":"健康检查","description":"存活探针。返回 200 即表示应用正常。","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/info":{"get":{"tags":["系统"],"summary":"服务器信息","description":"展示运行环境，同时也是数据库连通性自检。","operationId":"info_api_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/echo":{"get":{"tags":["系统"],"summary":"回显","description":"最简单的连通性测试。","operationId":"echo_api_echo_get","parameters":[{"name":"msg","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"hello","title":"Msg"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notes":{"get":{"tags":["笔记"],"summary":"列出全部笔记","operationId":"list_notes_api_notes_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NoteOut"},"title":"Response List Notes Api Notes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["笔记"],"summary":"新建笔记","operationId":"create_note_api_notes_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/notes/{note_id}":{"get":{"tags":["笔记"],"summary":"读取单条笔记","operationId":"get_note_api_notes__note_id__get","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"integer","title":"Note Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["笔记"],"summary":"删除笔记","operationId":"delete_note_api_notes__note_id__delete","parameters":[{"name":"note_id","in":"path","required":true,"schema":{"type":"integer","title":"Note Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/db-check":{"get":{"tags":["系统"],"summary":"数据库读写自检","description":"写一条、读回来、再删掉，确认数据库真的可读写（走事务）。","operationId":"db_check_api_db_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"NoteIn":{"properties":{"title":{"type":"string","maxLength":120,"minLength":1,"title":"Title","description":"标题"},"body":{"type":"string","maxLength":4000,"title":"Body","description":"正文","default":""}},"type":"object","required":["title"],"title":"NoteIn"},"NoteOut":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"created":{"type":"string","title":"Created"}},"type":"object","required":["id","title","body","created"],"title":"NoteOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}