{"id":135446,"date":"2020-07-15T03:21:35","date_gmt":"2020-07-14T19:21:35","guid":{"rendered":"http:\/\/4563.org\/?p=135446"},"modified":"2020-07-15T03:21:35","modified_gmt":"2020-07-14T19:21:35","slug":"%e5%88%9a%e5%88%9a%e7%9c%8b%e5%88%b0%e5%a5%bd%e5%83%8f-microsoft-%e4%b9%9f%e7%94%a8%e4%ba%86-fastapi","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=135446","title":{"rendered":"\u521a\u521a\u770b\u5230\u597d\u50cf Microsoft \u4e5f\u7528\u4e86 FastAPI"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u521a\u521a\u770b\u5230\u597d\u50cf Microsoft \u4e5f\u7528\u4e86 FastAPI               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hushao <\/span>  <span><i><\/i> 60<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5728\u770b pydantic \u7684\u6587\u6863\uff0c\u7136\u540e\u770b\u5230\u4e86\u4e0a\u9762\u63d0\u5230 Microsoft \u4e5f\u7528\u4e86 FastAPI \u3002\u3002\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/07\/20200721_5f1742be5c446.png\" alt=\"\u521a\u521a\u770b\u5230\u597d\u50cf Microsoft \u4e5f\u7528\u4e86 FastAPI\" \/> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/07\/20200721_5f1742c0360d3.png\" alt=\"\u521a\u521a\u770b\u5230\u597d\u50cf Microsoft \u4e5f\u7528\u4e86 FastAPI\" \/><\/p>\n<p>pydantic \u76f8\u5173\u94fe\u63a5\uff1a https:\/\/pydantic-docs.helpmanual.io\/<\/p>\n<p>fastapi \u76f8\u5173\u94fe\u63a5\uff1a https:\/\/github.com\/tiangolo\/fastapi\/pull\/26#issuecomment-463768795<\/p>\n<p>\u53e6\u5916\uff1afastapi \u662f\u4e0d\u662f\u53ef\u4ee5\u8003\u8651\u5728 v2 \u4e0a\u5f00\u4e2a\u8282\u70b9\uff1f@Livid<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>14<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1275790\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iConnect <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             fastapi \u5f88\u597d\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275791\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Qzier <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             wow\uff0cawesome \uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275792\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : midtin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4e5f\u5728\u8003\u8651\u7528 fastapi \u91cd\u6784\u4e00\u4e9b\u9ad8\u8bbf\u95ee\u91cf\u7684\u63a5\u53e3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275793\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wzw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7684\u786e\u5f88\u597d\u7528\uff0c\u53ef\u60dc golang \u6ca1\u6709                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275794\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pandachow <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u662f\u7684\uff0c\u6211\u5728\u5fae\u8f6f\uff0c\u6211\u5c31\u5728\u7528\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275795\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : enrio <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u53ef\u4ee5\uff0c\u81ea\u5e26 Swagger\uff0c\u662f\u4e2a\u5b9d\u8d1d\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275796\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dayeye2006199 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u548c\u5199 flask \u6709\u4ec0\u4e48\u611f\u53d7\u4e0a\u7684\u4e0d\u540c\u5417\uff1f\u591a\u4e86\u4e9b\u4ec0\u4e48\u529f\u80fd                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275797\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lithbitren <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u57fa\u7840\u8bbe\u65bd\u8be5\u6709\u5927\u591a\u90fd\u6709\u4e86\uff0cpy \u7684 web \u6846\u67b6\u5728\u7528\u6cd5\u4e0a\u4e5f\u90fd\u662f\u5927\u540c\u5c0f\u5f02\uff0c\u6ca1\u5565\u5b66\u4e60\u6210\u672c\uff0c\u6bd4\u8d77 flask \u53c8\u5c11\u62c5\u5fc3\u4e86\u70b9 io \u6548\u7387\u7684\u95ee\u9898\uff0c\u4e2a\u4eba\u9879\u76ee\u7684\u63a5\u53e3\u7528\u8d77\u6765\u6682\u65f6\u8fd8 OK \u3002\u5f88\u591a\u8f6e\u5b50\u6682\u65f6\u4e0d\u7528\u5728 golang \u4e0a\u518d\u9020\u4e00\u904d\u4e86\uff0cgin \u672c\u6765\u90fd\u642d\u8d77\u6765\uff0c\u4e00\u60f3\u5230\u8981\u9020\u8fd9\u4e48\u591a\u8f6e\u5b50\u5c31\u624b\u8f6f\uff0c\u8fd8\u662f\u7528 fastAPI \u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275798\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : hushao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @dayeye2006199 flask \u5c0f\u9879\u76ee\u723d\uff0cfastapi \u8d77\u5c0f\u9879\u76ee\u611f\u89c9\u6709\u70b9\u5570\u55e6\u3002\u5927\u9879\u76ee\u7684\u8fd8\u6ca1\u673a\u4f1a\u8bd5\uff0c\u81ea\u52a8\u6587\u6863\u5f88\u9999\uff0c\u4e0d\u8fc7\u76ee\u524d\u4e3a\u6b62\u6211\u6bd4\u8f83\u4ecb\u610f\u7684\u4e00\u70b9\u5c31\u662f sqlalchemy \u548c alembic\uff0csqlalchemy \u8fd8\u597d\uff0c\u5176\u4ed6\u9879\u76ee\u4e5f\u6709\u7528\u5012\u4e0d\u600e\u4e48\u62c5\u5fc3\uff0calembic \u4e4b\u524d\u7528\u7684\u65f6\u5019\uff08\u81ea\u5df1\u7ecf\u9a8c\u5c11\u8bef\u64cd\u4f5c\uff09\uff0c\u8bef\u5220\u8fc7\u6570\u636e\uff08\u53ef\u81ea\u67e5\u4f1a\u6709\u54ea\u4e9b\u5751\uff09\uff0c\u5bfc\u81f4\u6211\u73b0\u5728\u89c1\u5230 alembic \u90fd\u6301\u8c28\u614e\u6001\u5ea6\uff0c\u8fd8\u662f\u559c\u6b22 django \u7684 migrate \u529f\u80fd\u3002<br \/>\u81f3\u4e8e\u591a\u4e86\u54ea\u4e9b\u529f\u80fd\uff0c\u81ea\u52a8\u751f\u6210\u6587\u6863\uff0c\u63a5\u53e3\u53c2\u6570\u6821\u9a8c\uff0casgi \u662f\u63d0\u5230\u6bd4\u8f83\u591a\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275799\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : hushao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lithbitren \u5bf9\u5bf9\u5bf9\uff0cgo \u867d\u7136\u6709 gin\uff0c\u4f46\u662f\u611f\u89c9\u8fd8\u662f\u8fc7\u4e8e\u539f\u59cb\uff0c\u8fd8\u662f\u751f\u6001\u7684\u539f\u56e0\u5427\uff0c\u5f53\u7136\u4e5f\u662f\u81ea\u8eab\u6c34\u5e73\u6709\u9650&gt;dog face&lt;\uff0c\u7136\u540e\u5c31\u662f\u90e8\u5206\u811a\u672c\u5207\u6210\u4e86 go\uff0cweb \u65b9\u9762\u8fd8\u662f\u4f1a\u6839\u636e\u60c5\u51b5\u4f18\u5148\u8003\u8651 django \u548c fastapi\uff0c\u8ddf\u4f60\u60f3\u6cd5\u5dee\u4e0d\u591a\uff0c\u90fd\u642d\u8d77\u6765\u4e86\u53c8\u62c6\u4e86\uff0c\u54c8\u54c8\u54c8\u54c8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275800\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : hushao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @pandachow \u5927\u4f6c\u725b\u76ae\uff0c\u65b9\u4fbf\u900f\u9732\u662f\u4e2a\u4eba\u9879\u76ee\u8fd8\u662f\u516c\u53f8\u4e0a\u4e86\u751f\u4ea7\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275801\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : hushao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wzw \u4e0d\u662f\u6709\u4e2a goframe \u4e48\uff0c\u4e0d\u8fc7\u6211\u4e0d\u559c\u6b22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275802\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : hushao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @midtin fastapi \u5bf9\u63a5 flask \u3001django \u8fd9\u4e9b\u5199\u7684\u8001\u9879\u76ee\u8fd8\u662f\u5f88\u65b9\u4fbf\u7684\uff0c\u53ef\u4ee5\u8003\u8651\u76f4\u63a5\u5347\u7ea7\u63a5\u53e3\uff0c\u54c8\u54c8\u54c8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1275803\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hjahgdthab750 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u88ab django \u7684 swagger \u751f\u6210\u641e\u70e6\u4e86\u4e4b\u540e\uff0c\u6211\u8f6c\u5411\u4e86 dotnet core\uff0c\u5f53\u7136 java \u4e5f\u53ef\u4ee5\uff0c\u8fd9\u4e24\u4e2a\u7684 swagger \u63d2\u4ef6\u6bd4 django \u7684\u597d\u7528\u5f88\u591a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u521a\u521a\u770b\u5230\u597d\u50cf Microsoft &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/135446"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135446"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/135446\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135446"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}