{"id":194265,"date":"2020-11-04T09:06:07","date_gmt":"2020-11-04T01:06:07","guid":{"rendered":"http:\/\/4563.org\/?p=194265"},"modified":"2020-11-19T14:17:05","modified_gmt":"2020-11-19T06:17:05","slug":"magic-api%ef%bc%9a-java-%e5%90%8e%e7%ab%af%e5%bc%80%e5%8f%91%e8%80%85%e7%9a%84%e7%a6%8f%e9%9f%b3%ef%bc%8c%e6%8e%a5%e5%8f%a3%e5%bc%80%e5%8f%91%e5%88%a9%e5%99%a8","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=194265","title":{"rendered":"magic-api\uff1a Java \u540e\u7aef\u5f00\u53d1\u8005\u7684\u798f\u97f3\uff0c\u63a5\u53e3\u5f00\u53d1\u5229\u5668"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  magic-api\uff1a Java \u540e\u7aef\u5f00\u53d1\u8005\u7684\u798f\u97f3\uff0c\u63a5\u53e3\u5f00\u53d1\u5229\u5668               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : javaxd <\/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<h1>magic-api \u4ecb\u7ecd<\/h1>\n<p> <\/p>\n<p>magic-api \u662f\u4e00\u4e2a\u57fa\u4e8e Java \u7684\u63a5\u53e3\u5feb\u901f\u5f00\u53d1\u6846\u67b6\uff0c\u5c06\u901a\u8fc7 magic-api \u63d0\u4f9b\u7684 UI \u754c\u9762\u5b8c\u6210\u7f16\u5199\u63a5\u53e3\uff0c\u81ea\u52a8\u6620\u5c04\u4e3a HTTP \u63a5\u53e3\uff0c\u65e0\u9700\u5b9a\u4e49 Controller \u3001Service \u3001Dao \u3001Mapper \u3001XML \u3001VO \u7b49 Java \u5bf9\u8c61\u5373\u53ef\u5b8c\u6210\u5e38\u89c1\u7684 HTTP API \u63a5\u53e3\u5f00\u53d1<\/p>\n<blockquote>\n<p><code>magic-api<\/code> \u5e76\u4e0d\u662f\u4ee3\u66ff\u4f20\u7edf\u7684\u5f00\u53d1\uff0c\u5373\u53ef\u4ee5\u4e0e\u4f20\u7edf\u7684\u63a5\u53e3\u5f00\u53d1\u5171\u5b58\uff0c\u4e5f\u53ef\u4ee5\u5355\u72ec\u4f7f\u7528<\/p>\n<\/blockquote>\n<h1>magic-api \u53ef\u4ee5\u505a\u4ec0\u4e48\uff1f<\/h1>\n<p> <\/p>\n<ul>\n<li>\u62a5\u8868\u3001\u770b\u677f\u3001\u591a\u7edf\u8ba1\u67e5\u8be2\u573a\u666f<\/li>\n<li>\u4e1a\u52a1\u903b\u8f91\u76f8\u5bf9\u7b80\u5355\u3001\u9700\u5feb\u901f\u5f00\u53d1\u8fed\u4ee3<\/li>\n<li>\u5c06\u6570\u636e\u5e93\u3001\u670d\u52a1\u7b49\u591a\u4e2a\u7ed3\u679c\u96c6\u805a\u5408\u5904\u7406<\/li>\n<\/ul>\n<h1>magic-api \u6709\u54ea\u4e9b\u529f\u80fd\uff1f<\/h1>\n<p> <\/p>\n<ul>\n<li>\u652f\u6301 MySQL \u3001MariaDB \u3001Oracle \u3001DB2 \u3001PostgreSQL \u3001SQLServer \u7b49\u591a\u79cd\u6570\u636e\u5e93<\/li>\n<li>\u652f\u6301\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93 Redis \u3001Mongodb<\/li>\n<li>\u652f\u6301\u5206\u9875\u67e5\u8be2\u4ee5\u53ca\u81ea\u5b9a\u4e49\u5206\u9875\u67e5\u8be2<\/li>\n<li>\u652f\u6301\u591a\u6570\u636e\u6e90\u914d\u7f6e\uff0c\u652f\u6301\u8fd0\u884c\u65f6\u52a8\u6001\u6dfb\u52a0\u6570\u636e\u6e90<\/li>\n<li>\u652f\u6301 SQL \u7f13\u5b58\uff0c\u4ee5\u53ca\u81ea\u5b9a\u4e49 SQL \u7f13\u5b58<\/li>\n<li>\u652f\u6301\u81ea\u5b9a\u4e49 JSON \u7ed3\u679c\u3001\u81ea\u5b9a\u4e49\u5206\u9875\u7ed3\u679c<\/li>\n<li>\u652f\u6301\u5bf9\u63a5\u53e3\u6743\u9650\u914d\u7f6e\u3001\u62e6\u622a\u5668\u7b49\u529f\u80fd<\/li>\n<li>\u652f\u6301\u8fd0\u884c\u65f6\u52a8\u6001\u4fee\u6539\u6570\u636e\u6e90<\/li>\n<li>\u652f\u6301 Swagger \u63a5\u53e3\u6587\u6863\u751f\u6210<\/li>\n<li>\u57fa\u4e8emagic-script\u811a\u672c\u5f15\u64ce\uff0c\u52a8\u6001\u7f16\u8bd1\uff0c\u65e0\u9700\u91cd\u542f\uff0c\u5b9e\u65f6\u53d1\u5e03<\/li>\n<li>\u652f\u6301\u6570\u636e\u5e93\u4e8b\u52a1\u3001SQL \u652f\u6301\u62fc\u63a5\uff0c\u5360\u4f4d\u7b26\uff0c\u5224\u65ad\u7b49\u8bed\u6cd5<\/li>\n<li>\u652f\u6301\u6587\u4ef6\u4e0a\u4f20\u3001\u4e0b\u8f7d\u3001\u8f93\u51fa\u56fe\u7247<\/li>\n<li>\u652f\u6301\u811a\u672c\u5386\u53f2\u7248\u672c\u5bf9\u6bd4\u4e0e\u6062\u590d<\/li>\n<li>\u652f\u6301\u811a\u672c\u4ee3\u7801\u81ea\u52a8\u63d0\u793a\u3001\u9519\u8bef\u63d0\u793a<\/li>\n<li>\u652f\u6301\u5bfc\u5165 Spring \u4e2d\u7684 Bean \u3001Java \u4e2d\u7684\u7c7b<\/li>\n<li>\u652f\u6301\u5728\u7ebf\u8c03\u8bd5\u811a\u672c\u5f15\u64ce<\/li>\n<li>\u652f\u6301\u81ea\u5b9a\u4e49\u5de5\u5177\u7c7b\u3001\u81ea\u5b9a\u4e49\u6a21\u5757\u5305\u3001\u81ea\u5b9a\u4e49\u7c7b\u578b\u6269\u5c55<\/li>\n<\/ul>\n<h1>\u5feb\u901f\u96c6\u6210<\/h1>\n<p> <\/p>\n<h2>maven \u5f15\u5165<\/h2>\n<pre><code>&lt;!-- \u4ee5 spring-boot-starter \u7684\u65b9\u5f0f\u5f15\u7528 --&gt; &lt;dependency&gt;  &lt;groupId&gt;org.ssssssss&lt;\/groupId&gt;  &lt;artifactId&gt;magic-api-spring-boot-starter&lt;\/artifactId&gt;  &lt;version&gt;0.4.6&lt;\/version&gt; &lt;\/dependency&gt;   <\/code><\/pre>\n<h2>\u521b\u5efa\u6570\u636e\u5e93\u8868<\/h2>\n<p>\u6267\u884c Github \u6216 Gitee \u4ed3\u5e93\u4e2d\u7684 SQL \u8bed\u53e5\uff1a<code>db\/magic-api.sql<\/code>\uff0c\u5177\u4f53\u94fe\u63a5\u5728\u6587\u7ae0\u672b\u5c3e\u3002<\/p>\n<h2>\u914d\u7f6e SpringBoot<\/h2>\n<pre><code>server.port=9999 #\u914d\u7f6e web \u9875\u9762\u5165\u53e3 magic-api.web=\/magic\/web #\u4ee5\u4e0b\u914d\u7f6e\u9700\u8ddf\u5b9e\u9645\u60c5\u51b5\u4fee\u6539 spring.datasource.url=jdbc:mysql:\/\/localhost\/test spring.datasource.username=root spring.datasource.password=123456789 spring.datasource.driver-class-name=com.mysql.jdbc.Driver   <\/code><\/pre>\n<h2>\u542f\u52a8\u9879\u76ee<\/h2>\n<p>\u542f\u52a8\u9879\u76ee\u4e4b\u540e\uff0c\u5728\u8bbf\u95ee http:\/\/localhost:9999\/magic\/web \u5373\u53ef\u4ee5\u770b\u5230\u63a5\u53e3\u914d\u7f6e\u9875\u9762 <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/11\/20201119_5fb6095a51d1e.png\" alt=\"magic-api\uff1a Java \u540e\u7aef\u5f00\u53d1\u8005\u7684\u798f\u97f3\uff0c\u63a5\u53e3\u5f00\u53d1\u5229\u5668\" \/><\/p>\n<h1>\u521b\u5efa\u4e00\u4e2a\u63a5\u53e3<\/h1>\n<p> <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/11\/20201119_5fb6095fe03de.png\" alt=\"magic-api\uff1a Java \u540e\u7aef\u5f00\u53d1\u8005\u7684\u798f\u97f3\uff0c\u63a5\u53e3\u5f00\u53d1\u5229\u5668\" \/><\/p>\n<p>\u4fdd\u5b58\u4e4b\u540e\u8bbf\u95ee\u9875\u9762\u6d4b\u8bd5\uff08\u8bbf\u95ee\u7b2c 2 \u9875\uff0c\u6bcf\u9875 5 \u6761\uff09\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/11\/20201119_5fb60966683b9.png\" alt=\"magic-api\uff1a Java \u540e\u7aef\u5f00\u53d1\u8005\u7684\u798f\u97f3\uff0c\u63a5\u53e3\u5f00\u53d1\u5229\u5668\" \/><\/p>\n<p>\u5176\u5b83 Demo \u5c31\u4e0d\u4e00\u4e00\u5217\u4e3e\u4e86\uff0cSQL \u811a\u672c\u4e2d\u5185\u7f6e\u4e86\u5f88\u591a Demo\uff0c\u53ef\u4ee5\u4e0b\u8f7d\u81ea\u884c\u67e5\u770b\uff0c\u4e5f\u53ef\u4ee5\u8bbf\u95ee\u6f14\u793a\u5730\u5740<\/p>\n<h1>\u603b\u7ed3<\/h1>\n<p> <\/p>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u7b80\u5355\u7684\u914d\u7f6e\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e2a\u63a5\u53e3\uff0c\u76f8\u6bd4\u4f20\u7edf\u65b9\u5f0f\u6781\u5927\u7684\u7b80\u5316\u4e86\u5f00\u53d1\uff0c\u8fd9\u4e5f\u6b63\u662f\u672c\u9879\u76ee\u7684\u521d\u8877\u4ee5\u53ca\u76ee\u7684\u3002\u5982\u679c\u5927\u5bb6\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u6709\u4ec0\u4e48\u95ee\u9898\u3001\u7591\u95ee\u3001\u5efa\u8bae\u53ef\u4ee5\u5728\u8bc4\u8bba\u533a\u3001Github \u3001Gitee \u4e0a\u63d0 Issue\uff0c\u4e5f\u6b22\u8fce\u52a0 QQ \u4ea4\u6d41\u7fa4\u6765\u8ba8\u8bba\u3002<\/p>\n<ul>\n<li>\u6f14\u793a\u5730\u5740\uff1ahttp:\/\/140.143.210.90:9999\/magic\/web<\/li>\n<li>\u4f7f\u7528\u6587\u6863\uff1ahttps:\/\/ssssssss.org<\/li>\n<li>Github\uff1ahttps:\/\/github.com\/ssssssss-team\/magic-api<\/li>\n<li>Gitee\uff1ahttps:\/\/gitee.com\/ssssssss-team\/magic-api<\/li>\n<\/ul><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4206109\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lori01 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6536\u85cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4206110\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wysnylc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bf7\u95ee\u6709\u6ca1\u6709 JsonApi \u597d\u7528 <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/11\/504J5BO2-64.png\" alt=\"magic-api\uff1a Java \u540e\u7aef\u5f00\u53d1\u8005\u7684\u798f\u97f3\uff0c\u63a5\u53e3\u5f00\u53d1\u5229\u5668\"> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4206111\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : javaxd <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wysnylc APIJSON \u5417\uff1f\u6211\u4e2a\u4eba\u662f\u4e0d\u559c\u6b22\u90a3\u79cd\u98ce\u683c\u7684\u3002\u5b9a\u4f4d\u4e5f\u4e0d\u4e00\u6837                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4206112\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yuhangch <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5305\u540d\u79bb\u8c31\u54c8\u54c8\u54c8\u54c8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>magic-api\uff1a Java \u540e&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\/194265"}],"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=194265"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/194265\/revisions"}],"predecessor-version":[{"id":194267,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/194265\/revisions\/194267"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194265"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}