{"id":20,"date":"2021-11-11T16:09:44","date_gmt":"2021-11-11T07:09:44","guid":{"rendered":"https:\/\/kpc2021.satoshis.jp\/?p=20"},"modified":"2021-11-18T16:15:58","modified_gmt":"2021-11-18T07:15:58","slug":"musicplayer%e3%82%92web%e3%82%a2%e3%83%97%e3%83%aa%e3%81%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/kpc2021.satoshis.jp\/?p=20","title":{"rendered":"MusicPlayer\u3092Web\u30a2\u30d7\u30ea\u306b\u3059\u308b"},"content":{"rendered":"<h3>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u7528\u610f\u3059\u308b<\/h3>\n<p>\u914d\u5e03\u30d5\u30a9\u30eb\u30c0\u306e hsqldb \u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001\u81ea\u5206\u306e\u9818\u57df\u306b\u4fdd\u5b58\u3059\u308b\u3002<\/p>\n<p>bin \u30d5\u30a9\u30eb\u30c0\u306e runServer.bat \u3092\u30b3\u30d4\u30fc\u3057\u3066 runServerMp.bat \u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ncd ..\\data\r\n@java -classpath ..\/lib\/hsqldb.jar org.hsqldb.server.Server --database.0 db\/mp --dbname.0 mp\r\n<\/pre>\n<p>runServerMp.bat \u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u753b\u9762\u304c\u958b\u3044\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3059\u308b\u3002<\/p>\n<p>bin \u30d5\u30a9\u30eb\u30c0\u306e runManager.bat \u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002<br \/>\nConnect\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3059\u308b\u306e\u3067\u3001Type \u3067 HSQL Database Engine Server \u3092\u9078\u629e\u3057\u3001<br \/>\nURL \u306e\u6700\u5f8c\u306b mp \u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3002<\/p>\n<h3>MusicPlayer\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210<\/h3>\n<p>\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e\u306f\u3001Spring\u30b9\u30bf\u30fc\u30bf\u30fc\u30fb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<br \/>\n\u540d\u524d: MusicPlayer<br \/>\n\u30b0\u30eb\u30fc\u30d7: jp.kpc<br \/>\n\u6210\u679c\u7269: MusicPlayer<br \/>\n\u30d1\u30c3\u30b1\u30fc\u30b8: jp.kpc<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f9d\u5b58\u95a2\u4fc2\u3067\u3001\u4ee5\u4e0b\u306e\u3082\u306e\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<ul>\n<li>HyperSQL Database<\/li>\n<li>Spring Data JPA<\/li>\n<li>Spring Web<\/li>\n<li>Thymeleaf<\/li>\n<\/ul>\n<h3>pom.xml\u3092\u4fee\u6b63<\/h3>\n<p>pom.xml \u3092\u958b\u3044\u30668\u884c\u76ee\u306e 2.5.6 \u3092 2.2.1.RELEASE \u306b\u5909\u66f4\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3002<\/p>\n<h3>\u81ea\u4f5cHTML\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b<\/h3>\n<p>URL=\u201d\/\u201d \u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\u306b\u4f55\u304b\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>IndexController\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\nsrc\/main\/java \u306e\u4e2d\u306b\u3042\u308b jp.kpc \u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057[\u65b0\u898f]-[\u30af\u30e9\u30b9]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u540d\u524d\u306b\u300cIndexController\u300d\u3068\u5165\u529b\u3057\u300c\u5b8c\u4e86\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n<p>SpringBoot \u306b\u5bfe\u3057\u3066\u3001\u3053\u306e\u30af\u30e9\u30b9\u304c\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u3042\u308b\u3053\u3068\u3092\u6559\u3048\u308b\u305f\u3081\u306b\u3001@Controller \u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u3002<br \/>\npublic class \u306e\u524d\u306e\u884c\u3067\u300c@Cont\u300d\u3092\u5165\u529b\u3057\u3066Ctrl+\u30b9\u30da\u30fc\u30b9\u3092\u5165\u529b\u3059\u308b\u3068\u5019\u88dc\u304c\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u308b\u3002<br \/>\norg.springframework.stereotype \u306eController\u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\t@RequestMapping(&quot;\/&quot;)\r\n\tpublic String index() {\r\n\t\treturn &quot;index&quot;;\r\n\t}\r\n\r\n}\r\n<\/pre>\n<h3>HTML\u3092\u7528\u610f\u3059\u308b<\/h3>\n<p>src\/main\/resources \u306e\u4e0b\u306b\u3042\u308b templates \u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066[\u65b0\u898f]-[\u305d\u306e\u4ed6]\u3092\u9078\u629e\u3059\u308b\u3002<br \/>\n\u300cHTML\u30d5\u30a1\u30a4\u30eb\u300d\u3092\u9078\u629e\u3057\u300c\u6b21\u3078\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n\u30d5\u30a1\u30a4\u30eb\u540d\u3092 index.html \u306b\u3057\u3066\u300c\u6b21\u3078\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n\u300c\u65b0\u898fHTML\u30d5\u30a1\u30a4\u30eb(5)\u300d\u3092\u9078\u629e\u3057\u3066\u300c\u5b8c\u4e86\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n<p>index.html<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;MusicPlayer&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;MusicPlayer&lt;\/h1&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>SpringBoot \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u8d77\u52d5\u3057\u3066 http:\/\/localhost:8080\/ \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u300cMusicPlayer\u300d\u3068\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<h3>\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u3092\u8ffd\u52a0<\/h3>\n<p>index.html \u306b\u3001\u97f3\u697d\u3092\u767b\u9332\u3059\u308b\u305f\u3081\u306e\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;MusicPlayer&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;MusicPlayer&lt;\/h1&gt;\r\n\r\n&lt;h3&gt;\u66f2\u3092\u8ffd\u52a0\u3059\u308b&lt;\/h3&gt;\r\n&lt;form action=&quot;\/addmusic&quot; method=&quot;post&quot;&gt;\r\n\t&lt;table&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;artist&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;\u8ffd\u52a0&quot; \/&gt;\r\n\t\t&lt;\/td&gt;\r\n\t&lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>SpringBoot \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u8d77\u52d5\u3057\u3066 http:\/\/localhost:8080\/ \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306bMusic\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306b\u3001Music\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport javax.persistence.Entity;\r\n\r\n@Entity\r\npublic class Music {\r\n\tprivate long id;\r\n\tprivate String title;\r\n\tprivate String artist;\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\tpublic void setId(long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\tpublic String getTitle() {\r\n\t\treturn title;\r\n\t}\r\n\tpublic void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}\r\n\tpublic String getArtist() {\r\n\t\treturn artist;\r\n\t}\r\n\tpublic void setArtist(String artist) {\r\n\t\tthis.artist = artist;\r\n\t}\r\n}\r\n<\/pre>\n<p>SpringBoot\u306e\u30b7\u30b9\u30c6\u30e0\u306b\u3001\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30ab\u30e9\u30e0\u3067\u3042\u308b\u3053\u3068\u3092\u77e5\u3089\u305b\u308b\u305f\u3081\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.GeneratedValue;\r\nimport javax.persistence.Id;\r\nimport javax.validation.constraints.NotEmpty;\r\nimport javax.validation.constraints.NotNull;\r\n\r\n@Entity\r\npublic class Music {\r\n\t@Id\r\n\t@GeneratedValue\r\n\t@Column\r\n\t@NotNull\r\n\tprivate long id;\r\n\r\n\t@Column\r\n\t@NotEmpty\r\n\tprivate String title;\r\n\r\n\t@Column\r\n\t@NotEmpty\r\n\tprivate String artist;\r\n\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\tpublic void setId(long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\tpublic String getTitle() {\r\n\t\treturn title;\r\n\t}\r\n\tpublic void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}\r\n\tpublic String getArtist() {\r\n\t\treturn artist;\r\n\t}\r\n\tpublic void setArtist(String artist) {\r\n\t\tthis.artist = artist;\r\n\t}\r\n}\r\n<\/pre>\n<p>MusicRepository \u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>jp.kpc \u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066[\u65b0\u898f]-[\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9] \u3092\u9078\u629e\u3059\u308b\u3002<\/p>\n<p>\u540d\u524d\u306f MusicRepository \u3092\u6307\u5b9a\u3002<br \/>\n\u62e1\u5f35\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u53f3\u306e\u8ffd\u52a0\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001JpaRepository \u3092\u9078\u629e\u3057\u3066OK\u3059\u308b\u3002<br \/>\nextends JpaRepository \u306e T \u3092 Music \u306b\u3001ID \u3092 Long \u306b\u4fee\u6b63\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u6d88\u3048\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport org.springframework.data.jpa.repository.JpaRepository;\r\n\r\npublic interface MusicRepository extends JpaRepository&lt;Music, Long&gt; {\r\n\r\n}\r\n<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306e\u63a5\u7d9a\u8a2d\u5b9a\u3092 application.properties \u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nspring.datasource.url=jdbc:hsqldb:hsql:\/\/localhost\/mp\r\nspring.datasource.username=SA\r\nspring.datasource.password=\r\nspring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver\r\nspring.jpa.hibernate.ddl-auto=update\r\n<\/pre>\n<p>IndexController \u306b\u3001URL \/addmusic \u306b\u5bfe\u3059\u308bPOST\u30e1\u30bd\u30c3\u30c9\u3067\u306e\u30a2\u30af\u30bb\u30b9\u3092\u53d7\u3051\u53d6\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [16,17,18,19,20,21]; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\t@RequestMapping(&quot;\/&quot;)\r\n\tpublic String index() {\r\n\t\treturn &quot;index&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/addmusic&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addMusic(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;title&quot;) String title,\r\n\t\t\t@RequestParam(&quot;artist&quot;) String artist) {\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n}\r\n<\/pre>\n<p>MusicRepository\u3092\u4f7f\u7528\u3057\u3066\u3001Music\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [13,14,21,22,23,24,25,26,27,28,29,30,31]; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\r\n\t@Autowired\r\n\tprivate MusicRepository repository;\r\n\r\n\t@RequestMapping(&quot;\/&quot;)\r\n\tpublic String index() {\r\n\t\treturn &quot;index&quot;;\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/addmusic&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addMusic(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;title&quot;) String title,\r\n\t\t\t@RequestParam(&quot;artist&quot;) String artist) {\r\n\t\tSystem.out.println(&quot;title=&quot; + title + &quot;, artist=&quot; + artist);\r\n\t\tMusic music = new Music();\r\n\t\tmusic.setTitle(title);\r\n\t\tmusic.setArtist(artist);\r\n\t\trepository.saveAndFlush(music);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n}\r\n<\/pre>\n<p>index.html \u306b\u3001Music\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [2,11,12,13,14,15,16,17,18,19,20,21,22]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;MusicPlayer&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;MusicPlayer&lt;\/h1&gt;\r\n&lt;h3&gt;Music\u30ea\u30b9\u30c8&lt;\/h3&gt;\r\n&lt;table&gt;\r\n\t&lt;tr&gt;\r\n\t\t&lt;th&gt;ID&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/th&gt;\r\n\t&lt;\/tr&gt;\r\n\t&lt;tr th:each=&quot;music : ${list}&quot;&gt;\r\n\t\t&lt;td th:text=&quot;${music.id}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.title}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.artist}&quot;&gt;&lt;\/td&gt;\r\n\t&lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n\r\n&lt;h3&gt;\u66f2\u3092\u8ffd\u52a0\u3059\u308b&lt;\/h3&gt;\r\n&lt;form action=&quot;\/addmusic&quot; method=&quot;post&quot;&gt;\r\n\t&lt;table&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;artist&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;\u8ffd\u52a0&quot; \/&gt;\r\n\t\t&lt;\/td&gt;\r\n\t&lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>IndexController\u304b\u3089\u3001Music\u30ea\u30b9\u30c8\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u6e21\u3059\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [19,20,21,22,23,24]; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\r\n\t@Autowired\r\n\tprivate MusicRepository repository;\r\n\r\n\t@RequestMapping(&quot;\/&quot;)\r\n\tpublic ModelAndView index(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;index&quot;);\r\n\t\tList&lt;Music&gt; list = repository.findAll();\r\n\t\tmav.addObject(&quot;list&quot;, list);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/addmusic&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addMusic(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;title&quot;) String title,\r\n\t\t\t@RequestParam(&quot;artist&quot;) String artist) {\r\n\t\tSystem.out.println(&quot;title=&quot; + title + &quot;, artist=&quot; + artist);\r\n\t\tMusic music = new Music();\r\n\t\tmusic.setTitle(title);\r\n\t\tmusic.setArtist(artist);\r\n\t\trepository.saveAndFlush(music);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n}\r\n<\/pre>\n<p>\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [44,45,46,47,48,49,50,51,52,53,54,55,56]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;MusicPlayer&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;MusicPlayer&lt;\/h1&gt;\r\n&lt;h3&gt;Music\u30ea\u30b9\u30c8&lt;\/h3&gt;\r\n&lt;table&gt;\r\n\t&lt;tr&gt;\r\n\t\t&lt;th&gt;ID&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/th&gt;\r\n\t&lt;\/tr&gt;\r\n\t&lt;tr th:each=&quot;music : ${list}&quot;&gt;\r\n\t\t&lt;td th:text=&quot;${music.id}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.title}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.artist}&quot;&gt;&lt;\/td&gt;\r\n\t&lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n\r\n\r\n&lt;h3&gt;\u66f2\u3092\u8ffd\u52a0\u3059\u308b&lt;\/h3&gt;\r\n&lt;form action=&quot;\/addmusic&quot; method=&quot;post&quot;&gt;\r\n\t&lt;table&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;artist&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;\u8ffd\u52a0&quot; \/&gt;\r\n\t\t&lt;\/td&gt;\r\n\t&lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;h3&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3059\u308b&lt;\/h3&gt;\r\n&lt;form action=&quot;\/addplaylist&quot; method=&quot;post&quot;&gt;\r\n\t&lt;table&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u540d\u524d&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;name&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;\u8ffd\u52a0&quot; \/&gt;\r\n\t\t&lt;\/td&gt;\r\n\t&lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>PlayList\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.GeneratedValue;\r\nimport javax.persistence.Id;\r\nimport javax.validation.constraints.NotEmpty;\r\nimport javax.validation.constraints.NotNull;\r\n\r\n@Entity\r\npublic class PlayList {\r\n\t@Id\r\n\t@GeneratedValue\r\n\t@Column\r\n\t@NotNull\r\n\tprivate long id;\r\n\r\n\t@Column\r\n\t@NotEmpty\r\n\tprivate String name;\r\n\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\tpublic void setId(long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\tpublic void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}\r\n}\r\n<\/pre>\n<p>PlayListRepository \u3092\u3001MusicRepository\u540c\u69d8\u306b\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport org.springframework.data.jpa.repository.JpaRepository;\r\n\r\npublic interface PlayListRepository extends JpaRepository&lt;PlayList, Long&gt; {\r\n\r\n}\r\n<\/pre>\n<p>IndexController \u3067\u3001\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u306e\u8ffd\u52a0\u3092\u53d7\u3051\u53d6\u3063\u3066DB\u306b\u4fdd\u5b58\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [41,42,43,44,45,46,47,48]; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\r\n\t@Autowired\r\n\tprivate MusicRepository musicRepository;\r\n\r\n\t@Autowired\r\n\tprivate PlayListRepository playListRepository;\r\n\r\n\t@RequestMapping(&quot;\/&quot;)\r\n\tpublic ModelAndView index(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;index&quot;);\r\n\t\tList&lt;Music&gt; list = musicRepository.findAll();\r\n\t\tmav.addObject(&quot;list&quot;, list);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/addmusic&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addMusic(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;title&quot;) String title,\r\n\t\t\t@RequestParam(&quot;artist&quot;) String artist) {\r\n\t\tSystem.out.println(&quot;title=&quot; + title + &quot;, artist=&quot; + artist);\r\n\t\tMusic music = new Music();\r\n\t\tmusic.setTitle(title);\r\n\t\tmusic.setArtist(artist);\r\n\t\tmusicRepository.saveAndFlush(music);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/addplaylist&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addPlayList(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;name&quot;) String name) {\r\n\t\tPlayList playList = new PlayList();\r\n\t\tplayList.setName(name);\r\n\t\tplayListRepository.saveAndFlush(playList);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n}\r\n<\/pre>\n<p>index.html \u306b\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u306e\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [24,25,26,27,28,29,30,31,32,33,34]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;MusicPlayer&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;MusicPlayer&lt;\/h1&gt;\r\n&lt;h3&gt;Music\u30ea\u30b9\u30c8&lt;\/h3&gt;\r\n&lt;table&gt;\r\n\t&lt;tr&gt;\r\n\t\t&lt;th&gt;ID&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/th&gt;\r\n\t&lt;\/tr&gt;\r\n\t&lt;tr th:each=&quot;music : ${musics}&quot;&gt;\r\n\t\t&lt;td th:text=&quot;${music.id}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.title}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.artist}&quot;&gt;&lt;\/td&gt;\r\n\t&lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n&lt;h3&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8&lt;\/h3&gt;\r\n&lt;table&gt;\r\n\t&lt;tr&gt;\r\n\t\t&lt;th&gt;ID&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u540d\u524d&lt;\/th&gt;\r\n\t&lt;\/tr&gt;\r\n\t&lt;tr th:each=&quot;playlist : ${playlists}&quot;&gt;\r\n\t\t&lt;td th:text=&quot;${playlist.id}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${playlist.name}&quot;&gt;&lt;\/td&gt;\r\n\t&lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n\r\n&lt;h3&gt;\u66f2\u3092\u8ffd\u52a0\u3059\u308b&lt;\/h3&gt;\r\n&lt;form action=&quot;\/addmusic&quot; method=&quot;post&quot;&gt;\r\n\t&lt;table&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;artist&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;\u8ffd\u52a0&quot; \/&gt;\r\n\t\t&lt;\/td&gt;\r\n\t&lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;h3&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u3092\u8ffd\u52a0\u3059\u308b&lt;\/h3&gt;\r\n&lt;form action=&quot;\/addplaylist&quot; method=&quot;post&quot;&gt;\r\n\t&lt;table&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;\u540d\u524d&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;name&quot; \/&gt;&lt;\/td&gt;\r\n\t\t&lt;\/tr&gt;\r\n\t\t&lt;tr&gt;\r\n\t\t\t&lt;td&gt;&lt;\/td&gt;\r\n\t\t\t&lt;td&gt;&lt;input type=&quot;submit&quot; value=&quot;\u8ffd\u52a0&quot; \/&gt;\r\n\t\t&lt;\/td&gt;\r\n\t&lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>IndexController \u3067\u3001\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3057\u3066\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u6e21\u3059\u3002<\/p>\n<pre class=\"brush: java; highlight: [26,27,28,29]; title: ; notranslate\" title=\"\">\r\npackage jp.kpc;\r\n\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.RequestParam;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class IndexController {\r\n\r\n\t@Autowired\r\n\tprivate MusicRepository musicRepository;\r\n\r\n\t@Autowired\r\n\tprivate PlayListRepository playListRepository;\r\n\r\n\t@RequestMapping(&quot;\/&quot;)\r\n\tpublic ModelAndView index(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;index&quot;);\r\n\t\tList&lt;Music&gt; musics = musicRepository.findAll();\r\n\t\tmav.addObject(&quot;musics&quot;, musics);\r\n\t\tList&lt;PlayList&gt; playlists = playListRepository.findAll();\r\n\t\tmav.addObject(&quot;playlists&quot;, playlists);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/addmusic&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addMusic(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;title&quot;) String title,\r\n\t\t\t@RequestParam(&quot;artist&quot;) String artist) {\r\n\t\tSystem.out.println(&quot;title=&quot; + title + &quot;, artist=&quot; + artist);\r\n\t\tMusic music = new Music();\r\n\t\tmusic.setTitle(title);\r\n\t\tmusic.setArtist(artist);\r\n\t\tmusicRepository.saveAndFlush(music);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/addplaylist&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addPlayList(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;name&quot;) String name) {\r\n\t\tPlayList playList = new PlayList();\r\n\t\tplayList.setName(name);\r\n\t\tplayListRepository.saveAndFlush(playList);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n}\r\n<\/pre>\n<p>Music\u3092\u524a\u9664\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>index.html \u306b\u524a\u9664\u7528\u306e\u30ea\u30f3\u30af\u3092\u914d\u7f6e\u3059\u308b\u3002\u30ea\u30f3\u30af\u306b\u306f\u3001Music\u306eid\u3092\u57cb\u3081\u8fbc\u3093\u3067\u304a\u304f\u3002<\/p>\n<pre class=\"brush: xml; first-line: 10; highlight: [16,22]; title: ; notranslate\" title=\"\">\r\n&lt;h3&gt;Music\u30ea\u30b9\u30c8&lt;\/h3&gt;\r\n&lt;table&gt;\r\n\t&lt;tr&gt;\r\n\t\t&lt;th&gt;ID&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/th&gt;\r\n\t\t&lt;th&gt;\u64cd\u4f5c&lt;\/th&gt;\r\n\t&lt;\/tr&gt;\r\n\t&lt;tr th:each=&quot;music : ${musics}&quot;&gt;\r\n\t\t&lt;td th:text=&quot;${music.id}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.title}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td th:text=&quot;${music.artist}&quot;&gt;&lt;\/td&gt;\r\n\t\t&lt;td&gt;&lt;a th:href=&quot;@{'\/deletemusic\/' + ${music.id}}&quot;&gt;\u524a\u9664&lt;\/a&gt;&lt;\/td&gt;\r\n\t&lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n<\/pre>\n<p>IndexController \u306b\u3001\u524a\u9664\u7528\u30ea\u30f3\u30af\u306b\u5bfe\u5fdc\u3059\u308b\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; first-line: 32; highlight: [44,45,46,47,48,49]; title: ; notranslate\" title=\"\">\r\n\t@RequestMapping(value=&quot;\/addmusic&quot;, method=RequestMethod.POST)\r\n\tpublic ModelAndView addMusic(ModelAndView mav,\r\n\t\t\t@RequestParam(&quot;title&quot;) String title,\r\n\t\t\t@RequestParam(&quot;artist&quot;) String artist) {\r\n\t\tSystem.out.println(&quot;title=&quot; + title + &quot;, artist=&quot; + artist);\r\n\t\tMusic music = new Music();\r\n\t\tmusic.setTitle(title);\r\n\t\tmusic.setArtist(artist);\r\n\t\tmusicRepository.saveAndFlush(music);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n\r\n\t@RequestMapping(value=&quot;\/deletemusic\/{id}&quot;, method=RequestMethod.GET)\r\n\tpublic ModelAndView deleteMusic(ModelAndView mav,\r\n\t\t\t@PathVariable long id) {\r\n\t\tmusicRepository.deleteById(id);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u7528\u610f\u3059\u308b \u914d\u5e03\u30d5\u30a9\u30eb\u30c0\u306e hsqldb \u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001\u81ea\u5206\u306e\u9818\u57df\u306b\u4fdd\u5b58\u3059\u308b\u3002 bin \u30d5\u30a9\u30eb\u30c0\u306e runServer.bat \u3092\u30b3\u30d4\u30fc\u3057\u3066 runServerMp.bat \u3092\u4f5c\u6210\u3059\u308b\u3002  &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-springboot"],"views":299,"_links":{"self":[{"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20"}],"version-history":[{"count":20,"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":45,"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/20\/revisions\/45"}],"wp:attachment":[{"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kpc2021.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}