{"id":301556,"date":"2020-04-09T09:00:19","date_gmt":"2020-04-09T09:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301556"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-04-09T09:00:19","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301556","title":{"rendered":"\u041f\u0435\u0440\u0432\u044b\u0435 \u0448\u0430\u0433\u0438 \u0432 Spring, Rest API, \u0430\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 PUT \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u043c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/496386\/\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0435\u0431\u0435: \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442 Skillbox \u0438 \u043f\u0440\u043e\u0445\u043e\u0436\u0443 \u043a\u0443\u0440\u0441 \u201cJava-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u201d. \u041d\u0435 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0440\u0435\u043a\u043b\u0430\u043c\u0430, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0435\u0431\u0435. \u041d\u0430\u0447\u0430\u043b \u0443\u0447\u0438\u0442\u044c \u0434\u0436\u0430\u0432\u0443 \u0441 \u043c\u0430\u044f 2019 \u0433\u043e\u0434\u0430, \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u043b HTML, CSS \u0438 JS.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u0434\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u043e \u043c\u0435\u043d\u044f \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u0432\u043c\u0435\u0441\u0442\u0435 \u0438 \u043d\u0435\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 PUT \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412\u0435\u0437\u0434\u0435 \u0433\u0434\u0435 \u044f \u201c\u0433\u0443\u0433\u043b\u0438\u043b\u201d \u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d Rest API \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 POST \u0438 GET, \u0438\u043d\u043e\u0433\u0434\u0430 \u0441 DELETE \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u043d\u0435\u0441\u0442\u0438, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043a\u0430\u043a \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e REST API \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041d\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u043a\u043e\u0438\u043c \u044f \u044f\u0432\u043b\u044f\u044e\u0441\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u044e\u0437\u0435\u0440\u043e\u0432 Spring \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0435\u0434\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0445 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0435\u0439. \u0412\u0435\u0434\u044c \u044f \u0431\u0443\u0434\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442 (\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u043f\u044b\u0442\u0430).<br \/>  <a name=\"habracut\"><\/a><br \/>  \u042f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f Spring, \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c PUT, \u0442\u043e \u0431\u0438\u0448\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0411\u0414. \u0422\u0430\u043a\u0436\u0435 \u043e\u043f\u0438\u0448\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u044b POST \u0438 GET. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 CRUD (\u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0435\u0441\u043b\u0438 \u044f \u043d\u0435 \u043f\u0440\u0430\u0432). \u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430, \u0442\u043e \u0431\u0438\u0448\u044c \u043a\u0430\u043a \u0442\u0430\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>  \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b:<\/p>\n<ul>\n<li>Maven<\/li>\n<li>MySQL<\/li>\n<li>IntelliJ IDEA<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0445\u043e\u0447\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0431\u044b\u043b \u0432 \u0443\u0447\u0435\u0431\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043c\u043d\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u044b PUT \u0438 DELETE.<\/p>\n<p>  \u0412\u0435\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/skkovalenko\/ToDoList\" rel=\"nofollow\">GitHub<\/a>.<\/p>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043b\u0430\u0439\u0432\u0445\u0430\u043a: \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 maven \u0432\u0435\u0440\u0441\u0438\u044f java \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u043d\u0430 \u043f\u044f\u0442\u0443\u044e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 <i>pom.xml<\/i> \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435, \u0433\u0434\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u044d\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043b\u0430\u0439\u0444\u0445\u0430\u043a<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;properties&gt;     &lt;maven.compiler.target&gt;11&lt;\/maven.compiler.target&gt;     &lt;maven.compiler.source&gt;11&lt;\/maven.compiler.source&gt; &lt;\/properties&gt;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Spring<\/h3>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432 <i>pom.xml<\/i> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c Spring boot, \u043a\u0430\u043a parent, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u043b\u043e \u043f\u043e \u0432\u0435\u0440\u0441\u0438\u044f\u043c: <\/p>\n<pre><code class=\"xml\">&lt;parent&gt;     &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;     &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;     &lt;version&gt;2.2.4.RELEASE&lt;\/version&gt; &lt;\/parent&gt;<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c Spring web \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"xml\">&lt;dependency&gt;     &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;     &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt; &lt;\/dependency&gt;<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e <i>src\/main\/java\/main<\/i>, \u0434\u0430-\u0434\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u0442\u043e\u043b\u043a\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b, \u0434\u0443\u043c\u0430\u044e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u044f \u044d\u0442\u043e \u0443\u0437\u043d\u0430\u044e.<\/p>\n<p>  \u0418 \u0441\u0440\u0430\u0437\u0443 \u0432\u044b\u043b\u043e\u0436\u0443 \u0432\u0441\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mw\/h6\/dg\/mwh6dghwkeqffp2r-f9yfy2arzg.png\" alt=\"image\"><\/p>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b <i>Main.java<\/i> \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@SpringBootApplication<\/code>:<\/p>\n<pre><code class=\"java\">@SpringBootApplication public class Main {     public static void main(String[] args) {         SpringApplication.run(Main.class, args);     } }<\/code><\/pre>\n<p>  \u0418 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0436\u0430\u0442\u044c run \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u041c\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ef\/hj\/1z\/efhj1zxu3wg7gvmiwt0zimxi2p0.png\" alt=\"image\"><\/p>\n<p>  \u0417\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 8080. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>http:\/\/localhost:8080\/<\/code> \u0438 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 404 \u0432\u0435\u0434\u044c \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446.<\/p>\n<p>  \u0421\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438 \u043d\u0430\u0434\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434.<\/p>\n<p>  \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 <i>pom.xml<\/i> \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 HTML.<\/p>\n<pre><code class=\"xml\">&lt;dependency&gt;     &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;     &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;\/artifactId&gt; &lt;\/dependency&gt;<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 <i>index.html<\/i> \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <i>src\/main\/resources\/templates<\/i>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u043e\u0442 \u0441 \u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt;     &lt;meta charset=&quot;UTF-8&quot;&gt;     &lt;title&gt;ToDo List&lt;\/title&gt;     &lt;script src=&quot;\/js\/jquery-3.4.0.min.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;\/js\/main.js&quot;&gt;&lt;\/script&gt;     &lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;\/css\/styles.css&quot;&gt; &lt;\/head&gt; &lt;body&gt;     &lt;div id=&quot;todo-form&quot;&gt;         &lt;form&gt;             &lt;label&gt;\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043b\u0430:             &lt;\/label&gt;             &lt;input id=&quot;todo-form-name&quot; type=&quot;text&quot; name=&quot;name&quot; value=&quot;&quot;&gt;             &lt;label&gt;\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:             &lt;\/label&gt;             &lt;input id=&quot;todo-form-description&quot; type=&quot;text&quot; name=&quot;description&quot; value=&quot;&quot;&gt;             &lt;label&gt;\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f:             &lt;\/label&gt;             &lt;input id=&quot;todo-form-date&quot; type=&quot;date&quot; name=&quot;date&quot; value=&quot;&quot;&gt;             &lt;hr&gt;         &lt;\/form&gt;     &lt;\/div&gt;     &lt;h1&gt;\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b&lt;\/h1&gt;     &lt;button id=&quot;show-add-todo-list&quot;&gt;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u043b\u043e&lt;\/button&gt;     &lt;br&gt;&lt;br&gt;     &lt;div id=&quot;todo-list&quot;&gt;      &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u0442\u0438\u043b\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 src\/main\/resources\/static\/css \u0441\u043e\u0437\u0434\u0430\u0435\u043c styles.css<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0438\u043b\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"css\">* {     font-family: Arial, serif; }  #todo-form {     display: none;     align-items: center;     justify-content: center;     position: absolute;     top: 0;     left: 0;     width: 100%;     height: 100%;     z-index: 10;     background-color: #88888878; }  #todo-form form {     background-color: white;     border: 1px solid #333;     width: 300px;     padding: 20px; }  #todo-form h2 {     margin-top: 0; }  #todo-form label {     display: block; }  #todo-form form &gt; * {     margin-bottom: 5px; }  h4 {     margin-bottom: 0; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 <code>http:\/\/localhost:8080\/<\/code> \u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u044e\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u0439, \u043f\u0440\u0430\u0432\u0434\u0430 \u043f\u043e\u043a\u0430 \u0431\u0435\u0437 \u044d\u043a\u0448\u0435\u043d\u0430.<\/p>\n<p>  \u0418 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e js \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c jQuery \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <i>src\/main\/resources\/static\/js<\/i>, \u0435\u0449\u0435 \u0440\u0430\u0437 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0432 \u0443\u0447\u0435\u0431\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b jQuery \u0438 \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e <i>main.js<\/i>.<br \/>  \u0412\u0441\u0435 \u0442\u0430\u043a\u0438 \u0445\u0430\u0431 \u043f\u0440\u043e Java \u0438 Spring, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 js \u0434\u0443\u043c\u0430\u044e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e:<br \/>  <a href=\"https:\/\/github.com\/skkovalenko\/ToDoList\/blob\/master\/src\/main\/resources\/static\/js\/jquery-3.4.0.min.js\" rel=\"nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 jquery-3.4.0.min.js<br \/>  <\/a><a href=\"https:\/\/github.com\/skkovalenko\/ToDoList\/blob\/master\/src\/main\/resources\/static\/js\/main.js\" rel=\"nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 main.js<\/a>.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 GET \u0438 PUT. \u041a\u0430\u043a \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0442\u0430\u043a \u0438 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0444\u0440\u043e\u043d\u0435\u043d\u0434\u0430.<\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 \u044d\u043a\u0448\u0435\u043d \u0442\u043e\u0436\u0435 (\u043a\u043d\u043e\u043f\u043a\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0443).<\/p>\n<h3>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0411\u0414<\/h3>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c Spring data jpa:<\/p>\n<pre><code class=\"xml\">&lt;dependency&gt;     &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;     &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;\/artifactId&gt; &lt;\/dependency&gt; <\/code><\/pre>\n<p>  \u0418 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <i>src\/main\/java\/main\/model<\/i> \u0441\u043e\u0437\u0434\u0430\u044e POJO \u043a\u043b\u0430\u0441\u0441 Todo \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <code>@Entity<\/code>.<\/p>\n<p>  \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044f, \u0443 \u043c\u0435\u043d\u044f \u0431\u0443\u0434\u0435\u0442: id, name, description, date.<\/p>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 <code>setDate()<\/code>, \u044f \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 String \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 <i>java.util.Date<\/i> \u0434\u0430 \u0435\u0449\u0435 \u0438 \u0441 <code>atStartOfDay().atZone(ZoneId.of(&quot;UTC&quot;)<\/code>, \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044f date:<\/p>\n<pre><code class=\"java\">package main.model;  import javax.persistence.*; import java.time.LocalDate; import java.time.ZoneId; import java.util.Date;  @Entity public class Todo {      @Id     @GeneratedValue(strategy = GenerationType.AUTO)     private int id;     private String name;     private String description;     @Temporal(TemporalType.DATE)     private Date date;      \/\/getters and setters \u2026         public void setDate(String date) {         this.date = Date.from(LocalDate.parse(date).atStartOfDay().atZone(ZoneId.of(&quot;UTC&quot;)).toInstant());     } } <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 <i>pom.xml<\/i> \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 MySQL:<\/p>\n<pre><code class=\"xml\">&lt;dependency&gt;     &lt;groupId&gt;mysql&lt;\/groupId&gt;     &lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;     &lt;version&gt;8.0.19&lt;\/version&gt; &lt;\/dependency&gt; <\/code><\/pre>\n<p>  \u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <i>src\/main\/resources<\/i> \u0441\u043e\u0437\u0434\u0430\u0435\u043c <i>application.properties<\/i> \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414:<\/p>\n<pre><code class=\"plaintext\">spring.datasource.url=jdbc:mysql:\/\/localhost:3306\/todolist?useSSL=false&amp;allowPublicKeyRetrieval=true&amp;serverTimezone=UTC spring.datasource.username=root spring.datasource.password=password spring.jpa.hibernate.ddl-auto=none <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <i>src\/main\/java\/main\/model<\/i> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 TodoRepository \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@Repository<\/code> \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c CrudRepository&lt;Todo, Integer&gt;. \u041b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u2014 \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u044f\u043b \u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u043a\u043b\u0430\u0434\u043a\u0430 \u043c\u0435\u0436\u0434\u0443 \u0411\u0414 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c, \u0432 \u044d\u0442\u043e\u043c \u0442\u043e \u0438 \u0445\u043e\u0440\u043e\u0448 Spring, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u043a\u0435\u0442\u044b, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0430\u0440\u0438\u0442\u044c\u0441\u044f \u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u0411\u0414, \u043e\u043d \u0432\u0441\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430 \u0442\u0435\u0431\u044f.<\/p>\n<pre><code class=\"java\">package main.model;  import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository;  @Repository public interface TodoRepository extends CrudRepository&lt;Todo, Integer&gt; { }<\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0411\u0414.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0411\u0414 \u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0443.<\/p>\n<p>  \u0412 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <i>src\/main\/java\/main\/controller<\/i> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 TodoController \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@RestController<\/code>, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e TodoRepository \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. <\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 POST \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 add() \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 Todo \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 int (id), \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@PostMapping(\u201c\/todo-list\/\u201d)<\/code> \u0438 \u043f\u0443\u0442\u044c \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c. \u0411\u0435\u0440\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>save()<\/code> \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442 Todo, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0435\u043b \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c. \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u043b\u0448\u0435\u0431\u0441\u0442\u0432\u043e. <\/p>\n<pre><code class=\"java\">@PostMapping(&quot;\/todo-list\/&quot;) public int add(Todo todo) {     Todo newTodo = todoRepository.save(todo);     return newTodo.getId(); }<\/code><\/pre>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441 GET \u0438 DELETE, \u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c id \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c Todo \u0432 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0435 ResponseEntity. \u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u044c\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 <code>get()<\/code> \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439, \u043d\u0438\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. \u0414\u0430\u043b\u0435\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442 <code>ResponseEntity.ok(todoOptional.get());<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0434 200 \u0438\u043b\u0438 \u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 id \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0434 404 \u0441 \u0442\u0435\u043b\u043e\u043c null.<\/p>\n<pre><code class=\"java\">@GetMapping(&quot;\/todo-list\/{id}&quot;) public ResponseEntity&lt;Todo&gt; get(@PathVariable int id){     Optional&lt;Todo&gt; todoOptional = todoRepository.findById(id);     if(todoOptional.isEmpty()){         return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);     }     return ResponseEntity.ok(todoOptional.get()); }<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430? <\/p>\n<p>  \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 GET:<\/p>\n<p>  \u043a\u043b\u0438\u043a \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 todo =&gt; \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c id todo =&gt; \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0441\u0430\u043c id \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434. Id \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 get() \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0437 (value=&quot;\/todo-list\/{id}&quot;) \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u0430 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@PathVariable<\/code> \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430) =&gt; \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Todo =&gt; \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u043c, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 Todo \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0434\u0430\u0442\u0430. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 main.js, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f GET<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">$(document).on('click', '.todo-link', function(){     var link = $(this);     var todoId = link.data('id');     $.ajax({         method: &quot;GET&quot;,         url: '\/todo-list\/' + todoId,         success: function(response)         {             if($('.todo-div &gt; span').is('#' + todoId)){                 return;             }             link.parent().append(codeDataTodo(response, todoId));         },         error: function(response)         {             if(response.status == 404) {                 alert('\u0414\u0435\u043b\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e!');             }         }     });     return false; });<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c todo-list \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0430\u043d\u0438\u0446\u0443. \u0422\u0430\u043a\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u0438 \u0434\u043e\u0441\u0442\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a Todo, \u0430 \u0437\u0430\u0442\u0435\u043c \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c todoList \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0444\u0440\u043e\u043d\u0434\u0435\u043d\u0434:<\/p>\n<pre><code class=\"java\">@Controller public class DefaultController {     @Autowired     TodoRepository todoRepository;     @RequestMapping(&quot;\/&quot;)     public String index(Model model){         Iterable&lt;Todo&gt;  todoIterable = todoRepository.findAll();         ArrayList&lt;Todo&gt; todoList = new ArrayList&lt;&gt;();         for(Todo todo : todoIterable){             todoList.add(todo);         }         model.addAttribute(&quot;todoList&quot;, todoList);         return &quot;index&quot;;     } }<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0430\u043c\u0438 \u0432 index.html \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 todoList:<\/p>\n<pre><code class=\"xml\">&lt;html lang=&quot;en&quot; xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;div id=&quot;todo-list&quot;&gt;     &lt;div class=&quot;todo-div&quot; th:each=&quot;todo : ${todoList}&quot; th:attr=&quot;id=${todo.id}&quot;&gt;         &lt;a href=&quot;#&quot; class=&quot;todo-link&quot; th:attr=&quot;data-id=${todo.id}&quot; th:text=&quot;${todo.name}&quot;&gt;&lt;\/a&gt;         &lt;br&gt;     &lt;\/div&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<h3>\u0417\u0430\u043f\u0440\u043e\u0441 PUT<\/h3>\n<p>  \u0412 TodoController \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <code>put()<\/code> c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@PutMapping<\/code> \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 Map&lt;String, String&gt; \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@RequestParam<\/code> \u0438 int, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0437 value, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 Todo \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0439 \u0432 ResponseEntity. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0443 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 update() \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f Todo \u0438\u0437 \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 todoRepository \u043f\u043e id =&gt; \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Todo =&gt; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 =&gt; \u0432\u044b\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0443<\/p>\n<pre><code class=\"java\">@PutMapping(value = &quot;todo-list\/{id}&quot;) public ResponseEntity&lt;Todo&gt; put(@RequestParam Map&lt;String, String&gt; mapParam, @PathVariable int id){     Optional&lt;Todo&gt; todoOptional = todoRepository.findById(id);     if(todoOptional.isEmpty()){         return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);     }     todoOptional.get().setName(mapParam.get(&quot;name&quot;));     todoOptional.get().setDescription(mapParam.get(&quot;description&quot;));     todoOptional.get().setDate(mapParam.get(&quot;date&quot;));     todoRepository.save(todoOptional.get());     return ResponseEntity.ok(todoOptional.get()); }<\/code><\/pre>\n<p>  \u041d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435 \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f:<\/p>\n<p>  \u043a\u043b\u0438\u043a \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 \u201c\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u201d =&gt; \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 Todo =&gt; \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430 (\u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u044b \u0438 \u043a\u043d\u043e\u043f\u043a\u0430, \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 input value \u0434\u0430\u043d\u043d\u044b\u0435 Todo) =&gt; \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430 =&gt; \u0432\u0431\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f =&gt; \u043a\u043b\u0438\u043a \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435 \u201c\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u201d \u0432 \u0444\u043e\u0440\u043c\u0435 =&gt; \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 =&gt; \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 PUT (\u043f\u0443\u0442\u044c, \u0434\u0430\u043d\u043d\u044b\u0435) =&gt; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Todo, \u043d\u043e \u0441 \u0442\u0435\u043c \u0436\u0435 id =&gt; \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0434\u0435\u043b\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0436\u0435\u043b\u0430\u0435\u0442, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 Todo.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 main.js, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f PUT<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\/\/Update _todo and show updating _todo form $(document).on('click', '#show-update-todo-list', function(){     var buttonUpdate = $(this);     var todoId = buttonUpdate.data('id');     var todoName = buttonUpdate.data('name');     var todoDescription = buttonUpdate.data('description');     var todoDate = buttonUpdate.data('date');     todoFormNameAndButton('\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0435\u043b\u043e', '\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c', 'update-todo');     todoInputValue(todoName, todoDescription, todoDate);     $('#todo-form').css('display', 'flex');     $('#update-todo').click(function() {         var data = $('#todo-form form').serialize();         $.ajax({             method: &quot;PUT&quot;,             url: '\/todo-list\/' + todoId,             data: data,             success: function(response) {                 $('#todo-form').css('display', 'none');                 response.date = response.date.slice(0,10);                 $('.todo-div#' + todoId  + ' &gt; a').text(response.name);                 $('.todo-div#' + todoId +' &gt; span').replaceWith(codeDataTodo(response, todoId));             }         });         return false;     }); });<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430 <a href=\"https:\/\/github.com\/skkovalenko\/ToDoList\" rel=\"nofollow\">\u0433\u0438\u0442\u0445\u0430\u0431\u0435<\/a>.<\/p>\n<p>  \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u043e\u0442 \u043d\u043e\u0432\u0438\u0447\u043a\u0430, \u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443 \u043e\u0442 \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u044e\u0437\u0435\u0440\u043e\u0432, \u0442\u0430\u043a \u0436\u0435 \u043a\u0440\u0443\u0442\u043e \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 PUT \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 Map&lt;String, String&gt;, \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043f\u043e\u0434\u0430\u0442\u044c \u0442\u0443\u0434\u0430 Todo.<\/p>\n<p>  \u0420\u0435\u0441\u0443\u0440\u0441\u044b:<\/p>\n<ul>\n<li><a href=\"https:\/\/spring.io\/guides\/gs\/serving-web-content\/\" rel=\"nofollow\">Serving Web Content with Spring MVC<\/a><\/li>\n<li><a href=\"https:\/\/spring.io\/guides\/tutorials\/bookmarks\/\" rel=\"nofollow\">Building REST services with Spring<\/a><\/li>\n<li><a href=\"https:\/\/www.baeldung.com\/spring-data-crud-repository-save\" rel=\"nofollow\">Spring Data \u2013 CrudRepository<\/a><\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/496386\/\"> https:\/\/habr.com\/ru\/post\/496386\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/496386\/\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0435\u0431\u0435: \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0442 Skillbox \u0438 \u043f\u0440\u043e\u0445\u043e\u0436\u0443 \u043a\u0443\u0440\u0441 \u201cJava-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u201d. \u041d\u0435 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0440\u0435\u043a\u043b\u0430\u043c\u0430, \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0435\u0431\u0435. \u041d\u0430\u0447\u0430\u043b \u0443\u0447\u0438\u0442\u044c \u0434\u0436\u0430\u0432\u0443 \u0441 \u043c\u0430\u044f 2019 \u0433\u043e\u0434\u0430, \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u043b HTML, CSS \u0438 JS.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u0434\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u043e \u043c\u0435\u043d\u044f \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c \u0432\u043c\u0435\u0441\u0442\u0435 \u0438 \u043d\u0435\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 PUT \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412\u0435\u0437\u0434\u0435 \u0433\u0434\u0435 \u044f \u201c\u0433\u0443\u0433\u043b\u0438\u043b\u201d \u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d Rest API \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 POST \u0438 GET, \u0438\u043d\u043e\u0433\u0434\u0430 \u0441 DELETE \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u043e\u043d\u0435\u0441\u0442\u0438, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043a\u0430\u043a \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e REST API \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041d\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u043a\u043e\u0438\u043c \u044f \u044f\u0432\u043b\u044f\u044e\u0441\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u044e\u0437\u0435\u0440\u043e\u0432 Spring \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0435\u0434\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0445 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0435\u0439. \u0412\u0435\u0434\u044c \u044f \u0431\u0443\u0434\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442 (\u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u043f\u044b\u0442\u0430).  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-301556","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=301556"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301556\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}