{"id":134953,"date":"2020-07-08T22:37:32","date_gmt":"2020-07-08T14:37:32","guid":{"rendered":"http:\/\/4563.org\/?p=134953"},"modified":"2020-07-08T22:37:32","modified_gmt":"2020-07-08T14:37:32","slug":"nestjs-%e6%9c%89%e4%b8%80%e7%82%b9%e4%b8%8d%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=134953","title":{"rendered":"Nestjs \u6709\u4e00\u70b9\u4e0d\u89e3"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Nestjs \u6709\u4e00\u70b9\u4e0d\u89e3               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ChrisV5 <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5b98\u65b9\u4f8b\u5b50\u5728 controller \u91cc\u9762\u7ed9 Service \u4f20\u4e86\u4e00\u4e2a DTO.<\/p>\n<pre><code>this.catsService.create(createCatDto) <\/code><\/pre>\n<p>\u4f46\u662f service \u91cc\u9762\u7684\u5b9a\u4e49\u662f<\/p>\n<pre><code>import { Cat } from '.\/interfaces\/cat.interface'; create(cat: Cat): void <\/code><\/pre>\n<p>\u8fd9\u4e2a\u7c7b\u578b\u68c0\u67e5\u80fd\u8fc7\u53bb\uff1f\uff1f\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>6<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2507321\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ChevalierLxc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Dto \u548c Cat \u5b57\u6bb5\u4e00\u81f4\u4e3a\u4ec0\u4e48\u4e0d\u8fc7\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2507322\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ChrisV5 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ChevalierLxc \u6240\u4ee5\u8bf4 TypeScript \u7684\u7c7b\u578b\u4e0d\u662f\u771f\u7684\u7c7b\u578b\u4e86\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2507323\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Chikaku <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             TypeScript \u4f7f\u7528\u7684\u662f Structural Type System                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2507324\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wunonglin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             dto \u4e0d\u662f\u6709\u6821\u9a8c\u5417\uff0c\u4f60\u6ca1\u5199\u6821\u9a8c\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2507325\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ChrisV5 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Chikaku \u5b66\u5230\u4e86\u3002\u611f\u8c22\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2507326\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : darknoll <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             nest \u80fd\u4e0d\u80fd\u4e0d\u7528 ts \u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Nestjs \u6709\u4e00\u70b9\u4e0d\u89e3 \u8cc7\u6df1\u5927\u4f6c&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\/134953"}],"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=134953"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/134953\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134953"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}