{"id":4102,"date":"2021-11-29T10:43:09","date_gmt":"2021-11-29T02:43:09","guid":{"rendered":"http:\/\/123.57.164.21\/?p=4102"},"modified":"2021-11-29T10:43:09","modified_gmt":"2021-11-29T02:43:09","slug":"cloud-native-%e4%b8%8e-spring-cloud_%e5%85%a5%e9%97%a8_1_%e5%87%86%e5%a4%87crud","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=4102","title":{"rendered":"Cloud native \u4e0e Spring Cloud_\u5165\u95e8_1_\u51c6\u5907CRUD"},"content":{"rendered":"\n<ul><li>\u4e3a\u65b9\u4fbf\u505a CRUD\uff0c \u672c\u9879\u76ee\u4f9d\u8d56\u5982\u4e0b\u7b2c 3 \u65b9\u5e93\u3002<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u540d\u79f0<\/th><th>\u7528\u9014<\/th><th>\u7248\u672c\u53f7<\/th><th>\u5b98\u7f51<\/th><th>\u5907\u6ce8<\/th><\/tr><\/thead><tbody><tr><td>hutool<\/td><td>\u5904\u7406\u65e5\u671f\u5b57\u7b26\u4e32\u7b49<\/td><td>5.17.2<\/td><td><a href=\"https:\/\/hutool.cn\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/hutool.cn\/<\/a><\/td><td>\u4ec5\u4f9d\u8d56 hutool-core<\/td><\/tr><tr><td>springdoc<\/td><td>\u751f\u6210 OpenAPI \u6587\u6863<\/td><td>1.5.10<\/td><td><a href=\"https:\/\/springdoc.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/springdoc.org\/<\/a><\/td><td><\/td><\/tr><tr><td>Mapper Spring Boot Starter<\/td><td>\u5feb\u901f\u5b9e\u73b0 CRUD<\/td><td>2.1.5<\/td><td><a href=\"https:\/\/github.com\/abel533\/Mapper\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/abel533\/Mapper<\/a><\/td><td><\/td><\/tr><tr><td>PageHelper Spring Boot Starter<\/td><td>Mybatis \u5206\u9875\u63d2\u4ef6<\/td><td>1.3.1<\/td><td><a href=\"https:\/\/github.com\/pagehelper\/pagehelper-spring-boot\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/pagehelper\/pagehelper-spring-boot<\/a><\/td><td><\/td><\/tr><tr><td>Apache commons csv<\/td><td>CSV \u5bfc\u5165\u5bfc\u51fa<\/td><td>1.9.0<\/td><td><a href=\"https:\/\/commons.apache.org\/proper\/commons-csv\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/commons.apache.org\/proper\/commons-csv\/<\/a><\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul><li>pom.xml \u6dfb\u52a0\u4f9d\u8d56\u9879<a href=\"https:\/\/doc-jrecloud-dev.roks-iip-48-2029222ed72d9643e3d07091333056f5-0000.jp-tok.containers.appdomain.cloud\/docs\/intermediate\/crud-prepare#pomxml-\u6dfb\u52a0\u4f9d\u8d56\u9879\">\u200b<\/a><\/li><\/ul>\n\n\n\n<p>\u5c06 microservices\/product-api \u4e2d\u7684 pom.xml \u6587\u4ef6\u590d\u5236\u5230 demo-api \u9879\u76ee\u4e0b\uff0c \u67e5\u627e\u66ff\u6362 <code>product<\/code> -&gt; <code>demo<\/code><\/p>\n\n\n\n<p>\u4f9d\u8d56\u9879\u76ee\u6dfb\u52a0\u5b8c\u6210\u3002<\/p>\n\n\n\n<ul><li>\u4fee\u6539 application.yaml \u6587\u4ef6<a href=\"https:\/\/doc-jrecloud-dev.roks-iip-48-2029222ed72d9643e3d07091333056f5-0000.jp-tok.containers.appdomain.cloud\/docs\/intermediate\/crud-prepare#\u4fee\u6539-applicationyaml-\u6587\u4ef6\">\u200b<\/a><\/li><\/ul>\n\n\n\n<p>\u5c06 microservices\/product-api \u4e2d\u7684 <code>src\/main\/resources\/application.yaml<\/code> \u6587\u4ef6\u590d\u5236\u5230 demo-api \u5bf9\u5e94\u4f4d\u7f6e\uff0c \u67e5\u627e\u66ff\u6362 <code>product<\/code> -&gt; <code>demo<\/code><\/p>\n\n\n\n<p>spring \u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u5b8c\u6210\u3002<\/p>\n\n\n\n<ul><li>\u521b\u5efa demo \u8868<a href=\"https:\/\/doc-jrecloud-dev.roks-iip-48-2029222ed72d9643e3d07091333056f5-0000.jp-tok.containers.appdomain.cloud\/docs\/intermediate\/crud-prepare#\u521b\u5efa-demo-\u8868\">\u200b<\/a><\/li><\/ul>\n\n\n\n<p>\u6253\u5f00\u6587\u4ef6 <code>sql\/postgres\/01_schema.sql<\/code>, \u6dfb\u52a0\u5982\u4e0b SQL \u8bed\u53e5.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">create table demo\n(\n    demo_id     serial not null\n        constraint demo_pkey\n            primary key,\n    title       varchar(128),\n    description varchar(512),\n    author      varchar(32),\n    duration    int,\n    start_time  varchar(16)\n);<\/pre>\n\n\n\n<p>\u6253\u5f00\u6587\u4ef6 <code>sql\/postgres\/02_demo.sql<\/code>, \u6dfb\u52a0\u5982\u4e0b SQL \u8bed\u53e5.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">delete\nfrom \"demo\";\ninsert into demo(demo_id, title, description, author, duration, start_time)\nvalues (1, 'JRECloud demo', 'JRECloud\u7684\u7b2c\u4e00\u6b21demo', 'yinsb', 30, '2021-10-10 13:00'),\n       (2, 'JRECloud demo #2', 'JRECloud\u7684\u7b2c2\u6b21demo', 'yinsb', 30, '2021-10-17 15:00');\nalter sequence demo_demo_id_seq restart with 100;<\/pre>\n\n\n\n<p>\u8fde\u63a5\u5230\u672c\u5730\u6570\u636e\u5e93\uff0c \u6267\u884c\u5bf9\u5e94\u7684 SQL \u6587\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2021\/11\/image-55-1024x420.png\" alt=\"\" class=\"wp-image-4105\" width=\"604\" height=\"247\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55-1024x420.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55-300x123.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55-768x315.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55-830x340.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55-230x94.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55-350x143.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55-480x197.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2021\/11\/image-55.png 1298w\" sizes=\"(max-width: 604px) 100vw, 604px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u65b9\u4fbf\u505a CRUD\uff0c \u672c\u9879\u76ee\u4f9d\u8d56\u5982\u4e0b\u7b2c 3 \u65b9\u5e93\u3002 \u540d\u79f0 \u7528\u9014 \u7248\u672c\u53f7 \u5b98\u7f51 \u5907\u6ce8 hutool \u5904\u7406\u65e5\u671f\u5b57\u7b26 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/4102"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4102"}],"version-history":[{"count":4,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/4102\/revisions"}],"predecessor-version":[{"id":4107,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/4102\/revisions\/4107"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}